/* ============================================================
   SomobApp v2 — Design system (juillet 2026)
   Thème clair/sombre, accessible (WCAG AA), responsive.
   ============================================================ */

:root {
  /* Couleurs — thème clair */
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f0f1f6;
  --surface-3: #e7e9f1;
  --border: #dcdfe8;
  --border-fort: #c3c7d4;
  --texte: #171923;
  --texte-2: #4b5163;
  --texte-3: #6d7488;
  --accent: #4056d6;
  --accent-hover: #3346bb;
  --accent-doux: #e8ebfc;
  --accent-texte: #ffffff;
  --ok: #1a7f4e;
  --ok-doux: #e0f3e9;
  --attention: #9a6700;
  --attention-doux: #fcf0d7;
  --danger: #c93838;
  --danger-doux: #fce8e8;
  --info: #21618d;
  --info-doux: #e3f0fa;

  /* Géométrie */
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;
  --ombre-1: 0 1px 3px rgba(20, 24, 40, .07), 0 1px 2px rgba(20, 24, 40, .05);
  --ombre-2: 0 6px 24px rgba(20, 24, 40, .10), 0 2px 6px rgba(20, 24, 40, .06);
  --ombre-3: 0 16px 48px rgba(20, 24, 40, .18);

  /* Typo */
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --taille-base: 15px;

  /* Layout */
  --sidebar-l: 264px;
  --topbar-h: 58px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #12141c;
  --surface: #1b1e2a;
  --surface-2: #232736;
  --surface-3: #2b3042;
  --border: #333849;
  --border-fort: #454b61;
  --texte: #eceef4;
  --texte-2: #b3b9c9;
  --texte-3: #8a91a5;
  --accent: #8395f5;
  --accent-hover: #9dabf7;
  --accent-doux: #262c48;
  --accent-texte: #10122b;
  --ok: #4cc98a;
  --ok-doux: #17301f;
  --attention: #e3b341;
  --attention-doux: #33290f;
  --danger: #f07373;
  --danger-doux: #3a1d1d;
  --info: #6cb2e8;
  --info-doux: #16283a;
  --ombre-1: 0 1px 3px rgba(0, 0, 0, .4);
  --ombre-2: 0 6px 24px rgba(0, 0, 0, .5);
  --ombre-3: 0 16px 48px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* Taille de police réglable (accessibilité) */
:root[data-taille="s"] { --taille-base: 13.5px; }
:root[data-taille="l"] { --taille-base: 17px; }
:root[data-taille="xl"] { --taille-base: 19px; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--taille-base); }
body {
  margin: 0;
  font-family: var(--police);
  background: var(--bg);
  color: var(--texte);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg, video { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
code { font-family: var(--police-mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
::selection { background: var(--accent); color: var(--accent-texte); }

/* Focus visible : indispensable au clavier */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Lien d'évitement */
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 300;
  background: var(--accent); color: var(--accent-texte);
  padding: 10px 18px; border-radius: var(--radius-s); font-weight: 600;
}
.skip-link:focus { left: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Layout général ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-l) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  min-height: 100vh;
}
.topbar { grid-area: topbar; }
.sidebar { grid-area: sidebar; }
.main {
  grid-area: main;
  padding: 22px 26px 60px;
  max-width: 100%;
  width: 100%;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  position: sticky; top: 0; z-index: 60;
}
.topbar .titre-page { font-weight: 650; font-size: 1.05rem; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Omnibox de recherche */
.omnibox { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.omnibox input {
  width: 100%; height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--texte);
  padding: 0 84px 0 38px;
  font-size: .95rem;
  transition: border-color .15s, background .15s;
}
#recherche-globale { padding: 8px 12px 8px 40px; }
.omnibox input:focus { border-color: var(--accent); background: var(--surface); }
.omnibox .ico-loupe { position: absolute; left: 12px; top: 56%; translate: 0 -50%; color: var(--texte-3); pointer-events: none; }
.omnibox .raccourci {
  position: absolute; right: 46px; top: 50%; translate: 0 -50%;
  font-size: .72rem; color: var(--texte-3);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
  background: var(--surface);
}
.omnibox .btn-voix { position: absolute; right: 8px; top: 50%; translate: 0 -50%; }
.btn-voix.ecoute { color: var(--danger); animation: pulse-voix 1.2s infinite; }
@keyframes pulse-voix { 50% { opacity: .45; } }

.suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--ombre-2);
  padding: 6px; z-index: 100; max-height: 420px; overflow: auto;
}
.suggestions [role="option"] {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  color: var(--texte);
}
.suggestions [role="option"]:hover, .suggestions [role="option"][aria-selected="true"] { background: var(--accent-doux); }
.suggestions .genre { margin-left: auto; font-size: .72rem; color: var(--texte-3); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 70;
}
.sidebar .logo {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px 13px;
  font-size: 1.16rem; font-weight: 750; color: var(--texte);
  text-decoration: none;
}
.sidebar .logo .pastille {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7b5ce0);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1rem;
  flex-shrink: 0;
}
.sidebar .logo span b { color: var(--accent); font-weight: 750; }
.nav-groupe { padding: 6px 10px; }
.nav-groupe + .nav-groupe { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }
.nav-groupe .nav-titre {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--texte-3); padding: 4px 10px 6px; font-weight: 650;
}
.nav-lien {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; margin: 1px 0;
  border-radius: 9px; color: var(--texte-2);
  font-weight: 500; text-decoration: none;
  transition: background .12s, color .12s;
}
.nav-lien:hover { background: var(--surface-2); color: var(--texte); text-decoration: none; }
.nav-lien[aria-current="page"] { background: var(--accent-doux); color: var(--accent); font-weight: 650; }
.nav-lien .badge-nb { margin-left: auto; }
.sidebar .pied {
  margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--texte-3);
}

/* Arbre de dossiers */
.arbre { padding: 2px 6px 10px; }
.arbre ul { list-style: none; margin: 0; padding-left: 16px; }
.arbre > ul { padding-left: 4px; }
.arbre li { margin: 0; }
.noeud {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 7px;
  color: var(--texte-2); cursor: pointer; text-decoration: none;
  font-size: .92rem;
}
.noeud:hover { background: var(--surface-2); text-decoration: none; }
.noeud.actif { background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.noeud .chevron {
  width: 18px; height: 18px; display: grid; place-items: center;
  border: none; background: none; color: var(--texte-3); cursor: pointer;
  border-radius: 4px; padding: 0; flex-shrink: 0;
  transition: transform .15s;
}
.noeud .chevron.ouvert { transform: rotate(90deg); }
.noeud .nb { margin-left: auto; font-size: .74rem; color: var(--texte-3); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: .92rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .13s, border-color .13s, color .13s, box-shadow .13s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primaire { background: var(--accent); color: var(--accent-texte); }
.btn-primaire:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondaire { background: var(--surface); color: var(--texte); border-color: var(--border-fort); }
.btn-secondaire:hover:not(:disabled) { background: var(--surface-2); }
.btn-discret { background: transparent; color: var(--texte-2); }
.btn-discret:hover:not(:disabled) { background: var(--surface-2); color: var(--texte); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.btn-danger-doux { background: var(--danger-doux); color: var(--danger); }
.btn-s { height: 30px; padding: 0 10px; font-size: .84rem; border-radius: 7px; }
.btn-icone {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: none; background: transparent;
  color: var(--texte-2); cursor: pointer;
  transition: background .13s, color .13s;
}
.btn-icone:hover { background: var(--surface-2); color: var(--texte); }
.btn-icone.actif { background: var(--accent-doux); color: var(--accent); }

/* ---------- Champs ---------- */
.champ { display: flex; flex-direction: column; gap: 5px; }
.champ > label { font-size: .86rem; font-weight: 600; color: var(--texte-2); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="search"], input[type="email"], select, textarea {
  font: inherit; color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--border-fort);
  border-radius: 9px;
  padding: 8px 12px;
  min-height: 38px;
  transition: border-color .13s;
  width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux);
}
textarea { resize: vertical; min-height: 84px; }
select { cursor: pointer; }
.aide-champ { font-size: .8rem; color: var(--texte-3); }

.interrupteur { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.interrupteur input { position: absolute; opacity: 0; width: 42px; height: 24px; margin: 0; cursor: pointer; }
.interrupteur .piste {
  width: 42px; height: 24px; border-radius: 12px;
  background: var(--border-fort); position: relative; transition: background .15s; flex-shrink: 0;
}
.interrupteur .piste::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--ombre-1); transition: translate .15s;
}
.interrupteur input:checked + .piste { background: var(--accent); }
.interrupteur input:checked + .piste::after { translate: 18px 0; }
.interrupteur input:focus-visible + .piste { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Cartes & panneaux ---------- */
.carte {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--ombre-1);
  padding: 18px 20px;
  margin-top: 30px;
}
.carte + .carte { margin-top: 16px; }
.carte-titre { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.carte-titre h2, .carte-titre h3 { margin: 0; }
.carte-titre .a-droite { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grille { display: grid; gap: 16px; }
.grille-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grille-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grille-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* Tuiles de stats */
.tuile-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 2px;
}
.tuile-stat .valeur { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; }
.tuile-stat .libelle { font-size: .84rem; color: var(--texte-2); }
.tuile-stat .detail { font-size: .78rem; color: var(--texte-3); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; font-weight: 650;
  padding: 2px 9px; border-radius: 20px;
  background: var(--surface-3); color: var(--texte-2);
  white-space: nowrap;
}
.badge-ok { background: var(--ok-doux); color: var(--ok); }
.badge-attention { background: var(--attention-doux); color: var(--attention); }
.badge-danger { background: var(--danger-doux); color: var(--danger); }
.badge-info { background: var(--info-doux); color: var(--info); }
.badge-accent { background: var(--accent-doux); color: var(--accent); }
.badge-nb {
  background: var(--surface-3); color: var(--texte-2);
  font-size: .72rem; font-weight: 650; border-radius: 12px; padding: 1px 8px;
}
.pastille-notif {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--danger); color: #fff;
  font-size: .64rem; font-weight: 700;
  display: grid; place-items: center; padding: 0 4px;
}

/* ---------- Tableaux ---------- */
.tableau-enveloppe { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--texte-3); font-weight: 650;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
  position: sticky; top: 0;
}
.tableau td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tableau tbody tr:last-child td { border-bottom: none; }
.tableau tbody tr { transition: background .1s; }
.tableau tbody tr:hover { background: var(--surface-2); }
.tableau tbody tr.selectionne { background: var(--accent-doux); }
.tableau .tri-btn { background: none; border: none; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0; text-transform: inherit; letter-spacing: inherit; font-weight: inherit; }

/* ---------- Explorateur : liste & grille ---------- */
.fil-ariane { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .92rem; margin-bottom: 14px; }
.fil-ariane a { color: var(--texte-2); padding: 3px 7px; border-radius: 6px; }
.fil-ariane a:hover { background: var(--surface-2); text-decoration: none; color: var(--texte); }
.fil-ariane .separateur { color: var(--texte-3); }
.fil-ariane .courant { font-weight: 650; padding: 3px 7px; }

.barre-outils {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.barre-outils .a-droite { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.vue-grille {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.tuile-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  cursor: pointer; text-align: center; position: relative;
  transition: border-color .13s, box-shadow .13s, translate .13s;
  color: var(--texte); text-decoration: none;
}
.tuile-item:hover { border-color: var(--accent); box-shadow: var(--ombre-2); translate: 0 -2px; text-decoration: none; }
.tuile-item .apercu {
  width: 100%; aspect-ratio: 4/3; border-radius: var(--radius-s);
  background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden;
}
.tuile-item .apercu img { width: 100%; height: 100%; object-fit: cover; }
.tuile-item .nom {
  font-size: .86rem; font-weight: 550; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  word-break: break-word;
}
.tuile-item .infos { font-size: .74rem; color: var(--texte-3); }
.tuile-item input[type="checkbox"] { position: absolute; top: 10px; left: 10px; width: 17px; height: 17px; accent-color: var(--accent); }

.icone-fichier {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: .68rem; font-weight: 750; letter-spacing: .02em;
}
.icone-fichier svg { width: 22px; height: 22px; }
.if-pdf { background: #fde5e5; color: #c0392b; }
.if-image { background: #e5f2fd; color: #2471a3; }
.if-document { background: #e3ecfb; color: #2456a6; }
.if-tableur { background: #e2f4e8; color: #1e8449; }
.if-presentation { background: #fdeee0; color: #ca6f1e; }
.if-video { background: #f2e5fd; color: #7d3c98; }
.if-audio { background: #fdf2e0; color: #b7950b; }
.if-archive { background: #efe9e2; color: #7d6608; }
.if-texte, .if-code { background: var(--surface-3); color: var(--texte-2); }
.if-autre, .if-email { background: var(--surface-3); color: var(--texte-2); }
:root[data-theme="dark"] .if-pdf { background: #3a2020; color: #f1948a; }
:root[data-theme="dark"] .if-image { background: #1c2f40; color: #85c1e9; }
:root[data-theme="dark"] .if-document { background: #1d2a44; color: #7fa8e8; }
:root[data-theme="dark"] .if-tableur { background: #1a3324; color: #7dcea0; }
:root[data-theme="dark"] .if-presentation { background: #3b2a1a; color: #eb984e; }
:root[data-theme="dark"] .if-video { background: #2e1d3a; color: #c39bd3; }
:root[data-theme="dark"] .if-audio { background: #38301a; color: #f4d03f; }
:root[data-theme="dark"] .if-archive { background: #32302a; color: #d4c37a; }

.ligne-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ligne-item .textes { min-width: 0; }
.ligne-item .nom { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; color: var(--texte); }
.ligne-item .sous { font-size: .78rem; color: var(--texte-3); }

/* Barre d'actions groupées */
.barre-selection {
  position: sticky; bottom: 18px; z-index: 50;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border-fort);
  border-radius: var(--radius-l); box-shadow: var(--ombre-3);
  padding: 10px 16px; margin-top: 16px;
}

/* ---------- Modales & tiroirs ---------- */
.voile {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 12, 24, .55);
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modale {
  background: var(--surface); border-radius: var(--radius-l);
  box-shadow: var(--ombre-3);
  width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column;
  animation: modale-in .18s ease-out;
}
.modale.large { max-width: 980px; }
@keyframes modale-in { from { opacity: 0; translate: 0 10px; } }
.modale-tete { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.modale-tete h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.modale-corps { padding: 14px 20px; overflow-y: auto; }
.modale-pied { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 18px; }

/* Visionneuse de fichier */
.visionneuse { width: 100%; height: min(72vh, 760px); border: none; border-radius: var(--radius-s); background: var(--surface-2); }
.visionneuse-img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--radius-s); display: block; margin: 0 auto; }

/* ---------- Toasts ---------- */
.zone-toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 400;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  background: var(--surface); border: 1px solid var(--border-fort);
  border-radius: var(--radius); box-shadow: var(--ombre-2);
  padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; translate: 20px 0; } }
.toast.ok { border-left: 4px solid var(--ok); }
.toast.erreur { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

/* ---------- Notifications (menu) ---------- */
.menu-deroulant {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 150;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--ombre-2);
  min-width: 320px; max-width: 400px; max-height: 480px; overflow-y: auto;
  padding: 6px;
}
.menu-deroulant .entete-menu {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-weight: 650; border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.item-notif { padding: 9px 12px; border-radius: 8px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.item-notif:hover { background: var(--surface-2); }
.item-notif.non-lu { background: var(--accent-doux); }
.item-notif .quand { font-size: .74rem; color: var(--texte-3); }
.menu-simple { min-width: 210px; }
.menu-simple .item-menu {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 8px; border: none; background: none;
  font: inherit; color: var(--texte); cursor: pointer; text-align: left; text-decoration: none;
}
.menu-simple .item-menu:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Filtres (recherche avancée) ---------- */
.panneau-filtres {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.puces-filtres { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.puce {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-doux); color: var(--accent);
  border-radius: 16px; padding: 3px 6px 3px 11px;
  font-size: .82rem; font-weight: 600;
}
.puce button {
  border: none; background: none; color: inherit; cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  padding: 0; font-size: .9rem;
}
.puce button:hover { background: rgba(0,0,0,.1); }

/* ---------- Upload ---------- */
.zone-depot {
  border: 2px dashed var(--border-fort);
  border-radius: var(--radius-l);
  padding: 44px 24px; text-align: center;
  background: var(--surface);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.zone-depot.survol, .zone-depot:hover { border-color: var(--accent); background: var(--accent-doux); }
.zone-depot .grande-icone { color: var(--accent); margin-bottom: 8px; }
.barre-progression { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.barre-progression > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .2s; }

/* ---------- Fiche document ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.doc-meta dl { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; margin: 0; font-size: .92rem; }
.doc-meta dt { color: var(--texte-3); }
.doc-meta dd { margin: 0; word-break: break-word; }
.bloc-ocr {
  background: var(--surface-2); border-radius: var(--radius-s);
  padding: 12px 14px; max-height: 300px; overflow: auto;
  font-size: .86rem; white-space: pre-wrap; font-family: var(--police-mono);
}

/* ---------- Login ---------- */
.page-login {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--bg) 0%, var(--accent-doux) 100%);
  padding: 20px;
}
.carte-login {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); box-shadow: var(--ombre-2);
  padding: 34px 32px;
}
.carte-login .logo-login { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }

/* ---------- Onglets admin ---------- */
.onglets {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.onglet {
  border: none; background: none; font: inherit; font-weight: 600;
  color: var(--texte-2); padding: 10px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.onglet:hover { color: var(--texte); }
.onglet[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination .info { font-size: .86rem; color: var(--texte-3); }

/* ---------- États vides ---------- */
.etat-vide {
  text-align: center; padding: 54px 20px; color: var(--texte-3);
}
.etat-vide .grande-icone { margin-bottom: 10px; opacity: .6; }
.etat-vide h3 { color: var(--texte-2); }

/* Squelettes de chargement */
.squelette {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: squelette 1.4s infinite;
  border-radius: var(--radius-s);
}
@keyframes squelette { to { background-position: -200% 0; } }

/* ---------- Mini graphiques SVG ---------- */
.graph-barres { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.graph-barres .barre { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; opacity: .85; }
.graph-barres .barre:hover { opacity: 1; }
.legende-graph { display: flex; gap: 6px; font-size: .7rem; color: var(--texte-3); margin-top: 4px; }
.legende-graph span { flex: 1; text-align: center; overflow: hidden; }

/* ---------- Responsive ---------- */
.btn-menu-mobile { display: none; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: min(300px, 85vw); height: 100vh;
    translate: -100% 0; transition: translate .2s ease-out;
    box-shadow: var(--ombre-3);
  }
  .sidebar.ouverte { translate: 0 0; }
  .voile-sidebar { position: fixed; inset: 0; background: rgba(10,12,24,.45); z-index: 65; }
  .btn-menu-mobile { display: inline-flex; }
  .main { padding: 16px 14px 80px; }
  .doc-layout { grid-template-columns: 1fr; }
  .omnibox .raccourci { display: none; }
  .topbar .titre-page { display: none; }
}

@media (max-width: 560px) {
  .vue-grille { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .modale-pied { flex-wrap: wrap; }
  .barre-outils .a-droite { margin-left: 0; width: 100%; }
}

/* Impression */
@media print {
  .sidebar, .topbar, .barre-outils, .barre-selection, .pagination { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
}
