/* Mise en page « bureau » : Super Admin et administrateur d'organisation. */

.bureau { display: grid; grid-template-columns: 264px 1fr; min-height: 100dvh; }
.lateral {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px; background: var(--nuit); color: #C9D5EA; overflow-y: auto;
}
.lateral .marque { color: #fff; padding: 0 10px 18px; }
.lateral-groupe { font: 700 10.5px/1 var(--f-texte); letter-spacing: .14em; text-transform: uppercase; color: #8FA6CF; padding: 18px 12px 8px; }
.lien-nav {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none;
  color: inherit; font-weight: 600; font-size: 14.5px; border: 0; background: none; width: 100%; text-align: left;
  transition: background .18s, color .18s;
}
.lien-nav svg { width: 19px; height: 19px; opacity: .8; }
.lien-nav:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.lien-nav[aria-current="page"] { background: linear-gradient(90deg, rgba(240, 138, 28, .2), rgba(240, 138, 28, .04)); color: #fff; box-shadow: inset 3px 0 0 var(--pompe); }
.lien-nav[aria-current="page"] svg { opacity: 1; color: #FFB24A; }
.lien-nav .badge { margin-left: auto; background: var(--pompe); color: #1B0F00; }
.lateral-pied { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font: 800 14px var(--f-titre); background: linear-gradient(135deg, var(--pompe), #FFB24A); color: #1B0F00; flex: none; }
.avatar.bleu { background: linear-gradient(135deg, var(--marine-2), #2F6FDB); color: #fff; }

.principal { min-width: 0; padding: 26px clamp(18px, 3vw, 40px) 60px; }
.entete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.entete-page > :first-child { flex: 1 1 320px; min-width: 0; }
.entete-page .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-left: auto; }

.direct { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--texte-3); }
.direct i { width: 8px; height: 8px; border-radius: 50%; background: var(--texte-3); }
.direct.actif { color: var(--feuille-2); }
:root[data-theme="dark"] .direct.actif { color: #4ADE95; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .direct.actif { color: #4ADE95; } }
.direct.actif i { background: var(--feuille); box-shadow: 0 0 0 0 rgba(19, 150, 90, .5); animation: onde 1.8s infinite; }
@keyframes onde { 70% { box-shadow: 0 0 0 8px rgba(19, 150, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(19, 150, 90, 0); } }

.grille-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; display: grid; gap: 6px; position: relative; overflow: hidden; }
.kpi .valeur { white-space: nowrap; font: 800 30px/1 var(--f-titre); font-variation-settings: "wdth" 80; letter-spacing: -.02em; }
.kpi .sous { font-size: 12.5px; color: var(--texte-3); font-weight: 600; }
.kpi .pictogramme { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--texte-2); }
.kpi .pictogramme svg { width: 18px; height: 18px; }
.kpi:has(.pictogramme) > .surtitre { padding-right: 46px; min-height: 26px; }
.kpi.vedette { background: linear-gradient(140deg, var(--marine) 0%, var(--nuit) 100%); color: #fff; border: 0; grid-column: span 2; }
.kpi.vedette .surtitre { color: #8FA6CF; }
.kpi.vedette .sous { color: #8FA6CF; }
.kpi.alerte .pictogramme { background: var(--danger-fond); color: var(--danger); }

.grille-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 20px; }
.grille-2-egal { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 0; }
.carte-corps { padding: 16px 20px 20px; }

.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.recherche { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.recherche svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--texte-3); }
.recherche .saisie { padding-left: 40px; min-height: 42px; }
.puces { display: flex; gap: 6px; flex-wrap: wrap; }
.puce { border: 1.5px solid var(--brume); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700; color: var(--texte-2); transition: all .18s; }
.puce[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: #fff; }

.flux-activite { list-style: none; margin: 0; padding: 0; display: grid; }
.flux-activite li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid color-mix(in srgb, var(--brume) 60%, transparent); }
.flux-activite li:last-child { border-bottom: 0; }
.flux-activite .point { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.flux-activite .point svg { width: 17px; height: 17px; }
.flux-activite li.nouveau { animation: nouveau 1.6s var(--doux); }
@keyframes nouveau { 0% { background: color-mix(in srgb, var(--pompe) 22%, transparent); transform: translateX(-6px); } 100% { background: transparent; } }

/* chronologie d'un bon (tiroir) */
.chrono { list-style: none; margin: 0; padding: 0; display: grid; }
.chrono li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.chrono li::before { content: ""; position: absolute; left: 12px; top: 24px; bottom: 0; width: 2px; background: var(--brume); }
.chrono li:last-child::before { display: none; }
.chrono .rond { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--texte-3); }
.chrono .rond svg { width: 14px; height: 14px; }
.chrono li.fait .rond { background: var(--c, var(--feuille)); color: #fff; }

.entete-tiroir { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--brume); }
.corps-tiroir { padding: 22px; display: grid; gap: 20px; }
.definitions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; margin: 0; font-size: 14px; }
.definitions dt { color: var(--texte-3); font-weight: 600; }
.definitions dd { margin: 0; font-weight: 700; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.definitions .immat { display: inline-block; max-width: 100%; white-space: normal; line-height: 1.3; }

.barre-mobile { display: none; }

@media (max-width: 1100px) {
  .grille-2, .grille-2-egal { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .bureau { grid-template-columns: 1fr; }
  .lateral { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .35s var(--doux); }
  .lateral.ouvert { transform: none; box-shadow: var(--ombre-3); }
  .barre-mobile { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 30; padding: calc(10px + var(--haut)) 16px 10px; background: color-mix(in srgb, var(--papier) 88%, transparent); backdrop-filter: blur(14px); }
  .principal { padding: 8px 16px 40px; }
  .kpi.vedette { grid-column: auto; }
  .grille-kpi { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi .valeur { font-size: 24px; }
  .kpi.vedette { grid-column: 1 / -1; }
  /* tableaux : une carte par ligne, libellés de colonne portés par data-label */
  .bureau .tableau thead { display: none; }
  .bureau .tableau tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px 16px; border-bottom: 1px solid color-mix(in srgb, var(--brume) 60%, transparent); }
  .bureau .tableau tbody tr:last-child { border-bottom: 0; }
  .bureau .tableau td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .bureau .tableau td:first-child, .bureau .tableau td:last-child, .bureau .tableau td[data-utilisation] { grid-column: 1 / -1; }
  .bureau .tableau td:empty { display: none; }
  .bureau .tableau .num { text-align: left; }
  .bureau .tableau td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font: 700 .65625rem/1 var(--f-texte); letter-spacing: .1em; text-transform: uppercase; color: var(--texte-3); }
  .bureau .tableau .actions-ligne { justify-content: flex-start; flex-wrap: wrap; }
}
