/* ═══════════════════════════════════════
   CMS SIDEBAR — Navigation principale
   ═══════════════════════════════════════ */

:root {
  --cms-sidebar-w: 220px;
  --cms-sidebar-bg: #18181b;
  --cms-sidebar-hover: #27272a;
  --cms-sidebar-active: #3f3f46;
  --cms-sidebar-text: #71717a;
  --cms-sidebar-text-active: #fafafa;
  --cms-sidebar-border: #27272a;
  --cms-content-bg: #f4f4f5;
}

/* ─── Shell global ─── */
.cms-body {
  background: var(--cms-content-bg);
  min-height: 100vh;
  font-family: var(--admin-font-ui, system-ui, sans-serif);
}

.cms-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.cms-sidebar {
  width: var(--cms-sidebar-w);
  background: var(--cms-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  flex-shrink: 0;
}

/* Logo / Brand */
.cms-sidebar__brand {
  padding: 0 0.75rem;
  height: 52px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--cms-sidebar-border);
  flex-shrink: 0;
}

.cms-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.cms-sidebar__logo-mark {
  font-size: 1rem;
  color: #fafafa;
  line-height: 1;
}

.cms-sidebar__logo-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fafafa;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Sections nav */
.cms-sidebar__section {
  padding: 1.25rem 0.75rem 0.75rem;
  flex: 1;
}

.cms-sidebar__section-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #52525b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 0.5rem;
  margin-bottom: 0.375rem;
}

/* Nav links */
.cms-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cms-sidebar-text);
  transition: background 0.1s, color 0.1s;
  margin-bottom: 0.125rem;
}

.cms-sidebar__link:hover {
  background: var(--cms-sidebar-hover);
  color: #d4d4d8;
  text-decoration: none;
}

.cms-sidebar__link--active {
  background: var(--cms-sidebar-active);
  color: var(--cms-sidebar-text-active);
}

.cms-sidebar__link--active:hover {
  color: var(--cms-sidebar-text-active);
}

/* Icons */
.cms-sidebar__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Footer */
.cms-sidebar__footer {
  padding: 0.75rem;
  border-top: 1px solid var(--cms-sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.cms-sidebar__footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  color: #52525b;
  transition: background 0.1s, color 0.1s;
}

.cms-sidebar__footer-link:hover {
  background: var(--cms-sidebar-hover);
  color: #a1a1aa;
  text-decoration: none;
}

.cms-sidebar__footer-link--logout:hover { color: #f87171; }

.cms-sidebar__ext-icon {
  width: 10px;
  height: 10px;
  opacity: 0.6;
}

/* ─── Page (à droite de la sidebar) ─── */
.cms-page {
  flex: 1;
  margin-left: var(--cms-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.cms-main { flex: 1; }

.cms-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 2.5rem;
}

/* Flash */
.cms-flash {
  padding: 0.75rem 2.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

.cms-flash--notice {
  background: #f0fdf4;
  color: #15803d;
  border-bottom-color: #bbf7d0;
}

.cms-flash--alert {
  background: #fef2f2;
  color: #b91c1c;
  border-bottom-color: #fecaca;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .cms-sidebar { transform: translateX(-100%); }
  .cms-page { margin-left: 0; }
}
