/* Page admin : mise en page bureau, qui passe en une colonne sur téléphone. */
#app { max-width: none; flex-direction: row; flex-wrap: wrap; }
.side { flex: 1 1 220px; max-width: 100%; background: #07070f; border-inline-end: 1px solid var(--line); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { color: #fff; font-size: 16px; padding: 0 8px 18px; }
.side .brand img { width: 32px; height: 32px; }
.side a { padding: 11px 12px; border-radius: 10px; color: #c7c2db; text-decoration: none; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.side a[aria-current="page"] { background: rgba(255,255,255,.08); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--pink); }
.side .count { background: var(--pink); color: var(--on-primary); border-radius: 10px; font-size: 11px; font-weight: 700; padding: 2px 7px; }
.side .spacer { flex: 1; }
.side button { background: none; border: none; color: #c7c2db; text-align: start; padding: 11px 12px; font-size: 14px; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.main h1 { font-size: 26px; }
.bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters input, .filters select { height: 42px; border-radius: 10px; border: 1px solid var(--field); background: var(--surface-2); color: var(--ink); padding: 0 12px; font-size: 14px; }
.filters input[type=search] { min-width: 240px; }
.tabs { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.tabs button, .tabs a { height: 36px; padding: 0 14px; border: none; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; }
.tabs [aria-pressed="true"], .tabs [aria-current="page"] { background: var(--grad); color: var(--on-primary); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-family: var(--display); font-size: 24px; }
.kpi.dark { background: var(--grad-card); border-color: #3a2a55; color: #fff; }
.kpi.dark span { color: #c7c2db; }
.kpi.alert { background: var(--saffron-soft); border-color: #5a2350; color: var(--saffron-ink); text-decoration: none; }
.kpi.alert span { color: var(--saffron-ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 17px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data.wide { min-width: 720px; }
.dash-split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.dash-split > :first-child { flex: 2 1 560px; min-width: 0; }
.dash-split > :last-child { flex: 1 1 260px; min-width: 0; }
table.data th { text-align: start; color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.data td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td.num, table.data th.num { text-align: end; white-space: nowrap; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.btn.xs { height: 34px; font-size: 13px; width: auto; padding: 0 12px; border-radius: 9px; }
.btn.danger { background: var(--clay); color: var(--on-primary); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; word-break: break-word; }
.selfie { width: 100%; max-width: 260px; border-radius: 12px; background: var(--sand); aspect-ratio: 3 / 4; object-fit: cover; }
.rule-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rule-row .txt { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; }
.rule-row .txt strong { font-size: 15px; }
.rule-row .txt span { font-size: 12px; color: var(--muted); }
.unit-input { display: flex; align-items: center; gap: 8px; }
.unit-input input { width: 110px; height: 42px; border: 1px solid var(--field); border-radius: 10px; padding: 0 10px; font-size: 15px; text-align: end; background: var(--surface-2); color: var(--ink); }
.unit-input span { font-size: 13px; color: var(--muted); min-width: 48px; }
.switch { width: 52px; height: 30px; border-radius: 15px; border: none; padding: 3px; display: flex; background: #3a3450; cursor: pointer; }
.switch[aria-checked="true"] { background: var(--grad); justify-content: flex-end; }
.switch span { width: 24px; height: 24px; border-radius: 12px; background: #fff; display: block; }
.denied { max-width: 420px; margin: 80px auto; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.login-wrap { flex: 1; display: flex; justify-content: center; padding: 60px 20px; }
.login-wrap .screen { max-width: 400px; width: 100%; }

.qr-admin { display: flex; gap: 14px; align-items: center; }
.qr-admin svg { background: #fff; border-radius: 12px; padding: 6px; flex: none; }
.qr-text { font-size: 18px; letter-spacing: 1px; }
.kpi-sub { font-style: normal; font-size: 12px; color: var(--ok, #3be39c); font-weight: 600; }
.kpi-sub.muted { color: var(--muted); font-weight: 400; }
.kpi.dark .kpi-sub { color: #c7c2db; }
/* --- Statistiques --- */
.flows { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.flow { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.flow h3 { font-size: 15px; margin: 0 0 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.who { padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--on-primary); }
.who.c { background: var(--pink); } .who.p { background: var(--teal); } .who.a { background: #fff; }
.fl-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.fl-line:last-child { border-bottom: 0; }
.fl-line b { white-space: nowrap; font-weight: 700; }
.fl-line small { color: var(--muted); font-size: 12px; }
.fl-line.total { border-top: 1px solid var(--line-2, #363049); border-bottom: 0; margin-top: 4px; padding-top: 10px; font-weight: 700; }
.ledger { display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.ledger .fl-line.total { color: #fff; }
.ledger .fl-line.pos b { color: var(--ok, #3be39c); }
.ledger .fl-line.neg b { color: #ff9aae; }
table.data tr.strong td { font-weight: 700; color: #fff; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 8px; overflow-x: auto; }
.chart .col { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.chart .bars i { display: block; width: 45%; min-height: 1px; border-radius: 3px 3px 0 0; }
.chart small { font-size: 10px; color: var(--muted); }
.b1 { background: var(--pink); } .b2 { background: var(--teal); }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; }
.filters label.note { display: inline-flex; align-items: center; gap: 6px; }
