:root {
  --bg: #0b1120;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0f766e;          /* Kivora default; each restaurant can override */
  --accent-ink: #ffffff;
  --danger: #b42318;
  --radius: 14px;
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: radial-gradient(1200px 600px at 20% -10%, #1e293b 0%, var(--bg) 60%); }
[hidden] { display: none !important; }

.screen { min-height: 100vh; }
.center { display: grid; place-items: center; padding: 24px; }
/* ---- startup splash */
.boot { display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; overflow: hidden;
  background: radial-gradient(900px 520px at 50% 42%, #12324a 0%, #0b1120 62%); transition: opacity .42s ease, transform .42s ease; }
.boot.leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash { display: grid; justify-items: center; gap: 14px; transform: translateY(-4vh); }
.splash-mark { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
.mark { width: 112px; height: 112px; overflow: visible; filter: drop-shadow(0 18px 38px rgb(20 184 166 / .35)); }
.tile { transform-origin: 256px 256px; animation: tileIn .7s cubic-bezier(.2, 1.5, .35, 1) both; }
.k { fill: none; stroke: #fff; stroke-width: 44; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.k1 { animation: draw .34s .38s cubic-bezier(.6, 0, .3, 1) forwards; }
.k2 { animation: draw .3s .64s cubic-bezier(.6, 0, .3, 1) forwards; }
.k3 { animation: draw .3s .84s cubic-bezier(.6, 0, .3, 1) forwards; }
.ripple { position: absolute; inset: 0; border-radius: 30px; border: 2px solid rgb(45 212 191 / .55); opacity: 0;
  animation: ripple 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
.r1 { animation-delay: 1.05s; } .r2 { animation-delay: 1.45s; } .r3 { animation-delay: 1.85s; }
.splash-word { display: flex; margin-top: 12px; font-size: 40px; font-weight: 700; letter-spacing: -.02em; color: #f8fafc; }
.splash-word span { display: inline-block; opacity: 0; transform: translateY(16px); animation: letter .5s cubic-bezier(.2, 1.2, .4, 1) forwards; }
.splash-word span:nth-child(1) { animation-delay: .9s; } .splash-word span:nth-child(2) { animation-delay: .95s; }
.splash-word span:nth-child(3) { animation-delay: 1s; } .splash-word span:nth-child(4) { animation-delay: 1.05s; }
.splash-word span:nth-child(5) { animation-delay: 1.1s; } .splash-word span:nth-child(6) { animation-delay: 1.15s; }
.splash-tag { margin-top: -6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6em; padding-left: .6em; color: #5eead4;
  opacity: 0; animation: tag .7s 1.25s ease-out forwards; }
.splash-bar { margin-top: 26px; width: 140px; height: 3px; border-radius: 3px; background: rgb(148 163 184 / .18); overflow: hidden; opacity: 0; animation: fadeIn .4s 1.3s forwards; }
.splash-bar i { display: block; width: 40%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, transparent, #2dd4bf, transparent); animation: sweep 1.1s ease-in-out infinite; }
@keyframes tileIn { from { transform: scale(.4) rotate(-14deg); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ripple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.3); opacity: 0; } }
@keyframes letter { to { opacity: 1; transform: none; } }
@keyframes tag { from { letter-spacing: 1em; } to { opacity: 1; letter-spacing: .42em; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(280%); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }
/* Quicker on later launches in the same session */
.boot.quick .tile, .boot.quick .k, .boot.quick .splash-word span, .boot.quick .splash-tag, .boot.quick .splash-bar { animation-duration: .01s !important; animation-delay: 0s !important; }
@media (prefers-reduced-motion: reduce) { .boot .k { stroke-dashoffset: 0; } .splash-word span, .splash-tag, .splash-bar { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.card {
  width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 32px;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / .5); display: grid; gap: 14px; animation: rise .25s ease-out;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .2px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: conic-gradient(from 200deg, #14b8a6, #0f766e, #134e4a, #14b8a6); }
h1 { font-size: 22px; margin: 6px 0 0; }
h2 { font-size: 15px; margin: 0 0 12px; }
.muted { color: var(--muted); margin: 0; line-height: 1.5; }
.small { font-size: 13px; }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
input {
  font: inherit; font-weight: 400; font-size: 15px; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; outline: none; width: 100%; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { width: auto; padding: 0; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
#serviceCode { letter-spacing: 2px; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.pw { position: relative; display: block; }
.pw input { padding-right: 64px; }
.pw .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; }
.primary {
  background: var(--accent); color: var(--accent-ink); padding: 12px 16px; font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: filter .15s, transform .05s;
}
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: translateY(1px); }
.primary[disabled] { opacity: .7; cursor: progress; }
.primary.loading span::after {
  content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: inline-block; margin-left: 10px; vertical-align: -2px; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ghost { background: transparent; color: var(--muted); padding: 6px 10px; font-size: 13px; }
.ghost:hover { background: #f1f5f9; color: var(--text); }
.error { color: var(--danger); font-size: 13px; margin: 0; }
.foot { text-align: center; }

.tenant-head { display: flex; gap: 14px; align-items: center; }
.tenant-logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--accent) center / cover no-repeat;
  color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none;
}
.tenant-logo.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
.tenant-head h1 { margin: 0; }

#workspace { background: #f8fafc; }
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: var(--muted); }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #ecfdf5; color: #047857; font-weight: 600; }
.pill.offline { background: #fff7ed; color: #c2410c; }
.pill.error { background: #fef2f2; color: var(--danger); }
.ws-body { max-width: 980px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; animation: rise .2s ease-out; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.stats > div { display: grid; gap: 2px; }
.num { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; }
.row input { max-width: 220px; }

@media (max-width: 520px) {
  .card { padding: 24px; border-radius: 16px; }
  .who { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
