/* Le Tamarin — gestion de restaurant (démo). Palette : crème, vert sapin, terracotta, or. Pensé tablette, debout, au doigt. */

:root {
  --bg: #faf6ee;
  --bg-deep: #f1e9da;
  --surface: #ffffff;
  --surface-2: #fcf9f3;
  --ink: #1d1a16;
  --ink-2: #4e463d;
  --muted: #877d70;
  --line: #e8dfcf;
  --line-strong: #d6c9b2;

  --green: #1f3a2d;
  --green-600: #2d5340;
  --green-50: #e8f1ec;
  --terra: #b4532a;
  --terra-600: #94411d;
  --terra-50: #fbece4;
  --gold: #c9a15a;
  --gold-600: #9a7332;
  --gold-50: #faf2df;
  --gold-grad: linear-gradient(135deg, #f0d9a0 0%, #c9a15a 50%, #9a7332 100%);

  --ok: #1f7a4f;   --ok-50: #e2f3ea;
  --warn: #b0650d; --warn-50: #fdf0d9;
  --bad: #c0343b;  --bad-50: #fbe8e8;
  --info: #2b6f8f; --info-50: #e3f0f6;

  --r-sm: 12px; --r: 18px; --r-lg: 26px;
  --shadow-sm: 0 1px 2px rgba(50, 35, 15, .06), 0 2px 8px rgba(50, 35, 15, .04);
  --shadow: 0 2px 6px rgba(50, 35, 15, .06), 0 12px 32px rgba(50, 35, 15, .09);
  --shadow-lg: 0 24px 60px rgba(25, 15, 5, .28);

  --font: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --tap: 56px;
  --topbar: 68px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 400 17px/1.45 var(--font); color: var(--ink); background: var(--bg);
  background-image: radial-gradient(1100px 480px at 110% -10%, #f4e4c9 0%, transparent 60%), radial-gradient(900px 480px at -10% 110%, #e5eee6 0%, transparent 55%);
  background-attachment: fixed; min-height: 100vh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--terra) 55%, transparent); outline-offset: 2px; }
.ico { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 16px;
  padding: 0 18px; padding-top: env(safe-area-inset-top); background: var(--green); color: #f3ece0;
  box-shadow: 0 1px 0 rgba(201, 161, 90, .5), 0 8px 24px rgba(15, 25, 20, .2);
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand img { border-radius: 11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font: italic 600 23px/1 var(--display); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: #bcd0c4; margin-top: 4px; }
.nav { display: flex; gap: 4px; margin: 0 auto; background: rgba(255, 255, 255, .07); padding: 5px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 999px; color: #d6e0d9; text-decoration: none; font-weight: 500; font-size: 16px; white-space: nowrap; }
.nav a.active { background: var(--terra); color: #fff; box-shadow: 0 4px 14px rgba(180, 83, 42, .5); }
.nav .dot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: #1d1a16; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.who-chip { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #f3ece0; }
.who-chip .av { width: 30px; height: 30px; font-size: 13px; }
.day-state { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--bad); color: #fff; }
.clock { font: 600 20px/1 var(--font); font-variant-numeric: tabular-nums; color: #f0d9a0; }
@media (max-width: 1240px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .nav { order: 3; width: 100%; margin: 0; }
  .brand-sub, .clock { display: none; }
}

/* ---------------------------------------------------------------- Pages */
.view { max-width: 1400px; margin: 0 auto; padding: 22px 20px 120px; }
.view.narrow { max-width: 920px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.eyebrow { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--terra); font-weight: 600; margin-bottom: 4px; }
.title { font: 600 34px/1.1 var(--display); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 14px; }
.card-title { font: 600 20px/1.2 var(--display); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.grid2 > .card + .card { margin-top: 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--terra); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.av { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 15px; flex: none; }

/* ---------------------------------------------------------------- Boutons, champs */
a.btn { text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 22px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 17px; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--terra); border-color: var(--terra); color: #fff; box-shadow: 0 6px 18px rgba(180, 83, 42, .3); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, white); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { min-height: 42px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn-lg { min-height: 64px; font-size: 19px; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-ghost.loading::after { border-color: rgba(0, 0, 0, .2); border-top-color: var(--ink); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, textarea.input, select.input { width: 100%; min-height: var(--tap); padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 17px; }
textarea.input { padding: 12px 16px; min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px color-mix(in srgb, var(--terra) 18%, transparent); }
.input-money { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1 1 0; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg button.on { background: var(--green); border-color: var(--green); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 500; font-size: 15px; }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.chip .n { background: var(--terra); color: #fff; border-radius: 10px; min-width: 22px; padding: 0 6px; font-size: 13px; font-weight: 700; text-align: center; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg-deep); color: var(--ink-2); white-space: nowrap; }
.b-ok { background: var(--ok-50); color: var(--ok); } .b-warn { background: var(--warn-50); color: var(--warn); }
.b-bad { background: var(--bad-50); color: var(--bad); } .b-info { background: var(--info-50); color: var(--info); }
.b-terra { background: var(--terra-50); color: var(--terra-600); } .b-gold { background: var(--gold-50); color: var(--gold-600); }

/* ---------------------------------------------------------------- KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.kpi .k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font: 600 26px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 13px; color: var(--muted); }
.kpi.accent { background: var(--green); color: #fff; border-color: var(--green); }
.kpi.accent .k, .kpi.accent .s { color: #bcd0c4; }

/* ---------------------------------------------------------------- Plan de salle */
.zone-title { font: 600 20px/1 var(--display); margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.zone-title::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.tbl { position: relative; text-align: left; min-height: 132px; padding: 12px 14px; border-radius: var(--r); border: 2px solid var(--line-strong); background: var(--surface); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); transition: transform .08s; }
.tbl:active { transform: scale(.97); }
.tbl .code { font: 700 28px/1 var(--display); }
.tbl .seats { font-size: 13px; color: var(--muted); }
.tbl .st { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tbl .meta { font-size: 14px; color: var(--ink-2); }
.tbl .total { font-weight: 700; font-variant-numeric: tabular-nums; margin-top: auto; }
.tbl.free { border-style: dashed; background: var(--surface-2); }
.tbl.free .st { color: var(--ok); }
.tbl.seated { border-color: var(--ink-2); } .tbl.seated .st { color: var(--ink-2); }
.tbl.cooking { border-color: var(--warn); background: var(--warn-50); } .tbl.cooking .st { color: var(--warn); }
.tbl.ready { border-color: var(--ok); background: var(--ok-50); animation: pulse 1.6s ease-in-out infinite; } .tbl.ready .st { color: var(--ok); }
.tbl.eating { border-color: var(--info); background: var(--info-50); } .tbl.eating .st { color: var(--info); }
.tbl.late::after { content: "⏱"; position: absolute; top: 8px; right: 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); margin-top: 18px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; font-weight: 500; }
.banner.warn { background: var(--warn-50); color: var(--warn); } .banner.bad { background: var(--bad-50); color: var(--bad); } .banner.info { background: var(--info-50); color: var(--info); }

/* ---------------------------------------------------------------- Prise de commande */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin-bottom: 12px; }
.cat-tab { flex: none; min-height: 52px; padding: 0 20px; border-radius: 16px; border: 2px solid var(--line-strong); background: var(--surface); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.cat-tab.on { color: #fff; border-color: transparent; background: var(--cat, var(--green)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.tile { position: relative; text-align: left; min-height: 104px; padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line-strong); border-left: 6px solid var(--cat, var(--green)); background: var(--surface); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); }
.tile:active { transform: scale(.97); }
.tile .nm { font-weight: 600; line-height: 1.2; }
.tile .dt { font-size: 13px; color: var(--muted); line-height: 1.25; }
.tile .pr { margin-top: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--terra-600); }
.tile .cnt { position: absolute; top: -8px; right: -8px; min-width: 30px; height: 30px; border-radius: 15px; background: var(--terra); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 8px; box-shadow: var(--shadow-sm); }
.tile.out { opacity: .5; background: repeating-linear-gradient(135deg, #fff, #fff 8px, #f3ece0 8px, #f3ece0 16px); cursor: not-allowed; }
.tile.out .pr { color: var(--bad); }
.ticket { position: sticky; top: calc(var(--topbar) + 14px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar) - 34px); }
.ticket-head { padding: 14px 16px; border-bottom: 1px dashed var(--line-strong); }
.ticket-head h3 { font: 600 22px/1.1 var(--display); }
.ticket-lines { overflow-y: auto; padding: 6px 12px; flex: 1; min-height: 120px; }
.tl { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl .nm { font-weight: 600; line-height: 1.2; }
.tl .sub { font-size: 13px; color: var(--muted); }
.tl .sub.note { color: var(--terra-600); font-weight: 600; }
.qty { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.qty button { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; }
.qty b { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.ticket-foot { padding: 14px 16px; border-top: 1px dashed var(--line-strong); display: flex; flex-direction: column; gap: 10px; }
.sum { display: flex; justify-content: space-between; font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.ticket-toggle { display: none; }
@media (max-width: 900px) {
  .builder { grid-template-columns: 1fr; }
  .ticket { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; max-height: 82vh; border-radius: 22px 22px 0 0; transform: translateY(calc(100% - 78px)); transition: transform .25s; }
  .ticket.open { transform: none; }
  .ticket-toggle { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; height: 78px; border: 0; background: var(--green); color: #fff; border-radius: 22px 22px 0 0; font-weight: 600; width: 100%; }
}

/* ---------------------------------------------------------------- Feuille de commande */
.sheet-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.sheet-table { width: 84px; height: 84px; border-radius: 22px; background: var(--green); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.sheet-table b { font: 700 30px/1 var(--display); } .sheet-table span { font-size: 12px; opacity: .8; }
.round-title { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
.oi { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); margin-bottom: 8px; }
.oi .q { font: 700 20px/1 var(--display); min-width: 34px; }
.oi .nm { font-weight: 600; line-height: 1.2; }
.oi .sub { font-size: 13px; color: var(--muted); }
.oi .sub.note { color: var(--terra-600); font-weight: 600; }
.oi .pr { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 90px; }
.oi.st-new { border-left: 6px solid var(--ink-2); }
.oi.st-preparing { border-left: 6px solid var(--warn); background: var(--warn-50); }
.oi.st-ready { border-left: 6px solid var(--ok); background: var(--ok-50); }
.oi.st-served { border-left: 6px solid var(--info); }
.oi.st-cancelled { opacity: .55; text-decoration: line-through; border-left: 6px solid var(--bad); }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line-strong); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.totals { margin-left: auto; text-align: right; }
.totals .big { font: 700 28px/1 var(--display); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Cuisine (KDS) */
.kds-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.kt { background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.kt-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--green); color: #fff; }
.kt-head .no { font: 700 24px/1 var(--display); }
.kt-head .tb { font: 700 22px/1 var(--display); background: rgba(255, 255, 255, .16); padding: 4px 10px; border-radius: 10px; }
.kt-head .who { font-size: 13px; opacity: .85; line-height: 1.2; }
.kt-head .timer { margin-left: auto; font: 700 22px/1 var(--font); font-variant-numeric: tabular-nums; }
.kt.t-warn .kt-head { background: var(--warn); } .kt.t-late .kt-head { background: var(--bad); animation: pulse-red 1.2s ease-in-out infinite; }
.kt.t-done { border-color: var(--ok); } .kt.t-done .kt-head { background: var(--ok); }
.kt-note { padding: 8px 14px; background: var(--gold-50); color: var(--gold-600); font-weight: 600; font-size: 15px; }
.ki { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.ki .q { font: 700 26px/1 var(--display); min-width: 38px; }
.ki .nm { font-weight: 600; font-size: 18px; line-height: 1.15; }
.ki .sub { font-size: 14px; color: var(--ink-2); }
.ki .sub.note { color: var(--bad); font-weight: 700; }
.ki.s-preparing { background: var(--warn-50); } .ki.s-ready { background: var(--ok-50); }
.ki.s-ready .nm { text-decoration: line-through; opacity: .6; }
.ki.late .nm::after { content: " ⏱"; }
.ki-btn { min-height: 52px; min-width: 104px; border-radius: 14px; border: 0; font-weight: 700; font-size: 16px; color: #fff; }
.ki-btn.go { background: var(--warn); } .ki-btn.done { background: var(--ok); } .ki-btn.undo { background: transparent; color: var(--muted); border: 1.5px solid var(--line-strong); min-width: 52px; }
.kt-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.kt-foot .btn { flex: 1; }
.st-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.sp-new { background: var(--bg-deep); color: var(--ink-2); } .sp-preparing { background: var(--warn-50); color: var(--warn); }
.sp-ready { background: var(--ok-50); color: var(--ok); } .sp-served { background: var(--info-50); color: var(--info); } .sp-cancelled { background: var(--bad-50); color: var(--bad); }

/* ---------------------------------------------------------------- Listes, tableaux, graphiques */
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; width: 100%; }
button.li:active { transform: scale(.99); }
.li .nm { font-weight: 600; } .li .sub { font-size: 14px; color: var(--muted); }
.li .amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 110px; gap: 10px; align-items: center; font-size: 15px; }
.bar-row .track { height: 16px; border-radius: 8px; background: var(--bg-deep); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 8px; background: var(--terra); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.cols .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.cols .col .b { width: 100%; max-width: 38px; border-radius: 8px 8px 2px 2px; background: var(--green); min-height: 2px; }
.cols .col .l { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cols .col .t { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.daynav { display: flex; align-items: center; gap: 8px; }
.daynav .lbl { font-weight: 600; min-width: 190px; text-align: center; text-transform: capitalize; }
.gap-0 { color: var(--ok); } .gap-neg { color: var(--bad); } .gap-pos { color: var(--warn); }
.money-lines { display: flex; flex-direction: column; gap: 6px; }
.money-lines .ml { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.money-lines .ml.tot { font-weight: 700; border-top: 1px solid var(--line-strong); padding-top: 8px; margin-top: 4px; font-size: 18px; }

/* ---------------------------------------------------------------- Modales, toasts */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20, 14, 6, .55); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.overlay.in { opacity: 1; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); transform: translateY(14px); transition: transform .2s; }
.overlay.in .modal { transform: none; }
.modal.sm { width: min(420px, 100%); } .modal.lg { width: min(820px, 100%); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }
.modal-head h2 { font: 600 24px/1.15 var(--display); }
.modal-body { padding: 8px 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 auto; }
.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, 94vw); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 500; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: all .25s; }
.toast.in { opacity: 1; transform: none; }
.toast-success { background: var(--green); } .toast-error { background: var(--bad); } .toast-info { background: var(--info); }

/* ---------------------------------------------------------------- Verrouillage */
.boot { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 20px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line-strong); border-top-color: var(--terra); animation: spin .8s linear infinite; }
.lock { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lock-card { width: min(460px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.lock-card .brand-name { font-size: 34px; }
.slogan { font: italic 500 17px/1.3 var(--display); color: var(--gold-600); }
.role-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 14px 0 6px; }
.role-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 16px; border: 2px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 15px; }
.role-pick button .ico { font-size: 26px; color: var(--terra); }
.role-pick button.on { border-color: var(--green); background: var(--green-50); }
.demo-hint { margin-top: 10px; font-size: 13px; background: var(--gold-50); color: var(--gold-600); border-radius: 12px; padding: 8px 12px; width: 100%; }
.pin { width: 100%; max-width: 330px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 10px 0 6px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); }
.pin-dots span.on { background: var(--green); border-color: var(--green); }
.pin-dots.shake { animation: shake .4s; }
.pin-err { min-height: 22px; color: var(--bad); font-weight: 600; font-size: 14px; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-keys button { min-height: 62px; border-radius: 18px; border: 1.5px solid var(--line-strong); background: var(--surface-2); font: 600 24px/1 var(--font); display: flex; align-items: center; justify-content: center; }
.pin-keys button.ok { background: var(--terra); border-color: var(--terra); color: #fff; } .pin-keys button.ghost { background: transparent; }
.pin-keys button:active { transform: scale(.95); }

/* ---------------------------------------------------------------- Ticket imprimé */
#print-area { display: none; }
.receipt { width: 58mm; font: 12px/1.35 "Courier New", monospace; color: #000; }
.receipt .c { text-align: center; } .receipt .b { font-weight: 700; } .receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt .l { display: flex; justify-content: space-between; gap: 6px; } .receipt .big { font-size: 16px; font-weight: 700; }
.receipt img { width: 38px; height: 38px; display: block; margin: 0 auto 4px; }
@media print {
  @page { size: 58mm auto; margin: 0; }
  body { background: #fff !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ok) 22%, transparent); } }
@keyframes pulse-red { 50% { filter: brightness(1.18); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 640px) {
  .view { padding: 16px 12px 130px; }
  .title { font-size: 27px; }
  .bar-row { grid-template-columns: 90px 1fr 84px; }
  .tables-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
