/* Tiger-Pilot — feuille de style.
   Identité v2 « Signal » : Linen chalk #ECE5D6 / Matte black #18181A / Siren red #F2301F en 60-30-10,
   proportions inversées jour / nuit. Rouge = signal (logo, élément actif, critique), jamais décor.
   Propriétés logiques partout (inline-start/end) pour que l'arabe (RTL) s'affiche correctement. */

:root {
  /* JOUR : lin 60 % (fond), noir 30 % (texte, barre latérale, boutons), rouge 10 % */
  --brand-red: #F2301F; --linen: #ECE5D6; --black: #18181A;
  --bg: #ECE5D6; --surface: #F4EFE4; --surface-2: #E4DCCB; --line: #D5CBB8; --fg: #18181A; --mut: #5A554C;
  --accent: #18181A; --accent-strong: #18181A; --accent-soft: rgba(24,24,26,.07); --on-accent: #ECE5D6;
  --sun: #8F5A10; --sun-soft: #F1E3C8; --night: #18181A; --night-fg: #ECE5D6; --night-mut: #A9A397; --silk: #CFC6B5;
  --side-bg: #18181A; --side-fg: #ECE5D6; --side-mut: #A9A397; --side-hover: #26262A; --side-active: #2F2F34; --side-line: #2E2E33;
  --violet: #634AA6; --violet-soft: #E8E0EC; --ok: #2A7247; --ok-soft: #E6EFE2; --warn: #8F5E10; --warn-soft: #F6ECD9;
  --bad: #C8231A; --bad-strong: #C8231A; --bad-soft: #FAE6E1; --info: #2F5C99; --info-soft: #DCE2EA;
  --paper: #FBF7EF; --paper-ink: #18181A; --paper-mut: #6E685E; --paper-rule: #C9BFAE;
  --shadow: 0 1px 2px rgba(24,24,26,.06), 0 4px 14px rgba(24,24,26,.06);
  --c-matin: #c98a2e; --c-soir: #2c7fb8; /* graphique CA — paire validée (CVD, contraste) */
  --on-strong: #FBF7EF; --r-sm: 10px; --r-md: 14px; --r-lg: 18px;
  --f-display: 'Inter Display', 'Inter', system-ui, sans-serif; --f-text: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --bn-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  /* NUIT : noir 60 % (fond), lin 30 % (texte, barre latérale, boutons), rouge 10 % */
  --bg: #18181A; --surface: #222225; --surface-2: #2A2A2E; --line: #37373C; --fg: #ECE5D6; --mut: #A9A397;
  --accent: #ECE5D6; --accent-strong: #F4EFE4; --accent-soft: rgba(236,229,214,.1); --on-accent: #18181A;
  --sun: #E0B260; --sun-soft: rgba(224,178,96,.13); --night: #121214;
  --side-bg: #ECE5D6; --side-fg: #18181A; --side-mut: #5A554C; --side-hover: #E2DACA; --side-active: #D8CFBD; --side-line: #D5CBB8;
  --violet: #B6A1E6; --violet-soft: rgba(182,161,230,.14); --ok: #7FC69A; --ok-soft: rgba(127,198,154,.13); --warn: #E0B260; --warn-soft: rgba(224,178,96,.13);
  --bad: #FF4A36; --bad-strong: #FF4A36; --bad-soft: rgba(255,74,54,.14); --info: #94B4E2; --info-soft: rgba(148,180,226,.14);
  --c-matin: #b8812c; --c-soir: #4a8fd0;
  --on-strong: #18181A; --paper: #F1EBE0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.2);
  color-scheme: dark;
}
:root[lang="ar"] { --f-display: 'Noto Kufi Arabic', 'Inter Display', sans-serif; --f-text: 'Noto Kufi Arabic', 'Inter', sans-serif; }

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--f-text); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
:root[lang="ar"] h1, :root[lang="ar"] h2, :root[lang="ar"] h3, :root[lang="ar"] h4 { letter-spacing: 0; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 17px; } h4 { font-size: 15px; margin: 8px 0 4px; }
p { margin: 0 0 8px; }
a { color: var(--accent-strong); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.mut { color: var(--mut); } .ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.sm { font-size: 13.5px; } .xs { font-size: 12.5px; } .block { display: block; }
.mt { margin-top: 12px; } .mb { margin-bottom: 14px; } .pad { padding: 14px; }
.dim { opacity: .55; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.s { width: 16px; height: 16px; } .ic.l { width: 28px; height: 28px; } .ic.xl { width: 48px; height: 48px; }
[dir="rtl"] .ic.flip { transform: scaleX(-1); }

/* ---------- mise en page ---------- */
.row { display: flex; align-items: center; } .row.gap, .gap { gap: 10px; } .row.end { justify-content: flex-end; } .row.center { justify-content: center; }
.row.wrap, .wrap { flex-wrap: wrap; } .between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-2.gap-l { gap: 18px; align-items: start; }
@media (max-width: 900px) { .grid-2.gap-l { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

.app { min-height: 100dvh; }
.sidebar { display: none; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(var(--st) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { flex: 1; font-size: 21px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-chip { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 999px; }
.op-meta { display: none; flex-direction: column; text-align: start; line-height: 1.2; }
.op-meta small { color: var(--mut); font-size: 12px; }
.view { padding: 16px 16px calc(var(--bn-h) + var(--sb) + 32px); max-width: 1240px; margin: 0 auto; }
.page-sub { color: var(--mut); margin: -4px 0 14px; }
.bottom-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; padding: 0 4px var(--sb);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.bn-item { position: relative; flex: 1; min-width: 0; height: var(--bn-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; color: var(--mut); }
.bn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-item[aria-current="page"] { color: var(--fg); } .bn-item[aria-current="page"] .ic { stroke: var(--fg); }
.bn-item[aria-current="page"]::after { content: ''; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-red); }
.nb { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad-strong); color: var(--on-strong);
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 18px 12px; background: var(--side-bg); color: var(--side-fg); border-inline-end: 1px solid var(--side-line); }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
  .brand b { font-family: var(--f-display); font-size: 18px; display: block; } .brand small { color: var(--side-mut); }
  .side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
  .side-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--side-fg); font-weight: 500; text-align: start; }
  .side-item:hover { background: var(--side-hover); }
  .side-item .ic { color: var(--side-mut); }
  .side-item[aria-current="page"] { background: var(--side-active); color: var(--side-fg); font-weight: 600; } .side-item[aria-current="page"] .ic { stroke: var(--brand-red); color: var(--brand-red); }
  .side-item .nb { position: static; margin-inline-start: auto; }
  .side-foot { display: flex; gap: 6px; padding-top: 10px; border-top: 1px solid var(--side-line); } .side-foot .btn { color: var(--side-mut); }
  .bottom-nav, .top-logo { display: none; }
  .view { padding: 24px 28px 48px; }
  .op-meta { display: flex; }
  .topbar { padding: 14px 28px; }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.card-h .ic { color: var(--accent); }
.card-h .btn .ic { color: inherit; }
.card-h.between > span { display: inline-flex; align-items: center; gap: 8px; }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--mut); font-weight: 600; min-height: 28px; }
details.card > summary::-webkit-details-marker { display: none; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* ---------- formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { font-size: 13.5px; font-weight: 600; color: var(--mut); }
.hint { font-size: 12.5px; color: var(--mut); min-height: 0; } .hint b { color: var(--fg); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--fg); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; min-height: 46px; width: 100%; transition: border-color .12s; }
textarea { min-height: 0; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 0; height: 18px; accent-color: var(--accent); }
input:disabled { opacity: .5; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.money { position: relative; display: block; }
.money input { padding-inline-end: 34px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; }
.money::after { content: "€"; position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: var(--mut); font-weight: 600; pointer-events: none; }
.search-in { margin-bottom: 14px; }
.seg { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px; }
.seg > button, .seg > label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border-radius: 8px; font-weight: 600; color: var(--mut); }
.seg > button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.seg > label:has(input:checked) { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.seg > label input { accent-color: var(--accent); }
.shift.off-day.conge { border-inline-start-color: var(--violet); }
.seg > button[aria-pressed="true"][data-v="matin"] .ic { color: var(--sun); } .seg > button[aria-pressed="true"][data-v="soir"] .ic { color: var(--violet); }
.subline { display: flex; justify-content: space-between; padding-top: 10px; margin-top: 10px; border-top: 1px dashed var(--line); font-weight: 600; font-variant-numeric: tabular-nums; }
.hours-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--mut); font-size: 14px; }
.savebar { position: sticky; bottom: calc(var(--bn-h) + var(--sb) + 8px); display: flex; justify-content: flex-end; padding: 8px 0 14px; }
@media (min-width: 960px) { .savebar { bottom: 12px; } }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-sm);
  background: var(--surface); border: 1.5px solid var(--line); font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: transform .08s, background .12s; text-decoration: none; color: var(--fg); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--on-strong); }
.btn.danger { color: var(--bad-strong); border-color: color-mix(in srgb, var(--bad-strong) 40%, transparent); background: transparent; }
.btn.danger.lg, form .btn.danger[type="submit"] { background: var(--bad-strong); color: var(--on-strong); border-color: var(--bad-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn.icon { width: 44px; padding: 0; } .btn.icon.sm { width: 36px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--accent-strong); font-weight: 600; padding: 6px 2px; }
.link[aria-current="true"] { color: var(--fg); text-decoration: underline; }

/* ---------- badges, puces ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--mut); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad-strong); } .badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.amber { background: var(--sun-soft); color: var(--sun); }
.badge.sev-critique { background: var(--bad-strong); color: var(--on-strong); } .badge.sev-alerte { background: var(--warn-soft); color: var(--warn); } .badge.sev-info { background: var(--info-soft); color: var(--info); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 12px; } .chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--mut); }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-weight: 600; color: var(--mut); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.count { background: var(--surface-2); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.between .tabs { margin-bottom: 0; border: 0; }

/* ---------- notes ---------- */
.note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); margin-bottom: 14px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); width: 100%; text-align: start; }
.note .ic { margin-top: 1px; } .note > div { flex: 1; }
.note.info { background: var(--info-soft); border-color: transparent; } .note.info .ic { color: var(--info); }
.note.warn { background: var(--warn-soft); border-color: transparent; } .note.warn .ic { color: var(--warn); }
.note.bad { background: var(--bad-soft); border-color: transparent; } .note.bad .ic { color: var(--bad-strong); }
.note.violet { background: var(--violet-soft); border-color: transparent; } .note.violet .ic { color: var(--violet); }
.note.clickable { cursor: pointer; }

/* ---------- indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.kpi .l { font-size: 13px; color: var(--mut); font-weight: 600; }
.kpi .v { font-family: var(--f-display); font-size: clamp(20px, 5.4vw, 28px); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.kpi small { font-size: 12px; }
.trend { font-size: 12.5px; font-weight: 700; } .trend.up { color: var(--ok); } .trend.down { color: var(--bad); }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 6px 0; }
.meter span { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.meter.warn span { background: var(--warn); } .meter.bad span { background: var(--bad-strong); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); } .chart .bar.hi { fill: var(--accent); }
/* Graphique CA */
.rc-head { display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap; margin: 2px 0 10px; }
.rc-sum { display: flex; flex-direction: column; gap: 1px; } .rc-sum b { font: 600 19px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
.rc-range { margin-inline-start: auto; }
.rc-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--mut); margin-bottom: 4px; }
.rc-legend span, .rc-tr { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw.matin { background: var(--c-matin); } .sw.soir { background: var(--c-soir); }
.sw.avg { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--mut); }
.rc-plot { position: relative; width: 100%; min-height: 230px; direction: ltr; }
.rc-svg { display: block; overflow: visible; font-family: var(--f-text); }
.rc-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; } .rc-grid.base { stroke: color-mix(in srgb, var(--mut) 55%, transparent); }
.rc-ylab, .rc-xlab { font-size: 11px; fill: var(--mut); font-variant-numeric: tabular-nums; }
.rc-xlab.num { font-size: 11.5px; fill: var(--fg); } .rc-xlab.mon { font-weight: 700; } .rc-xlab.hi { fill: var(--fg); font-weight: 700; }
.rc-matin { fill: var(--c-matin); } .rc-soir { fill: var(--c-soir); }
.rc-none { stroke: var(--line); stroke-width: 2; stroke-dasharray: 3 3; }
.rc-avg { stroke: var(--mut); stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }
.rc-cap { font: 700 12px var(--f-text); fill: var(--fg); font-variant-numeric: tabular-nums; }
.rc-hit { fill: transparent; } .rc-col { outline: none; cursor: default; }
.rc-col.on .rc-hit, .rc-col:focus-visible .rc-hit { fill: color-mix(in srgb, var(--fg) 6%, transparent); }
.rc-col:focus-visible .rc-hit { stroke: var(--accent); stroke-width: 2; }
.rc-tip { position: absolute; z-index: 5; min-width: 190px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(0,0,0,.14); font-size: 13px; pointer-events: none; display: grid; gap: 4px; }
:root[dir="rtl"] .rc-tip { direction: rtl; }
.rc-td { font-weight: 700; text-transform: capitalize; }
.rc-tt, .rc-tr { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; } .rc-tt b { font-size: 15px; }
.rc-tr span { flex: 1; } .rc-cmp { font-size: 12px; } .rc-cmp .up { color: var(--ok); } .rc-cmp .down { color: var(--bad); }
.rc-warn { font-size: 12px; color: var(--warn); font-weight: 600; }
.rc-table { margin-top: 8px; } .rc-table summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; padding: 4px 0; }
.rc-table .dtable td, .rc-table .dtable th { padding: 7px 10px; } .dtable .num { text-align: end; }
.chart .axis { font-size: 11px; fill: var(--mut); font-family: var(--f-text); }

/* ---------- listes ---------- */
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.card:not(.flush) .list-row { padding-inline: 0; }
.list-row:last-child { border-bottom: 0; }
.av { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.av.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 13px; }
.av.me { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.empty { text-align: center; color: var(--mut); padding: 36px 12px; } .empty .ic { width: 36px; height: 36px; opacity: .6; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.tbl th { font-size: 12.5px; color: var(--mut); font-weight: 600; background: var(--surface-2); }
.tbl .r { text-align: end; white-space: nowrap; } .tbl td.warn { color: var(--warn); font-weight: 700; }
.tbl tfoot td { font-weight: 600; }
.scroll-x { overflow-x: auto; }
.tbl.plan td { min-width: 96px; } .tbl.plan td:first-child { min-width: 120px; }
.shift-chip { display: block; width: 100%; margin-bottom: 4px; padding: 4px 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 700; }
.add-chip { width: 100%; padding: 2px; border-radius: 8px; border: 1.5px dashed var(--line); color: var(--mut); font-weight: 700; }

/* ---------- caisse : ticket (élément signature) ---------- */
.sticky-col { position: sticky; top: 76px; }
@media (max-width: 900px) { .sticky-col { position: static; } }
.ticket { --zig: 9px; position: relative; background: var(--paper); color: var(--paper-ink); padding: 18px 18px 26px; border-radius: 8px 8px 0 0; font-variant-numeric: tabular-nums; font-size: 14.5px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%; box-shadow: var(--shadow); }
.t-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.5px dashed var(--paper-rule); padding-bottom: 8px; margin-bottom: 8px; }
.t-head b { font-family: var(--f-display); font-size: 22px; } .t-head span { color: var(--paper-mut); font-size: 13px; }
.t-line { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; }
.t-line i { flex: 1; border-bottom: 1.5px dotted var(--paper-rule); transform: translateY(-4px); }
.t-line small { color: var(--paper-mut); }
.t-line.sub { font-weight: 700; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid #e3dbcf; }
.t-total { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 8px; padding-top: 8px; border-top: 2px solid var(--paper-ink); }
.t-total span { font-weight: 700; } .t-total b { font-family: var(--f-display); font-size: 34px; line-height: 1; }
.t-foot { display: flex; justify-content: space-between; gap: 8px; color: var(--paper-mut); font-size: 13px; margin-top: 6px; }
.t-foot strong { color: var(--paper-ink); } .t-foot .bad { color: #b91c1c; } .t-foot .ok { color: #15803d; }
.t-id { text-align: center; letter-spacing: .12em; font-size: 12px; color: var(--paper-mut); margin-top: 10px; }
.print-slot { overflow: hidden; border-top: 3px solid var(--fg); border-radius: 2px; }
.print-slot .ticket { animation: print .9s cubic-bezier(.3,.7,.2,1) both; }
@keyframes print { from { transform: translateY(-100%); } to { transform: none; } }
.paybar { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 12px 12px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.paybar > div { flex: 1; min-width: 0; } .paybar span { display: block; font-size: 13px; color: var(--mut); }
.paybar b { font-family: var(--f-display); font-size: 30px; font-variant-numeric: tabular-nums; }
.paybar.matin { border-color: color-mix(in srgb, var(--sun) 55%, transparent); } .paybar.soir { border-color: color-mix(in srgb, var(--violet) 55%, transparent); }
@media (max-width: 900px) { .paybar { position: sticky; bottom: calc(var(--bn-h) + var(--sb) + 10px); z-index: 5; } }
.day-block { margin-bottom: 18px; }
.day-h { display: flex; justify-content: space-between; padding: 6px 2px 8px; font-variant-numeric: tabular-nums; } .day-h b { text-transform: capitalize; }
.entry { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--sun); border-radius: var(--r-md); padding: 12px 14px 6px; margin-bottom: 10px; }
.entry.soir { border-inline-start-color: var(--violet); }
.entry-top { display: flex; justify-content: space-between; gap: 10px; }
.entry-total { font-family: var(--f-display); font-size: 22px; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.entry-acts { display: flex; flex-wrap: wrap; gap: 2px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.thanks { text-align: center; padding: 6px 0 12px; } .thanks .ic { color: var(--ok); }

/* ---------- stock ---------- */
.ing { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); border-inline-start: 4px solid transparent; }
.ing:last-child { border-bottom: 0; }
.ing.warn { border-inline-start-color: var(--warn); } .ing.bad { border-inline-start-color: var(--bad-strong); }
.ing-main b, .ing-qty b { display: block; } .ing-main small, .ing-qty small { font-size: 12.5px; }
.ing-acts { display: flex; gap: 4px; }
@media (max-width: 620px) { .ing { grid-template-columns: 1fr auto; } .ing-acts { grid-column: 1 / -1; justify-content: flex-end; } }

/* ---------- hygiène ---------- */
.temp { border-top: 4px solid var(--line); } .temp.ok { border-top-color: var(--ok); } .temp.bad { border-top-color: var(--bad-strong); background: var(--bad-soft); }
.temp-v { font-family: var(--f-display); font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.temp.bad .temp-v { color: var(--bad-strong); }
.temp form input { flex: 1; }
.spark { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.spark span { font-size: 11.5px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.spark span.bad { background: var(--bad-strong); color: var(--on-strong); }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; } .task small { display: block; }
.task.done b { text-decoration: line-through; color: var(--mut); }
.check-btn { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.check-btn[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: var(--on-strong); }

/* ---------- équipe ---------- */
.clock { text-align: center; }
.clock-state { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; text-align: start; }
.clock-state b { display: block; font-size: 18px; } .clock-state small { color: var(--mut); }
.clock.on .clock-state .ic { color: var(--ok); } .clock.on { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }

/* ---------- agent ---------- */
.finding { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--info); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 10px; }
.finding.sev-critique { border-inline-start-color: var(--bad-strong); } .finding.sev-alerte { border-inline-start-color: var(--warn); }
.finding-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; } .finding-top small { margin-inline-start: auto; }
.finding p { margin: 0 0 4px; }
.finding-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ai-summary { background: var(--accent-soft); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 6px; }
.md h4 { margin: 8px 0 4px; } .md ul { margin: 4px 0 8px; padding-inline-start: 20px; } .md p { margin: 0 0 6px; }
.qa { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; } .qa .q { font-weight: 700; }
.flist { list-style: none; padding: 0; margin: 8px 0 0; } .flist li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.flist li:last-child { border: 0; }
.watch { margin: 10px 0 0; padding-inline-start: 18px; font-size: 14px; } .watch li { margin-bottom: 4px; }

/* ---------- messages ---------- */
.chat { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; height: calc(100dvh - 210px); min-height: 420px; }
.conv-list { overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px; }
.conv { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: var(--r-sm); text-align: start; }
.conv small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv.on { background: var(--accent-soft); } .conv .nb { position: static; }
.thread { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.dsep { align-self: center; font-size: 12px; color: var(--mut); padding: 8px 0 4px; }
.bub { max-width: 78%; padding: 8px 12px 5px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bub.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-end-end-radius: 5px; }
.bub.them { align-self: flex-start; background: var(--surface-2); border-end-start-radius: 5px; }
.bub .who { display: block; font-size: 12px; color: var(--accent-strong); }
.bub .meta { display: block; text-align: end; font-size: 11px; opacity: .7; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; } .quick::-webkit-scrollbar { display: none; }
.quick .chip { min-height: 32px; }
.chat-in { display: flex; gap: 8px; } .chat-in .btn { flex: 0 0 46px; height: 46px; border-radius: 50%; }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .conv-list { display: flex; overflow-x: auto; padding: 4px; } .conv { flex: 0 0 auto; width: auto; } .conv small { display: none; }
  .thread { height: calc(100dvh - 300px); min-height: 380px; }
}

/* ---------- entrée : connexion, PIN ---------- */
.gate { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(var(--st) + 24px) 16px calc(var(--sb) + 24px);
  background: radial-gradient(1100px 480px at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), var(--bg); }
.brand-big img { flex: 0 0 auto; border-radius: 16px; box-shadow: var(--shadow); }
.gate-card { width: 100%; max-width: 440px; }
.gate-card h1 { margin: 18px 0 10px; }
.brand-big { display: flex; align-items: center; gap: 12px; } .brand-big .ic { color: var(--accent); }
.brand-big b { font-family: var(--f-display); font-size: 26px; display: block; } .brand-big small { color: var(--mut); }
.gate-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; }
.gate-foot { margin-top: 28px; text-align: center; color: var(--mut); }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.name-btn, .pick { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--line); text-align: start; box-shadow: var(--shadow); }
.name-btn small, .pick small { display: block; color: var(--mut); font-size: 12.5px; }
.name-btn:disabled { opacity: .5; }
.pick .ic { color: var(--accent); }
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 22px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--mut); }
.pin-dots i.f { background: var(--accent); border-color: var(--accent); }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; }
.pad button { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); font-size: 26px; font-weight: 600; box-shadow: var(--shadow); }
.pad button:active { background: var(--surface-2); }
.pad button.txt { background: transparent; border-color: transparent; box-shadow: none; font-size: 14px; color: var(--mut); }
.shake { animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: none; } 25%, 75% { transform: translateX(-10px); } 50% { transform: translateX(10px); } }
.price-card { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 18px; margin: 14px 0; border-radius: var(--r-lg); background: var(--night); color: var(--night-fg); }
.price-card b { font-family: var(--f-display); font-size: 42px; line-height: 1; color: #8fd0c3; }
.price-card span { font-weight: 600; } .price-card small { flex-basis: 100%; color: var(--night-mut); }
.sel { user-select: all; overflow-wrap: anywhere; }
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--night); color: var(--night-fg); z-index: 100; font-family: var(--f-display); font-size: 22px; }

/* ---------- modale & notifications ---------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-end; justify-content: center; background: rgba(10,8,6,.55); }
.modal-root.open { display: flex; }
.modal { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 14px 18px calc(18px + var(--sb)); animation: sheet .22s cubic-bezier(.2,.8,.2,1); }
.modal.wide { max-width: 760px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
@media (min-width: 640px) { .modal-root { align-items: center; } .modal { border-radius: 22px; } }
@keyframes sheet { from { transform: translateY(24px); opacity: .5; } to { transform: none; opacity: 1; } }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); font-weight: 600; }
.more-item .ic { color: var(--accent); }
#toasts { position: fixed; top: calc(var(--st) + 12px); inset-inline: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; max-width: 520px; width: 100%; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--fg); color: var(--bg);
  box-shadow: 0 12px 30px rgba(0,0,0,.25); font-size: 14.5px; animation: sheet .2s; transition: opacity .25s; }
.toast.ok .ic { color: #8fd0a8; } .toast.bad { background: var(--bad-strong); color: var(--on-strong); } .toast.out { opacity: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
@media print { .sidebar, .bottom-nav, .topbar, .paybar, .entry-acts { display: none !important; } .view { padding: 0; } }

/* =====================================================================
   Composants « pro » (bureau) : onglets à compteur, bandeau d'indicateurs,
   barre d'outils, tableaux de données, niveaux de stock, planning hebdomadaire
   ===================================================================== */
.view { max-width: 1440px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.page-head .page-sub { margin: 0; }
.page-date { color: var(--mut); font-size: 14px; font-weight: 500; text-transform: capitalize; white-space: nowrap; }
.ptabs { display: flex; gap: 2px; border-bottom: 1.5px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; font-weight: 600; color: var(--mut); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.ptab:hover { color: var(--fg); }
.ptab[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.ptab .n { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--mut); font-size: 12px; line-height: 20px; text-align: center; }
.ptab[aria-selected="true"] .n { background: var(--accent-soft); color: var(--accent-strong); }
.ptab .n.hot { background: var(--warn-soft); color: var(--warn); }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 18px; overflow: hidden; box-shadow: var(--shadow); }
.stat { padding: 16px 18px; background: var(--surface); min-width: 0; }
.stat .l { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
:root[lang="ar"] .stat .l { letter-spacing: 0; }
.stat .v { display: block; font-family: var(--f-display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { font-size: 12.5px; color: var(--mut); }
.stat.warn { box-shadow: inset 0 3px 0 var(--warn); } .stat.bad { box-shadow: inset 0 3px 0 var(--bad-strong); } .stat.ok { box-shadow: inset 0 3px 0 var(--ok); }
.stat .link { font-size: 13px; padding: 0; }
@media (max-width: 760px) { .stat-strip { grid-template-columns: 1fr 1fr; } .stat { padding: 12px 14px; } .stat .v { font-size: 20px; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.toolbar-pro { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar-pro .spacer { flex: 1; }
.toolbar-pro .tb-title { font-family: var(--f-display); font-size: 17px; font-weight: 600; }
.tb-search { position: relative; flex: 0 1 280px; min-width: 180px; }
.tb-search input { padding-inline-start: 36px; min-height: 40px; }
.tb-search .ic { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--mut); }
.tb-select { width: auto; min-height: 40px; padding: 6px 10px; }
.seg-filter { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-2); }
.seg-filter button { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--mut); white-space: nowrap; }
.seg-filter button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.dtable th { padding: 10px 14px; text-align: start; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
:root[lang="ar"] .dtable th { letter-spacing: 0; }
.dtable td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable .num { text-align: end; white-space: nowrap; }
.dtable .end { text-align: end; width: 1%; white-space: nowrap; }
.dtable tr.dim td { opacity: .55; }
.dtable input[type="number"], .dtable input.qty { width: 100px; min-height: 36px; padding: 6px 8px; text-align: end; }
.cell-main b { display: block; font-weight: 600; } .cell-main span { display: block; font-size: 12.5px; color: var(--mut); }
.row-actions { display: inline-flex; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; color: var(--fg); text-decoration: none; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.table-foot { padding: 10px 16px; font-size: 13px; color: var(--mut); border-top: 1px solid var(--line); background: var(--surface-2); }
.scroll-x .dtable { min-width: 760px; }
.lvl { min-width: 130px; }
.lvl b { font-weight: 700; } .lvl small { color: var(--mut); }
.lvl-track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; }
.lvl-track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: var(--ok); }
.lvl-track i.low { background: var(--bad-strong); } .lvl-track i.watch { background: var(--warn); }
.lvl-track em { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--mut); border-radius: 1px; }
.dot-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.dot-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot-badge.low, .dot-badge.bad { background: var(--bad-soft); color: var(--bad-strong); }
.dot-badge.watch, .dot-badge.warn { background: var(--warn-soft); color: var(--warn); }
.dot-badge.ok { background: var(--ok-soft); color: var(--ok); }
.dot-badge.info { background: var(--info-soft); color: var(--info); }
.dot-badge.violet { background: var(--violet-soft); color: var(--violet); }
.dot-badge.mut { background: var(--surface-2); color: var(--mut); }
.alg { display: inline-block; padding: 1px 7px; margin: 1px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--sun-soft); color: var(--sun); }
.alg-matrix th.alg-col { writing-mode: vertical-rl; transform: rotate(180deg); text-transform: none; letter-spacing: 0; padding: 10px 6px; height: 130px; }
.alg-matrix td.alg-cell { text-align: center; padding: 8px 4px; }
.alg-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--bad-strong); }
.fc { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.fc-track { position: relative; flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.fc-track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: var(--ok); }
.fc-track i.warn { background: var(--warn); } .fc-track i.bad { background: var(--bad-strong); }
.fc-track em { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--fg); opacity: .5; }
.count-list { max-height: 55dvh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.count-row { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1fr 1fr; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.count-row.head { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--mut); text-transform: uppercase; z-index: 1; }
.count-row input { min-height: 38px; padding: 6px 8px; text-align: end; }
.count-row .num { text-align: end; font-variant-numeric: tabular-nums; }
.count-cat { padding: 8px 12px; background: var(--surface-2); font-weight: 700; font-size: 13px; }
.info-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-md); background: var(--info-soft); font-size: 14px; margin-bottom: 14px; }
.info-banner .ic { color: var(--info); }
.order-total { text-align: end; } .order-total span { display: block; font-size: 12px; color: var(--mut); } .order-total b { font-family: var(--f-display); font-size: 18px; }
.sup-av { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- sidebar groupée (bureau) ---------- */
.side-group { margin-top: 14px; } .side-group:first-child { margin-top: 0; }
.side-label { padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--side-mut); }
:root[lang="ar"] .side-label { letter-spacing: 0; }
.rest-card { display: flex; align-items: center; gap: 10px; margin: 0 4px 18px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.rest-card .av { background: var(--accent); border: 0; color: var(--on-accent); width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; }
.rest-card b { display: block; color: var(--fg); font-size: 14px; } .rest-card small { color: var(--mut); font-size: 12px; }
@media (min-width: 960px) {
  .side-item[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand-red); }
  [dir="rtl"] .side-item[aria-current="page"] { box-shadow: inset -3px 0 0 var(--brand-red); }
}

/* ---------- planning hebdomadaire ---------- */
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.plan-bar .week { font-family: var(--f-display); font-size: 17px; font-weight: 600; min-width: 210px; text-align: center; }
.plan-state { margin-inline-start: 4px; }
.plan-wrap { overflow-x: auto; }
.plan { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 940px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.plan th, .plan td { border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); vertical-align: top; }
.plan th:first-child, .plan td:first-child { border-inline-start: 0; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.plan thead th { padding: 10px 8px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--mut); text-align: center; }
.plan thead th.today { color: var(--accent-strong); box-shadow: inset 0 -3px 0 var(--accent); }
.plan thead th b { display: block; font-size: 15px; color: var(--fg); }
.plan .emp { width: 172px; padding: 10px 10px; }
.plan .emp-in { display: flex; align-items: center; gap: 10px; }
.plan .emp b { display: block; font-size: 14px; } .plan .emp small { display: block; font-size: 12px; color: var(--mut); }
.plan .emp .hrs { font-weight: 700; } .plan .emp .hrs.over { color: var(--bad-strong); } .plan .emp .hrs.under { color: var(--warn); }
.plan td.day { position: relative; padding: 5px; height: 72px; }
.plan td.day.off { background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--mut) 9%, transparent) 7px 8px); }
.plan td.day.today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.shift { display: block; width: 100%; text-align: start; margin-bottom: 5px; padding: 5px 7px; border-radius: 8px; font-size: 12.5px; line-height: 1.3; background: var(--accent-soft); color: var(--accent-strong); border-inline-start: 3px solid var(--accent); }
.shift b { display: block; font-size: 13px; color: var(--fg); }
.shift small { display: block; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift.draft { background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--accent-soft) 6px 12px); border-style: dashed; }
.shift.conflict { background: var(--bad-soft); border-inline-start-color: var(--bad-strong); }
.shift.pos-cuisine { border-inline-start-color: #f59e0b; } .shift.pos-salle { border-inline-start-color: #8b5cf6; } .shift.pos-caisse { border-inline-start-color: #0ea5e9; } .shift.pos-livraison { border-inline-start-color: #22c55e; }
.abs-chip { display: block; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; background: var(--violet-soft); color: var(--violet); margin-bottom: 5px; }
.abs-chip.pending { background: var(--surface-2); color: var(--mut); border: 1.5px dashed var(--line); }
.shift.off-day { background: var(--surface-2); color: var(--fg); border-inline-start: 3px solid var(--mut); }
.shift.off-day b { display: inline-flex; align-items: center; gap: 5px; }
.shift.off-day.draft { border-style: dashed; opacity: .8; }
.cell-add { display: inline-flex; align-items: center; justify-content: center; opacity: 0; position: absolute; inset-inline-end: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 7px; border: 1.5px dashed var(--line); color: var(--mut); font-weight: 700; background: var(--surface); transition: opacity .12s; }
.plan td.day:hover .cell-add, .cell-add:focus-visible, .plan td.day.empty .cell-add { opacity: 1; }
@media (hover: none) { .cell-add { opacity: 1; } }
.plan td.day.empty .cell-add { position: static; width: 100%; height: 56px; border-radius: 9px; }
.plan tfoot td { padding: 8px; font-size: 12.5px; color: var(--mut); text-align: center; background: var(--surface-2); }
.plan tfoot td b { display: block; color: var(--fg); font-size: 14px; }
.plan tfoot td:first-child { text-align: start; font-weight: 700; padding-inline-start: 12px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; font-size: 12.5px; color: var(--mut); border-top: 1px solid var(--line); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.my-shift { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.my-shift .d { width: 52px; text-align: center; border-radius: 10px; background: var(--surface-2); padding: 4px 0; }
.my-shift .d b { display: block; font-family: var(--f-display); font-size: 20px; } .my-shift .d small { font-size: 11px; color: var(--mut); text-transform: uppercase; }
@media print { .plan-bar button, .cell-add { display: none !important; } .plan { min-width: 0; font-size: 11px; } }

@media (max-width: 959px) { .topbar .page-date { display: none; } }

.tr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.rc-table .table-wrap { overflow-x: auto; max-height: 320px; overflow-y: auto; }
.rc-table .dtable td:first-child { white-space: nowrap; }
/* écran d'abonnement : « J'ai un code » */
.code-box { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; background: var(--surface); }
.code-box summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.code-box form { margin: 10px 0 6px; } .code-box input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; letter-spacing: .04em; }
.rc-tip[hidden] { display: none; }
/* agent : compteurs par gravité */
.sev-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 12px; }
.sev-count { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; }
.sev-count b { font: 700 24px var(--f-display); } .sev-count span { font-size: 12.5px; color: var(--mut); }
.sev-count.sev-critique b { color: var(--bad-strong); } .sev-count.sev-alerte b { color: var(--warn); } .sev-count.sev-info b { color: var(--info); }

/* ---------- Logo v2 : symbole A1 (T à pointes + point rouge) + « Tiger.Pilot » ---------- */
.wordmark { display: inline-flex; align-items: baseline; gap: 0; font: 700 22px/1 var(--f-display); letter-spacing: -.035em; color: var(--fg); white-space: nowrap; direction: ltr; }
.wordmark .wm-mark { width: 1.2em; height: 1.15em; align-self: center; margin-inline-end: .34em; flex: none; }
.wordmark b, .wordmark em { font: inherit; letter-spacing: inherit; }
.wordmark i { display: inline-block; width: .17em; height: .17em; border-radius: 50%; background: var(--brand-red); margin: 0 .035em 0 .04em; }
.wordmark.lg { font-size: 34px; } .wordmark.xl { font-size: 44px; }
.brand .wordmark { padding: 6px 4px 0; color: var(--side-fg); }
.brand-big { flex-direction: column; align-items: flex-start; gap: 6px; }
.splash { background: #18181A; } .splash .wordmark { color: #ECE5D6; }

/* modules non activés */
.lock-card { max-width: 560px; margin: 40px auto; text-align: center; padding: 32px 24px; display: grid; gap: 10px; justify-items: center; }
.lock-card .lock-ic { font-size: 34px; } .lock-card h2 { margin: 0; }
.side-item.locked, .bn-item.locked, .more-item.locked { opacity: .55; }
.side-item .lock, .bn-item .lock { margin-inline-start: auto; font-size: 12px; }

/* ---------- document imprimable (export PDF) ---------- */
#print-doc { display: none; }
@media print {
  body.printing > *:not(#print-doc) { display: none !important; }
  body.printing { background: #fff !important; color: #18181A !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing #print-doc { display: block; font: 10.5pt/1.45 var(--f-text); color: #18181A; }
  #print-doc header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #18181A; padding-bottom: 8px; margin-bottom: 14px; }
  #print-doc .pd-brand { display: flex; align-items: baseline; font: 700 16pt/1 var(--f-display); letter-spacing: -.03em; direction: ltr; }
  #print-doc .pd-brand svg { width: 20pt; height: 19pt; align-self: center; margin-inline-end: 6pt; }
  #print-doc .pd-brand i { display: inline-block; width: 4pt; height: 4pt; border-radius: 50%; background: #F2301F; margin: 0 1pt; }
  #print-doc .pd-meta { font-size: 9pt; color: #5A554C; }
  #print-doc h1 { font: 700 17pt/1.2 var(--f-display); margin: 0 0 4px; }
  #print-doc .pd-sub { color: #5A554C; margin: 0 0 12px; }
  #print-doc table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  #print-doc th { text-align: start; background: #ECE5D6; border-bottom: 1.5px solid #18181A; padding: 5px 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-doc td { border-bottom: 1px solid #D5CBB8; padding: 5px 6px; vertical-align: top; }
  #print-doc td.n { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #print-doc tr.tot td { font-weight: 700; border-top: 1.5px solid #18181A; }
  #print-doc tr { break-inside: avoid; }
  #print-doc .pd-note { margin-top: 14px; font-size: 8.5pt; color: #5A554C; }
  #print-doc .pd-sign { display: flex; gap: 40px; margin-top: 28px; } #print-doc .pd-sign div { flex: 1; border-top: 1px solid #18181A; padding-top: 4px; font-size: 9pt; }
}
/* paie : grille de validation (heures par jour) */
.pay-grid .hcell { width: 64px; min-height: 38px; padding: 4px 8px; text-align: end; font-variant-numeric: tabular-nums; }
.pay-grid td, .pay-grid th { padding: 6px 6px; }
/* bilan du mois */
.fin-split tr.strong td { font-weight: 700; border-top: 1.5px solid var(--fg); }
.fin-split tr.strong.ok td { color: var(--ok); } .fin-split tr.strong.bad td { color: var(--bad-strong); }
.fin-sec { margin-bottom: 14px; } .fin-sec .tb-title { flex: none; } .fin-sec b.tr { font-variant-numeric: tabular-nums; }
.fin-days summary { cursor: pointer; list-style: none; } .fin-days summary::-webkit-details-marker { display: none; }
.fin-sec .dtable, .scroll-x .fin-split { min-width: 0; width: 100%; }
.fin-sec .dtable td { white-space: normal; }
.fin-split th, .fin-split td { white-space: nowrap; }
.grid-2.gap-l > * { min-width: 0; }
.code-pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; font: 500 12.5px/1.55 var(--f-mono); overflow-x: auto; white-space: pre; direction: ltr; text-align: left; }
/* caisse configurable */
.cum-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--mut); vertical-align: middle; }
.cum-tag.day { background: var(--violet-soft); color: var(--violet); }
.pay-cfg .coef-in { width: 76px; min-height: 36px; padding: 4px 8px; text-align: end; }
.pay-cfg td { vertical-align: middle; } .scroll-x .pay-cfg { min-width: 560px; }
/* paie par semaine + matrice (saisie directe) */
.pay-month th small, .pay-month td small { display: block; font-size: 11.5px; font-weight: 500; }
.pay-month .pay-rest { color: var(--fg); font-size: 15px; }
.fin-sec .fin-lbl { width: 100%; min-height: 36px; padding: 4px 8px; border-color: transparent; background: transparent; }
.fin-sec .fin-lbl:hover, .fin-sec .fin-lbl:focus { border-color: var(--line); background: var(--surface); }
.fin-sec .fin-amt input { width: 120px; min-height: 36px; padding: 4px 26px 4px 8px; text-align: end; }
/* matrice : fournisseurs → factures */
.fin-mat-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; flex-wrap: wrap; }
.fin-mat .note { margin: 4px 16px 8px; }
.fin-mat details.sup { border-top: 1px solid var(--line); }
.fin-mat details.sup > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.fin-mat details.sup > summary::-webkit-details-marker { display: none; }
.fin-mat details.sup > summary::before { content: '▸'; color: var(--mut); transition: transform .2s; }
.fin-mat details.sup[open] > summary::before { transform: rotate(90deg); }
[dir="rtl"] .fin-mat details.sup > summary::before { content: '◂'; }
[dir="rtl"] .fin-mat details.sup[open] > summary::before { transform: rotate(-90deg); }
.fin-mat details.sup .dtable td { font-size: 13.5px; }
.close-files{list-style:none;margin:12px 0;padding:0;display:grid;gap:6px}
.close-files li{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;font-family:var(--mono, 'JetBrains Mono', monospace);font-size:13px}
.close-files li span{flex:1;min-width:0;overflow-wrap:anywhere}
.install-btn { gap: 6px; }
.install-card { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.install-card img { border-radius: 14px; flex: none; }
.install-card small { display: block; color: var(--mut); margin-top: 2px; }
.install-steps { margin: 14px 0 0; padding-inline-start: 22px; display: grid; gap: 10px; line-height: 1.5; }
@media (max-width: 640px) { .install-btn span { display: none; } }
