/* ── NAV ── */
#nav {
  position: sticky; top: 0; z-index: 110; height: var(--nav-h);
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.nav-links {
  display: flex; align-items: center; gap: 2px;
  min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-a {
  height: var(--nav-h); display: inline-flex; align-items: center;
  padding: 0 14px; white-space: nowrap; color: var(--muted);
  border-bottom: 2px solid transparent;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase;
  transition: color .14s, border-color .14s;
  cursor: pointer; text-decoration: none;
}
.nav-a:hover  { color: var(--text); }
.nav-a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── CONTROL BAR ── */
#control-bar {
  position: sticky; top: var(--nav-h); z-index: 105;
  min-height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.control-left  { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.control-right { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* ── CONTROL GROUP ── */
.ctl-group {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2); min-height: 38px;
}
.ctl-label {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted-2); text-transform: uppercase;
  letter-spacing: .08em; white-space: nowrap;
}

/* ── INPUTS & SELECTS ── */
input[type="date"],
input[type="search"],
select {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  min-height: 34px; padding: 6px 10px;
  border-radius: 7px;
  font-family: var(--mono); font-size: 11px;
  transition: border-color .14s, background .14s;
}
input[type="date"]:focus,
input[type="search"]:focus,
select:focus {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
input::placeholder { color: var(--muted-2); }

/* ── PAGE CONTAINER ── */
/* Le <main> est juste un wrapper neutre — c'est la page-view active qui s'étend */
.page {
  padding: 0;
  display: block;
}

/* ── SECTION / PAGE-VIEW ── */
/* Toutes les sections sont cachées par défaut */
.page-view {
  display: none;                                        /* caché par défaut */
  padding: 20px 24px 80px;
  min-height: calc(100vh - var(--nav-h) - var(--bar-h));
  /* Conserve l'apparence card de .section */
  background: var(--surface);
  border: none;                                         /* pas de border sur la page entière */
  border-radius: 0;
  box-shadow: none;
}

/* La page active s'affiche */
.page-view.active {
  display: block;
}

/* Les sections qui n'ont pas de control-bar au-dessus */
.page-view.no-bar {
  min-height: calc(100vh - var(--nav-h));
}

/* Section-header à l'intérieur d'une page */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.section-title-wrap { display: flex; flex-direction: column; gap: 4px; }
.section-title {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  letter-spacing: .03em; color: var(--accent);
}
.section-sub { font-size: 13px; color: var(--muted); }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── PAGE TRANSITION (optionnelle, légère) ── */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-view.active {
  animation: pageFadeIn .18s ease;
}