/* HMSCloud Pro — design tokens
   Light by default; dark only when the person picks it (data-theme="dark" on <html>).
   Neutrals are pure greys: white is #FFFFFF. Colour comes from a Google-like set used with
   meaning: blue = primary/occupied, green = available/money in, yellow = keys/attention,
   red = check-out/danger, purple = repair, teal = reports. The one expressive element is the
   room "key rack" where each room is a key fob on a brass ring. */
:root {
  --paper: #FFFFFF;
  --surface: #FFFFFF;
  --sunk: #F8F9FA;
  --hover: #F1F3F4;
  --ink: #202124;
  --ink-2: #5F6368;
  --ink-3: #80868B;
  --line: #E8EAED;
  --line-2: #DADCE0;

  --blue: #1A73E8; --blue-2: #1765CC; --blue-soft: #E8F0FE; --on-blue: #FFFFFF;
  --red: #D93025; --red-soft: #FCE8E6;
  --yellow: #F9AB00; --amber: #B06000; --yellow-soft: #FEF7E0;
  --green: #188038; --green-soft: #E6F4EA;
  --purple: #9334E6; --purple-soft: #F3E8FD;
  --teal: #007B83; --teal-soft: #E4F7FB;
  --pink: #C5221F; --pink-soft: #FCE8E6;
  --orange: #E8710A; --orange-soft: #FEEFE3;

  --s-avail: var(--green); --s-avail-bg: var(--green-soft);
  --s-occ: var(--blue); --s-occ-bg: var(--blue-soft);
  --s-dirty: var(--amber); --s-dirty-bg: var(--yellow-soft);
  --s-maint: var(--purple); --s-maint-bg: var(--purple-soft);
  --danger: var(--red); --danger-bg: var(--red-soft);

  --rail: #FFFFFF; --rail-ink: #3C4043; --rail-dim: #80868B;
  --scrim: rgba(32, 33, 36, .45);

  --f-ui: 'Figtree', 'Google Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-display: var(--f-ui);

  --r-s: 8px; --r-m: 12px; --r-l: 16px;
  --shadow: 0 1px 2px rgba(60, 64, 67, .12), 0 1px 3px 1px rgba(60, 64, 67, .08);
  --shadow-up: 0 4px 8px 3px rgba(60, 64, 67, .15), 0 1px 3px rgba(60, 64, 67, .3);
  --rail-w: 248px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #17181A; --surface: #202124; --sunk: #28292C; --hover: #303134;
  --ink: #E8EAED; --ink-2: #BDC1C6; --ink-3: #9AA0A6; --line: #3C4043; --line-2: #5F6368;
  --blue: #8AB4F8; --blue-2: #AECBFA; --blue-soft: #233046; --on-blue: #202124;
  --red: #F28B82; --red-soft: #3D2523; --yellow: #FDD663; --amber: #FDD663; --yellow-soft: #3A3220;
  --green: #81C995; --green-soft: #1F3326; --purple: #C58AF9; --purple-soft: #33264A;
  --teal: #78D9EC; --teal-soft: #1C3439; --pink: #F28B82; --pink-soft: #3D2523; --orange: #FCAD70; --orange-soft: #3B2C1F;
  --rail: #202124; --rail-ink: #E8EAED; --rail-dim: #9AA0A6; --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 1px 3px 1px rgba(0, 0, 0, .3);
  --shadow-up: 0 4px 8px 3px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 14.5px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; margin: 0; letter-spacing: -.01em; text-wrap: balance; color: var(--ink); }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 16.5px; line-height: 1.35; font-weight: 500; }
p { margin: 0; }
a { color: var(--blue); }
small, .hint { color: var(--ink-3); font-size: 12.5px; }
.muted { color: var(--ink-2); }
.num, td.n, .tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
::selection { background: var(--blue-soft); }

/* ------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 14px/1 var(--f-ui); padding: 10px 18px; min-height: 40px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--blue); color: var(--on-blue); transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--blue-2); box-shadow: var(--shadow); }
.btn[disabled], .btn.busy { opacity: .6; cursor: progress; box-shadow: none; }
.btn.ghost { background: var(--surface); color: var(--blue); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--blue-soft); border-color: var(--line-2); box-shadow: none; }
.btn.quiet { background: transparent; color: var(--blue); padding-inline: 10px; }
.btn.quiet:hover { background: var(--blue-soft); box-shadow: none; }
.btn.danger { background: var(--surface); color: var(--red); border-color: var(--line-2); }
.btn.danger:hover { background: var(--red-soft); box-shadow: none; }
.btn.solid-danger { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.brass { background: var(--yellow); color: #202124; }
.btn.brass:hover { background: var(--yellow); filter: brightness(1.05); }
.btn.sm { min-height: 32px; padding: 6px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 50%; cursor: pointer; color: var(--ink-2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
.theme-btn .sun { color: var(--orange); }
.theme-btn .moon { color: var(--blue); }

label.f { display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); min-width: 0; }
label.f > span em { font-style: normal; color: var(--ink-3); }
.in, select.in, textarea.in {
  width: 100%; font: 400 14.5px/1.3 var(--f-ui); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 9px 12px; min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
textarea.in { min-height: 64px; resize: vertical; }
.in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.in[readonly] { background: var(--sunk); color: var(--ink-2); }
.in.mono { letter-spacing: .04em; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.stack-s { display: grid; gap: 8px; }
.spacer { flex: 1; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: 500 13px var(--f-ui); color: var(--ink-2); cursor: pointer; }
.seg button:hover { background: var(--hover); }
.seg button.on { background: var(--blue-soft); color: var(--blue); }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 500 13px var(--f-ui); cursor: pointer;
}
.chip:hover { background: var(--hover); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.on { border-color: transparent; background: var(--blue-soft); color: var(--blue); }
.chip.on span { color: var(--blue) !important; }
.chip b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.chip.on b { color: var(--blue); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill.avail, .s-Available { color: var(--s-avail); background: var(--s-avail-bg); }
.pill.occ, .s-Occupied { color: var(--s-occ); background: var(--s-occ-bg); }
.pill.dirty, .s-Dirty { color: var(--s-dirty); background: var(--s-dirty-bg); }
.pill.maint, .s-Maintenance { color: var(--s-maint); background: var(--s-maint-bg); }
.pill.warn { color: var(--amber); background: var(--yellow-soft); }
.pill.bad { color: var(--red); background: var(--red-soft); }
.pill.good { color: var(--green); background: var(--green-soft); }
.pill.info { color: var(--blue); background: var(--blue-soft); }
.pill.purple { color: var(--purple); background: var(--purple-soft); }
.pill.neutral { color: var(--ink-2); background: var(--hover); }

/* ------------------------------------------------------------ app shell */
.shell { display: flex; min-height: 100%; }
.rail {
  width: var(--rail-w); flex: none; background: var(--rail); color: var(--rail-ink); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px)) 0;
  padding-left: env(safe-area-inset-left, 0px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 20px 18px; }
.brand-mark { width: 30px; height: 36px; flex: none; }
.brand-name { font-size: 19px; line-height: 1.1; color: var(--ink); letter-spacing: -.01em; }
.brand-name b { font-weight: 600; }
.brand-sub { font-size: 12px; color: var(--rail-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.nav { display: grid; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 22px; border-radius: 0 999px 999px 0;
  color: var(--rail-ink); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav a:hover { background: var(--hover); }
.nav a.on { background: var(--blue-soft); color: var(--blue); }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav .count { margin-left: auto; font-size: 12px; color: var(--rail-dim); font-variant-numeric: tabular-nums; }
.nav a.on .count { color: var(--blue); }
.nav .badge { margin-left: auto; font-size: 11.5px; background: var(--red); color: #fff; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 14px 10px 22px; }
.ic-blue { color: var(--blue); } .ic-green { color: var(--green); } .ic-orange { color: var(--orange); } .ic-red { color: var(--red); }
.ic-purple { color: var(--purple); } .ic-teal { color: var(--teal); } .ic-grey { color: var(--ink-2); } .ic-pink { color: var(--pink); } .ic-yellow { color: var(--yellow); }
.rail-foot { margin-top: auto; display: grid; gap: 12px; padding: 14px 8px 0 20px; border-top: 1px solid var(--line); }
.rail-plan { font-size: 12.5px; color: var(--rail-dim); line-height: 1.5; }
.rail-plan a { color: var(--blue); text-decoration: none; font-weight: 500; }
.rail-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.rail-user .who { min-width: 0; }
.rail-user .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rail-user .who small { color: var(--rail-dim); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper);
  display: flex; align-items: center; gap: 10px; min-height: 64px;
  padding-block: 10px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--paper); }
.top .title { min-width: 0; }
.top .title h1 { font-size: 22px; }
.top .title .hint { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .menu-btn { display: none; }
.pf-dot { /* discreet profile switch */
  width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 1.5px solid var(--line-2); background: transparent; cursor: pointer; opacity: .55; flex: none; margin-left: 2px;
}
.pf-dot:hover { opacity: 1; }
.pf-dot.alt { background: var(--line-2); }
.view { padding-block: 24px 40px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); flex: 1; width: 100%; max-width: 1360px; }
.foot {
  padding-block: 18px calc(18px + env(safe-area-inset-bottom, 0px)); padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); display: flex; gap: 6px 18px; flex-wrap: wrap;
}
.foot b { font-weight: 600; color: var(--ink-2); }

.banner {
  margin: 16px max(28px, env(safe-area-inset-right, 0px)) 0 max(28px, env(safe-area-inset-left, 0px));
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px 10px 16px; border-radius: var(--r-m);
  background: var(--blue-soft); color: var(--ink); font-size: 14px;
}
.banner.warn { background: var(--yellow-soft); }
.banner.bad { background: var(--red-soft); }
.banner .spacer { min-width: 8px; }

/* ------------------------------------------------------------ blocks */
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 20px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { font-size: 17px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; flex-wrap: wrap; }
.section-title:first-child { margin-top: 0; }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.side { grid-template-columns: 320px minmax(0, 1fr); }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* KPI tiles: each tile has its own colour */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { --k: var(--blue); --kb: var(--blue-soft); padding: 16px 18px 18px; min-width: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); position: relative; }
.kpi .lbl { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; font-weight: 500; }
.kpi .lbl i { width: 32px; height: 32px; border-radius: 10px; background: var(--kb); color: var(--k); display: grid; place-items: center; flex: none; }
.kpi .lbl i svg { width: 18px; height: 18px; }
.kpi .val { font-size: 32px; line-height: 1.1; margin-top: 12px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.kpi .val small { font-size: 14px; color: var(--ink-3); letter-spacing: 0; }
.kpi .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.k-blue { --k: var(--blue); --kb: var(--blue-soft); } .k-green { --k: var(--green); --kb: var(--green-soft); }
.k-yellow { --k: var(--amber); --kb: var(--yellow-soft); } .k-red { --k: var(--red); --kb: var(--red-soft); }
.k-purple { --k: var(--purple); --kb: var(--purple-soft); } .k-teal { --k: var(--teal); --kb: var(--teal-soft); }
.k-orange { --k: var(--orange); --kb: var(--orange-soft); }
.kpi.click { cursor: pointer; } .kpi.click:hover { box-shadow: var(--shadow); }
.meter { height: 6px; background: var(--hover); border-radius: 6px; overflow: hidden; margin-top: 12px; display: flex; }
.meter span { display: block; height: 100%; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-2); background: var(--sunk); padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:first-child td { border-top: 0; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--sunk); }
table.t tfoot td { font-weight: 500; background: var(--sunk); border-top: 1px solid var(--line-2); }
table.t .actions { white-space: nowrap; text-align: right; }
table.t.compact td { padding: 8px 12px; }
.room-no { font-size: 18px; color: var(--blue); font-variant-numeric: tabular-nums; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); display: grid; gap: 12px; justify-items: center; }
.empty h3 { font-size: 18px; font-weight: 400; }
.empty p { max-width: 46ch; }

/* ------------------------------------------------------------ key rack */
.rack-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.rack-tools .in { max-width: 260px; min-height: 36px; padding-block: 6px; border-radius: 999px; padding-inline: 16px; }
.rack { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 8px 20px 22px; }
.floor { padding-top: 16px; }
.floor + .floor { border-top: 1px dashed var(--line-2); margin-top: 10px; }
.floor-name { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; font-weight: 500; }
.pegs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 18px 14px; }
.fob {
  --c: var(--s-avail); --bg: var(--s-avail-bg);
  position: relative; display: grid; justify-items: center; align-content: start; gap: 2px;
  min-height: 150px; padding: 34px 10px 12px; border: 1px solid transparent;
  background: var(--bg); color: var(--ink); border-radius: 46px 46px 16px 16px; cursor: pointer;
  font: inherit; text-align: center; transform-origin: 50% -14px; transition: transform .25s ease, box-shadow .2s;
}
.fob::before { content: ''; position: absolute; top: 9px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 3px var(--yellow); }
.fob:hover { transform: rotate(-2.5deg); box-shadow: var(--shadow-up); }
.fob:focus-visible { outline-offset: 3px; }
.fob .no { font-size: 32px; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: -.02em; }
.fob .type { font-size: 12px; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fob .guest { font-size: 13px; margin-top: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fob .state { margin-top: auto; padding-top: 8px; font-size: 11.5px; color: var(--c); font-weight: 600; }
.fob.s-Occupied { --c: var(--s-occ); --bg: var(--s-occ-bg); }
.fob.s-Dirty { --c: var(--s-dirty); --bg: var(--s-dirty-bg); }
.fob.s-Maintenance { --c: var(--s-maint); --bg: var(--s-maint-bg); background-image: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--s-maint) 9%, transparent) 8px 9px); }
@keyframes swing { 0% { transform: rotate(0) } 30% { transform: rotate(4deg) } 60% { transform: rotate(-2.5deg) } 85% { transform: rotate(1deg) } 100% { transform: rotate(0) } }
.rack.intro .fob { animation: swing .9s ease both; }
@media (prefers-reduced-motion: reduce) { .rack.intro .fob, .fob:hover { animation: none; transform: none; } }

/* drawer */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); z-index: 60; background: var(--surface);
  box-shadow: var(--shadow-up); transform: translateX(102%); transition: transform .25s ease; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.drawer.on { transform: none; }
.drawer-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-body { padding: 18px 22px 26px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.drawer .big-no { font-size: 40px; line-height: 1; font-weight: 500; letter-spacing: -.02em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.bill-mini { background: var(--sunk); border-radius: var(--r-m); padding: 14px 16px; display: grid; gap: 6px; font-size: 14px; }
.bill-mini .line { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.bill-mini .line.total { border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 2px; font-size: 16px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.charge-list { display: grid; gap: 2px; font-size: 13.5px; }
.charge-list .c { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.charge-list .c .d { flex: 1; min-width: 0; }
.charge-list .c .a { font-variant-numeric: tabular-nums; }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.modal { pointer-events: auto; width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-up); animation: pop .18s ease; }
.modal.wide { width: min(820px, 100%); }
.modal.doc { width: min(880px, 100%); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 22px 24px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { flex: 1; font-size: 21px; }
.modal-body { padding: 16px 24px 8px; display: grid; gap: 14px; }
.modal-foot { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal .sub-note { font-size: 13px; color: var(--ink-2); }
.doc-frame { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-m); overflow: hidden; }
.doc-frame iframe { width: 100%; height: 70vh; border: 0; display: block; background: #fff; }
.secret-box { background: var(--yellow-soft); border-radius: var(--r-m); padding: 14px 16px; display: grid; gap: 8px; }
.secret-box code { font: 600 20px var(--f-ui); letter-spacing: .06em; color: var(--ink); overflow-wrap: anywhere; }

/* toasts */
.toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: #323232; color: #fff; padding: 13px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow-up); animation: pop .2s ease; }
:root[data-theme="dark"] .toast { background: #E8EAED; color: #202124; }
.toast.bad { background: var(--red); color: #fff; }

/* restaurant */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dish { text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-m); padding: 12px 12px 10px; cursor: pointer; display: grid; gap: 6px; font: inherit; color: var(--ink); position: relative; }
.dish:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.dish .nm { font-size: 14px; line-height: 1.3; padding-right: 14px; font-weight: 500; }
.dish .pr { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13.5px; }
.dish .veg { position: absolute; top: 12px; right: 10px; width: 11px; height: 11px; border: 1.5px solid #188038; border-radius: 2px; display: grid; place-items: center; }
.dish .veg::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #188038; }
.dish .veg.nv { border-color: #C5221F; }
.dish .veg.nv::after { background: #C5221F; }
.dish.off { opacity: .45; }
.cat-name { font-size: 13px; color: var(--ink-3); margin: 16px 0 8px; font-weight: 500; }
.cat-name:first-child { margin-top: 0; }
.cart { position: sticky; top: 84px; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; }
.stepper button { border: 0; background: none; width: 28px; height: 28px; cursor: pointer; color: var(--blue); font-size: 16px; border-radius: 50%; }
.stepper button:hover { background: var(--blue-soft); }
.stepper span { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }

/* checkout */
.guest-list { display: grid; gap: 6px; }
.guest-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.guest-item:hover { background: var(--sunk); }
.guest-item.on { border-color: var(--blue); background: var(--blue-soft); }
.guest-item .rno { font-size: 22px; color: var(--blue); min-width: 44px; font-weight: 500; }
.guest-item .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lines td.desc { min-width: 180px; }
.totals { display: grid; gap: 6px; font-size: 14px; }
.totals .line { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.totals .line span:last-child { color: var(--ink); }
.totals .grand { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 4px; align-items: baseline; }
.totals .grand span:first-child { color: var(--ink); }
.totals .grand span:last-child { font-size: 30px; letter-spacing: -.02em; }
.totals .due span:last-child { color: var(--green); font-size: 17px; font-weight: 600; }
.done-card { display: grid; gap: 14px; justify-items: start; }
.done-card .inv-no { font-size: 28px; letter-spacing: -.01em; }

/* plans */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan { border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 22px; background: var(--surface); display: grid; gap: 12px; align-content: start; position: relative; }
.plan.pick { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.plan .price { font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.plan .price small { font-size: 14px; color: var(--ink-3); letter-spacing: 0; }
.plan .tag { position: absolute; top: 18px; right: 18px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.ticks li { display: flex; gap: 9px; }
.ticks li::before { content: ''; flex: none; width: 13px; height: 7px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg) translate(2px, 3px); margin-top: 3px; }
.qr { background: #fff; padding: 10px; border-radius: var(--r-m); width: max-content; border: 1px solid var(--line-2); }
.copy-row { display: flex; gap: 8px; align-items: center; background: var(--sunk); border-radius: var(--r-s); padding: 8px 10px; font-variant-numeric: tabular-nums; }
.copy-row code { flex: 1; font: 500 14px var(--f-ui); overflow-wrap: anywhere; }

/* settings */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 11px 16px; font: 500 14px var(--f-ui); color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 4px 4px 0 0; }
.tabs button:hover { background: var(--hover); }
.tabs button.on { color: var(--blue); border-color: var(--blue); }
.form-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px 28px; padding: 22px 0; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section > header h3 { margin-bottom: 4px; }
.form-section > header p { font-size: 13px; color: var(--ink-3); }
.sticky-save { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.steps li.done::before { content: '✓'; background: var(--green); color: #fff; }
.steps li.done .t { color: var(--ink-3); }

.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 220px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.split-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--hover); gap: 2px; }
.loading { padding: 60px 0; display: grid; place-items: center; color: var(--ink-3); }
.loading::before { content: ''; width: 28px; height: 28px; border: 3px solid var(--blue-soft); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; }
.list-plain li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list-plain li:first-child { border-top: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.list-plain .grow div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: 13.5px; }
.feed li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 8px 0; }
.feed li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 6px; }
.feed li.k-pay::before { background: var(--green); } .feed li.k-admin::before { background: var(--purple); } .feed li.k-warn::before { background: var(--yellow); } .feed li.k-bad::before { background: var(--red); }
.feed .when { color: var(--ink-3); font-size: 12px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .cols, .cols.side, .cols.three { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 960px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .rail { position: fixed; z-index: 80; left: 0; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-up); }
  .rail.open { transform: none; }
  .top .menu-btn { display: inline-grid; }
  .top, .view, .foot { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .banner { margin-left: max(16px, env(safe-area-inset-left, 0px)); margin-right: max(16px, env(safe-area-inset-right, 0px)); }
  .plans, .cols.even { grid-template-columns: minmax(0, 1fr); }
  .top .title h1 { font-size: 19px; }
  .top .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .val { font-size: 25px; }
  .kpi .lbl i { width: 28px; height: 28px; }
  .pegs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 10px; }
  .fob { min-height: 132px; padding-top: 30px; }
  .fob .no { font-size: 27px; }
  .rack { padding-inline: 12px; }
  .panel { padding: 16px; }
  .action-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .top .btn.sm { padding-inline: 11px; }
}

/* ------------------------------------------------------------ auth pages */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100%; }
.auth-side {
  background: var(--sunk); color: var(--ink); display: flex; flex-direction: column; gap: 28px; border-right: 1px solid var(--line);
  padding-block: calc(40px + env(safe-area-inset-top, 0px)) 32px; padding-left: max(48px, env(safe-area-inset-left, 0px)); padding-right: 48px;
  position: relative; overflow: hidden;
}
.colour-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; height: 4px; }
.colour-bar span { flex: 1; }
.auth-side h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; max-width: 15ch; margin-top: 18px; letter-spacing: -.02em; }
.auth-side .lead { color: var(--ink-2); max-width: 44ch; font-size: 15.5px; margin-top: 14px; }
.auth-side .points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: 14.5px; color: var(--ink-2); max-width: 46ch; }
.auth-side .points li { display: flex; gap: 12px; align-items: flex-start; }
.auth-side .points li i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.auth-side .points li i svg { width: 15px; height: 15px; }
.mini-rack { display: flex; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.mini-rack .fob { min-height: 112px; width: 82px; padding-top: 30px; cursor: default; }
.mini-rack .fob .no { font-size: 24px; }
.mini-rack .fob::before { background: var(--sunk); }
.auth-side .legal { font-size: 12px; color: var(--ink-3); }
.auth-main { display: grid; place-items: center; position: relative; padding-block: 40px calc(28px + env(safe-area-inset-bottom, 0px)); padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.auth-main > .theme-btn { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); }
.auth-card { width: min(420px, 100%); display: grid; gap: 22px; }
.auth-card h2 { font-size: 28px; }
.auth-card form { display: grid; gap: 14px; }
.otp { font-size: 26px; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; padding-left: .5em; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .in { padding-right: 64px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--blue); font: 500 13px var(--f-ui); cursor: pointer; padding: 6px 8px; }
.form-msg { font-size: 13.5px; padding: 10px 12px; border-radius: var(--r-s); background: var(--red-soft); color: var(--red); }
.form-msg.ok { background: var(--blue-soft); color: var(--blue); }
.auth-alt { font-size: 14px; color: var(--ink-2); text-align: center; }
.auth-foot { font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.6; }
.linkish { background: none; border: 0; padding: 0; text-align: left; color: var(--blue); font: inherit; cursor: pointer; text-decoration: none; font-weight: 500; }
.linkish:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: calc(28px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 26px max(20px, env(safe-area-inset-left, 0px)); gap: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-side h1 { font-size: 28px; margin-top: 8px; }
  .mini-rack, .auth-side .points { display: none; }
}

/* network activity */
.net-bar { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .2s; overflow: hidden; }
.net-bar.on { opacity: 1; transition-delay: .25s; }
.net-bar::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -40%; background: linear-gradient(90deg, #4285F4, #EA4335, #FBBC04, #34A853); animation: netslide 1.2s ease-in-out infinite; }
@keyframes netslide { to { left: 100%; } }
.net-note { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, -8px); z-index: 100; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-up); border-radius: 999px; padding: 8px 16px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; }
.net-note.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .net-bar::before { animation-duration: 3s; } }
