/* Digital Kitchen · Texas GrillZ — socle visuel commun */
@font-face { font-family: 'Anton'; src: url('/assets/fonts/anton-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 400; src: url('/assets/fonts/barlow-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 500; src: url('/assets/fonts/barlow-latin-500-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 600; src: url('/assets/fonts/barlow-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 700; src: url('/assets/fonts/barlow-latin-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; src: url('/assets/fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; src: url('/assets/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; src: url('/assets/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Permanent Marker'; src: url('/assets/fonts/permanent-marker-latin-400-normal.woff2') format('woff2'); font-display: swap; }

:root {
  --bg: #111015; --bg-2: #17161d; --surface: #1d1c24; --surface-2: #26252f; --surface-3: #302f3a;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #f6f1ea; --text-2: #c9c2b8; --muted: #8f8a93;
  --fire: #e8762c; --fire-2: #f39a4b; --fire-ink: #1a0f06;
  --red: #c8262b; --red-2: #e0444a; --gold: #f2c23e; --teal: #2f8f94; --teal-2: #4cb3b8; --navy: #2b2d5c;
  --ok: #3fb57a; --warn: #f2c23e; --bad: #e0444a; --info: #4cb3b8;
  --radius: 14px; --radius-sm: 10px; --radius-lg: 22px;
  --shadow: 0 10px 30px rgba(0,0,0,.35); --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  --display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --brush: 'Permanent Marker', 'Comic Sans MS', cursive;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 500 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; display: block; }
a { color: var(--fire-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--fire); color: var(--fire-ink); }
:focus-visible { outline: 2px solid var(--fire-2); outline-offset: 2px; border-radius: 6px; }

.display { font-family: var(--display); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; line-height: .95; }
.brush { font-family: var(--brush); font-weight: 400; }
.eyebrow { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--fire-2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.center { text-align: center; }

/* Boutons */
.btn { --b: var(--surface-2); --c: var(--text); appearance: none; border: 1px solid var(--line-2); background: var(--b); color: var(--c);
  height: 44px; padding: 0 18px; border-radius: 12px; font: 700 15px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: transform .12s, background .2s, border-color .2s, opacity .2s;
  white-space: nowrap; user-select: none; }
.btn:hover { border-color: rgba(255,255,255,.28); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { --b: var(--fire); --c: var(--fire-ink); border-color: transparent; box-shadow: 0 6px 20px rgba(232,118,44,.35); }
.btn.primary:hover { --b: var(--fire-2); }
.btn.red { --b: var(--red); --c: #fff; border-color: transparent; }
.btn.teal { --b: var(--teal); --c: #fff; border-color: transparent; }
.btn.ghost { --b: transparent; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 56px; padding: 0 26px; font-size: 18px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Champs */
.field { display: grid; gap: 6px; }
.field > span, .label { font: 700 12px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.input, select.input, textarea.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2);
  color: var(--text); transition: border-color .2s, box-shadow .2s; }
textarea.input { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--fire); box-shadow: 0 0 0 3px rgba(232,118,44,.2); }
.input::placeholder { color: #6f6a73; }
input[type=color].input { padding: 4px; width: 56px; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }

/* Cartes et éléments */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.pad-lg { padding: 24px; }
.card h3 { margin: 0 0 12px; font: 700 15px/1.1 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font: 700 12px/1 var(--cond); letter-spacing: .06em;
  text-transform: uppercase; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.ok { background: rgba(63,181,122,.16); color: #6fd8a1; }
.badge.warn { background: rgba(242,194,62,.16); color: var(--gold); }
.badge.bad { background: rgba(224,68,74,.16); color: #ff7a7f; }
.badge.info { background: rgba(76,179,184,.16); color: var(--teal-2); }
.badge.fire { background: rgba(232,118,44,.18); color: var(--fire-2); }
.chip { height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
  font: 700 14px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; white-space: nowrap; transition: all .2s; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font: 700 13px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .5; margin: 0 auto 10px; }

/* Tableaux */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 700 12px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; background: var(--bg-2); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.tbl .r { text-align: right; }

/* Fenêtres modales et volets */
.overlay { position: fixed; inset: 0; background: rgba(5,4,8,.66); backdrop-filter: blur(6px); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .18s ease; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { width: min(880px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-h h2 { margin: 0; font: 400 26px/1 var(--display); text-transform: uppercase; }
.modal-b { padding: 18px 22px 22px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 22px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .overlay { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 22px 22px 0 0; max-height: 92dvh; animation: up .25s cubic-bezier(.2,.9,.3,1); }
}

/* Notifications */
.toasts { position: fixed; z-index: 120; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { background: #2c2a35; border: 1px solid var(--line-2); border-left: 4px solid var(--ok); color: var(--text); padding: 14px 16px; border-radius: 12px; box-shadow: var(--shadow);
  font-weight: 600; animation: up .25s ease; pointer-events: auto; }
.toast.err { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--fire); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--fire); animation: spin .8s linear infinite; }
.loading { display: grid; place-items: center; padding: 60px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes up { from { opacity: 0; transform: translateY(16px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,118,44,.6); } 50% { box-shadow: 0 0 0 10px rgba(232,118,44,0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Signature marque : coup de pinceau rouge */
.stroke { position: relative; display: inline-block; padding: 4px 18px 6px; color: #fff; isolation: isolate; }
.stroke::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--red);
  clip-path: polygon(2% 18%, 8% 6%, 30% 10%, 55% 2%, 80% 8%, 98% 4%, 100% 40%, 97% 70%, 99% 94%, 70% 90%, 45% 98%, 20% 92%, 3% 96%, 0% 60%); }
.grain { position: relative; }
.grain::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Graphiques */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: rgba(255,255,255,.06); }
.chart .axis text { fill: var(--muted); font: 600 11px var(--cond); letter-spacing: .04em; }
.chart .bar { fill: var(--fire); transition: opacity .15s; }
.chart .bar.dim { opacity: .35; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .line { fill: none; stroke: var(--fire); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#fireGrad); }
.chart .dot { fill: var(--fire); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: #0c0b10; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; white-space: nowrap;
  box-shadow: var(--shadow); transform: translate(-50%, calc(-100% - 10px)); z-index: 5; }
.tip b { display: block; font: 700 12px var(--cond); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .b { height: 10px; border-radius: 0 5px 5px 0; background: var(--fire); min-width: 2px; }
.hbar .track { background: rgba(255,255,255,.05); border-radius: 0 5px 5px 0; }
.hbar .v { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 48px; text-align: right; }
