/* DecodeVox, administration : thème posé sur Bootstrap 5.3 (vendor/bootstrap-5.3.3).
   Ce fichier ne contient que l'identité DecodeVox (couleurs, polices) et quelques composants
   absents de Bootstrap (barre latérale sombre, recherche rapide, tableaux en fiches sur mobile).
   Aucun style inline (CSP stricte), aucune ressource externe. */
@import url("tokens.css");

@font-face { font-family: "Figtree"; src: url("fonts/figtree-var.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Syne"; src: url("fonts/syne-var.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

/* ------------------------------------------------------------------ jetons Bootstrap aux couleurs de la marque */
:root, [data-bs-theme=light] {
  --bs-body-font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-font-monospace: "Plex Mono", ui-monospace, monospace;
  --bs-body-font-size: .95rem;
  --bs-body-bg: #F4F2EC; --bs-body-color: #0B0C0F; --bs-secondary-color: #5E636D;
  --bs-tertiary-bg: #FAF8F3; --bs-border-color: #E4E0D6;
  --bs-primary: #E24A2A; --bs-primary-rgb: 226, 74, 42;
  --bs-link-color: #0B0C0F; --bs-link-color-rgb: 11, 12, 15; --bs-link-hover-color: #E24A2A; --bs-link-hover-color-rgb: 226, 74, 42;
  --bs-success: #17705F; --bs-success-rgb: 23, 112, 95; --bs-danger: #B3341B; --bs-danger-rgb: 179, 52, 27;
  --bs-warning: #8A5A12; --bs-focus-ring-color: rgba(47, 138, 128, .3);
  --bs-border-radius: .65rem; --bs-border-radius-sm: .5rem; --bs-border-radius-lg: .9rem;
  --dvx-surface: #FFFFFF; --dvx-ok-bg: #E2F3EE; --dvx-warn-bg: #FBF0DC; --dvx-bad-bg: #FBE7E2; --dvx-accent-soft: #FCE9E3;
  --dvx-side-bg: #0E0F13; --dvx-side-ink: #E9E6DD; --dvx-side-muted: #8C9099; --dvx-side-hover: #1A1C22; --dvx-side-line: #23262D;
  --dvx-display: "Syne", var(--bs-body-font-family);
}
.btn-primary { --bs-btn-bg: #E24A2A; --bs-btn-border-color: #E24A2A; --bs-btn-hover-bg: #C93D20; --bs-btn-hover-border-color: #C93D20;
  --bs-btn-active-bg: #B5361C; --bs-btn-active-border-color: #B5361C; --bs-btn-disabled-bg: #E24A2A; --bs-btn-disabled-border-color: #E24A2A; }
.btn-dark { --bs-btn-bg: #0B0C0F; --bs-btn-border-color: #0B0C0F; }
.btn { --bs-btn-font-weight: 600; }
.form-control, .form-select { background-color: var(--dvx-surface); }
.form-control:focus, .form-select:focus { border-color: #2F8A80; }
.card { --bs-card-bg: var(--dvx-surface); --bs-card-border-color: var(--bs-border-color); box-shadow: 0 1px 2px rgba(11, 12, 15, .04); }

/* ------------------------------------------------------------------ typographie */
h1, h2, h3, .h1, .h2, .h3 { font-family: var(--dvx-display); font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.5rem, 3.2vw, 2rem); }
h2 { font-size: 1.12rem; margin-top: 2rem; }
code, .mono { font-family: var(--bs-font-monospace); font-size: .86em; overflow-wrap: anywhere; color: inherit; }
.eyebrow { font-family: var(--bs-font-monospace); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #E24A2A; margin-bottom: .35rem; }
.eyebrow a { text-decoration: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head p { color: var(--bs-secondary-color); margin: 0; max-width: 72ch; }
.muted { color: var(--bs-secondary-color); }
.min-w-0 { min-width: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 8px; }
kbd { font-family: var(--bs-font-monospace); font-size: .7rem; padding: 2px 6px; background: transparent; color: inherit; border: 1px solid currentColor; opacity: .7; }

/* ------------------------------------------------------------------ barre latérale : offcanvas Bootstrap (tiroir < 992 px) */
.dvx-sidebar { --bs-offcanvas-width: 272px; --bs-offcanvas-bg: var(--dvx-side-bg); --bs-offcanvas-color: var(--dvx-side-ink);
  background: var(--dvx-side-bg); color: var(--dvx-side-ink); }
@media (min-width: 992px) {
  /* .offcanvas-lg rend le fond transparent à partir de lg : la barre garde son fond sombre */
  .dvx-sidebar { position: sticky; top: 0; height: 100vh; width: 272px; flex: none; overflow-y: auto;
    background-color: var(--dvx-side-bg) !important; color: var(--dvx-side-ink); }
  .dvx-sidebar .offcanvas-body { height: 100%; }
}
.dvx-sidebar .offcanvas-body { display: flex; flex-direction: column; gap: 1rem; padding: 1rem .9rem; }
.dvx-sidebar .btn-close { filter: invert(1); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--dvx-display); font-weight: 800;
  font-size: 1.15rem; letter-spacing: -0.02em; color: inherit; }
.brand:hover { color: inherit; }
.search-trigger { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .75rem; border-radius: .65rem;
  border: 1px solid var(--dvx-side-line); background: #15171C; color: var(--dvx-side-muted); font-size: .9rem; }
.search-trigger span { flex: 1; text-align: left; }
.search-trigger:hover { color: var(--dvx-side-ink); border-color: #343842; }
.nav-title { margin: 0 0 .25rem; padding: 0 .75rem; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dvx-side-muted); }
.dvx-nav .nav-link { position: relative; display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: .65rem;
  color: var(--dvx-side-ink); font-weight: 500; }
.dvx-nav .nav-link .ico { color: var(--dvx-side-muted); }
.dvx-nav .nav-link:hover { background: var(--dvx-side-hover); color: #fff; }
.dvx-nav .nav-link:hover .ico { color: #fff; }
.dvx-nav .nav-link.active { background: var(--dvx-side-hover); color: #fff; }
.dvx-nav .nav-link.active .ico { color: #E24A2A; }
.dvx-nav .nav-link.active::before { content: ""; position: absolute; left: -.9rem; top: .5rem; bottom: .5rem; width: 3px; border-radius: 0 3px 3px 0; background: #E24A2A; }
.who { display: flex; align-items: center; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--dvx-side-line); margin-top: auto; }
.who-id { flex: 1; min-width: 0; display: flex; align-items: center; gap: .6rem; padding: .35rem; border-radius: .65rem; text-decoration: none; color: inherit; }
.who-id:hover, .who-id.active { background: var(--dvx-side-hover); color: inherit; }
.who-id strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-id small { display: block; font-size: .75rem; color: var(--dvx-side-muted); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: #E24A2A; color: #fff; font-weight: 700; }
.btn-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: .6rem; color: inherit; }
.dvx-sidebar .btn-icon:hover { background: var(--dvx-side-hover); color: #fff; }

/* barre du haut : fil d'Ariane */
.dvx-topbar { background: rgba(244, 242, 236, .88); backdrop-filter: saturate(1.4) blur(10px); }
.breadcrumb { --bs-breadcrumb-divider-color: #C9C4B8; --bs-breadcrumb-item-active-color: #0B0C0F; font-size: .9rem; flex-wrap: nowrap; overflow: hidden; }
.breadcrumb-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb-item a { text-decoration: none; color: var(--bs-secondary-color); }
.breadcrumb-item.active { font-weight: 600; }

/* ------------------------------------------------------------------ indicateurs */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .35rem; }
.stat > span:first-child { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-secondary-color); font-weight: 700; }
.stat strong { font-family: var(--dvx-display); font-size: 2rem; line-height: 1; letter-spacing: -0.03em; }
.stat > span:last-child { color: var(--bs-secondary-color); font-size: .9rem; }
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--bs-border-color); }
.grid > .stat:nth-child(1)::before { background: #E24A2A; }
.grid > .stat:nth-child(2)::before { background: #C08A2C; }
.grid > .stat:nth-child(3)::before { background: #17705F; }
.grid > .stat:nth-child(4)::before { background: #2F5F8A; }

/* pastilles de statut (sur .badge de Bootstrap) */
.badge { font-weight: 600; font-size: .76rem; padding: .35em .75em; border-radius: 999px; color: #0B0C0F; background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color); display: inline-flex; align-items: center; gap: .4em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.ok { background: var(--dvx-ok-bg); color: #17705F; border-color: transparent; }
.badge.warn { background: var(--dvx-warn-bg); color: #8A5A12; border-color: transparent; }
.badge.bad { background: var(--dvx-bad-bg); color: #B3341B; border-color: transparent; }
.badge.accent { background: var(--dvx-accent-soft); color: #C93D20; border-color: transparent; }
.tag { padding: 2px 8px; border-radius: 6px; background: #EFECE4; font-size: .8rem; }
.alert.ok { --bs-alert-bg: var(--dvx-ok-bg); --bs-alert-color: #17705F; --bs-alert-border-color: transparent; }
.alert.warn { --bs-alert-bg: var(--dvx-warn-bg); --bs-alert-color: #8A5A12; --bs-alert-border-color: transparent; }
.alert.bad { --bs-alert-bg: var(--dvx-bad-bg); --bs-alert-color: #B3341B; --bs-alert-border-color: transparent; }
.alert ul { margin: 0; padding-left: 1.1em; }

/* ------------------------------------------------------------------ tableaux (.table de Bootstrap) */
.table-card { background: var(--dvx-surface); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg);
  overflow: hidden; box-shadow: 0 1px 2px rgba(11, 12, 15, .04); }
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #FAF8F3; margin: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: #EFECE4; }
.table thead th { background: #FAF8F3; font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--bs-secondary-color);
  font-weight: 700; white-space: nowrap; border-bottom-color: var(--bs-border-color); position: sticky; top: 0; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table td a { font-weight: 600; text-decoration: none; }
.table td a:hover { text-decoration: underline; }
tr[data-href] { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.empty { padding: 2.5rem 1rem !important; text-align: center; color: var(--bs-secondary-color); }
.empty-note { color: var(--bs-secondary-color); padding: 1.1rem; border: 1px dashed var(--bs-border-color); border-radius: var(--bs-border-radius-lg); text-align: center; }
.table-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: .6rem; }
.table-toolbar .count { margin: 0; color: var(--bs-secondary-color); font-size: .9rem; }
.table-toolbar .count strong { color: var(--bs-body-color); }
.per-page { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--bs-secondary-color); }
.per-page .form-select { width: auto; }
.pagination { --bs-pagination-color: #0B0C0F; --bs-pagination-hover-color: #0B0C0F; --bs-pagination-active-bg: #0B0C0F;
  --bs-pagination-active-border-color: #0B0C0F; --bs-pagination-border-radius: .6rem; gap: .35rem; }
.pagination .page-link { border-radius: .6rem !important; min-width: 2.4rem; text-align: center; font-weight: 600; }
.pagination .page-link .ico { width: 16px; height: 16px; vertical-align: -3px; }

/* filtres en pastilles */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters a { padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--bs-border-color); background: var(--dvx-surface);
  text-decoration: none; font-size: .88rem; font-weight: 500; }
.filters a:hover { border-color: #0B0C0F; }
.filters a[aria-current="true"] { background: #0B0C0F; color: #F4F2EC; border-color: #0B0C0F; }

/* formulaires : compléments */
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; flex: none; accent-color: #E24A2A; }
.hint { display: block; color: var(--bs-secondary-color); font-size: .84rem; margin-top: .35rem; font-weight: 400; }
input.code { font-family: var(--bs-font-monospace); font-size: 1.5rem; letter-spacing: .35em; text-align: center; }
.pw { position: relative; }
.pw .form-control { padding-right: 6.5rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); }
.link-btn { background: none; border: 0; padding: .25rem; color: var(--bs-secondary-color); text-decoration: underline; }
.link-btn:hover { color: #0B0C0F; }

/* ------------------------------------------------------------------ connexion */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-brand { display: none; }
.auth-main { display: grid; place-items: center; padding: 2rem 1.1rem; }
.auth-card { width: min(100%, 420px); }
.auth-card h1 { font-size: 1.9rem; margin-bottom: .3rem; }
.lead { font-size: 1rem; color: var(--bs-secondary-color); margin-bottom: 1.4rem; }
.brand-mobile { margin-bottom: 1.8rem; }
.auth-note { margin-top: 1.4rem; font-size: .84rem; color: var(--bs-secondary-color); text-align: center; }
@media (min-width: 900px) {
  .auth { grid-template-columns: minmax(380px, 44%) 1fr; }
  .auth-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 2.75rem 3rem; color: var(--dvx-side-ink);
    position: relative; overflow: hidden;
    background: radial-gradient(1200px 500px at -10% 110%, rgba(226, 74, 42, .22), transparent 60%), linear-gradient(180deg, #0E0F13, #08090B); }
  .auth-brand::before { content: ""; position: absolute; inset: 0; opacity: .07; background-size: 44px 44px;
    background-image: linear-gradient(rgba(255, 255, 255, .6) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .6) 1px, transparent 1px); }
  .auth-brand-inner { position: relative; margin: auto 0; }
  .brand-lg { font-size: 1.9rem; gap: .9rem; }
  .auth-signature { margin: 1.1rem 0 0; font-size: 1.15rem; color: var(--dvx-side-muted); }
  .auth-signal { display: block; width: 100%; max-width: 420px; height: 70px; margin-top: 2rem; }
  .auth-signal path { fill: none; stroke: #E24A2A; stroke-width: 2.5; }
  .auth-foot { position: relative; display: flex; align-items: center; gap: .6rem; margin: 0; font-size: .85rem; color: var(--dvx-side-muted); }
  .auth-foot .ico { color: #6FD3C4; }
  .brand-mobile { display: none; }
  .auth-main { padding: 3rem; }
}
.qr { display: block; width: min(100%, 220px); margin: .75rem auto 1rem; border-radius: .75rem; background: #F2EFE6; padding: .5rem; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; font-family: var(--bs-font-monospace); padding: 0; list-style: none; }
.codes li { padding: .55rem; border: 1px dashed var(--bs-border-color); border-radius: .5rem; text-align: center; background: var(--dvx-surface); }

/* ------------------------------------------------------------------ recherche rapide (Ctrl K, modale Bootstrap) */
.palette-search { display: flex; align-items: center; gap: .6rem; padding: .25rem 1rem; border-bottom: 1px solid var(--bs-border-color); color: var(--bs-secondary-color); }
.palette-search .form-control { border: 0; box-shadow: none; padding: .9rem 0; font-size: 1.05rem; background: transparent; }
.palette-list .list-group-item { display: flex; align-items: center; gap: .75rem; border: 0; border-radius: .6rem !important; font-weight: 500; }
.palette-list .list-group-item .ico { color: var(--bs-secondary-color); }
.palette-list .list-group-item.active { background: #EFECE4; color: #0B0C0F; }
.palette-list .list-group-item.active .ico { color: #E24A2A; }
.palette-hint { margin: 0; padding: .6rem 1rem; border-top: 1px solid var(--bs-border-color); font-size: .78rem; color: var(--bs-secondary-color); }

/* ------------------------------------------------------------------ contenus */
.prose { max-width: 76ch; }
.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.2rem; border-top: 1px solid var(--bs-border-color); padding-top: 1em; }
.prose h3 { font-size: 1.04rem; margin-top: 1.4em; }
.prose table { display: block; overflow-x: auto; }
.prose a { color: #17705F; overflow-wrap: anywhere; }
video { width: 100%; max-height: 72vh; background: #000; border-radius: var(--bs-border-radius-lg); }
.video-col { max-width: 380px; }
.split { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(260px, 380px) 1fr; } }
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
pre.copy { background: #FAF8F3; border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .9rem; font-family: var(--bs-font-monospace);
  font-size: .84rem; max-height: 360px; overflow: auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--bs-secondary-color); }
.dot.ok { background: #17705F; } .dot.bad { background: #B3341B; } .dot.warn { background: #8A5A12; }
.token { font-family: var(--bs-font-monospace); padding: .75rem; background: #FAF8F3; border: 2px dashed #E24A2A; border-radius: .5rem; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------------ tableaux sur mobile : une fiche par ligne
   (intitulés posés par admin.js ; sans JS, défilement dans le cadre .table-responsive) */
@media (max-width: 720px) {
  .table-card { border: 0; background: none; box-shadow: none; overflow: visible; }
  .table-card .table-responsive { overflow: visible; }
  table.stackable, table.stackable tbody, table.stackable tr, table.stackable td { display: block; width: 100%; }
  table.stackable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stackable tr { background: var(--dvx-surface); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg);
    padding: .6rem .9rem; margin-bottom: .75rem; }
  table.stackable > :not(caption) > * > * { display: flex; gap: .75rem; justify-content: space-between; align-items: baseline;
    padding: .5rem 0; border-bottom: 1px solid #EFECE4; text-align: right; overflow-wrap: anywhere; box-shadow: none; }
  table.stackable td:last-child { border-bottom: 0; }
  table.stackable td::before { content: attr(data-label); flex: 0 0 40%; text-align: left; color: var(--bs-secondary-color);
    font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; }
  table.stackable td:first-child { display: block; text-align: left; font-weight: 600; }
  table.stackable td:first-child::before { display: block; margin-bottom: 2px; }
  table.stackable td.empty { display: block; text-align: center; }
  table.stackable td.empty::before { display: none; }
}
