/* RestaurantOS design tokens (SRS §19.3) + shared components */
:root {
  --brand: #C2410C; --brand-hover: #9A3412; --brand-soft: #FFF1E8; --brand-ink: #fff;
  --accent: #EAB308; --leaf: #0F766E; --leaf-soft: #E6F4F1;
  --bg: #F7F8FA; --raised: #FFFFFF; --sunken: #EEF0F3; --border: #E3E6EB;
  --text: #14171C; --text-2: #5B6472; --text-3: #8A93A0;
  --ok: #15803D; --ok-soft: #E8F6EC; --warn: #B45309; --warn-soft: #FEF3E2;
  --danger: #B91C1C; --danger-soft: #FDECEC; --info: #1D4ED8; --info-soft: #EAF0FD;
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 24px;
  --sh-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --sh-2: 0 8px 24px rgba(16,24,40,.12);
  --sh-3: 0 20px 48px rgba(16,24,40,.22);
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", "Consolas", ui-monospace, monospace;
}
.dark {
  --brand: #FB923C; --brand-hover: #FDBA74; --brand-soft: #3A1A0C; --brand-ink: #1a0d05;
  --bg: #0B0D10; --raised: #14171C; --sunken: #0F1216; --border: #262B33;
  --text: #F2F4F7; --text-2: #A3ABB8; --text-3: #6B7280;
  --ok: #4ADE80; --ok-soft: #10291A; --warn: #FBBF24; --warn-soft: #2C2210;
  --danger: #F87171; --danger-soft: #2D1515; --info: #60A5FA; --info-soft: #111D33;
  --leaf: #2DD4BF; --leaf-soft: #0D2622;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .money { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
a { color: var(--brand); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--raised); color: var(--text); font-weight: 600; cursor: pointer; transition: background .12s, transform .12s, border-color .12s; user-select: none; white-space: nowrap; }
.btn:hover { background: var(--sunken); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.dark .btn.ok { color: #06210f; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.lg { min-height: 52px; font-size: 16px; padding: 0 22px; border-radius: 12px; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* inputs */
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--raised); outline: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--text-2); }
.pill.pill-wrap { white-space: normal; border-radius: 10px; padding: 6px 10px; line-height: 1.35; display: flex; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.leaf { background: var(--leaf-soft); color: var(--leaf); }

.veg { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.5px solid #15803D; border-radius: 3px; flex: none; }
.veg::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #15803D; }

.card { background: var(--raised); border: 1px solid var(--border); border-radius: var(--r-lg); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.idx { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--sunken); color: var(--text-2); }

/* toast */
#toasts { position: fixed; z-index: 9999; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: #14171C; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sh-3); display: flex; gap: 10px; align-items: center; animation: toastIn .2s ease-out; font-weight: 500; }
.toast.ok { background: #14532D; } .toast.err { background: #7F1D1D; } .toast.warn { background: #78350F; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* modal / sheet */
.overlay { position: fixed; inset: 0; background: rgba(10,12,16,.5); z-index: 1000; display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; }
.modal { background: var(--raised); border-radius: var(--r-lg); box-shadow: var(--sh-3); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; animation: pop .2s ease-out; }
.modal-h { padding: 18px 20px 6px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-h h3 { margin: 0; font-size: 18px; }
.modal-b { padding: 8px 20px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(21,128,61,.5); animation: pulse 2s infinite; display: inline-block; }
.live-dot.off { background: var(--danger); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.45); } 70% { box-shadow: 0 0 0 8px rgba(21,128,61,0); } 100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); } }

.skeleton { background: linear-gradient(90deg, var(--sunken), var(--border), var(--sunken)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 40px 16px; color: var(--text-2); }
.empty .big { font-size: 40px; }

.demo-badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 999px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
