@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --fond: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f5f6fb;
  --texte: #161a2c;
  --texte-2: #5d6481;
  --bord: #e5e8f2;
  --accent: #5b4cf0;
  --accent-2: #8b5cf6;
  --accent-texte: #ffffff;
  --accent-doux: #efedff;
  --degrade: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
  --ok: #0f8a5f;
  --ok-fond: #e3f7ee;
  --attention: #a15c00;
  --attention-fond: #fff3d6;
  --alerte: #d0302f;
  --alerte-fond: #ffe9e8;
  --neutre-fond: #eef0f6;
  --ombre: 0 1px 2px rgba(22, 26, 44, .04), 0 8px 24px -12px rgba(22, 26, 44, .12);
  --ombre-forte: 0 18px 40px -18px rgba(76, 29, 149, .35);
  --rayon: 16px;
  --nav-fond: linear-gradient(180deg, #1b1840 0%, #26205a 60%, #2e1f63 100%);
  --nav-texte: #c9c6ee;
  --blob-1: rgba(99, 102, 241, .14);
  --blob-2: rgba(236, 72, 153, .10);
  --blob-3: rgba(20, 184, 166, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0c0f1d;
    --surface: #151a2e;
    --surface-2: #1b2139;
    --texte: #e8eaf6;
    --texte-2: #9aa1c2;
    --bord: #262d4a;
    --accent: #8b7dff;
    --accent-2: #b197fc;
    --accent-texte: #ffffff;
    --accent-doux: #221f48;
    --ok: #4cd69a;
    --ok-fond: #12301f;
    --attention: #f5b94a;
    --attention-fond: #33270f;
    --alerte: #ff7a73;
    --alerte-fond: #3a1a1c;
    --neutre-fond: #232a45;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --ombre-forte: 0 18px 40px -18px rgba(0, 0, 0, .7);
    --nav-fond: linear-gradient(180deg, #0f1124 0%, #141838 100%);
    --blob-1: rgba(99, 102, 241, .16);
    --blob-2: rgba(217, 70, 239, .08);
    --blob-3: rgba(20, 184, 166, .07);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--texte); background-color: var(--fond);
  background-image:
    radial-gradient(900px 500px at 100% -10%, var(--blob-1), transparent 60%),
    radial-gradient(700px 500px at 20% 0%, var(--blob-2), transparent 60%),
    radial-gradient(800px 600px at 60% 110%, var(--blob-3), transparent 60%);
  background-attachment: fixed;
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.65rem; letter-spacing: -.02em; margin: 0 0 .2rem; font-weight: 750; }
h2 { font-size: 1.05rem; letter-spacing: -.01em; margin: 0 0 .9rem; font-weight: 680; }
h3 { font-size: .74rem; margin: 1.2rem 0 .55rem; color: var(--texte-2); text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.muted { color: var(--texte-2); }
.petit { font-size: .85rem; }
.nombre { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.icone { flex-shrink: 0; vertical-align: -3px; }

/* ---------- Mise en page ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.nav {
  background: var(--nav-fond); color: var(--nav-texte); padding: 1.25rem .9rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.nav .tete { display: flex; justify-content: space-between; align-items: center; }
.nav .marque { display: flex; align-items: center; gap: .65rem; padding: .25rem .5rem 1.4rem; color: #fff; font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; }
.nav .marque:hover { text-decoration: none; }
.nav .marque .logo-okodoc { height: 38px; width: auto; display: block; }
.marque-connexion { margin: 0 0 .9rem; }
.marque-connexion .logo-okodoc { height: 54px; width: auto; display: block; }
.marque-connexion.petite .logo-okodoc { height: 38px; }
.seul-sombre { display: none; }
@media (prefers-color-scheme: dark) { .seul-clair { display: none; } .seul-sombre { display: block; } }
.logo {
  width: 36px; height: 36px; border-radius: 11px; background: var(--degrade); display: grid; place-items: center;
  box-shadow: 0 6px 16px -6px rgba(139, 92, 246, .8); color: #fff;
}
.nav .liens { display: flex; flex-direction: column; flex: 1; }
.nav a.lien {
  display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 11px;
  color: var(--nav-texte); margin-bottom: 3px; font-weight: 500; transition: background .15s, color .15s;
}
.nav a.lien:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.lien.actif { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 #a78bfa; }
.nav a.lien.actif .icone { color: #c4b5fd; }
.nav .bas {
  margin-top: auto; padding: .9rem .75rem; border-radius: 14px; background: rgba(255, 255, 255, .06); font-size: .85rem;
}
.nav .bas .qui { color: #fff; font-weight: 600; display: flex; align-items: center; gap: .55rem; margin-bottom: .5rem; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #14b8a6, #6366f1);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; text-transform: uppercase;
}
.nav .bas a, .nav .bas button.lien-btn { color: var(--nav-texte); font-size: .82rem; }
.nav .bas form { display: inline; }
.contenu { padding: 1.75rem 2.25rem 3.5rem; max-width: 1240px; width: 100%; min-width: 0; }
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.entete .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.fil { font-size: .82rem; color: var(--texte-2); margin-bottom: .3rem; }
.fil a { color: var(--texte-2); }

/* ---------- Bandeau d'accueil ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; color: #fff; padding: 1.8rem 2rem 4.6rem;
  margin-bottom: 1.5rem; box-shadow: var(--ombre-forte); isolation: isolate; min-height: 210px;
}
.hero picture, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: bottom; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(30, 20, 80, .55), rgba(30, 20, 80, 0) 70%); }
.hero h1 { font-size: 2rem; color: #fff; }
.hero p { margin: .2rem 0 0; color: rgba(255, 255, 255, .88); font-size: 1rem; }
.hero .actions { margin-top: 1.1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.hero .btn { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); backdrop-filter: blur(6px); }
.hero .btn:hover { background: rgba(255, 255, 255, .26); }
.hero .btn.primaire { background: #fff; color: #4c1d95; border-color: #fff; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 1.3rem 1.45rem; box-shadow: var(--ombre); margin-bottom: 1.4rem; min-width: 0;
}
.carte > h2:first-child { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.titre-icone { display: inline-flex; align-items: center; gap: .55rem; }
.titre-icone .bulle { width: 30px; height: 30px; border-radius: 9px; }
.grille { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); margin-bottom: 1.4rem; }
.grille > .carte { margin-bottom: 0; }
.grille { align-items: start; }

.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 1.4rem; }
.stat {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 1.1rem 1.2rem; box-shadow: var(--ombre);
}
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c, var(--accent)); }
.stat .tete { display: flex; justify-content: space-between; align-items: center; }
.stat .libelle { font-size: .8rem; color: var(--texte-2); font-weight: 550; }
.stat .valeur { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: .35rem; }
.stat .sous { font-size: .8rem; color: var(--texte-2); }
.stat.alerte .valeur { color: var(--alerte); }
.stats .stat:nth-child(4n+1) { --c: #6366f1; --c-fond: rgba(99, 102, 241, .12); }
.stats .stat:nth-child(4n+2) { --c: #14b8a6; --c-fond: rgba(20, 184, 166, .13); }
.stats .stat:nth-child(4n+3) { --c: #f43f5e; --c-fond: rgba(244, 63, 94, .12); }
.stats .stat:nth-child(4n+4) { --c: #f59e0b; --c-fond: rgba(245, 158, 11, .14); }
.bulle {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--c-fond, var(--accent-doux)); color: var(--c, var(--accent));
}
.bulle.violet { --c: #8b5cf6; --c-fond: rgba(139, 92, 246, .13); }
.bulle.turquoise { --c: #14b8a6; --c-fond: rgba(20, 184, 166, .13); }
.bulle.rose { --c: #f43f5e; --c-fond: rgba(244, 63, 94, .12); }
.bulle.ambre { --c: #f59e0b; --c-fond: rgba(245, 158, 11, .14); }
.bulle.bleu { --c: #0ea5e9; --c-fond: rgba(14, 165, 233, .13); }

.jauge { height: 7px; border-radius: 99px; background: var(--neutre-fond); overflow: hidden; margin-top: .55rem; }
.jauge span { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--accent)); }

/* Liste « à faire » */
.tache { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--bord); }
.tache:last-child { border-bottom: none; }
.tache .bulle { width: 34px; height: 34px; border-radius: 10px; }
.tache .quand { font-size: .8rem; color: var(--texte-2); }

/* ---------- Cartes de biens ---------- */
.biens { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.bien-carte {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--bord); border-radius: 18px;
  overflow: hidden; box-shadow: var(--ombre); color: var(--texte); transition: transform .18s, box-shadow .18s;
}
.bien-carte:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); text-decoration: none; }
.bien-carte .visuel { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.bien-carte .visuel img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.bien-carte:hover .visuel img { transform: scale(1.04); }
.bien-carte .visuel .badge { position: absolute; top: .7rem; left: .7rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.bien-carte .visuel .type { position: absolute; bottom: .6rem; right: .7rem; font-size: .72rem; font-weight: 650; background: rgba(15, 12, 40, .55); color: #fff; padding: .15rem .55rem; border-radius: 99px; backdrop-filter: blur(4px); }
.bien-carte .corps { padding: .95rem 1.05rem 1.05rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.bien-carte .nom { font-weight: 680; font-size: 1rem; letter-spacing: -.01em; }
.bien-carte .lieu { font-size: .84rem; color: var(--texte-2); }
.bien-carte .pied { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: auto; padding-top: .65rem; border-top: 1px solid var(--bord); font-size: .85rem; }
.bien-carte .pied .qui { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte-2); }
.bien-carte .loyer { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bien-carte .corps .lieu { margin-bottom: .55rem; }
.bien-carte.ajout { align-items: center; justify-content: center; min-height: 180px; border: 2px dashed var(--bord); background: transparent; box-shadow: none; color: var(--texte-2); gap: .5rem; font-weight: 600; }
.bien-carte.ajout:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

/* Bannière d'un bien */
.banniere { position: relative; border-radius: 22px; overflow: hidden; margin-bottom: 1.4rem; box-shadow: var(--ombre-forte); height: 280px; background: var(--surface-2); }
.banniere img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banniere::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15, 10, 40, .75) 0%, rgba(15, 10, 40, .1) 55%, rgba(15, 10, 40, 0) 100%); }
.banniere .texte { position: absolute; left: 1.6rem; right: 1.6rem; bottom: 1.2rem; color: #fff; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.banniere .texte h1 { color: #fff; font-size: 1.9rem; }
.banniere .texte .fil, .banniere .texte .fil a { color: rgba(255, 255, 255, .85); }
.banniere .texte .adresse { color: rgba(255, 255, 255, .9); }
.banniere .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.banniere .btn { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .3); backdrop-filter: blur(6px); }
.banniere .btn:hover { background: rgba(255, 255, 255, .3); }
.banniere .btn.primaire { background: #fff; color: #4c1d95; border-color: #fff; }
.banniere .astuce { position: absolute; top: 1rem; right: 1rem; z-index: 1; font-size: .78rem; background: rgba(255, 255, 255, .85); color: #2e1065; padding: .3rem .7rem; border-radius: 99px; }
.banniere .astuce:hover { text-decoration: none; background: #fff; }

/* ---------- Fiches ---------- */
dl.fiche { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: .5rem 1.1rem; margin: 0; }
dl.fiche dt { color: var(--texte-2); font-size: .9rem; }
dl.fiche dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; margin: 0 -1.45rem; padding: 0 1.45rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .65rem; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-2); font-weight: 650; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
tfoot td { font-weight: 700; border-bottom: none; border-top: 2px solid var(--bord); }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline-block; vertical-align: middle; }
td.actions > a, td.actions > form { vertical-align: middle; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .62rem; border-radius: 999px; font-size: .76rem; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.ok { background: var(--ok-fond); color: var(--ok); }
.badge.attention { background: var(--attention-fond); color: var(--attention); }
.badge.alerte { background: var(--alerte-fond); color: var(--alerte); }
.badge.neutre { background: var(--neutre-fond); color: var(--texte-2); }
.type-fichier {
  display: inline-grid; place-items: center; min-width: 2.7rem; height: 1.7rem; font-size: .66rem; font-weight: 800; letter-spacing: .03em;
  border-radius: 7px; background: var(--accent-doux); color: var(--accent); margin-right: .55rem; vertical-align: middle;
}
.type-fichier.PDF { background: #ffe4e6; color: #e11d48; }
.type-fichier.IMG { background: #dcfce7; color: #15803d; }
.type-fichier.DOC { background: #dbeafe; color: #1d4ed8; }
.type-fichier.XLS { background: #d1fae5; color: #047857; }
@media (prefers-color-scheme: dark) {
  .type-fichier.PDF { background: #3b1520; color: #fb7185; }
  .type-fichier.IMG { background: #12301f; color: #4ade80; }
  .type-fichier.DOC { background: #172554; color: #93c5fd; }
  .type-fichier.XLS { background: #0f2e25; color: #34d399; }
}
.docs { display: flex; flex-direction: column; }
.doc { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--bord); }
.doc:last-child { border-bottom: none; }
.doc-apercu { flex-shrink: 0; display: grid; place-items: center; width: 44px; }
.doc-apercu .type-fichier { margin: 0; }
.doc-apercu .vignette { margin: 0; }
.doc-infos { flex: 1; min-width: 0; }
.doc-titre { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-actions { display: flex; gap: .2rem; flex-shrink: 0; }
.btn-icone { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--texte-2); }
.btn-icone:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }
.btn-icone.danger:hover { background: var(--alerte-fond); color: var(--alerte); }
.vignette { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; margin-right: 0; vertical-align: middle; border: 1px solid var(--bord); }
.galerie { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: .5rem; }
.galerie a { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: 1px solid var(--bord); }
.galerie img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block; }
.galerie a:hover img { transform: scale(1.05); }
.galerie .legende { position: absolute; inset: auto 0 0 0; padding: .35rem .5rem; font-size: .75rem; color: #fff; background: linear-gradient(0deg, rgba(0, 0, 0, .6), transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Boutons ---------- */
.btn, button {
  display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: 11px;
  border: 1px solid var(--bord); background: var(--surface); color: var(--texte); font: inherit; font-size: .88rem; font-weight: 580;
  cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2; transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:hover, button:hover { background: var(--surface-2); text-decoration: none; }
.btn:active, button:active { transform: translateY(1px); }
.btn.primaire, button.primaire {
  background: var(--degrade); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(124, 58, 237, .9);
}
.btn.primaire:hover, button.primaire:hover { filter: brightness(1.07); box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 1); }
.btn.danger, button.danger { color: var(--alerte); border-color: color-mix(in srgb, var(--alerte) 40%, transparent); background: transparent; }
.btn.danger:hover, button.danger:hover { background: var(--alerte-fond); }
.btn.mini, button.mini { padding: .3rem .62rem; font-size: .78rem; border-radius: 8px; }
button.lien-btn { border: none; background: none; padding: 0; color: var(--accent); font-weight: 500; box-shadow: none; }

/* ---------- Formulaires ---------- */
form.formulaire { max-width: 740px; }
.champ { margin-bottom: 1.05rem; }
.champ label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.champ .aide { font-size: .8rem; color: var(--texte-2); margin-top: .3rem; }
.champ .erreur, .erreurs { color: var(--alerte); font-size: .85rem; margin-top: .3rem; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], input[type=search], input[type=month],
input[type=file], select, textarea {
  width: 100%; padding: .62rem .75rem; border: 1px solid var(--bord); border-radius: 11px;
  background: var(--surface); color: var(--texte); font: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=file] { padding: .5rem; background: var(--surface); }
input[type=file]::file-selector-button { border: none; background: var(--accent-doux); color: var(--accent); padding: .45rem .8rem; border-radius: 8px; font: inherit; font-weight: 600; margin-right: .75rem; cursor: pointer; }
.champ ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.champ ul label { font-weight: normal; display: flex; gap: .45rem; align-items: center; }
.champ input[type=checkbox] { width: auto; accent-color: var(--accent); }
.champ.case label { display: flex; gap: .5rem; align-items: center; }
.boutons { display: flex; gap: .5rem; margin-top: 1.6rem; flex-wrap: wrap; }
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.1rem; }
.filtres select, .filtres input { width: auto; }

/* ---------- Messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 1.1rem; }
.messages li { padding: .75rem 1rem; border-radius: 12px; margin-bottom: .5rem; background: var(--accent-doux); font-weight: 500; }
.messages li.success { background: var(--ok-fond); color: var(--ok); }
.messages li.error { background: var(--alerte-fond); color: var(--alerte); }
.messages li.warning { background: var(--attention-fond); color: var(--attention); }

/* ---------- Documents ---------- */
.docs-layout { display: grid; grid-template-columns: 250px 1fr; gap: 1.4rem; align-items: start; }
.categories { position: sticky; top: 1rem; padding: .7rem; }
.categories a { display: flex; justify-content: space-between; align-items: center; padding: .48rem .65rem; border-radius: 9px; color: var(--texte); font-size: .88rem; }
.categories a span:last-child { font-size: .75rem; font-weight: 650; color: var(--texte-2); background: var(--neutre-fond); border-radius: 99px; padding: 0 .45rem; min-width: 1.5rem; text-align: center; }
.categories a:hover { background: var(--surface-2); text-decoration: none; }
.categories a.actif { background: var(--accent-doux); color: var(--accent); font-weight: 650; }
.categories a.actif span:last-child { background: var(--accent); color: #fff; }
.categories a.vide { color: var(--texte-2); }
.depot {
  border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--bord)); border-radius: var(--rayon); padding: 1.1rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent), color-mix(in srgb, #14b8a6 6%, transparent));
  transition: border-color .15s, background .15s;
}
.depot.survol { border-color: var(--accent); background: var(--accent-doux); }
.depot .ligne { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.vide-etat { text-align: center; padding: 2.2rem 1rem; color: var(--texte-2); }
.vide-etat img { width: 200px; max-width: 60%; display: block; margin: 0 auto 1rem; }
.vide-etat h2 { color: var(--texte); font-size: 1.3rem; }

/* ---------- Connexion ---------- */
.page-connexion { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; position: relative; isolation: isolate; background: #1e1b4b; }
.page-connexion picture, .page-connexion picture img { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: bottom; z-index: -1; }
.page-connexion .connexion {
  width: 100%; max-width: 400px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .6); border-radius: 22px;
  padding: 2rem; box-shadow: 0 30px 60px -20px rgba(30, 10, 80, .55); color: #161a2c;
}
.page-connexion .connexion .logo { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 1rem; }
.page-connexion .connexion h1 { font-size: 1.5rem; }
.page-connexion .connexion p { color: #5d6481; margin-top: 0; }
.page-connexion .connexion input { background: #fff; color: #161a2c; border-color: #dfe3ef; }
.page-connexion button.primaire { width: 100%; justify-content: center; padding: .75rem; font-size: .95rem; }
.page-connexion .pied { margin-top: 1.2rem; font-size: .78rem; color: #5d6481; display: flex; align-items: center; gap: .4rem; justify-content: center; }
@media (prefers-color-scheme: dark) {
  .page-connexion .connexion { background: rgba(21, 26, 46, .82); border-color: rgba(255, 255, 255, .08); color: #e8eaf6; }
  .page-connexion .connexion p, .page-connexion .pied { color: #9aa1c2; }
  .page-connexion .connexion input { background: #0f1426; color: #e8eaf6; border-color: #2a3150; }
}

.menu-mobile { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: sticky; top: 0; z-index: 10; height: auto; padding: .6rem 1rem; }
  .nav .marque { padding: .3rem 0; }
  .nav .liens { display: none; padding-bottom: .5rem; }
  .nav.ouvert .liens { display: flex; }
  .nav .bas { margin-top: .75rem; }
  .menu-mobile { display: inline-flex; background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .15); }
  .contenu { padding: 1.1rem 1rem 3rem; }
  .hero { padding: 1.4rem 1.3rem 4.8rem; border-radius: 18px; }
  .hero h1 { font-size: 1.55rem; }
  .banniere { height: 240px; border-radius: 18px; }
  .banniere .texte { left: 1rem; right: 1rem; bottom: .9rem; }
  .banniere .texte h1 { font-size: 1.4rem; }
  .docs-layout { grid-template-columns: 1fr; }
  .categories { position: static; display: flex; overflow-x: auto; gap: .3rem; }
  .categories a { flex-shrink: 0; gap: .5rem; }
  .depot .ligne { grid-template-columns: 1fr; }
  .carte { padding: 1.05rem; }
  .table-wrap { margin: 0 -1.05rem; padding: 0 1.05rem; }
  dl.fiche { grid-template-columns: 1fr; gap: .1rem; }
  dl.fiche dd { margin-bottom: .55rem; }
}
@media print {
  .nav, .actions, .boutons, td.actions, .filtres, .hero picture { display: none !important; }
  body { background: #fff; }
  .app { display: block; }
  .carte, .stat { box-shadow: none; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Interactions sans rechargement (htmx) ---------- */
#toasts { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; width: max-content; max-width: calc(100vw - 2rem); }
.toast {
  background: #1b1840; color: #fff; padding: .7rem 1.1rem; border-radius: 12px; font-size: .9rem; font-weight: 550;
  box-shadow: 0 12px 30px -10px rgba(20, 10, 60, .55); animation: toast-entree .25s ease-out; transition: opacity .4s, transform .4s;
  display: flex; align-items: center; gap: .55rem;
}
.toast::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #14b8a6; font-size: .75rem; flex-shrink: 0; }
.toast.sortie { opacity: 0; transform: translateY(8px); }
@keyframes toast-entree { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-color-scheme: dark) { .toast { background: #2a2466; } }
.htmx-request button, .htmx-request.btn-icone, button.htmx-request { opacity: .55; pointer-events: none; }
tr.htmx-swapping, .doc.htmx-swapping { opacity: 0; transition: opacity .25s; }
tr.htmx-added, .doc.htmx-added { background: var(--ok-fond); }
tr.htmx-settling { transition: background 1.2s; }
#resultats.htmx-request, #liste-docs.htmx-request { opacity: .6; transition: opacity .15s; }
.apercu-revision { background: linear-gradient(135deg, var(--accent-doux), color-mix(in srgb, #14b8a6 10%, var(--surface))); border-color: color-mix(in srgb, var(--accent) 25%, var(--bord)); }
.grand-chiffre { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
