/* Merchant dashboard. Visual design from the team's Slotline CMS mock-up (green accent, Inter,
   sidebar layout), with a dark version and a phone layout added. */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #fafbfb; --ink: #111827; --ink-2: #374151; --ink-3: #6b7280; --ink-4: #9ca3af;
  --line: #e6e8eb; --line-2: #d3d7dc; --hover: #f3f4f6;
  --brand: #0e7c5b; --brand-dark: #0a5e45; --brand-soft: #e6f4ee; --brand-line: #bfe3d2; --on-brand: #ffffff;
  --good: #15803d; --good-soft: #dcfce7; --warning: #b45309; --warning-soft: #fef3c7; --critical: #b91c1c; --critical-soft: #fee2e2;
  --info: #1d4ed8; --info-soft: #dbeafe; --neutral: #4b5563; --neutral-soft: #f3f4f6;
  --attention: #fffbeb; --attention-line: #fde68a; --attention-ink: #78350f;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05); --radius: 8px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  /* the control panel's older names */
  --accent: var(--brand); --accent-ink: var(--on-brand); --unlock: var(--attention); --unlock-line: var(--attention-line);
}
/* Dark: the computer's setting, unless light was picked; or picked outright. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1214; --surface: #171b1f; --surface-2: #1c2126; --ink: #e8ecef; --ink-2: #c3cad1; --ink-3: #8f99a3; --ink-4: #6b757f;
    --line: #262c33; --line-2: #343c45; --hover: #1f252b;
    --brand: #2bb383; --brand-dark: #22936b; --brand-soft: #12302a; --brand-line: #1f5a48; --on-brand: #06140f;
    --good: #4ade80; --good-soft: #14321f; --warning: #fbbf24; --warning-soft: #3a2c0c; --critical: #f87171; --critical-soft: #3a1717;
    --info: #93b4ff; --info-soft: #172446; --neutral: #b8c0c8; --neutral-soft: #222930;
    --attention: #2b2410; --attention-line: #5b4a15; --attention-ink: #f6dfa0;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
    --bg: #0f1214; --surface: #171b1f; --surface-2: #1c2126; --ink: #e8ecef; --ink-2: #c3cad1; --ink-3: #8f99a3; --ink-4: #6b757f;
    --line: #262c33; --line-2: #343c45; --hover: #1f252b;
    --brand: #2bb383; --brand-dark: #22936b; --brand-soft: #12302a; --brand-line: #1f5a48; --on-brand: #06140f;
    --good: #4ade80; --good-soft: #14321f; --warning: #fbbf24; --warning-soft: #3a2c0c; --critical: #f87171; --critical-soft: #3a1717;
    --info: #93b4ff; --info-soft: #172446; --neutral: #b8c0c8; --neutral-soft: #222930;
    --attention: #2b2410; --attention-line: #5b4a15; --attention-ink: #f6dfa0;
    --shadow: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 13.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--ink-3); }

/* ---- sign in ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.login .brand { padding: 0; height: auto; border: 0; margin-bottom: 6px; }
.login p { margin: 0 0 4px; color: var(--ink-3); }
.login input, dialog input { border: 1px solid var(--line-2); border-radius: 7px; padding: 9px 11px; background: var(--surface); width: 100%; }

/* ---- shell ---- */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow: auto; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 56px; border-bottom: 1px solid var(--line); flex: none; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex: none; }
.brand b { font-size: 15px; font-weight: 700; display: block; line-height: 1.1; }
.brand small { font-size: 11px; color: var(--ink-3); font-weight: 500; display: block; }
#merchant-pick select { border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 4px; background: var(--surface); font-size: 11.5px;
  max-width: 150px; color: var(--ink-2); }
.nav { padding: 8px 10px; }
.nav .group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); padding: 12px 10px 5px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; position: relative; }
.nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; color: var(--ink-3); }
.nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a.on svg { color: var(--brand); }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.count { margin-left: auto; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px;
  background: var(--warning-soft); color: var(--warning); }
.count.bad { background: var(--critical-soft); color: var(--critical); }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center;
  font-weight: 700; font-size: 12px; flex: none; }
.me .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.me .who b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; }
.me-actions { display: flex; gap: 6px; margin-top: 8px; }
.me-actions .btn { flex: 1; justify-content: center; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.topbar .spacer { flex: 1; }
.menu-button { display: none; width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface);
  place-items: center; color: var(--ink-2); }
.menu-button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.mode-pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--warning-soft); color: var(--warning); white-space: nowrap; }
main { padding: 22px 28px 56px; display: flex; flex-direction: column; gap: 18px; max-width: 1460px; width: 100%; }
.scrim { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 24px rgba(0, 0, 0, .2); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 15; }
  .menu-button { display: grid; }
  .topbar { padding: 0 16px; }
  main { padding: 16px 16px 40px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---- page parts ---- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--ink-3); margin-top: 3px; font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 5px; }
.crumb a { color: var(--ink-3); }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 7px;
  padding: 7px 13px; font-weight: 600; font-size: 13px; color: var(--ink); box-shadow: var(--shadow); white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--hover); text-decoration: none; }
.btn:disabled { color: var(--ink-4); box-shadow: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn.primary:disabled { background: var(--neutral-soft); border-color: var(--line); color: var(--ink-4); }
.btn.danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-head h2, .panel-head h2 { font-size: 14.5px; }
.card-head .meta, .panel-head small { font-size: 12.5px; color: var(--ink-3); }
.card-body { padding: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0; line-height: 1.15; display: flex; align-items: center; gap: 8px; }
.kpi .value small { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.kpi .foot { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2, .grid-side { grid-template-columns: minmax(0, 1fr); } }

.attention { background: var(--attention); border: 1px solid var(--attention-line); border-radius: var(--radius); }
.attention .row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--attention-line);
  font-size: 13px; color: var(--attention-ink); flex-wrap: wrap; }
.attention .row:last-child { border-bottom: 0; }
.attention .row a { margin-left: auto; font-weight: 600; color: var(--attention-ink); }
.attention .icon { width: 24px; height: 24px; border-radius: 6px; background: var(--surface); border: 1px solid var(--attention-line);
  display: grid; place-items: center; font-weight: 700; flex: none; }

/* ---- tables ---- */
.table-wrap, .log-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
tbody td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
th.right, td.right { text-align: right; }
.panel table thead th { background: transparent; padding: 0 10px 8px 0; }
.panel table tbody td { padding: 8px 10px 8px 0; }
td.when { white-space: nowrap; color: var(--ink-3); font-variant-numeric: tabular-nums; }
td.raw { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--ink-3); }
td.what, td.state { white-space: nowrap; }
td .sub { color: var(--ink-3); font-size: 12px; }

/* ---- pills, dots, bars ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px;
  line-height: 1.5; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warning-soft); color: var(--warning); }
.pill.bad { background: var(--critical-soft); color: var(--critical); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: var(--neutral-soft); color: var(--neutral); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-4); }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warning); }
.dot.bad { background: var(--critical); }
.bar { display: inline-flex; align-items: center; gap: 8px; min-width: 130px; }
.bar .track { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.bar.low .track i { background: #f59e0b; }
.bar.critical .track i { background: #dc2626; }
.bar span { font-size: 12.5px; font-weight: 600; min-width: 34px; text-align: right; }
.thumb { width: 32px; height: 32px; border-radius: 6px; background: var(--neutral-soft); border: 1px solid var(--line); display: inline-grid;
  place-items: center; font-size: 11px; color: var(--ink-3); font-weight: 700; vertical-align: middle; margin-right: 10px; flex: none; }
.machine-icon { width: 52px; height: 52px; border-radius: 10px; background: var(--brand-soft); border: 1px solid var(--brand-line);
  display: grid; place-items: center; color: var(--brand); flex: none; }
.machine-icon svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.machine-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.machine-head h1 { font-size: 20px; }
.machine-head .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 5px; color: var(--ink-3); font-size: 13px; }

/* ---- filters, chips, tabs, forms ---- */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input, .select, .filters input, .filters select { border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 10px; background: var(--surface);
  font-size: 13px; min-height: 34px; min-width: 0; }
.filters input.search { flex: 1 1 220px; max-width: 360px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px;
  font-size: 12.5px; font-weight: 500; background: var(--surface); }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on, .tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field.full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 10px; background: var(--surface); min-height: 34px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row b { display: block; }
.toggle-row span { font-size: 12.5px; color: var(--ink-3); }
.switch { width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; border: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
.switch.on { background: var(--brand); }
.switch.on::after { left: 18px; }
.empty { padding: 32px 16px; text-align: center; color: var(--ink-3); }
.message { padding: 10px 14px; border-radius: var(--radius); background: var(--critical-soft); color: var(--ink); border: 1px solid var(--critical); }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--info-soft); color: var(--ink); border: 1px solid var(--line); font-size: 13px; }
.once { padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--warning); background: var(--warning-soft); font-size: 13px; }
.once code { font-size: 14px; user-select: all; }
.stage-why, .readonly-note { margin: -4px 0 8px; color: var(--ink-3); font-size: 13px; }
.readonly-note { margin: 0; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 13px; }
.items { display: grid; gap: 8px; }
.items .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.items input, .items select, .team select { border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 9px; background: var(--surface); min-height: 32px; }
.items input.name { flex: 1 1 200px; min-width: 0; }
.items input.price { width: 140px; }

/* ---- planogram ---- */
.planogram { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 7px; }
.cell { border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); padding: 7px 8px 6px; text-align: left; display: flex;
  flex-direction: column; gap: 2px; min-height: 76px; position: relative; min-width: 0; }
.cell:hover { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.cell.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-line); background: var(--brand-soft); }
.cell .n { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.cell .p { font-size: 11.5px; font-weight: 600; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cell .s { font-size: 11px; font-weight: 700; margin-top: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cell.low .s { color: var(--warning); }
.cell.low { background: var(--warning-soft); }
.cell.empty { background: var(--surface-2); border-style: dashed; }
.cell.empty .p { color: var(--ink-3); font-weight: 500; }
.cell.empty .s { color: var(--critical); }
.cell.off { background: var(--critical-soft); border-color: var(--critical); }
.cell .tags { position: absolute; top: 5px; right: 5px; display: flex; gap: 3px; }
.cell .tags span { font-size: 9.5px; font-weight: 700; color: var(--info); background: var(--info-soft); border-radius: 3px; padding: 0 4px; }
.cell .tags span.bad { color: var(--critical); background: var(--critical-soft); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-3); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line-2); }
.editor { position: sticky; top: 72px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper b { min-width: 64px; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .planogram { grid-template-columns: repeat(6, minmax(0, 1fr)); } .editor { position: static; } }
@media (max-width: 520px) { .planogram { grid-template-columns: repeat(4, minmax(0, 1fr)); } .form { grid-template-columns: minmax(0, 1fr); } }

/* ---- machine control (the original console's parts, restyled) ---- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.tile label { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.tile .value { font-size: 20px; font-weight: 700; margin: 4px 0 2px; display: flex; align-items: center; gap: 8px; }
.tile .note { color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lock { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 12px; }
.lock.open { background: var(--attention); border-color: var(--attention-line); }
.lock .text { flex: 1; min-width: 200px; }
.lock .text b { display: block; font-weight: 600; }
.lock .text span { color: var(--ink-3); font-size: 12.5px; }
.lock-actions { display: flex; gap: 8px; }
.slots { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 520px) { .slots { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.slot { width: 100%; min-width: 0; height: 46px; padding: 0; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; position: relative; }
.slot:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.slot:disabled { background: var(--surface-2); color: var(--ink-4); border-color: var(--line); }
.slot.running { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.slot .seen { position: absolute; top: 2px; right: 4px; font-size: 10px; font-weight: 700; line-height: 1; color: var(--good); }
.slot .seen.stuck { color: var(--critical); }
.slot .tag { position: absolute; top: 2px; left: 4px; font-size: 9px; font-weight: 700; line-height: 1; color: var(--info); }
.slot .mark { display: block; font-size: 10px; font-weight: 500; line-height: 1.1; color: var(--ink-3); }
.slot.r-good { border-color: var(--good); box-shadow: inset 0 -3px 0 var(--good); }
.slot.r-warn { border-color: var(--warning); box-shadow: inset 0 -3px 0 var(--warning); }
.slot.r-bad { border-color: var(--critical); box-shadow: inset 0 -3px 0 var(--critical); background: var(--critical-soft); }
.slots + .legend { margin-top: 10px; }
.run { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.run label { color: var(--ink-2); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.run input { border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 8px; background: var(--surface); width: 64px; }
.run input.slot-list { width: 200px; }
.run .progress { color: var(--ink-2); font-size: 13px; }
.saw { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: var(--radius); font-size: 13px; }
.saw input { flex: 1 1 160px; min-width: 0; border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 8px; background: var(--surface); }
.turns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--ink-2); font-size: 13px; }
.hint { flex-basis: 100%; color: var(--ink-3); font-size: 12px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.temp-set { display: inline-flex; gap: 6px; align-items: center; }
.temp-set input { border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 8px; background: var(--surface); width: 64px; }
.bill-log { margin: 10px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 13px; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: 170px; }
.chart-tip { position: absolute; top: 0; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12px; padding: 4px 8px;
  border-radius: 6px; white-space: nowrap; transform: translateX(-50%); }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.events li { display: flex; gap: 10px; font-size: 13px; }
.events time { color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.check { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.check-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.check-title { font-weight: 600; }
.where { font-size: 12px; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.check-how { color: var(--ink-2); font-size: 13px; }
.detected { font-size: 13px; overflow-wrap: anywhere; }
.check-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.pick { padding: 5px 12px; font-size: 13px; }
.pick.on-pass { background: var(--good); border-color: var(--good); color: #fff; }
.pick.on-fail { background: var(--critical); border-color: var(--critical); color: #fff; }
.pick.on-skip { background: var(--ink-3); border-color: var(--ink-3); color: var(--surface); }
.check-note { flex: 1; min-width: 180px; font-size: 13px; background: var(--surface); padding: 6px 8px; border: 1px solid var(--line-2);
  border-radius: 7px; resize: vertical; min-height: 32px; }

/* ---- dialogs ---- */
dialog { border: 1px solid var(--line-2); border-radius: 12px; padding: 20px; background: var(--surface); color: var(--ink);
  width: min(400px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0, 0, 0, .2); }
dialog::backdrop { background: rgba(17, 24, 39, .45); }
dialog h2 { font-size: 16px; margin-bottom: 6px; }
dialog p { margin: 0 0 16px; color: var(--ink-2); }
dialog form { display: grid; gap: 10px; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- alerts, reports, add machine ---- */
.count.warn { background: var(--warning-soft); color: var(--warning); }
.chart-wrap { position: relative; }
.sales-chart { display: block; width: 100%; height: auto; overflow: visible; }
.sales-chart .grid { stroke: var(--line); stroke-width: 1; }
.sales-chart .axis { stroke: var(--line-2); stroke-width: 1; }
.sales-chart .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.sales-chart .bar-mark { fill: var(--brand); }
.sales-chart .hit { fill: transparent; }
.sales-chart .hit.on { fill: var(--hover); fill-opacity: .6; }
.sales-tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 7px; padding: 6px 9px; font-size: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, .08); white-space: nowrap; color: var(--ink); }
.sales-tip b, .sales-tip div { color: var(--ink); }
.sales-tip .muted { color: var(--ink-3); }
pre.env { background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; margin: 12px 0; white-space: pre-wrap; word-break: break-all; user-select: all; }
ul.coming { list-style: none; margin: 0; padding: 0; }
ul.coming li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.coming li:last-child { border-bottom: 0; }

/* ---- product photos ---- */
img.thumb.photo { object-fit: contain; background: #fff; padding: 1px; vertical-align: middle; }
.photo-edit { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.photo-help { flex: 1; min-width: 220px; font-size: 13px; }
.photo-help p { margin: 0 0 8px; }
/* A small copy of a kiosk card, at the kiosk's proportions. */
.kiosk-card { width: 154px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #fff; color: #111827; flex: none; }
.kiosk-art { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800;
  color: rgba(255, 255, 255, .92); background: #4f9d86; }
.kiosk-art.photo { background: #fff; padding: 6px; }
.kiosk-art.photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kiosk-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.kiosk-body b { font-size: 12.5px; line-height: 1.25; }

/* ---- machine models ---- */
.planogram .gap, .slots .gap { min-height: 0; }
.model-spec { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); font-size: 13px; }
.model-spec .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.model-spec dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 4px; }
.model-spec dt { color: var(--ink-3); }
.model-spec dd { margin: 0; }
.model-spec p { margin: 6px 0 0; }
.field textarea.mono { font-size: 12.5px; line-height: 1.5; min-height: 140px; resize: vertical; }
.field.layout-field { align-self: start; }

/* machine banners and board settings (Kratos lessons) */
.banner { padding: 10px 14px; border-radius: var(--radius); border: 1px solid; font-size: 13px; margin: 0 0 12px; color: var(--ink); }
.banner.warn { background: var(--warning-soft); border-color: var(--warning); }
.banner.bad { background: var(--critical-soft); border-color: var(--critical); }
.board-settings { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.board-settings h3 { font-size: 13.5px; margin: 0 0 4px; }
.board-settings .mono { font-size: 12px; margin: 6px 0 10px; overflow-wrap: anywhere; }

/* idle screen media */
.media-thumb { width: 54px; height: 96px; object-fit: cover; border-radius: 6px; background: #000; display: block; }
.logo-thumb { max-height: 40px; max-width: 160px; border-radius: 4px; background: var(--neutral-soft); padding: 4px; }

/* the kiosk screenshot on the Control tab */
.kiosk-shot { margin: 12px 0 0; }
.kiosk-shot img { display: block; max-width: 100%; max-height: min(70vh, 560px); border-radius: 12px; border: 1px solid var(--line-2); background: #000; }
.kiosk-shot figcaption { margin-top: 6px; color: var(--ink-3); font-size: 13px; }

/* kiosk header and footer */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 8px 0; }
.banner-slot { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface-2); }
.banner-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.banner-head .sub { color: var(--ink-3); font-size: 13px; }
.banner-thumb { display: block; width: 100%; max-height: 120px; object-fit: contain; background: #0d1b2a; border-radius: 6px; margin-bottom: 8px; }

/* dashboard home: a wide card beside a narrow one, sales change, top products */
.grid-wide { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-wide { grid-template-columns: minmax(0, 1fr); } }
.delta { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; margin-right: 4px; }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--critical-soft); color: var(--critical); }
.top-products { list-style: none; margin: 0; padding: 4px 16px 12px; }
.top-products li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.top-products li:last-child { border-bottom: 0; }
.top-products .rank { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.top-products .what b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 6px; }
.top-products .track { display: block; height: 6px; border-radius: 3px; background: var(--neutral-soft); overflow: hidden; }
.top-products .track i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.top-products .right { text-align: right; white-space: nowrap; }

/* top bar: search, alerts bell, theme, account menu */
.search-box { position: relative; display: flex; align-items: center; gap: 8px; width: min(440px, 100%); height: 36px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); color: var(--ink-3); }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-box > svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); height: 100%; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box kbd { font: 600 11px var(--font); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; background: var(--surface); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 420px; overflow: auto; z-index: 30; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 32px rgba(17, 24, 39, .14); }
.search-results .result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
  background: none; text-align: left; cursor: pointer; }
.search-results .result.on { background: var(--hover); }
.search-results .kind { flex: none; width: 62px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.search-results .what { display: flex; flex-direction: column; min-width: 0; }
.search-results .what b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .what span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .none { padding: 12px; color: var(--ink-3); }
.icon-button { position: relative; display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid transparent;
  border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.icon-button:hover { background: var(--hover); text-decoration: none; }
.icon-button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-count { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; font-size: 10px;
  font-weight: 700; line-height: 16px; text-align: center; color: #fff; background: var(--warning); box-shadow: 0 0 0 2px var(--surface); }
.bell-count.bad { background: var(--critical); }
.user-menu { position: relative; }
.me-button { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: 9px;
  background: none; cursor: pointer; text-align: left; }
.me-button:hover, .me-button[aria-expanded="true"] { background: var(--hover); }
.me-button .who { display: flex; flex-direction: column; line-height: 1.2; }
.me-button .who b { font-size: 13px; color: var(--ink); white-space: nowrap; }
.me-button .who span { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; }
.me-button .caret { width: 14px; height: 14px; stroke: var(--ink-3); fill: none; stroke-width: 2.4; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 30; padding: 6px; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 32px rgba(17, 24, 39, .14); }
.user-menu .menu-who { padding: 8px 10px 10px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu .menu button, .user-menu .menu a { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none;
  color: var(--ink); text-align: left; cursor: pointer; font-weight: 500; }
.user-menu .menu button:hover, .user-menu .menu a:hover { background: var(--hover); text-decoration: none; }
.user-menu .menu .danger { color: var(--critical); }
.user-menu .menu .sep { height: 1px; background: var(--line); margin: 4px 0; }
@media (max-width: 900px) {
  .search-box kbd, .me-button .who, .me-button .caret { display: none; }
  .search-box { width: auto; flex: 1; }
  .topbar .spacer { display: none; }
  .topbar { gap: 8px; }
}
@media (max-width: 600px) {
  .mode-pill { max-width: 82px; overflow: hidden; text-overflow: ellipsis; }
}

/* maintenance tickets */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover); }
tr.selected td { background: var(--brand-soft); }
tr.detail-row > td { background: var(--surface-2); padding: 0; }
.issue-detail { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; padding: 16px 18px 18px; }
@media (max-width: 900px) { .issue-detail { grid-template-columns: minmax(0, 1fr); } }
.issue-text { margin: 0 0 12px; white-space: pre-wrap; }
.issue-log { list-style: none; margin: 0 0 12px; padding: 0; border-left: 2px solid var(--line-2); }
.issue-log li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 4px 0 8px 12px; }
.issue-log time { color: var(--ink-3); font-size: 12px; }
.issue-log p { margin: 2px 0 0; white-space: pre-wrap; }
.issue-note { display: flex; gap: 8px; align-items: flex-start; }
.issue-note textarea { flex: 1; min-height: 56px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); resize: vertical; }
.issue-side { display: flex; flex-direction: column; gap: 8px; }
.issue-side .row { display: flex; flex-direction: column; gap: 2px; }
.issue-side .select { width: 100%; }
.issue-side .tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* per-machine access on Users & roles */
.access-edit { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.access-edit label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.access-list { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 4px 20px; max-height: 220px; overflow: auto; }
.access-list.off { opacity: .45; }
.access-edit .tools { display: flex; gap: 6px; }

/* planogram: grid or list */
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: none; padding: 5px 14px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--line-2); }
.segmented button.on { background: var(--brand-soft); color: var(--brand); }
.card-head .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pg-thumb { display: block; width: 36px; height: 36px; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.pg-thumb.initials { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--surface-2); }
.stock-cell { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.stock-chip { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 6px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stock-chip.good { background: var(--good-soft); color: var(--good); }
.stock-chip.warn { background: var(--warning-soft); color: var(--warning); }
.stock-chip.bad { background: var(--critical-soft); color: var(--critical); }
.bad-text { color: var(--critical); }
.pg-inline { padding: 12px; max-width: 520px; }
.pg-inline .card { box-shadow: none; }
td.num { white-space: nowrap; }
.pg-sku { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.stock-cell .btn { padding: 2px 7px; min-height: 26px; }
.pg-thumb { width: 32px; height: 32px; }
.banner.info { background: var(--info-soft); border-color: var(--info); }
/* one-line install */
.install-code { display: flex; flex-direction: column; gap: 8px; }
.install-code .code-big { font-size: 26px; font-weight: 700; letter-spacing: .12em; }
.install-code pre { margin: 0; white-space: pre-wrap; word-break: break-all; }
/* order timeline */
.timeline { list-style: none; margin: 0; padding: 14px 18px 16px 30px; position: relative; }
.timeline li { position: relative; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; padding: 4px 0 10px; }
.timeline li::before { content: ""; position: absolute; left: -16px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.timeline li.command::before { background: var(--ink-4); width: 7px; height: 7px; left: -15px; }
.timeline li.odd::before { background: var(--critical); }
.timeline li::after { content: ""; position: absolute; left: -12px; top: 18px; bottom: -4px; border-left: 1px solid var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline time { color: var(--ink-3); font-size: 12px; }
/* purchase funnel */
.funnel { display: flex; flex-direction: column; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 110px; gap: 14px; align-items: center; }
.funnel-label { display: flex; flex-direction: column; }
.funnel-track { height: 22px; border-radius: 4px; background: var(--neutral-soft); overflow: hidden; }
.funnel-track i { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.funnel-row.unknown .funnel-track { background: repeating-linear-gradient(135deg, var(--neutral-soft) 0 6px, transparent 6px 12px); }
.funnel-num { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .funnel-row { grid-template-columns: minmax(0, 1fr) 80px; } .funnel-track { grid-column: 1 / -1; order: 3; } }
.drop-offs { list-style: none; margin: 0; padding: 4px 16px 12px; }
.drop-offs li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.drop-offs li:last-child { border-bottom: 0; }
.hours-chart { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; height: 160px; align-items: end; }
.hours-chart .hour { display: flex; flex-direction: column; align-items: center; height: 100%; }
.hours-chart .pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.hours-chart .pair i { width: 40%; min-height: 1px; border-radius: 3px 3px 0 0; }
.hours-chart span { font-size: 11px; color: var(--ink-3); height: 16px; }
.hours-chart .v, .legend-inline .v { background: var(--ink-4); }
.hours-chart .g, .legend-inline .g { background: var(--brand); }
.legend-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.log-more { padding: 10px 16px 14px; }
/* agent update progress */
.update-progress { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2); }
.update-progress.good { border-color: var(--good); background: var(--good-soft); }
.update-progress.bad { border-color: var(--critical); background: var(--critical-soft); }
.update-progress p { margin: 8px 0 0; }
.update-progress .btn { margin-top: 8px; }
.update-head { display: flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.update-steps { list-style: none; display: flex; gap: 6px; margin: 10px 0 0; padding: 0; flex-wrap: wrap; }
.update-steps li { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--neutral-soft); color: var(--ink-3); }
.update-steps li.now { background: var(--info-soft); color: var(--info); font-weight: 600; }
.update-steps li.done { background: var(--good-soft); color: var(--good); }
