/* =============================================================================
 * shell.css — Le SHELL de tous les écrans connectés (UI V2 « Le Carnet », S01)
 *
 * Sommaire
 *   1.  Lien d'évitement (skip-link)
 *   2.  Topnav : barre, marque, liens, menus déroulants
 *   3.  Topnav : actions de droite (recherche, cloche, CTA, avatar)
 *   4.  Menu mobile (< 880 px) : feuille plein écran, cibles ≥ 48 px
 *   5.  Conteneur de page + sous-navigation
 *   6.  Palette de commandes (⌘K)
 *   7.  Tuiles KPI, blocs de section, barre de filtres, tables
 *   8.  Panneaux latéraux (slide-over) et filtres déroulants
 *   9.  Pied de page
 *   10. Héritage : ancien layout sidebar (inerte, conservé pour compatibilité)
 *
 * Aucune couleur en dur : uniquement des var(--token) de tokens.css.
 * Les 5 signatures Carnet (.numero-estampe, .perforation, .tampon, .languette,
 * .filet-total) et le patron .page-head vivent dans ux.css — source unique.
 * ============================================================================= */

/* =============================================================================
 * 1. LIEN D'ÉVITEMENT
 * Premier élément focusable du document (inséré par shell.js avant la topnav).
 * ============================================================================= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  font-size: 14px;
  border-radius: 0 0 var(--r-3) 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
  outline: none;
  box-shadow: var(--focus-ring);
}

/* =============================================================================
 * 2. TOPNAV — barre, marque, liens, menus déroulants
 * ============================================================================= */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}
@media (max-width: 640px) {
  .topnav-inner { padding: 0 14px; gap: 10px; }
}

/* --- Marque : logo carré bleu encre + nom de l'entreprise -------------------- */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
  border-radius: var(--r-3);
  padding: 5px;
  margin-left: -5px;
  min-height: 44px; /* cible tactile : le logo ramène à l'accueil */
}
.brand-logo:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--r-3);
  background: var(--accent);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  flex: 0 0 auto;
}
.brand-img { display: block; width: 100%; height: 100%; border-radius: inherit; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 720px) { .brand-name { display: none; } }

/* --- Liens de navigation ----------------------------------------------------- */
.topnav-links { display: flex; align-items: center; gap: 2px; }
@media (max-width: 880px) { .topnav-links { display: none; } }

.topnav-link,
.topnav-dd-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--r-2) var(--r-2) 0 0;
  transition: color 120ms ease, background 120ms ease;
}
.topnav-link:hover,
.topnav-dd-btn:hover { color: var(--text); background: var(--surface-2); }
.topnav-link:focus-visible,
.topnav-dd-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Lien actif : bleu encre + soulignement 3 px (le trait de stylo). */
.topnav-link.active,
.topnav-dd-btn.active { color: var(--accent-text); font-weight: 600; }
.topnav-link.active::after,
.topnav-dd-btn.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

/* --- Menus déroulants (Factures ▾ / Rapports ▾) ------------------------------ */
.nav-dd { position: relative; display: inline-flex; align-items: center; }
.nav-dd .topnav-dd-btn { padding-right: 26px; }

/* Chevron rendu en CSS (masque SVG monochrome) : il survit au remplacement de
   textContent effectué par la bascule de langue, contrairement à un enfant. */
.dd-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  pointer-events: none;
  background: currentColor;
  color: var(--text-3);
  transition: transform 150ms ease;
  -webkit-mask: var(--caret-mask) center / 12px 12px no-repeat;
  mask: var(--caret-mask) center / 12px 12px no-repeat;
}
.nav-dd { --caret-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); }
.nav-dd:has(.topnav-dd-btn.active) .dd-caret { color: var(--accent-text); }
.nav-dd.open .dd-caret { transform: rotate(180deg); }

.nav-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 226px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  /* visibility:hidden retire aussi les liens du parcours clavier tant que le
     menu est fermé (sinon on tabule dans un menu invisible). */
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
  z-index: 50;
}
.nav-dd.open .nav-dd-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
/* Pont de survol : comble l'espace de 6 px entre le bouton et le menu pour que
   la souris ne « quitte » jamais la zone en descendant vers les items. */
.nav-dd-menu::before {
  content: ""; position: absolute;
  top: -10px; left: 0; right: 0; height: 10px;
}
/* Ouverture au clavier : :focus-visible ne réagit pas au clic souris, donc la
   bascule au clic (classe .open, shell.js) continue de fonctionner telle quelle. */
.nav-dd:has(:focus-visible) .nav-dd-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.nav-dd-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: var(--r-3);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
}
.nav-dd-menu a:hover { background: var(--surface-2); color: var(--text); }
.nav-dd-menu a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nav-dd-menu a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

/* =============================================================================
 * 3. TOPNAV — actions de droite
 * ============================================================================= */
.topnav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Boutons ronds (recherche, cloche, menu) — cible 44 px. */
.nav-icon-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.nav-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nav-icon-btn--badged { position: relative; }

/* Recherche : pilule bordée « ⌘K » en desktop, icône seule en dessous. */
#cmdk-trigger { border-color: var(--border); }
#cmdk-trigger:hover { border-color: var(--border-strong); }
.nav-kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
@media (max-width: 1024px) {
  .nav-kbd { display: none; }
  #cmdk-trigger { padding: 0; }
}

/* Pastille de notification (rouge numéroteur). */
.dot-indicator {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--numero);
  box-shadow: 0 0 0 2px var(--surface);
}
.dot-indicator[hidden] { display: none; }

/* Bouton primaire « + Nouvelle facture ». */
.nav-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-3);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-brand);
}
.nav-new:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: var(--shadow-brand); }
.nav-new:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* Sous 880 px, le CTA vit au bas du menu mobile (feuille) : on l'y retire. */
@media (max-width: 880px) { .nav-new { display: none; } }

/* Sélecteur de propriétaire (comptable multi-dossiers). */
.nav-owner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  max-width: 210px;
}
.nav-owner:hover { border-color: var(--border-strong); color: var(--text); }
.nav-owner:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nav-owner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Avatar. */
.nav-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nav-avatar:hover { border-color: var(--accent); }
.nav-avatar:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Popover ancré à droite (base : .topbar-popover, ux.css). */
.topbar-popover--right { left: auto; right: 0; }

/* Items de la cloche : icône teintée + titre + sous-titre. */
.notif { display: flex; align-items: flex-start; gap: 10px; }
.notif__ico { flex: 0 0 auto; display: flex; margin-top: 1px; color: var(--text-3); }
.notif--danger .notif__ico { color: var(--danger); }
.notif--warn .notif__ico   { color: var(--warn-text); }
.notif--info .notif__ico   { color: var(--accent); }
.notif--ok .notif__ico     { color: var(--ok); }
.notif__txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.notif__txt strong { font-weight: 600; font-size: 13.5px; color: var(--text); }
.notif__sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* Cadenas de forfait sur un lien de nav. */
.nav-lock { display: inline-flex; vertical-align: middle; margin-left: 3px; opacity: 0.7; }
.nav-lock svg { color: var(--text-3); }
.topnav-link.is-locked { opacity: 0.85; }

/* =============================================================================
 * 4. MENU MOBILE (< 880 px) — feuille plein écran, cibles ≥ 48 px
 * ============================================================================= */
.nav-burger-wrap { display: none; }
@media (max-width: 880px) { .nav-burger-wrap { display: block; } }

@media (max-width: 880px) {
  .topbar-popover--sheet {
    position: fixed;
    inset: 0;
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    box-shadow: none;
    z-index: 120;
  }
  .topbar-popover--sheet .topbar-popover__head {
    padding: 20px 20px 14px;
    margin: 0;
    font-size: 13px;
    background: var(--surface);
  }
  .topbar-popover__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 12px 16px;
    background: var(--surface);
  }
  .topbar-popover--sheet .topbar-popover__item {
    min-height: 48px;
    font-size: 15px;
    padding: 10px 12px;
  }
  .topbar-popover__foot--cta {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  .nav-sheet-cta { width: 100%; height: 48px; font-size: 15px; }
}
/* En desktop la feuille reste un popover classique : pas de CTA dupliqué. */
@media (min-width: 881px) { .topbar-popover__foot--cta { display: none; } }

/* =============================================================================
 * 5. CONTENEUR DE PAGE + SOUS-NAVIGATION
 * ============================================================================= */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 88px; }
@media (max-width: 640px) { .page { padding: 22px 14px 72px; } }
/* Neutralise le padding hérité de l'ancien .page-content (layout sidebar). */
.page > .page-content { padding: 0; max-width: none; }

.subnav {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.subnav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}
.subnav a:hover { color: var(--text); }
.subnav a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.subnav a.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.subnav a svg { color: currentColor; }

/* =============================================================================
 * 6. PALETTE DE COMMANDES (⌘K)
 * ============================================================================= */
#cmdk { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
#cmdk .cmdk-backdrop { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(2px); }
#cmdk .cmdk-panel {
  position: relative;
  width: min(560px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
#cmdk .cmdk-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  color: var(--text-3);
}
#cmdk .cmdk-input input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 15px; color: var(--text); font-family: inherit;
}
#cmdk .cmdk-list { padding: 6px; max-height: 360px; overflow-y: auto; }
#cmdk .cmdk-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px;
  padding: 8px 10px; border-radius: var(--r-2);
  text-decoration: none; color: var(--text-2); font-size: 14px;
}
#cmdk .cmdk-item:hover,
#cmdk .cmdk-item.active { background: var(--accent-soft); color: var(--accent-text); }
#cmdk .cmdk-item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
#cmdk .cmdk-item span { flex: 1; }
#cmdk .cmdk-foot {
  display: flex; gap: 18px;
  padding: 10px 16px; font-size: 12px; color: var(--text-3);
  border-top: 1px solid var(--divider);
  background: var(--surface-2);
}

/* =============================================================================
 * 7. TUILES KPI · BLOCS · FILTRES · TABLES
 * ============================================================================= */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 16px 18px;
  box-shadow: var(--shadow-1);
}
.kpi .kpi-label {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.kpi .kpi-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 600;
  margin: 8px 0 4px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.kpi .kpi-meta { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .delta-up { color: var(--ok-text); }
.kpi .delta-down { color: var(--danger-text); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin: 0; }
.section-head .section-meta { font-size: 13px; color: var(--text-3); }

.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3) var(--r-3) 0 0;
  border-bottom: 0;
}
.filter-bar .search-input {
  flex: 1; max-width: 320px;
  display: flex; align-items: center; gap: 8px;
  height: var(--field-h); padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.filter-bar .search-input:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.filter-bar .search-input input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 13.5px; color: var(--text); font-family: inherit;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 13px; color: var(--text-2);
  cursor: pointer;
}
.chip:hover { background: var(--surface-3); }
.chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.chip.active { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-soft-2); font-weight: 600; }

.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--r-3) var(--r-3);
  overflow: hidden;
}
.tbl-wrap.full-radius { border-top: 1px solid var(--border); border-radius: var(--r-3); }

/* Filtre déroulant compact (<details><summary>, toggle natif accessible). */
.chip-dropdown { position: relative; display: inline-block; }
.chip-dropdown > summary { list-style: none; cursor: pointer; }
.chip-dropdown > summary::-webkit-details-marker { display: none; }
.chip-dropdown > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-pill); }
.chip-dropdown__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-4);
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}
.chip-dropdown__option {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px;
  padding: 8px 10px; border-radius: var(--r-2); cursor: pointer; font-size: 13.5px;
}
.chip-dropdown__option:hover { background: var(--surface-2); }
.chip-dropdown__option.is-checked { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.chip-dropdown__option input[type="radio"] { margin: 0; }

/* =============================================================================
 * 8. PANNEAU LATÉRAL (slide-over)
 * ============================================================================= */
.slide-over-backdrop {
  position: fixed; inset: 0;
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 90;
}
.slide-over-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }

.slide-over {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  transform: translateX(100%);
  transition: transform 220ms ease;
  z-index: 100;
  display: flex; flex-direction: column;
}
.slide-over[data-open="true"] { transform: translateX(0); }
.slide-over-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.slide-over-body { padding: 20px; overflow-y: auto; flex: 1; }
.slide-over-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* =============================================================================
 * 9. PIED DE PAGE (discret : marque + liens légaux)
 * ============================================================================= */
.app-footer {
  margin-top: 8px;
  padding: 18px 0 calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-3);
}
.app-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.app-footer__brand { font-weight: 600; color: var(--text-2); }
.app-footer__links { display: flex; gap: 18px; }
.app-footer__links a { color: inherit; text-decoration: none; padding: 4px 0; }
.app-footer__links a:hover { color: var(--accent-text); text-decoration: underline; }
.app-footer__links a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-1); }

/* =============================================================================
 * 10. HÉRITAGE — ancien layout sidebar
 * Ces classes ne sont plus émises par renderShell (topnav depuis la v2) mais
 * restent référencées par quelques vues historiques : on les conserve inertes.
 * ============================================================================= */
.app-shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 12px 10px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-2); cursor: pointer; }
.brand:hover { background: var(--surface-3); }
.brand-meta { flex: 1; min-width: 0; }
.brand-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search-trigger {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 4px 8px;
  padding: 0 10px;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  color: var(--text-3);
  font-size: 13.5px; font-family: inherit;
  cursor: pointer;
}
.search-trigger:hover { background: var(--surface-3); color: var(--text-2); }
.search-trigger:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.search-trigger span { flex: 1; text-align: left; }
.search-trigger kbd { margin-left: auto; }

.nav-main { flex: 1; padding: 6px 4px; overflow-y: auto; min-height: 0; }
.sidebar-bottom { padding: 8px 4px; border-top: 1px solid var(--divider); margin-top: 8px; }

.user-card { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; border-radius: var(--r-2); cursor: pointer; }
.user-card:hover { background: var(--surface-3); }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.user-role { font-size: 12px; color: var(--text-3); }

.main-area { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; }
.page-title { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.page-subtitle { font-size: 13px; color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.page-content { padding: 24px 28px 60px; max-width: 1500px; }

/* =============================================================================
 * MOUVEMENT RÉDUIT
 * ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  .topnav-link,
  .topnav-dd-btn,
  .nav-icon-btn,
  .dd-caret,
  .nav-dd-menu,
  .slide-over,
  .slide-over-backdrop,
  .subnav a { transition: none; }
}

/* Attribut hidden : toujours prioritaire sur les display des composants (.btn, etc.). */
[hidden] { display: none !important; }
