/* Polices servies localement */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/archivo/archivo-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/archivo/archivo-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/jetbrains/jetbrains-mono-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/jetbrains/jetbrains-mono-latin-500-normal.woff2) format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #0C0E12;
  --header: #0E1015;
  --col: #101318;
  --surface: #151820;
  --surface-2: #1A1E27;
  --surface-3: #1E222C;
  --line: #1D212A;
  --line-2: #2A2F3A;
  --text: #E7EAF0;
  --text-2: #AEB5C2;
  --text-3: #8B93A3;
  --link: #7DD3F5;
  --primary-bg: #F2F4F7;
  --primary-fg: #0C0E12;
  --amber: #F7C460;
  --amber-bg: rgba(245, 184, 61, 0.14);
  --amber-line: rgba(245, 184, 61, 0.5);
  --red: #FF8A8A;
  --red-bg: rgba(255, 107, 107, 0.14);
  --red-line: rgba(255, 107, 107, 0.55);
  --violet: #CDBEFF;
  --violet-bg: rgba(167, 139, 250, 0.16);
  --green: #86EFAC;
  --green-bg: rgba(74, 222, 128, 0.12);
  --blue-bg: rgba(56, 189, 248, 0.08);
  --blue-line: rgba(56, 189, 248, 0.3);
  --cost: #FF9EB0;
  --cost-bg: #1A1418;
  --cost-line: #3A2A30;
  --shop-3as: #00A0DE;
  --shop-ixtem: #FF5B1C;
  --focus: #00A0DE;
  --overlay: rgba(5, 6, 9, 0.72);
  --input: #0C0E12;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F3F4F6;
    --header: #FFFFFF;
    --col: #EBEDF1;
    --surface: #FFFFFF;
    --surface-2: #F1F3F6;
    --surface-3: #E9ECF1;
    --line: #E0E3E9;
    --line-2: #C9CED8;
    --text: #14171D;
    --text-2: #3F4653;
    --text-3: #5B6371;
    --link: #006E9C;
    --primary-bg: #14171D;
    --primary-fg: #FFFFFF;
    --amber: #8A5300;
    --amber-bg: #FDF0D5;
    --amber-line: #E9B54A;
    --red: #B42318;
    --red-bg: #FDE6E3;
    --red-line: #E8837A;
    --violet: #5B3FC4;
    --violet-bg: #EEE9FE;
    --green: #157F3C;
    --green-bg: #E3F6EA;
    --blue-bg: #E6F5FC;
    --blue-line: #8FD3EE;
    --cost: #B4234B;
    --cost-bg: #FDECF0;
    --cost-line: #F2BFCC;
    --overlay: rgba(20, 23, 29, 0.45);
    --input: #FFFFFF;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* En-tête */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px;
  padding: 12px 24px; background: var(--header); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; flex: none; }
.brand-mark span:first-child { background: var(--shop-3as); }
.brand-mark span:last-child { background: var(--shop-ixtem); }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name strong { font-size: 15px; letter-spacing: 0.04em; font-weight: 800; }
.brand-name small { font-size: 11.5px; color: var(--text-3); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 13.5px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a[aria-current='page'] { background: var(--surface-2); color: var(--text); }
.nav .count { margin-left: 6px; font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--amber-bg); color: var(--amber); }
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-3);
}
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 13.5px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12px; font-weight: 700; cursor: pointer; }

/* Boutons et champs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); font-weight: 700; }
.btn-primary:hover { background: var(--primary-bg); filter: brightness(0.95); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { width: 32px; height: 32px; padding: 0; min-height: 0; border-radius: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--input); color: var(--text); font-size: 14px;
}
.textarea { resize: vertical; line-height: 1.5; }
.input.mono { font-family: var(--mono); font-size: 13px; }
.input:disabled, .select:disabled { opacity: 0.6; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; min-height: 38px; }
.check input { width: 17px; height: 17px; accent-color: var(--shop-3as); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.seg button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--primary-bg); color: var(--primary-fg); }
.seg .n { font-family: var(--mono); font-size: 11.5px; opacity: 0.75; }

/* Pastilles */
.shop { font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; padding: 3px 7px; border-radius: 5px; flex: none; line-height: 1.2; }
.shop-3AS { background: var(--shop-3as); color: #04121A; }
.shop-IXTEM { background: var(--shop-ixtem); color: #1C0900; }
.shop-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); background: var(--surface-3); padding: 3px 8px; border-radius: 6px; }
.chip-violet { color: var(--violet); background: var(--violet-bg); font-weight: 600; }
.chip-amber { color: var(--amber); background: var(--amber-bg); font-weight: 600; }
.chip-blue { color: var(--link); background: var(--blue-bg); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.age { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.age-amber { padding: 3px 8px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-weight: 700; }
.age-red { padding: 3px 8px; border-radius: 999px; background: var(--red-bg); color: var(--red); font-weight: 700; }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; flex: none; }

/* Page */
.page { max-width: 1680px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 18px; }
.page-narrow { max-width: 1320px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head h1 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -0.01em; }
.page-head p { margin: 5px 0 0; color: var(--text-2); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); cursor: pointer; text-align: left; color: var(--text);
}
.stat[aria-pressed='true'] { border-color: var(--text-2); }
.stat b { font-size: 20px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--text-2); line-height: 1.2; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar .select { width: auto; min-width: 150px; background: var(--surface); }
.spacer { flex: 1; }
.empty { padding: 36px 20px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: 14px; }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* Kanban */
.board-scroll { overflow-x: auto; margin: 0 -24px; padding: 4px 24px 18px; }
.board { display: flex; gap: 12px; align-items: flex-start; width: max-content; }
.col { width: 292px; flex: none; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 14px; background: var(--col); border: 1px solid var(--line); min-height: 140px; }
.col.drop { border-color: var(--focus); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; }
.col-head h2 { margin: 0; flex: 1; min-width: 0; font-size: 13px; font-weight: 700; }
.col-count { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }
.col-collapsed {
  width: 46px; min-height: 260px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0;
  border-radius: 14px; background: transparent; border: 1px dashed var(--line-2); color: var(--text-2); cursor: pointer;
}
.col-collapsed.drop { border-color: var(--focus); border-style: solid; }
.col-collapsed .vlabel { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.col-note { margin: 0; padding: 18px 8px; text-align: center; font-size: 12.5px; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: 10px; }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 13px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line-2); color: var(--text); cursor: pointer;
}
.card:hover { text-decoration: none; border-color: var(--text-3); }
.card.amber { border-color: var(--amber-line); }
.card.red { border-color: var(--red-line); }
.card.dragging { opacity: 0.4; }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-num { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.card-body { display: flex; gap: 10px; align-items: flex-start; }
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.card-title { font-size: 14.5px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb { width: 46px; height: 46px; flex: none; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--line-2); object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.card-foot { display: flex; align-items: center; gap: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.card-foot .email { flex: 1; min-width: 0; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--text-2); }

/* Tableau */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--col); }
table.list { width: 100%; min-width: 1240px; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr.row { cursor: pointer; }
table.list tr.row:hover td { background: var(--surface); }
table.list .ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fiche dossier */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.d-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 18px; }
.d-title { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.d-title h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; overflow-wrap: anywhere; }
.d-title p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.d-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.state-select { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.state-select select { height: 100%; min-width: 240px; border: 0; background: transparent; font-size: 14px; font-weight: 600; cursor: pointer; }
.state-select select:focus { outline: none; }
.state-select:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid; }
.banner p { margin: 0; flex: 1 1 320px; }
.banner-amber { background: var(--amber-bg); border-color: var(--amber-line); }
.banner-amber strong { color: var(--amber); }
.banner-red { background: var(--red-bg); border-color: var(--red-line); }
.banner-red strong { color: var(--red); }
.banner-info { background: var(--blue-bg); border-color: var(--blue-line); }
.trail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--col); border: 1px solid var(--line); }
.trail-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-right: 6px; }
.trail .pill.current { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); font-weight: 700; }
.trail .date { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.trail .current .date { color: inherit; opacity: 0.7; }
.d-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px; }
.d-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.d-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.section { padding: 18px 20px 20px; border-radius: 14px; background: var(--col); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.section h2 { margin: 0; font-size: 15px; font-weight: 700; }
.section .hint { margin: 0; font-size: 12.5px; color: var(--text-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.span-all { grid-column: 1 / -1; }
.prod-row { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(110px, 1fr) minmax(110px, 1fr) 80px 70px 36px; gap: 8px; align-items: end; }
@media (max-width: 900px) { .prod-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.proc { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); }
.proc p { margin: 0; white-space: pre-wrap; line-height: 1.55; color: var(--text-2); }
.ship { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 11px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.ship .dir { flex: 0 0 170px; font-weight: 600; font-size: 13.5px; }
.ship .trk { flex: 1 1 150px; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.ship-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line-2); }
@media (max-width: 700px) { .ship-form { grid-template-columns: minmax(0, 1fr); } }
.carrier { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--blue-bg); color: var(--link); }
.fee { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); }
.fee b { color: var(--text); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 9px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); min-width: 0; }
.file:hover { text-decoration: none; border-color: var(--text-3); }
.file .preview { height: 104px; border-radius: 8px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--text-3); overflow: hidden; }
.file .preview img { width: 100%; height: 100%; object-fit: cover; }
.file .name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta { font-size: 11.5px; color: var(--text-3); }
.file .del { position: absolute; top: 14px; right: 14px; background: var(--surface); }
.file.purged { opacity: 0.6; border-style: dashed; }
.drop-zone { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line-2); background: transparent; color: var(--text-2); font-size: 12.5px; text-align: center; cursor: pointer; }
.drop-zone.over { border-color: var(--focus); color: var(--text); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; width: 100%; }
.progress span { display: block; height: 100%; background: var(--shop-3as); }
.costs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .costs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cost { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.cost .label { font-size: 12px; color: var(--text-3); }
.cost .value { font-size: 17px; font-weight: 700; }
.cost.net { background: var(--cost-bg); border-color: var(--cost-line); }
.cost.net .value { color: var(--cost); font-weight: 800; }
.cost .input { min-height: 34px; font-size: 15px; font-weight: 700; }
.where { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--blue-bg); border: 1px solid var(--blue-line); }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.feed li { display: flex; gap: 10px; }
.feed .who { font-size: 13px; color: var(--text-2); }
.feed .who b { color: var(--text); }
.feed .bubble { margin: 6px 0 0; padding: 9px 12px; border-radius: 4px 12px 12px 12px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.feed .sub { margin-top: 5px; font-size: 12.5px; color: var(--text-3); }
.private { border-color: var(--violet-bg); }
.private-tag { font-size: 11.5px; font-weight: 600; color: var(--violet); background: var(--violet-bg); padding: 3px 8px; border-radius: 6px; }

/* Tableau de bord */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--col); border: 1px solid var(--line); }
.kpi .label { font-size: 12.5px; color: var(--text-2); }
.kpi .value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.kpi .hint { font-size: 12px; color: var(--text-3); }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
@media (max-width: 480px) { .cards-2 { grid-template-columns: minmax(0, 1fr); } }
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.bar-row .track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-row .track span { display: block; height: 100%; border-radius: 99px; }
.bar-row .v { font-family: var(--mono); font-size: 12.5px; text-align: right; white-space: nowrap; }
.histo { display: flex; align-items: flex-end; gap: 10px; min-width: 640px; height: 220px; padding-top: 8px; border-bottom: 1px solid var(--line-2); }
.histo .m { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.histo .stack { width: 100%; max-width: 44px; display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden; }
.histo-labels { display: flex; gap: 10px; min-width: 640px; padding-top: 7px; }
.histo-labels span { flex: 1; text-align: center; font-size: 11.5px; color: var(--text-3); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.row-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row-line:last-child { border-bottom: 0; }

/* Listes d'administration */
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.admin-row .grow { flex: 1 1 200px; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; }
.tabs button[aria-selected='true'] { color: var(--text); border-bottom-color: var(--text); }
.sup-layout { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.sup-list { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.sup-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); cursor: pointer; text-align: left; color: var(--text); width: 100%; }
.sup-item[aria-current='true'] { border-color: var(--text-2); }
.sup-edit { flex: 2 1 420px; }

/* Modale */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { width: min(760px, 100%); background: var(--col); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.modal h2 { margin: 0; font-size: 20px; font-weight: 800; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.warn { padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: 13px; }

/* Connexion */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login form { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 28px; border-radius: 16px; background: var(--col); border: 1px solid var(--line-2); }
.login h1 { margin: 0; font-size: 22px; font-weight: 800; }
.error { padding: 10px 12px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-size: 13px; }

/* Notifications */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--primary-bg); color: var(--primary-fg); font-size: 13.5px; font-weight: 600; max-width: 360px; }
.toast.err { background: var(--red); color: #fff; }
.loading { padding: 40px; text-align: center; color: var(--text-3); }
.hint-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--amber); }
.sup-search { width: 100%; }
