/* PizzaOne admin — "the oven". Dark, warm, ember-lit. */
:root {
  --bg: #120d0b;
  --surface: #1a1310;
  --surface-2: #1e1613;
  --surface-3: #261c18;
  --border: #2e231e;
  --border-strong: #463630;
  --ember: #ff6a2b;
  --ember-deep: #d9461a;
  --amber: #ffb547;
  --text: #f6ede6;
  --muted: #b8a79b;
  --faint: #8c7b70;
  --ok: #7fd18b;
  --danger: #ff8a7a;
  --on-ember: #1a0e08;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 24px rgba(255, 106, 43, 0.35);
  --tap: 48px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* `hidden` must win over every display rule below. */
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 106, 43, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 181, 71, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.noscript { text-align: center; padding: 40px; }
.root { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }

/* ---------- embers ---------- */
.embers { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.embers span {
  position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 8px 2px rgba(255, 140, 50, 0.55); opacity: 0;
  animation: rise 14s linear infinite;
}
.embers span:nth-child(odd) { background: var(--ember); }
.embers span:nth-child(1) { left: 6%; animation-delay: 0s; animation-duration: 13s; }
.embers span:nth-child(2) { left: 14%; animation-delay: 4s; animation-duration: 17s; transform: scale(0.7); }
.embers span:nth-child(3) { left: 22%; animation-delay: 9s; }
.embers span:nth-child(4) { left: 31%; animation-delay: 2s; animation-duration: 19s; }
.embers span:nth-child(5) { left: 38%; animation-delay: 11s; animation-duration: 15s; }
.embers span:nth-child(6) { left: 46%; animation-delay: 6s; animation-duration: 21s; }
.embers span:nth-child(7) { left: 53%; animation-delay: 1s; animation-duration: 16s; }
.embers span:nth-child(8) { left: 61%; animation-delay: 8s; animation-duration: 18s; }
.embers span:nth-child(9) { left: 68%; animation-delay: 13s; animation-duration: 14s; }
.embers span:nth-child(10) { left: 74%; animation-delay: 3s; animation-duration: 20s; }
.embers span:nth-child(11) { left: 80%; animation-delay: 10s; }
.embers span:nth-child(12) { left: 86%; animation-delay: 5s; animation-duration: 17s; }
.embers span:nth-child(13) { left: 91%; animation-delay: 12s; animation-duration: 15s; }
.embers span:nth-child(14) { left: 96%; animation-delay: 7s; animation-duration: 22s; }
.embers span:nth-child(15) { left: 3%; animation-delay: 15s; animation-duration: 18s; }
.embers span:nth-child(16) { left: 57%; animation-delay: 17s; animation-duration: 23s; }
@keyframes rise {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: 0.55; }
  50% { transform: translate(18px, -50vh) scale(0.8); opacity: 0.35; }
  100% { transform: translate(-14px, -105vh) scale(0.3); opacity: 0; }
}

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ff7d42, var(--ember)); border-color: transparent; color: var(--on-ember); box-shadow: var(--glow); }
.btn.primary:hover { background: linear-gradient(180deg, #ff8d57, #ff7234); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 138, 122, 0.5); color: var(--danger); background: rgba(255, 138, 122, 0.06); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 0.92rem; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg, .btn svg { width: 20px; height: 20px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 700; font-size: 0.95rem; }
.input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: #0e0a08; color: var(--text); font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 4px rgba(255, 106, 43, 0.18); }
textarea.input { min-height: 96px; padding: 12px 16px; resize: vertical; line-height: 1.7; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-end: 54px; }
.input-wrap .icon-btn { position: absolute; inset-inline-end: 2px; top: 2px; }
.error { color: var(--danger); font-weight: 600; margin: 0 0 12px; min-height: 1.6em; }
.hint { color: var(--muted); font-size: 0.9rem; }

/* ---------- auth screens (login, PIN, lock) ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px 16px; }
.oven-card {
  width: min(440px, 100%); padding: 34px 28px 28px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(38, 28, 24, 0.95), rgba(26, 19, 16, 0.96));
  border: 1px solid var(--border); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative; overflow: hidden; animation: appear 0.45s var(--ease) both;
}
.oven-card::before {
  /* the oven mouth glowing at the top edge */
  content: ""; position: absolute; inset-inline: 18%; top: -60px; height: 120px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 106, 43, 0.45), transparent); filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 8px; position: relative; }
.brand-mark { width: 52px; height: 52px; }
.brand-name { font-size: 1.5rem; font-weight: 900; letter-spacing: 0.3px; }
.brand-name b { color: var(--ember); }
.auth h1 { margin: 6px 0 4px; font-size: 1.35rem; text-align: center; }
.auth .lead { margin: 0 0 22px; text-align: center; color: var(--muted); }
@keyframes appear { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.btn.wide { width: 100%; }
.first-visit { text-align: center; margin: 16px 0 0; }
.link-btn { background: none; border: 0; color: var(--amber); font-weight: 700; cursor: pointer; min-height: 44px; padding: 0 8px; text-decoration: underline; text-underline-offset: 4px; }
.link-btn:hover { color: #ffd08a; }
.code-input { text-align: center; font-size: 1.35rem; font-weight: 800; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
.field .hint { font-size: 0.82rem; }

/* PIN pizza */
.pin-card { width: min(420px, 100%); text-align: center; }
.pizza { width: 210px; height: 210px; margin: 6px auto 8px; display: block; overflow: visible; }
.pizza .pan { fill: #0d0907; stroke: var(--border-strong); stroke-width: 2; }
.pizza .slice .base { fill: #231915; stroke: #3a2c25; stroke-width: 1.5; stroke-dasharray: 4 5; transition: fill 0.25s; }
.pizza .slice .crust { fill: none; stroke: #4a3529; stroke-width: 7; stroke-linecap: round; transition: stroke 0.25s; }
.pizza .slice .tops { opacity: 0; transform: scale(0.4); transform-box: fill-box; transform-origin: center; transition: opacity 0.2s, transform 0.25s var(--ease); }
.pizza .slice.filled .base { fill: #f2b544; stroke: #e0962e; stroke-dasharray: none; }
.pizza .slice.filled .crust { stroke: #c9822f; }
.pizza .slice.filled .tops { opacity: 1; transform: scale(1); }
.pizza .slice { transform-box: view-box; transform-origin: 100px 100px; transition: transform 0.5s var(--ease), opacity 0.5s; }
.pizza.spin { animation: spin 0.9s var(--ease) both; }
@keyframes spin { 0% { transform: rotate(0) scale(1); } 60% { transform: rotate(320deg) scale(1.08); filter: drop-shadow(0 0 22px rgba(255, 150, 60, 0.6)); } 100% { transform: rotate(360deg) scale(0.2); opacity: 0; } }
.pizza.scatter .slice { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
.pin-dots { display: flex; justify-content: center; gap: 10px; margin: 0 0 6px; }
.pin-msg { min-height: 1.7em; margin: 4px 0 14px; font-weight: 600; }
.pin-msg.bad { color: var(--danger); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; direction: ltr; }
.key {
  height: 64px; border-radius: 20px; border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #2a201b, #1e1613); font-size: 1.55rem; font-weight: 800; cursor: pointer;
  transition: transform 0.1s, border-color 0.2s, box-shadow 0.2s;
}
.key:hover { border-color: var(--faint); }
.key:active { transform: scale(0.94); box-shadow: inset 0 0 18px rgba(255, 106, 43, 0.35); }
.key.fn { font-size: 0.95rem; color: var(--muted); background: transparent; }
.key svg { width: 24px; height: 24px; }
.pin-foot { margin-top: 18px; }

/* Lock: closed oven door */
.oven-door { width: 230px; height: auto; display: block; margin: 0 auto 10px; }
.oven-door .door { fill: #1d1512; stroke: #3d2e27; stroke-width: 3; }
.oven-door .window { fill: #0b0705; stroke: #2e231e; stroke-width: 3; }
.oven-door .handle { fill: #3a2c25; }
.oven-door .coal { fill: #ff6a2b; opacity: 0.35; animation: coal 4.5s ease-in-out infinite; }
.oven-door .coal:nth-of-type(2n) { fill: #ffb547; animation-delay: 1.2s; animation-duration: 5.5s; }
.oven-door .coal:nth-of-type(3n) { animation-delay: 2.4s; animation-duration: 6.5s; }
@keyframes coal { 0%, 100% { opacity: 0.22; } 50% { opacity: 0.55; } }
.countdown { font-size: clamp(2.6rem, 11vw, 3.6rem); font-weight: 900; letter-spacing: 2px; color: var(--amber); text-shadow: 0 0 22px rgba(255, 181, 71, 0.35); margin: 6px 0 4px; direction: ltr; }

/* ---------- app shell ---------- */
.shell { max-width: 1320px; margin: 0 auto; padding: 0 20px 40px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 0 12px; }
.topbar .brand { margin: 0; justify-content: flex-start; }
.topbar .brand-mark { width: 40px; height: 40px; }
.topbar .brand-name { font-size: 1.2rem; }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 22px; width: fit-content; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; }
.tab svg { width: 19px; height: 19px; }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.tab[aria-current="page"] svg { color: var(--ember); }
.view { animation: appear 0.3s var(--ease) both; }
.view-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.view-title h1 { font-size: 1.5rem; margin: 0; }

.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h2 { margin: 0 0 4px; font-size: 1.12rem; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.open { color: var(--ok); background: rgba(127, 209, 139, 0.1); }
.pill.closed { color: var(--muted); }
.pill.emergency { color: var(--danger); background: rgba(255, 138, 122, 0.1); }
.pill.warn { color: var(--amber); background: rgba(255, 181, 71, 0.1); }

/* ---------- home ---------- */
.home-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-bottom: 20px; }
.greeting h1 { margin: 0; font-size: 1.6rem; }
.greeting p { margin: 2px 0 0; color: var(--muted); }
.kill-note { margin-top: 10px; }

/* neon "open" sign */
.neon {
  position: relative; min-width: 260px; padding: 16px 26px 14px; border-radius: 22px; cursor: pointer; text-align: center;
  background: #0c0806; border: 1px solid #2a1f1a; box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}
.neon .caption { display: block; font-size: 0.82rem; color: var(--faint); font-weight: 700; margin-bottom: 2px; }
.neon .word {
  display: block; font-size: 2rem; font-weight: 900; line-height: 1.25; color: #4a3a31;
  text-shadow: none; transition: color 0.4s, text-shadow 0.4s;
}
.neon .sub { display: block; font-size: 0.8rem; color: var(--faint); margin-top: 2px; }
.neon[aria-checked="true"] { border-color: rgba(255, 106, 43, 0.45); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.7), 0 0 34px rgba(255, 106, 43, 0.22); }
.neon[aria-checked="true"] .word {
  color: #ffe2cc;
  text-shadow: 0 0 4px #fff2e6, 0 0 12px #ff9a5a, 0 0 26px #ff6a2b, 0 0 48px #ff6a2b;
  animation: flicker 1.1s linear 1;
}
.neon[aria-checked="false"] .word { animation: dimout 0.6s ease-out 1; }
.neon[aria-busy="true"] { opacity: 0.7; cursor: progress; }
@keyframes flicker {
  0% { opacity: 0.2; } 8% { opacity: 1; } 12% { opacity: 0.3; } 20% { opacity: 1; } 24% { opacity: 0.5; }
  30%, 100% { opacity: 1; }
}
@keyframes dimout { from { color: #ffe2cc; text-shadow: 0 0 12px #ff9a5a, 0 0 26px #ff6a2b; } to { color: #4a3a31; text-shadow: none; } }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; margin-bottom: 20px; }
.map-card { padding: 0; overflow: hidden; position: relative; min-height: 340px; }
.map-card .card-head { position: absolute; top: 16px; inset-inline: 20px; z-index: 2; }
.map { width: 100%; height: 100%; display: block; min-height: 340px; }
.map .land { fill: #150f0c; }
.map .contour { fill: none; stroke: #2a1f1a; stroke-width: 1.2; }
.map .road { fill: none; stroke: #33261f; stroke-width: 3; stroke-linecap: round; }
.map .road.main { stroke: #3f2f27; stroke-width: 5; }
.map .label { fill: #5d4b41; font-size: 13px; font-weight: 700; }
.map .label.big { font-size: 30px; fill: #2c211c; font-weight: 900; letter-spacing: 6px; }
.map .pt .halo { opacity: 0.18; transition: opacity 0.6s, fill 0.6s; }
.map .pt .core { fill: #5a4a40; stroke: #120d0b; stroke-width: 3; transition: fill 0.6s; }
.map .pt .name { fill: var(--muted); font-size: 14px; font-weight: 800; }
.map .pt .ring { fill: none; stroke: var(--amber); stroke-width: 2; opacity: 0; }
.map .pt.open .halo { opacity: 0.9; animation: ember 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.map .pt.open .core { fill: #ffb06a; }
.map .pt.open .name { fill: var(--text); }
.map .pt.busy .ring { animation: ring 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.map .pt.busy .ring:nth-of-type(2) { animation-delay: 0.8s; }
.map .pt.busy .ring:nth-of-type(3) { animation-delay: 1.6s; }
@keyframes ember { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.18); opacity: 1; } }
@keyframes ring { 0% { transform: scale(0.4); opacity: 0.85; } 100% { transform: scale(2.6); opacity: 0; } }
.map-legend { position: absolute; bottom: 12px; inset-inline-start: 18px; display: flex; gap: 14px; font-size: 0.8rem; color: var(--muted); z-index: 2; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }

/* live chats rail: kitchen order tickets */
.rail { display: flex; flex-direction: column; }
.rail-list { display: grid; gap: 12px; max-height: 420px; overflow-y: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.ticket {
  --edge: #2e231e;
  position: relative; padding: 16px 16px 12px; border-radius: 6px;
  background: #f4e9dc; color: #2a1d16;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  /* torn top edge of an order ticket */
  -webkit-mask: radial-gradient(6px at 6px 0, transparent 98%, #000) -6px 0 / 12px 100% repeat-x;
  mask: radial-gradient(6px at 6px 0, transparent 98%, #000) -6px 0 / 12px 100% repeat-x;
  animation: ticketIn 0.4s var(--ease) both;
}
.ticket .t-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.95rem; border-bottom: 1.5px dashed #c9b6a3; padding-bottom: 8px; margin-bottom: 8px; }
.ticket .t-head .spacer { flex: 1; }
.ticket .t-name { font-size: 1.15rem; font-weight: 900; }
.ticket .t-phone { color: #6b5446; font-weight: 700; }
.ticket .t-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.85rem; color: #6b5446; font-weight: 700; }
.ticket .state { padding: 1px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; }
.ticket.new .state { background: #ff6a2b; color: #1a0e08; }
.ticket.in_progress .state { background: #2a1d16; color: #f4e9dc; }
.ticket.new { box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(255, 106, 43, 0.7); }
@keyframes ticketIn { from { opacity: 0; transform: translateY(-10px) rotate(-1deg); } to { opacity: 1; transform: none; } }
.rail-empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.rail-empty svg { width: 64px; height: 64px; opacity: 0.5; display: block; margin: 0 auto 8px; }

/* branch cards */
.branches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.bcard { display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.bcard::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--border-strong); }
.bcard.open::after { background: linear-gradient(180deg, var(--amber), var(--ember)); box-shadow: 0 0 18px rgba(255, 106, 43, 0.6); }
.bcard.emergency::after { background: var(--danger); }
.bcard header { display: flex; align-items: flex-start; gap: 10px; }
.bcard h3 { margin: 0; font-size: 1.2rem; }
.bcard .area { margin: 0; color: var(--muted); font-size: 0.92rem; }
.bcard header .spacer { flex: 1; }
.bstats { display: flex; gap: 18px; }
.bstat b { display: block; font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.bstat span { color: var(--muted); font-size: 0.85rem; }
.hoursbar { position: relative; height: 14px; border-radius: 999px; background: #0d0907; border: 1px solid var(--border); direction: ltr; overflow: hidden; }
.hoursbar .seg { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(255, 181, 71, 0.55), rgba(255, 106, 43, 0.75)); }
.hoursbar .now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); box-shadow: 0 0 6px #fff; }
.hours-scale { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--faint); direction: ltr; margin-top: 4px; }
.hours-caption { font-size: 0.88rem; color: var(--muted); margin-top: 2px; }
.bactions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.bactions .spacer { flex: 1; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); background: none; border: 0; cursor: pointer; padding: 0; font-weight: 700; }
.switch .track { width: 52px; height: 30px; border-radius: 999px; background: #3a2c25; position: relative; transition: background 0.25s; flex-shrink: 0; }
.switch .thumb { position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #c9b8ab; transition: inset-inline-start 0.25s var(--ease), background 0.25s; }
.switch[aria-checked="true"] .track { background: var(--ember); box-shadow: 0 0 14px rgba(255, 106, 43, 0.45); }
.switch[aria-checked="true"] .thumb { inset-inline-start: 25px; background: #fff3ea; }
.switch[aria-busy="true"] { opacity: 0.6; cursor: progress; }

/* ---------- branches (hours) page ---------- */
.hours-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 20px; }
.day-row { display: grid; grid-template-columns: 72px auto minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.day-row:last-of-type { border-bottom: 0; }
.day-row .day { font-weight: 800; }
.day-row input[type="time"] { min-height: 44px; padding: 0 8px; direction: ltr; min-width: 0; width: 100%; }
.day-row.closed input[type="time"] { opacity: 0.35; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--muted); min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ember); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.counter { font-size: 0.8rem; color: var(--faint); text-align: end; margin-top: -8px; margin-bottom: 8px; }

/* ---------- audit ---------- */
.list { display: grid; gap: 10px; }
.entry { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.entry .when { color: var(--muted); font-size: 0.85rem; min-width: 96px; }
.entry .what b { display: block; }
.entry .change { color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.entry .change del { color: var(--faint); }
.entry .change ins { text-decoration: none; color: var(--amber); }
.entry.undone { opacity: 0.6; }
.tag { font-size: 0.78rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }

/* ---------- security ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.device { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.device:last-child { border-bottom: 0; }
.device .d-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--amber); flex-shrink: 0; }
.device .d-icon svg { width: 22px; height: 22px; }
.device .d-main { flex: 1; min-width: 0; }
.device .d-main b { display: block; }
.device .d-main span { color: var(--muted); font-size: 0.86rem; }
.table-wrap { overflow-x: auto; }
table.history { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
table.history th, table.history td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--border); }
table.history th { color: var(--faint); font-weight: 700; font-size: 0.82rem; }
.ok-text { color: var(--ok); font-weight: 700; }
.bad-text { color: var(--danger); font-weight: 700; }

/* ---------- toast & dialog ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 30; max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 999px; background: #2a1f1a; border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-weight: 700; display: flex; gap: 12px; align-items: center; animation: appear 0.25s var(--ease);
}
.toast[hidden] { display: none; }
.toast.bad { border-color: rgba(255, 138, 122, 0.6); color: var(--danger); }
.toast button { background: none; border: 0; color: var(--amber); font-weight: 800; cursor: pointer; min-height: 40px; }
.dialog { border: 1px solid var(--border-strong); border-radius: 22px; background: var(--surface-2); color: var(--text); padding: 24px; width: min(420px, calc(100% - 32px)); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(8, 5, 4, 0.7); backdrop-filter: blur(2px); }
.dialog h2 { margin: 0 0 8px; font-size: 1.2rem; }
.dialog p { margin: 0 0 18px; color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .home-grid { grid-template-columns: 1fr; }
  .branches { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .shell { padding: 0 14px 100px; }
  .topbar { padding-top: 14px; }
  .topbar .who span { display: none; }
  .tabs {
    position: fixed; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; right: 10px; width: auto; z-index: 20;
    justify-content: space-around; margin: 0; box-shadow: var(--shadow); background: rgba(26, 19, 16, 0.96); backdrop-filter: blur(8px);
  }
  .tab { flex-direction: column; gap: 0; padding: 4px 6px; min-height: 52px; font-size: 0.72rem; border-radius: 16px; flex: 1; }
  .home-top { grid-template-columns: 1fr; }
  .neon { min-width: 0; width: 100%; }
  .branches { grid-template-columns: 1fr; }
  .map-card, .map { min-height: 280px; }
  .entry { grid-template-columns: 1fr auto; }
  .entry .when { grid-column: 1 / -1; }
  .day-row { grid-template-columns: 64px auto 1fr 1fr; gap: 6px; }
  .oven-card { padding: 28px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .embers { display: none; }
  .map .pt.open .halo { animation: none; }
}
