/* ============================================================
   MySlot Web App — Complete Stylesheet
   Theme: Exact match to Android AppColors (Theme.kt)
   ============================================================ */

/* ─── CSS Variables: Dark Theme (matches Android darkAppColors) ─── */
:root {
  --bg:            #0A0E17;
  --bg2:           #121826;
  --bg3:           #1A1F35;
  --surface:       #121826;
  --surface2:      #1A1F35;
  --card:          #2A2F45;
  --card2:         #1E2435;
  --text:          #FFFFFF;
  --text2:         rgba(255,255,255,0.70);
  --text3:         rgba(255,255,255,0.50);
  --border:        #2A2F45;        /* Android: Color(0xFF2A2F45) — solid */
  --primary:       #52BD6C;        /* Android: appleGreen */
  --primary-h:     #3DA857;
  --primary-bg:    rgba(82,189,108,0.15);
  --danger:        #F44336;
  --danger-bg:     rgba(244,67,54,0.14);
  --warning:       #FF9800;
  --warning-bg:    rgba(255,152,0,0.14);
  --info:          #2196F3;
  --info-bg:       rgba(33,150,243,0.14);
  --success:       #4CAF50;
  --success-bg:    rgba(76,175,80,0.14);
  --shadow:        0 8px 32px rgba(0,0,0,0.55);
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.35);
  --r:             12px;
  --r-sm:          8px;
  --r-lg:          18px;
  --ease:          0.2s ease;
  --nav-h:         60px;
  --btm-h:         64px;
  --side-w:        232px;
  --side-w-collapsed: 72px;
  --chk-bg:        #000000;
  --chk-border:    rgba(255,255,255,0.70);
}
@media(min-width:1024px) {
  :root { --nav-h:66px; --side-w:252px; }
}

/* ─── Light Theme (matches Android lightAppColors) ─── */
[data-theme="light"] {
  --bg:            #F4F6FB;
  --bg2:           #FFFFFF;
  --bg3:           #EBEFF8;
  --surface:       #FFFFFF;
  --surface2:      #F0F3FA;
  --card:          #EEF2FA;        /* Android: Color(0xFFEEF2FA) */
  --card2:         #E8EDF8;
  --text:          #0F1628;        /* Android: Color(0xFF0F1628) */
  --text2:         #4A5068;
  --text3:         #9498B0;
  --border:        rgba(0,0,0,0.15); /* Android: black.copy(alpha=0.15) */
  --primary:       #52BD6C;
  --primary-h:     #3DA857;
  --primary-bg:    rgba(82,189,108,0.12);
  --danger:        #D32F2F;
  --danger-bg:     rgba(211,47,47,0.10);
  --warning:       #E65100;
  --warning-bg:    rgba(230,81,0,0.10);
  --info:          #1565C0;
  --info-bg:       rgba(21,101,192,0.10);
  --shadow:        0 8px 32px rgba(0,0,0,0.10);
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.07);
  --chk-bg:        #ffffff;
  --chk-border:    #4A5068;
}

/* ─── Reset ─── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: -webkit-fill-available;
}
body {
  font-family: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  transition: background var(--ease), color var(--ease);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Android backgroundGradient applied to main content */
.app-main {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 50%, var(--bg3) 100%);
}
[data-theme="light"] .app-main {
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F6FB 50%, #EBEFF8 100%);
}

a { color:var(--primary); text-decoration:none; }
a:hover { color:var(--primary-h); }
img { max-width:100%; height:auto; display:block; }
button,input,select,textarea { font-family:inherit; -webkit-appearance:none; }
input[type="checkbox"],input[type="radio"] {
  -webkit-appearance:none; appearance:none;
  width:20px; height:20px; min-width:20px;
  border:2px solid var(--chk-border); border-radius:4px;
  background:var(--chk-bg); cursor:pointer;
  position:relative; display:inline-block;
  vertical-align:middle; flex-shrink:0;
  transition:background var(--ease), border-color var(--ease);
}
input[type="checkbox"]:checked,input[type="radio"]:checked {
  background:var(--primary); border-color:var(--primary);
}
input[type="checkbox"]:checked::after {
  content:''; display:block; position:absolute;
  top:1px; left:5px; width:6px; height:10px;
  border:2px solid #fff; border-top:none; border-left:none;
  transform:rotate(45deg);
}
input[type="date"]::-webkit-calendar-picker-indicator { filter:invert(0.5); cursor:pointer; }
button { touch-action:manipulation; }

/* ─── Typography ─── */
h1 { font-size:2rem;    font-weight:800; line-height:1.2; }
h2 { font-size:1.5rem;  font-weight:700; line-height:1.3; }
h3 { font-size:1.2rem;  font-weight:600; line-height:1.4; }
h4 { font-size:1rem;    font-weight:600; }
h5 { font-size:.875rem; font-weight:600; }

.text-gradient {
  background: linear-gradient(130deg, #52BD6C 0%, #8EF5A8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text2  { color:var(--text2); }
.text3  { color:var(--text3); }
.text-primary-c { color:var(--primary) !important; }
.text-danger-c  { color:var(--danger)  !important; }
.text-sm  { font-size:.875rem; }
.text-xs  { font-size:.8rem;  }
.fw-600   { font-weight:600; }
.fw-700   { font-weight:700; }
.text-center { text-align:center; }

/* ─── Buttons ─── */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:.45rem;
  padding:.625rem 1.25rem; border-radius:var(--r-sm);
  font-size:.9rem; font-weight:600; cursor:pointer; border:none;
  transition:all var(--ease); white-space:nowrap;
  font-family:inherit; text-decoration:none; line-height:1;
  touch-action:manipulation; -webkit-tap-highlight-color:transparent;
}
.btn:disabled { opacity:.45; cursor:not-allowed; }
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover:not(:disabled)  { background:var(--primary-h); color:#fff; transform:translateY(-1px); box-shadow:0 4px 14px rgba(82,189,108,.35); }
.btn-primary:active:not(:disabled) { transform:translateY(0); }
.btn-outline { background:transparent; color:var(--primary); border:1.5px solid var(--primary); }
.btn-outline:hover:not(:disabled)  { background:var(--primary-bg); color:var(--primary); }
.btn-ghost   { background:transparent; color:var(--text2); border:1.5px solid var(--border); }
.btn-ghost:hover:not(:disabled)    { background:var(--card); color:var(--text); }
.btn-danger  { background:var(--danger); color:#fff; }
.btn-danger:hover:not(:disabled)   { filter:brightness(1.1); }
.btn-sm  { padding:.38rem .85rem; font-size:.8rem; }
.btn-lg  { padding:.875rem 1.75rem; font-size:1rem; }
.btn-block { width:100%; }
.btn-icon {
  padding:.5rem; border-radius:var(--r-sm); background:var(--card);
  color:var(--text2); border:1px solid var(--border); cursor:pointer;
  transition:all var(--ease); display:inline-flex; align-items:center;
  touch-action:manipulation;
}
.btn-icon:hover { color:var(--primary); background:var(--primary-bg); border-color:var(--primary); }

/* ─── Form Controls ─── */
.form-group { margin-bottom:.9rem; }
.form-group label { display:block; font-size:.88rem; font-weight:500; color:var(--text2); margin-bottom:.32rem; }
.form-control {
  width:100%; padding:.6rem .875rem;
  background:var(--surface); border:1.5px solid var(--border);
  border-radius:var(--r-sm); color:var(--text);
  font-size:.9rem; outline:none;
  transition:border-color var(--ease),box-shadow var(--ease);
  -webkit-appearance:none;
}
.form-control:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-bg); }
.form-control::placeholder { color:var(--text3); }
.form-control.error { border-color:var(--danger); }
.form-control[readonly] { cursor:pointer; caret-color:transparent; }
.form-control-readonly { background:var(--card2); color:var(--text2); cursor:default; }
.field-hint { font-size:.73rem; font-weight:500; color:var(--text3); text-transform:none; letter-spacing:0; }
select.form-control {
  cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239498B0' stroke-width='1.3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .8rem center; padding-right:2.2rem;
  background-color:var(--surface);
}
textarea.form-control { resize:vertical; min-height:72px; }
.input-wrap { position:relative; display:flex; align-items:center; }
.input-wrap .ico { position:absolute; left:.8rem; color:var(--text3); font-size:.875rem; pointer-events:none; }
.input-wrap .form-control { padding-left:2.35rem; }
.input-wrap .prefix { position:absolute; left:.8rem; color:var(--text2); font-size:.85rem; font-weight:600; pointer-events:none; }
.input-wrap .form-control.has-prefix { padding-left:2.7rem; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:.875rem; }
@media(max-width:500px){ .form-row { grid-template-columns:1fr; } }
.error-msg { color:var(--danger); font-size:.8rem; margin-top:.25rem; }

.form-section { margin-bottom:1.15rem; }
.form-section-title {
  font-size:.78rem; font-weight:700; color:var(--text2);
  text-transform:uppercase; letter-spacing:.04em;
  margin-bottom:.55rem; padding-left:.1rem;
}
.form-section-body {
  border:1px solid var(--border); border-radius:var(--r);
  background:var(--card2); padding:1rem 1rem .1rem;
}
.form-section-body .form-group:last-child,
.form-section-body .form-row:last-child { margin-bottom:1rem; }

/* ─── Navbar ─── */
.navbar {
  position:fixed; top:0; left:0; right:0; height:var(--nav-h);
  background:var(--surface); border-bottom:1px solid var(--border);
  display:flex; align-items:center; padding:0 1.25rem;
  z-index:500; transition:background var(--ease),border-color var(--ease);
  box-shadow:var(--shadow-sm);
}
@media(min-width:1024px){ .navbar { padding:0 2.25rem; } }
.nav-brand { display:flex; align-items:center; gap:.55rem; text-decoration:none; flex-shrink:0; }
.nav-logo  {
  width:30px; height:30px; object-fit:contain; border-radius:7px;
  background:#ffffff; padding:3px; flex-shrink:0;
}
[data-theme="light"] .nav-logo { background:transparent; padding:0; }
.nav-title { font-size:1.05rem; font-weight:700; color:var(--text); white-space:nowrap; }
.nav-title span { color:var(--primary); }
.nav-right { margin-left:auto; display:flex; align-items:center; gap:.55rem; }
.theme-btn {
  background:var(--card); border:1px solid var(--border); border-radius:var(--r-sm);
  padding:.4rem .5rem; cursor:pointer; color:var(--text2); font-size:.95rem;
  transition:all var(--ease); display:flex; align-items:center;
  touch-action:manipulation;
}
.theme-btn:hover { color:var(--primary); background:var(--primary-bg); }
.company-pill {
  background:var(--primary-bg); color:var(--primary); padding:.28rem .72rem;
  border-radius:20px; font-size:.75rem; font-weight:600;
  max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  border:1px solid rgba(82,189,108,.25);
}
.user-avatar {
  width:32px; height:32px; border-radius:50%; background:var(--primary);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:.72rem; font-weight:700; flex-shrink:0; cursor:pointer;
  touch-action:manipulation;
}

/* ─── App Shell ─── */
/* height (not min-height) + overflow:hidden makes .app-wrap the true viewport
   bound — .app-main then owns the actual page scroll (see below), instead of
   body, so a screen that wants to cap and internally scroll its own content
   (see .board) has a real, fixed-height ancestor chain to size against. */
.app-wrap { display:flex; height:100vh; overflow:hidden; padding-top:var(--nav-h); }

/* Sidebar — an icon rail by default that expands into a full labelled
   menu on hover (Hotstar-style flyout), instead of a manual toggle button
   that people didn't notice. The expand overlays the page rather than
   pushing it, so .app-main only ever reserves space for the rail width. */
.sidebar {
  width:var(--side-w-collapsed); background:var(--surface);
  border-right:1px solid var(--border);
  position:fixed; top:var(--nav-h); left:0; bottom:0;
  overflow-y:auto; overflow-x:hidden; padding:1.1rem .85rem; display:none; z-index:200;
  transition:width .2s ease, box-shadow .2s ease;
}
.sidebar:hover {
  width:var(--side-w); box-shadow:16px 0 40px rgba(0,0,0,.35);
}
@media(min-width:768px) {
  .sidebar { display:flex; flex-direction:column; }
  .app-main { margin-left:var(--side-w-collapsed); }
  .btm-nav  { display:none !important; }
}
.nav-spacer { flex:1; min-height:1rem; }
.nav-group-lbl {
  font-size:.73rem; font-weight:700; color:var(--text3);
  text-transform:uppercase; letter-spacing:.07em;
  padding:.4rem .85rem .5rem;
  white-space:nowrap; overflow:hidden;
  opacity:0; transition:opacity .15s ease;
}
.sidebar:hover .nav-group-lbl { opacity:1; }
/* Each item is its own inset, rounded button with a real margin gap on every
   side — flush edge-to-edge rows are what made hover states on one item
   visually bleed into its neighbour at some zoom levels. */
.nav-item {
  display:flex; align-items:center; gap:.7rem; padding:.5rem .6rem;
  margin-bottom:.2rem; border-radius:var(--r-sm);
  cursor:pointer; color:var(--text2); font-size:.93rem; font-weight:500;
  transition:background var(--ease),color var(--ease);
  user-select:none; touch-action:manipulation; position:relative;
}
.nav-item:hover  { background:var(--card2); color:var(--text); }
.nav-item.active { background:var(--primary-bg); color:var(--primary); font-weight:600; }
.nav-item .nav-lbl {
  flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  opacity:0; transition:opacity .15s ease;
}
.sidebar:hover .nav-item .nav-lbl { opacity:1; }
.nav-ico {
  width:30px; height:30px; border-radius:var(--r-sm); flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:.85rem; transition:background var(--ease),color var(--ease);
}
/* Content */
.app-main {
  flex:1; min-width:0; min-height:0; overflow-y:auto;
  padding:1.1rem;
  /* .btm-nav's own height is var(--btm-h) PLUS env(safe-area-inset-bottom) —
     that inset (the home-indicator strip on notched phones) was missing here,
     so the last card on any screen sat exactly behind that sliver on those
     devices. Reserve the same total the bottom nav actually occupies. */
  padding-bottom:calc(var(--btm-h) + env(safe-area-inset-bottom) + 1.25rem);
}
@media(min-width:768px){ .app-main { padding-bottom:1.25rem; } }
/* More desktop breathing room the wider the viewport gets, instead of the
   same phone-sized padding stretched across a full monitor. */
@media(min-width:1024px){ .app-main { padding:1.75rem 2.25rem 2rem; } }
@media(min-width:1440px){ .app-main { padding:2rem 3rem 2.25rem; } }

/* Bottom Nav */
.btm-nav {
  position:fixed; bottom:0; left:0; right:0; height:var(--btm-h);
  background:var(--surface); border-top:1px solid var(--border);
  display:flex; align-items:center; z-index:500;
  /* Safe area for iPhones */
  padding-bottom:env(safe-area-inset-bottom);
}
.btm-item {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:.18rem; padding:.45rem .2rem; cursor:pointer; color:var(--text3);
  font-size:.66rem; font-weight:500; transition:color var(--ease);
  border:none; background:none; font-family:inherit; touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.btm-item i    { font-size:1.2rem; }
.btm-item.active { color:var(--primary); }

/* Screens */
.screen { display:none; }
.screen.active {
  display:block; max-width:1280px; margin:0 auto;
  animation:fadeIn .2s ease;
}
/* Settings is a sequential list of rows, not a data/card gallery — a narrower
   reading column looks like a real settings page instead of a skinny list
   adrift in the middle of a 1280px slab of empty background. */
#scr-settings.active { max-width:760px; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ─── OFFLINE BANNER ─── */
.offline-banner {
  position:fixed; top:var(--nav-h); left:0; right:0;
  background:var(--warning); color:#000; z-index:499;
  padding:.45rem 1rem; font-size:.82rem; font-weight:600;
  display:flex; align-items:center; justify-content:center; gap:.5rem;
}

/* ─── NETWORK ERROR STATE ─── */
.net-error {
  text-align:center; padding:2.5rem 1rem;
}
.net-error i   { font-size:2.5rem; color:var(--danger); margin-bottom:.85rem; display:block; opacity:.7; }
.net-error h3  { font-size:1rem; color:var(--text2); margin-bottom:.4rem; }
.net-error p   { font-size:.88rem; color:var(--text3); margin-bottom:1rem; }

/* ─── LANDING PAGE ─── */
.landing-wrap { min-height:100vh; background:var(--bg); }
.landing-hero {
  min-height:100vh; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:5rem 1.25rem 3rem;
  background:radial-gradient(ellipse at 65% 15%, rgba(82,189,108,.08) 0%, transparent 60%), var(--bg);
  text-align:center;
}
.hero-logo {
  width:72px; height:72px; object-fit:contain; border-radius:16px;
  margin:0 auto 1.25rem;
  box-shadow:0 8px 30px rgba(82,189,108,.28);
  background:#fff; padding:6px;
}
[data-theme="light"] .hero-logo { background:transparent; padding:0; }
.hero-badge {
  display:inline-flex; align-items:center; gap:.4rem;
  background:var(--primary-bg); color:var(--primary);
  padding:.28rem .875rem; border-radius:20px; font-size:.78rem; font-weight:600;
  margin-bottom:.85rem; border:1px solid rgba(82,189,108,.28);
}
.hero-title   { font-size:2.4rem; font-weight:800; line-height:1.18; margin-bottom:.85rem; }
.hero-sub     { font-size:.98rem; color:var(--text2); max-width:460px; line-height:1.65; margin:0 auto 1.8rem; }
.hero-btns    { display:flex; gap:.75rem; justify-content:center; flex-wrap:wrap; margin-bottom:2.5rem; }
.hero-feats   { display:grid; grid-template-columns:repeat(3,1fr); gap:.75rem; max-width:400px; width:100%; }
.hero-feat    { background:var(--card); border:1px solid var(--border); border-radius:var(--r); padding:.875rem .6rem; text-align:center; }
.hero-feat i  { font-size:1.4rem; color:var(--primary); margin-bottom:.45rem; display:block; }
.hero-feat span { font-size:.72rem; color:var(--text2); font-weight:500; }
@media(max-width:440px){ .hero-title { font-size:1.8rem; } }

/* ─── AUTH MODAL ─── */
.overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.75);
  display:none; align-items:center; justify-content:center;
  z-index:1000; padding:1rem;
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
}
.overlay.open { display:flex; }
.modal {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-lg); padding:1.6rem;
  width:100%; max-width:400px; max-height:90vh; overflow-y:auto;
  box-shadow:0 24px 64px rgba(0,0,0,.6);
  animation:slideUp .22s ease;
}
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:none;opacity:1} }
.modal-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:1.1rem; }
.modal-hdr h3 { font-size:1.15rem; }
.close-btn {
  background:none; border:none; cursor:pointer; color:var(--text3);
  font-size:1.15rem; padding:.3rem; border-radius:var(--r-sm);
  transition:all var(--ease); touch-action:manipulation;
}
.close-btn:hover { color:var(--text); background:var(--card); }
.auth-tabs { display:flex; background:var(--card); border-radius:var(--r-sm); padding:.22rem; margin-bottom:1.1rem; gap:.2rem; }
.auth-tab {
  flex:1; padding:.48rem; text-align:center; font-size:.85rem; font-weight:600;
  cursor:pointer; border-radius:6px; color:var(--text2);
  border:none; background:none; font-family:inherit; transition:all var(--ease);
  touch-action:manipulation;
}
.auth-tab.active { background:var(--primary); color:#fff; }
.auth-pane { display:none; }
.auth-pane.active { display:block; }
.divider { display:flex; align-items:center; gap:.65rem; margin:.9rem 0; color:var(--text3); font-size:.78rem; }
.divider::before,.divider::after { content:''; flex:1; height:1px; background:var(--border); }
.google-btn {
  width:100%; background:var(--card); border:1.5px solid var(--border);
  border-radius:var(--r-sm); padding:.625rem 1rem;
  display:flex; align-items:center; justify-content:center; gap:.7rem;
  font-size:.9rem; font-weight:600; cursor:pointer; color:var(--text);
  transition:all var(--ease); font-family:inherit; touch-action:manipulation;
}
.google-btn:hover { border-color:var(--primary); background:var(--primary-bg); }

/* ─── SETUP PAGE ─── */
.setup-wrap {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:5.5rem 1rem 2rem;
  background:radial-gradient(ellipse at 50% 0%, rgba(82,189,108,.08) 0%, transparent 55%), var(--bg);
}
.del-page-wrap {
  min-height:100vh; display:flex; flex-direction:column; align-items:center;
  padding:calc(var(--nav-h) + 1.5rem) 1rem 3rem;
  background:radial-gradient(ellipse at 50% 0%, rgba(244,67,54,.06) 0%, transparent 55%), var(--bg);
}
.del-page-wrap > * { width:100%; max-width:520px; }
.del-item {
  display:flex; align-items:center; gap:.65rem;
  font-size:.87rem; color:var(--text2); padding:.3rem 0;
}
.setup-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-lg); padding:2rem; width:100%;
  max-width:460px; box-shadow:var(--shadow);
}
.setup-logo {
  width:52px; height:52px; object-fit:contain; border-radius:11px;
  margin:0 auto .9rem; background:#fff; padding:4px;
}
[data-theme="light"] .setup-logo { background:transparent; padding:0; }

/* ─── CARDS ─── */
.card {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--r); padding:1.1rem; box-shadow:var(--shadow-sm);
}
.card-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:.85rem; flex-wrap:wrap; gap:.5rem; }
.card-title { font-size:1rem; font-weight:600; display:flex; align-items:center; gap:.4rem; }

/* Stats Grid */
.stats-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:.75rem; margin-bottom:1rem; }
@media(min-width:560px){ .stats-grid { grid-template-columns:repeat(4,1fr); } }
.stat-card {
  background:var(--card); border:1px solid var(--border); box-shadow:var(--shadow-sm);
  border-radius:var(--r); padding:1.05rem; transition:all var(--ease);
}
.stat-card:hover { border-color:var(--primary); box-shadow:var(--shadow); transform:translateY(-2px); }
.stat-ico  { width:36px; height:36px; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center; margin-bottom:.55rem; font-size:1rem; }
.stat-val  { font-size:1.65rem; font-weight:800; line-height:1; }
.stat-lbl  { font-size:.8rem; color:var(--text2); margin-top:.2rem; }

/* Home hero banner — a plain date/clock row reads as a phone lock-screen
   widget; a bordered gradient card with the same content reads as a
   dashboard greeting. */
.home-hero {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.85rem;
  background:
    radial-gradient(ellipse 420px 160px at 100% 0%, var(--primary-bg), transparent 70%),
    var(--card);
  border:1px solid var(--border); border-radius:var(--r-lg);
  padding:1.3rem 1.5rem; margin-bottom:1.25rem; box-shadow:var(--shadow-sm);
}
.home-greeting {
  font-size:1rem; font-weight:700; color:var(--text); margin-bottom:.2rem;
  display:flex; align-items:center; gap:.4rem;
}

/* First-run polish: each home tile eases in on its own beat instead of
   popping in all at once — the home screen is the very first thing a
   new user sees after signing in. */
#scr-home > * { animation:homeIn .5s cubic-bezier(.16,1,.3,1) both; }
#scr-home > *:nth-child(1) { animation-delay:0s;   }
#scr-home > *:nth-child(2) { animation-delay:.07s; }
#scr-home > *:nth-child(3) { animation-delay:.14s; }
#scr-home > *:nth-child(4) { animation-delay:.21s; }
#scr-home > *:nth-child(5) { animation-delay:.28s; }
#scr-home > *:nth-child(6) { animation-delay:.35s; }
@keyframes homeIn { from{transform:translateY(16px); opacity:0} to{transform:none; opacity:1} }
@media (prefers-reduced-motion:reduce) {
  #scr-home > * { animation:none; }
}

.home-tile-hdr {
  display:flex; align-items:center; gap:.5rem; margin-bottom:.85rem;
  font-size:1rem; font-weight:700;
}
.home-tile-hdr .tile-ico {
  width:30px; height:30px; border-radius:var(--r-sm);
  display:flex; align-items:center; justify-content:center; font-size:.88rem; flex-shrink:0;
}

/* Section Header */
.sec-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem; flex-wrap:wrap; gap:.6rem; }
.sec-title { font-size:1.15rem; font-weight:700; }
.sec-sub   { font-size:.88rem; color:var(--text2); margin-top:.1rem; }
@media(min-width:1024px){
  .sec-title { font-size:1.4rem; }
  .stat-val  { font-size:1.9rem; }
}

/* Filter Bar */
.filter-bar { display:flex; gap:.55rem; margin-bottom:.9rem; flex-wrap:wrap; align-items:center; }
.filter-bar input,.filter-bar select {
  background:var(--card); border:1.5px solid var(--border);
  border-radius:var(--r-sm); color:var(--text); font-size:.82rem;
  padding:.48rem .75rem; font-family:inherit; outline:none;
  transition:border-color var(--ease); min-width:100px; flex:1; -webkit-appearance:none;
}
.filter-bar input:focus,.filter-bar select:focus { border-color:var(--primary); }
.filter-bar select {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239498B0' stroke-width='1.3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .7rem center; padding-right:2rem;
  background-color:var(--card);
}

/* List Cards */
.list-card {
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  box-shadow:var(--shadow-sm);
  padding:.875rem 1rem; margin-bottom:.6rem; cursor:pointer; transition:all var(--ease);
  touch-action:manipulation;
}
.list-card:hover  { border-color:var(--primary); box-shadow:var(--shadow); transform:translateY(-1px); }

/* A single card stretched edge-to-edge across a 1280px-wide desktop screen —
   with all its real content hugging the left and acres of empty card
   background to the right — is exactly what reads as "plain/mobile app on a
   big monitor". Reflow these list containers into a multi-column grid once
   there's room, same cards, no markup changes. */
:is(#today-list, #pending-list, #patient-list, #rep-list) {
  display:grid; grid-template-columns:1fr; gap:.6rem;
}
@media(min-width:720px) {
  /* #rep-list excluded — unlike the others, it's a grouped list where a
     full-width .date-group-hdr sits as a sibling before each date's
     .rpt-appt-card children (see renderRepList). Auto-fit columns would
     place the header into its own grid cell and float the first card into
     the next column beside it instead of below it. */
  :is(#today-list, #pending-list, #patient-list) {
    grid-template-columns:repeat(auto-fit,minmax(340px,420px));
    justify-content:center;
  }
}
:is(#today-list, #pending-list, #patient-list, #rep-list,
    #staff-available-list, #staff-unavailable-list, #staff-off-list,
    #appt-list-upcoming, #appt-list-closed, #appt-list-requested)
  :is(.list-card, .patient-card, .rpt-appt-card) {
  margin-bottom:0;
}

/* Board columns: Staff (Available / Not Available / Day Off) and Appointments
   (Upcoming / Closed / Unconfirmed) each lay their three groups side by side
   as vertical columns, every group stacking its own cards top to bottom —
   instead of one long page of stacked full-width sections. Single column on
   narrow screens since three squeezed side by side there would be unreadable. */
:is(#staff-available-list, #staff-unavailable-list, #staff-off-list,
    #appt-list-upcoming, #appt-list-closed, #appt-list-requested) {
  display:grid; grid-template-columns:1fr; gap:.6rem;
}
/* Each column's card list gets its own direct, fixed height cap — not
   inherited through a chain of flex/grid ancestors, which kept silently
   breaking. .app-main (see above) still scrolls as a fallback for the rare
   case this cap plus everything above it doesn't fit a very short window,
   but in the normal case only the list inside the cap scrolls, with its
   header staying fixed above it since the header is a separate sibling,
   never inside the scrolling box. */
.board { display:flex; flex-direction:column; gap:0; }
.board-col { position:relative; }
/* Explicit ids, not a suffix pattern — the appointment ids (appt-list-upcoming
   etc.) have "list" in the middle, not the end, so div[id$="-list"] silently
   never matched them at all while looking like it matched the staff ids. */
:is(#staff-available-list, #staff-unavailable-list, #staff-off-list,
    #appt-list-upcoming, #appt-list-closed, #appt-list-requested,
    #order-list-ongoing, #order-list-completed, #order-list-closed,
    #kot-list-placed, #kot-list-preparing, #kot-list-ready,
    #billing-queue-list) {
  max-height:min(60vh, 520px); overflow-y:auto;
  /* Top padding, not just the group-hdr's own margin-bottom below — the
     first tile's hover lift (translateY + box-shadow) needs its own room
     inside this scroll box, otherwise it reads as crowding/overlapping the
     header sitting just above (a separate sibling, outside this box). */
  padding-top:.35rem; padding-right:.6rem;
  /* Native scrollbar hidden — Safari on macOS fades it out on the OS-level
     "auto-hide scroll bars" preference regardless of any CSS override, so
     app.js draws its own .scroll-thumb instead, which never fades. */
  scrollbar-width:none;
}
:is(#staff-available-list, #staff-unavailable-list, #staff-off-list,
    #appt-list-upcoming, #appt-list-closed, #appt-list-requested,
    #order-list-ongoing, #order-list-completed, #order-list-closed,
    #kot-list-placed, #kot-list-preparing, #kot-list-ready,
    #billing-queue-list)::-webkit-scrollbar { display:none; }
.scroll-thumb {
  position:absolute; right:2px; width:5px; border-radius:3px;
  background:var(--text3); pointer-events:none; transition:background .15s;
}
.board-col:hover .scroll-thumb { background:var(--primary); }
@media(min-width:900px) {
  .board { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; align-items:start; }
  .board .group-hdr { margin-top:0; }
}
:is(#today-list, #pending-list, #patient-list, #rep-list,
    #staff-available-list, #staff-unavailable-list, #staff-off-list,
    #appt-list-upcoming, #appt-list-closed, #appt-list-requested,
    #billing-queue-list)
  :is(.empty, .net-error, .shimmer) {
  grid-column:1/-1;
}
/* Billing queue: "3 cards per row" grid, same responsive breakpoint the
   Orders/Kitchen boards already use — falls back to a single column below
   900px rather than squeezing 3 illegibly-narrow cards onto a phone screen. */
#billing-queue-list { display:flex; flex-direction:column; gap:.6rem; }
@media(min-width:900px) {
  #billing-queue-list { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; align-content:start; }
}
.list-card:active { background:var(--primary-bg); }
.list-hdr  { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:.3rem; flex-wrap:wrap; gap:.6rem; }
.list-hdr-text { flex:1; min-width:0; }
.list-name { font-weight:600; font-size:.95rem; }
.list-sub  { font-size:.85rem; color:var(--text2); word-break:break-word; }
.list-meta { display:flex; gap:.4rem; margin-top:.5rem; flex-wrap:wrap; }
.list-meta span { font-size:.8rem; color:var(--text3); display:flex; align-items:center; gap:.25rem; }

.list-sub-row {
  display:flex; align-items:center; gap:.4rem;
  font-size:.85rem; color:var(--text2); margin-top:.22rem; word-break:break-word;
}
.list-sub-row i { color:var(--primary); font-size:.78rem; width:14px; text-align:center; flex-shrink:0; }

/* Badges */
.badge { display:inline-flex; align-items:center; gap:.22rem; padding:.22rem .65rem; border-radius:20px; font-size:.76rem; font-weight:700; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; flex-shrink:0; }
.b-upcoming  { background:var(--info-bg);    color:var(--info);    }
.b-closed    { background:var(--success-bg); color:var(--success); }
.b-requested { background:var(--warning-bg); color:var(--warning); }
.b-available { background:var(--success-bg); color:var(--success); }
.b-off       { background:var(--danger-bg);  color:var(--danger);  }
.b-dayoff    { background:var(--info-bg);    color:var(--info);    }
.b-primary   { background:var(--primary-bg); color:var(--primary); }

/* ─── Staff card kebab menu ─── */
.card-menu-wrap { position:relative; }
.card-menu {
  position:absolute; top:calc(100% + 4px); right:0; min-width:190px;
  max-width:calc(100vw - 16px);
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
  box-shadow:var(--shadow); z-index:500; overflow:hidden; display:none;
}
.card-menu.open { display:block; }
/* Set in toggleCardMenu (app.js): flip to open upward when there's more
   room above the button than below. */
.card-menu.open-up { top:auto; bottom:calc(100% + 4px); }
.card-menu-item {
  display:flex; align-items:center; gap:.6rem; padding:.6rem .85rem;
  font-size:.88rem; color:var(--text); cursor:pointer; transition:background var(--ease);
  touch-action:manipulation;
}
.card-menu-item:hover { background:var(--primary-bg); }
.card-menu-item i { width:16px; text-align:center; color:var(--primary); font-size:.85rem; }
.card-menu-item.danger        { color:var(--danger); }
.card-menu-item.danger i      { color:var(--danger); }
.card-menu-item.danger:hover  { background:var(--danger-bg); }
.card-menu-divider { height:1px; background:var(--border); margin:.25rem 0; }

/* Token */
.token {
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:50%;
  background:var(--primary); color:#fff; font-size:.78rem; font-weight:700; flex-shrink:0;
}
/* Token pill — matches the Android app's "Token No. X" chip on the appointment card
   (a small tinted badge next to the patient name, not a bare circular number). */
.token-pill {
  display:inline-flex; align-items:center;
  background:var(--primary-bg); color:var(--primary);
  border:1px solid rgba(82,189,108,.3); border-radius:6px;
  padding:.2rem .5rem; font-size:.72rem; font-weight:700; white-space:nowrap;
}

/* Appointment card info grid — captioned Date/Time/Doctor/Department values,
   mirrors the Android app's AppointmentCard layout. */
.appt-info-grid {
  display:flex; flex-wrap:wrap; gap:.9rem 1.4rem;
  margin-top:.6rem; padding-top:.6rem; border-top:1px solid var(--border);
}
.appt-info-cap { font-size:.72rem; color:var(--text3); margin-bottom:.12rem; }
.appt-info-val { font-size:.85rem; color:var(--text); font-weight:600; }
.appt-notes-preview {
  font-size:.8rem; color:var(--text2); margin-top:.4rem;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

/* SMS-not-sent warning bar */
.sms-warn-bar {
  display:flex; align-items:center; justify-content:space-between; gap:.6rem; flex-wrap:wrap;
  background:rgba(255,167,38,.12); border:1px solid rgba(255,167,38,.4);
  border-radius:var(--r-sm); padding:.5rem .7rem; margin-top:.6rem;
  font-size:.8rem; color:#FFA726; font-weight:500;
}
.sms-warn-bar i { margin-right:.35rem; }
.sms-warn-bar button {
  background:transparent; border:none; color:#FFA726; font-weight:700; font-size:.8rem;
  cursor:pointer; padding:.25rem .5rem; border-radius:6px; font-family:inherit;
}
.sms-warn-bar button:hover { background:rgba(255,167,38,.15); }

/* WhatsApp share button */
.whatsapp-share-btn {
  display:flex; align-items:center; justify-content:center; gap:.5rem; width:100%;
  background:rgba(37,211,102,.12); border:1px solid rgba(37,211,102,.3);
  border-radius:var(--r-sm); padding:.55rem; margin-top:.6rem;
  color:#25D366; font-size:.85rem; font-weight:600; cursor:pointer;
  font-family:inherit; transition:background var(--ease);
}
.whatsapp-share-btn:hover { background:rgba(37,211,102,.2); }

/* Avatar */
.avatar     { width:36px; height:36px; border-radius:50%; background:var(--primary); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:.76rem; font-weight:700; text-transform:uppercase; flex-shrink:0; }
.avatar-sm  { width:28px; height:28px; font-size:.66rem; }

/* Persistent "Get Android App" shortcut (add actions live in each tab's own header button).
   Named .app-fab, not .fab — Font Awesome's brand-icon prefix class is literally "fab"
   (e.g. class="fab fa-whatsapp"), so a plain .fab here was hijacking every brand icon on
   the page into a fixed, circular, bottom-right floating button of its own. */
.app-fab {
  position:fixed; bottom:calc(var(--btm-h) + env(safe-area-inset-bottom) + .85rem); right:.9rem;
  width:52px; height:52px; border-radius:50%; background:var(--card);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; border:1px solid var(--border); box-shadow:0 4px 18px rgba(0,0,0,.22);
  transition:all var(--ease); z-index:100; touch-action:manipulation;
}
.app-fab i { font-size:1.4rem; color:var(--primary); }
.app-fab:hover  { transform:scale(1.08); border-color:var(--primary); }
.app-fab:active { transform:scale(.96); }
@media(min-width:768px){ .app-fab { bottom:.85rem; } }

/* Screen-specific action FAB (e.g. New Order on the Orders screen) — left
   side, so it never sits on top of the persistent Android-app FAB (right
   side). Placed as a child of its <section>, so the existing .screen/
   .screen.active display toggle already shows/hides it for free. */
.app-fab-secondary { left:.9rem; right:auto; background:var(--primary); border-color:var(--primary); }
.app-fab-secondary i { color:#fff; }

/* ─── COLLAPSIBLE BOARD GROUPS (Orders/Kitchen/Billing) — default collapsed,
   same on/off mechanic as .stats-collapse-body, just under a different name
   since these live inside a .board-col rather than a standalone card. ─── */
.group-hdr.collapsible { cursor:pointer; user-select:none; }
.group-hdr.collapsible:hover { filter:brightness(1.05); }
.group-chevron { color:var(--text3); font-size:.8rem; transition:transform var(--ease); }
.group-body { display:none; }
.group-body.open { display:block; }

/* Empty State */
.empty { text-align:center; padding:2.5rem 1rem; color:var(--text3); }
.empty i   { font-size:2.75rem; opacity:.4; display:block; margin-bottom:.85rem; }
.empty h3  { font-size:.95rem; color:var(--text2); margin-bottom:.4rem; }
.empty p   { font-size:.88rem; }

/* Toast */
#toast-wrap { position:fixed; top:calc(var(--nav-h) + .65rem); right:.9rem; z-index:9999; display:flex; flex-direction:column; gap:.45rem; max-width:320px; pointer-events:none; }
.toast {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
  padding:.8rem .95rem; display:flex; align-items:center; gap:.65rem;
  box-shadow:var(--shadow); font-size:.9rem; animation:toastIn .22s ease;
  pointer-events:all;
}
@keyframes toastIn { from{transform:translateX(110%);opacity:0} to{transform:none;opacity:1} }
.toast.success { border-left:3px solid var(--success); }
.toast.error   { border-left:3px solid var(--danger);  }
.toast.info    { border-left:3px solid var(--info);    }
.toast.warning { border-left:3px solid var(--warning); }

/* Loading */
#loading { position:fixed; inset:0; background:rgba(10,14,23,.85); display:none; align-items:center; justify-content:center; z-index:9990; flex-direction:column; gap:.75rem; }
#loading.show { display:flex; }
.spinner { width:38px; height:38px; border:3px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin .65s linear infinite; }
.spinner-sm { width:18px; height:18px; border-width:2px; display:inline-block; border:2px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin .65s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
.loading-text { font-size:.85rem; color:var(--text2); }

/* Shimmer skeleton */
.shimmer {
  background:linear-gradient(90deg, var(--card) 25%, var(--surface2) 50%, var(--card) 75%);
  background-size:200% 100%;
  animation:shimmer 1.5s infinite;
  border-radius:var(--r-sm);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-line { height:14px; margin-bottom:.6rem; }
.skeleton-card { height:80px; margin-bottom:.6rem; border-radius:var(--r); }

/* ─── LIVE CLOCK ─── */
.live-clock { font-size:1.65rem; font-weight:800; color:var(--text); font-variant-numeric:tabular-nums; line-height:1; }
.live-date  { font-size:.82rem; color:var(--text2); margin-bottom:.3rem; font-weight:500; }

/* ─── CHIP SELECTORS ─── */
.chip-group { display:flex; gap:.45rem; flex-wrap:wrap; }
.sel-chip {
  padding:.42rem .9rem; border-radius:20px; font-size:.85rem; font-weight:600;
  cursor:pointer; border:1.5px solid var(--border); background:var(--card);
  color:var(--text2); transition:all var(--ease); user-select:none; font-family:inherit;
  touch-action:manipulation;
}
.sel-chip:hover { border-color:var(--primary); color:var(--primary); }
.sel-chip.selected { background:var(--primary); border-color:var(--primary); color:#fff; }
.sel-chip:disabled { opacity:.4; cursor:not-allowed; pointer-events:none; }
.sel-chip.sel-upcoming.selected  { background:var(--info);    border-color:var(--info);    }
.sel-chip.sel-closed.selected    { background:var(--success); border-color:var(--success); }
.sel-chip.sel-requested.selected { background:var(--warning); border-color:var(--warning); color:#fff; }

/* Gender chip colors — match the Android app's palette exactly (Male/Female/Other). */
.sel-chip.sel-male.selected   { background:rgba(66,165,245,.15);  border-color:rgba(66,165,245,.5);  color:#42A5F5; }
.sel-chip.sel-female.selected { background:rgba(255,128,171,.15); border-color:rgba(255,128,171,.5); color:#FF80AB; }
.sel-chip.sel-other.selected  { background:rgba(156,39,176,.15);  border-color:rgba(156,39,176,.5);  color:#9C27B0; }

/* ─── SPEC CHIPS (multi-select) ─── */
.spec-wrap {
  display:flex; flex-wrap:wrap; gap:.4rem; min-height:40px; padding:.45rem;
  background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r-sm);
  cursor:pointer; transition:border-color var(--ease);
}
.spec-wrap:hover,.spec-wrap:focus-within { border-color:var(--primary); }
.spec-chip {
  display:inline-flex; align-items:center; gap:.3rem;
  background:var(--primary-bg); color:var(--primary);
  border:1px solid rgba(82,189,108,.3); border-radius:20px;
  padding:.24rem .7rem; font-size:.8rem; font-weight:600;
}
.spec-chip .rm { cursor:pointer; opacity:.7; font-size:.75rem; }
.spec-chip .rm:hover { opacity:1; }
.spec-add-hint { font-size:.85rem; color:var(--text3); align-self:center; padding:0 .25rem; }
.spec-field-wrap { position:relative; }
.spec-dropdown {
  position:absolute; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r); box-shadow:var(--shadow); z-index:3000;
  max-height:260px; overflow-y:auto; width:100%; top:calc(100% + 4px); left:0;
}
.spec-group-title { padding:.5rem .85rem .25rem; font-size:.75rem; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:.06em; }
.spec-opt { padding:.52rem .85rem; font-size:.9rem; cursor:pointer; transition:background var(--ease); display:flex; align-items:center; justify-content:space-between; touch-action:manipulation; }
.spec-opt:hover { background:var(--primary-bg); }
.spec-opt.chosen { color:var(--primary); font-weight:600; }
.spec-opt.chosen::after { content:'✓'; }
.spec-dropdown-footer {
  position:sticky; bottom:0; background:var(--surface);
  border-top:1px solid var(--border); padding:.5rem .85rem;
  display:flex; justify-content:flex-end;
}
.spec-done-btn {
  background:var(--primary); color:#fff; border:none; border-radius:var(--r-sm);
  padding:.4rem 1rem; font-size:.8rem; font-weight:700; cursor:pointer;
  font-family:inherit; touch-action:manipulation;
}
.spec-done-btn:hover { filter:brightness(1.08); }

/* ─── GROUPED SELECT ─── */
.grouped-select {
  width:100%; padding:.6rem .875rem; background:var(--surface);
  border:1.5px solid var(--border); border-radius:var(--r-sm);
  color:var(--text); font-size:.92rem; outline:none;
  transition:border-color var(--ease); font-family:inherit; cursor:pointer;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239498B0' stroke-width='1.3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .8rem center; padding-right:2.2rem;
  background-color:var(--surface);
}
.grouped-select:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-bg); }
optgroup { font-weight:700; color:var(--text2); font-style:normal; }
option   { background:var(--surface); color:var(--text); }

/* ─── CHAR COUNTER ─── */
.char-counter { font-size:.77rem; color:var(--text3); text-align:right; margin-top:.2rem; }
.char-counter.warn { color:var(--warning); }
.char-counter.over { color:var(--danger); }

/* ─── STAFF AVAILABILITY GRID ─── */
.avail-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:.65rem; margin-top:.6rem; }
@media(min-width:480px){ .avail-grid { grid-template-columns:repeat(4,1fr); } }
.avail-cell { background:var(--surface2); border:1px solid var(--border); border-radius:var(--r); padding:.8rem; text-align:center; }
.avail-num  { font-size:1.5rem; font-weight:800; margin-bottom:.2rem; }
.avail-lbl  { font-size:.77rem; color:var(--text2); font-weight:500; }

/* ─── UNCONFIRMED CARDS ─── */
.unconf-card {
  background:var(--card); border:1px solid var(--border);
  border-left:3px solid var(--warning); border-radius:var(--r);
  padding:.75rem .95rem; margin-bottom:.55rem;
  display:flex; align-items:center; gap:.75rem; flex-wrap:wrap;
}
.unconf-info { flex:1; min-width:0; }
.unconf-name { font-weight:600; font-size:.95rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* A narrow card (mobile, single-column board) leaves too little room for
   "Dr. X · 2:10 AM" to fit — wrapping mid-value ("2:10" / "AM" on separate
   lines) reads as broken. Truncate the whole line instead, never mid-word. */
.unconf-meta { font-size:.82rem; color:var(--text2); margin-top:.15rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sec-pill {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:22px; height:22px; background:var(--warning);
  color:#fff; border-radius:11px; font-size:.72rem; font-weight:700; padding:0 .45rem;
}

/* ─── INFO BOX ─── */
.info-box {
  display:flex; align-items:center; gap:.55rem;
  background:var(--info-bg); border:1px solid rgba(33,150,243,.2);
  border-radius:var(--r-sm); padding:.65rem .85rem; margin-bottom:.85rem;
  font-size:.85rem; color:var(--info); line-height:1.5;
}
.info-box i { font-size:1rem; }

/* ─── PLAY STORE BTN ─── */
.playstore-btn {
  display:inline-flex; align-items:center; gap:.45rem;
  background:var(--card); color:var(--text2); border:1px solid var(--border);
  border-radius:var(--r-sm); padding:.4rem .7rem; font-size:.78rem; font-weight:600;
  cursor:pointer; transition:all var(--ease); text-decoration:none; white-space:nowrap;
  touch-action:manipulation;
}
.playstore-btn:hover { color:var(--primary); border-color:var(--primary); background:var(--primary-bg); }
.playstore-btn i { font-size:1rem; color:#52BD6C; }

/* ─── QUICK SCROLL ACTIONS ─── */
/* padding-top matters here: overflow-x:auto makes overflow-y compute to auto as
   well (per spec, since it can't stay visible on just one axis), so without
   headroom above the row the hover lift + shadow on each item gets clipped by
   the scroll container's own top edge. */
.quick-scroll {
  display:flex; gap:.7rem; overflow-x:auto; padding:.4rem .1rem .5rem; margin:-.4rem -.1rem 1.1rem; scrollbar-width:none; -webkit-overflow-scrolling:touch;
  /* On mobile this row scrolls to reveal 2 more tiles past the fold, with no
     scrollbar to hint at that — fade the trailing edge so it reads as "more
     content this way" instead of looking like the full, complete row. */
  -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
  mask-image:linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
}
.quick-scroll::-webkit-scrollbar { display:none; }
.quick-scroll-item {
  flex-shrink:0; background:var(--card); border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  border-radius:var(--r); padding:.85rem .9rem; text-align:center;
  cursor:pointer; transition:all var(--ease); min-width:88px; touch-action:manipulation;
}
/* A handful of fixed-width tiles in a scroll row leaves a wide dead gap
   once there's more viewport than content — from tablet width up, spread
   the same tiles into a grid that fills the tile edge-to-edge instead. */
@media(min-width:640px){
  .quick-scroll {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(112px, 1fr));
    overflow-x:visible; margin:0; padding:0;
    -webkit-mask-image:none; mask-image:none;
  }
  .quick-scroll-item { min-width:0; }
}
.quick-scroll-item:hover  { border-color:var(--primary); background:var(--primary-bg); box-shadow:var(--shadow); transform:translateY(-2px); }
.quick-scroll-item:active { transform:translateY(0); }
.quick-scroll-item i   { font-size:1.35rem; color:var(--primary); margin-bottom:.4rem; display:block; }
.quick-scroll-item span { font-size:.72rem; color:var(--text2); font-weight:500; }

/* ─── APPOINTMENT DETAIL ─── */
.detail-modal  { max-width:540px; }
.detail-row    { display:flex; gap:1rem; padding:.6rem 0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.detail-row:last-child { border-bottom:none; }
.detail-label  { font-size:.85rem; color:var(--text3); min-width:110px; padding-top:.05rem; }
.detail-value  { font-size:.92rem; font-weight:500; flex:1; }
.status-actions { display:flex; gap:.45rem; flex-wrap:wrap; margin-top:.85rem; }

/* ─── SETTINGS ─── */
.settings-profile-card {
  display:flex; align-items:center; gap:.9rem;
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  box-shadow:var(--shadow-sm); padding:1rem 1.1rem; margin-bottom:.9rem;
}
.settings-profile-avatar {
  width:52px; height:52px; border-radius:50%; background:var(--primary); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:1.1rem; font-weight:700;
  text-transform:uppercase; flex-shrink:0;
}
.settings-profile-info  { min-width:0; }
.settings-profile-name  { font-size:1.05rem; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.settings-profile-email { font-size:.82rem; color:var(--text3); margin-top:.15rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.settings-sec { background:var(--card); border:1px solid var(--border); border-radius:var(--r); box-shadow:var(--shadow-sm); margin-bottom:1.1rem; overflow:hidden; }
.settings-sec-title {
  display:flex; align-items:center; gap:.5rem;
  padding:.65rem 1rem; font-size:.78rem; font-weight:600; color:var(--text3); text-transform:uppercase; letter-spacing:.06em;
  border-bottom:1px solid var(--border); border-left:3px solid var(--primary); background:var(--surface2);
}
.settings-sec-title i { font-size:.75rem; width:14px; text-align:center; }
.s-item { display:flex; align-items:center; justify-content:space-between; padding:.8rem 1rem; border-bottom:1px solid var(--border); cursor:pointer; transition:background var(--ease); touch-action:manipulation; }
.s-item:last-child { border-bottom:none; }
.s-item:hover  { background:var(--primary-bg); }
.s-item:active { background:var(--primary-bg); }
/* Rows with no click action of their own — plain info display, or a row whose
   only control is an inner toggle switch — shouldn't look clickable. */
.s-item-static { cursor:default; }
.s-item-static:hover, .s-item-static:active { background:transparent; }

/* Danger Zone — Disable/Delete Account are irreversible-or-near-irreversible,
   so they get their own visually separated section (red border + tinted
   header + explicit warning line), distinct from routine actions like Sign
   Out which shouldn't share that same alarming red treatment. */
.settings-sec-danger { border-color:var(--danger); }
.settings-sec-title-danger {
  color:var(--danger); background:var(--danger-bg);
  border-left-color:var(--danger); border-bottom-color:var(--danger);
}
.danger-zone-note {
  display:flex; align-items:flex-start; gap:.5rem;
  padding:.6rem 1rem; font-size:.8rem; color:var(--text2); line-height:1.5;
  background:var(--danger-bg); border-bottom:1px solid var(--border);
}
.danger-zone-note i { color:var(--danger); margin-top:.15rem; flex-shrink:0; }
.s-left  { display:flex; align-items:center; gap:.7rem; }
.s-ico   { width:34px; height:34px; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center; font-size:.9rem; flex-shrink:0; }
.s-lbl   { font-size:.95rem; font-weight:500; }
.s-desc  { font-size:.8rem; color:var(--text3); margin-top:.08rem; }

/* Toggle */
.toggle-wrap { position:relative; width:44px; height:24px; flex-shrink:0; }
.toggle-wrap input { opacity:0; width:0; height:0; position:absolute; }
.tog-track { position:absolute; inset:0; background:var(--border); border-radius:24px; transition:background var(--ease); cursor:pointer; }
.toggle-wrap input:checked ~ .tog-track { background:var(--primary); }
.tog-thumb { position:absolute; top:3px; left:3px; width:18px; height:18px; background:#fff; border-radius:50%; transition:transform var(--ease); pointer-events:none; }
.toggle-wrap input:checked ~ .tog-track .tog-thumb { transform:translateX(20px); }

/* ─── REPORTS ─── */
.report-row { display:flex; align-items:center; justify-content:space-between; padding:.65rem 0; border-bottom:1px solid var(--border); }
.report-row:last-child { border-bottom:none; }
.report-lbl { display:flex; align-items:center; gap:.55rem; font-size:.92rem; color:var(--text2); }
.report-val { font-weight:700; font-size:1rem; }
.bar-wrap { height:7px; background:var(--surface2); border-radius:4px; overflow:hidden; margin-top:.3rem; }
.bar-fill { height:100%; background:var(--primary); border-radius:4px; transition:width .7s ease; }

/* ─── TERMS ─── */
.terms-wrap { max-width:700px; margin:0 auto; padding:1.2rem; padding-top:calc(var(--nav-h) + 1.5rem); }
.terms-sec   { margin-bottom:1.6rem; }
.terms-sec h3 { margin-bottom:.55rem; }
.terms-sec p,.terms-sec li { font-size:.88rem; color:var(--text2); line-height:1.72; margin-bottom:.45rem; }
.terms-sec ul  { padding-left:1.2rem; }

/* ─── UTILITY ─── */
.hidden { display:none !important; }
.flex   { display:flex; }
.items-center { align-items:center; }
.gap-1  { gap:.5rem; }
.gap-2  { gap:.85rem; }
.mb-1   { margin-bottom:.5rem; }
.mb-2   { margin-bottom:.9rem; }
.mb-3   { margin-bottom:1.25rem; }
.mt-1   { margin-top:.5rem; }
.mt-2   { margin-top:.9rem; }
.w-full { width:100%; }

/* Scrollbar */
::-webkit-scrollbar { width:4px; height:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

/* ─── MOBILE SPECIFIC ─── */
@media(max-width:767px) {
  .company-pill { max-width:100px; font-size:.7rem; }
  .nav-title { font-size:.95rem; }
  /* Longhand sides only — the shorthand `padding` used here used to also
     reset padding-bottom to .875rem, wiping out the clearance the base rule
     reserves for .btm-nav + its safe-area inset. That's the actual cause of
     cards sitting behind the bottom bar on phones specifically (this query
     only fires at phone widths). */
  .app-main { padding-top:.875rem; padding-left:.875rem; padding-right:.875rem; }
  .stats-grid { gap:.6rem; }
  .stat-val { font-size:1.4rem; }

  /* Slightly denser cards on phones — same info, less scroll per screen. */
  .list-card, .kot-card { padding:.7rem .85rem; margin-bottom:.5rem; }
  .list-name { font-size:.88rem; }
  .list-meta span, .kot-elapsed, .kot-table { font-size:.74rem; }
  .list-sub { font-size:.78rem; }
  .group-hdr { padding:.45rem .75rem; margin-bottom:.55rem; margin-top:.55rem; }
  .group-hdr-title { font-size:.78rem; }
}

@media(max-width:380px) {
  .hero-title { font-size:1.6rem; }
  .hero-feats { grid-template-columns:repeat(2,1fr); }
}

/* Prevent text selection on interactive elements */
.nav-item,.btm-item,.sel-chip,.quick-scroll-item,.list-card,.s-item { -webkit-user-select:none; user-select:none; }

/* ─── TAB BAR ─── */
.tab-bar { display:flex; background:var(--card); border-radius:var(--r-sm); padding:.22rem; gap:.22rem; margin-bottom:1rem; overflow-x:auto; scrollbar-width:none; }
.tab-bar::-webkit-scrollbar { display:none; }
.tab-btn {
  /* min-width:0 (not fit-content) so all tabs stay truly equal-width even
     when one label is longer than the others — with fit-content, that tab
     clamps to its own content width and the shorter ones get squeezed to
     share whatever's left instead of an equal share. */
  flex:1; min-width:0; padding:.48rem .6rem; text-align:center;
  font-size:.86rem; font-weight:600; cursor:pointer; border-radius:6px;
  color:var(--text2); border:none; background:none; font-family:inherit;
  transition:all var(--ease); white-space:nowrap; touch-action:manipulation;
  display:flex; align-items:center; justify-content:center; gap:.35rem;
}
.tab-btn.active { background:var(--primary); color:#fff; }
.tab-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; padding:0 .35rem;
  background:rgba(255,255,255,.25); color:inherit; border-radius:9px;
  font-size:.68rem; font-weight:700;
}
.tab-btn:not(.active) .tab-badge { background:var(--surface2); }
.tab-btn.tab-closed.active    { background:var(--info);    }
.tab-btn.tab-requested.active { background:var(--warning); }
.tab-btn.tab-unavail.active   { background:var(--danger);  }
.tab-btn.tab-dayoff.active    { background:var(--info);    }

/* ─── SEARCH + SORT BAR ─── */
.search-bar {
  display:flex; gap:.55rem; align-items:center; margin-bottom:.75rem; flex-wrap:wrap;
}
.search-input {
  flex:1; min-width:160px; width:100%; background:var(--card); border:1.5px solid var(--border);
  border-radius:var(--r-sm); color:var(--text); font-size:.92rem;
  padding:.65rem .85rem .65rem 2.3rem; font-family:inherit; outline:none;
  transition:border-color var(--ease); -webkit-appearance:none; text-overflow:ellipsis;
}
.search-input:focus { border-color:var(--primary); }
.search-input::placeholder { color:var(--text3); }
/* flex-basis:100% forces the search box onto its own full-width row, pushing the sort
   buttons to wrap below it — otherwise they'd fight it for space and clip the placeholder. */
.search-wrap { position:relative; flex:1 1 100%; min-width:160px; }
.search-ico { position:absolute; left:.75rem; top:50%; transform:translateY(-50%); color:var(--text3); font-size:.85rem; pointer-events:none; line-height:1; }
/* Sort + order-direction controls wrap onto their own line below the full-width search box —
   anchoring them to the right keeps them reading as this row's actions, not stray left-over buttons. */
.search-bar .sort-btn:first-of-type { margin-left:auto; }
.sort-btn {
  display:flex; align-items:center; gap:.35rem; padding:.52rem .8rem;
  background:var(--card); border:1.5px solid var(--border); border-radius:var(--r-sm);
  color:var(--text2); font-size:.84rem; font-weight:600; cursor:pointer;
  transition:all var(--ease); white-space:nowrap; font-family:inherit; touch-action:manipulation;
}
.sort-btn:hover,.sort-btn.active { border-color:var(--primary); color:var(--primary); background:var(--primary-bg); }

/* ─── DATE RANGE ROW ─── */
.date-range-row {
  display:flex; gap:.5rem; align-items:center; margin-bottom:.75rem;
  flex-wrap:wrap; background:var(--card); border:1px solid var(--border);
  border-radius:var(--r); padding:.55rem .8rem;
}
.date-range-row label { font-size:.8rem; color:var(--text2); font-weight:600; white-space:nowrap; }
.date-range-row input[type=date] {
  background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r-sm);
  color:var(--text); font-size:.92rem; font-weight:600; padding:.42rem .6rem; font-family:inherit;
  outline:none; transition:border-color var(--ease); -webkit-appearance:none; flex:1; min-width:130px;
}
.date-range-row input[type=date]:focus { border-color:var(--primary); }
.date-range-row .dr-sep { color:var(--text2); font-size:.85rem; font-weight:600; }
.date-range-row input[type=date][readonly] { cursor:pointer; caret-color:transparent; }
/* Today/All presets read as actions distinct from the From/To fields — anchoring them to
   the row's right edge (instead of trailing straight after "To") makes that separation clear. */
.date-range-row .sort-btn:first-of-type { margin-left:auto; }

/* ─── CUSTOM DATE PICKER POPOVER ─── */
.dp-popover {
  position:absolute; z-index:3000; width:300px; max-width:calc(100vw - 16px);
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  box-shadow:var(--shadow); padding:.9rem; font-family:inherit;
  animation:dpFadeIn .12s ease;
}
@keyframes dpFadeIn { from{opacity:0; transform:translateY(-4px);} to{opacity:1; transform:translateY(0);} }
.dp-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:.75rem; }
.dp-title { font-size:1rem; font-weight:700; color:var(--text); }
.dp-nav {
  width:34px; height:34px; border-radius:50%; border:none; background:var(--card2);
  color:var(--text2); cursor:pointer; display:flex; align-items:center; justify-content:center;
  font-size:.85rem; transition:all var(--ease);
}
.dp-nav:hover { background:var(--primary-bg); color:var(--primary); }
.dp-weekdays { display:grid; grid-template-columns:repeat(7,1fr); margin-bottom:.3rem; }
.dp-weekdays span { text-align:center; font-size:.78rem; font-weight:700; color:var(--text3); }
.dp-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:.2rem; }
.dp-cell { aspect-ratio:1; display:flex; align-items:center; justify-content:center; }
.dp-day {
  width:100%; height:100%; border:none; background:transparent; border-radius:50%; color:var(--text);
  font-size:.92rem; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:all var(--ease);
}
.dp-day:hover:not(:disabled) { background:var(--primary-bg); color:var(--primary); }
.dp-day:disabled { color:var(--text3); opacity:.35; cursor:not-allowed; }
.dp-day.dp-today { border:1.5px solid var(--primary); }
.dp-day.dp-selected { background:var(--primary); color:#fff; }
.dp-footer { display:flex; justify-content:flex-end; margin-top:.65rem; padding-top:.6rem; border-top:1px solid var(--border); }
.dp-today-btn { border:none; background:transparent; color:var(--primary); font-weight:700; font-size:.85rem; cursor:pointer; padding:.3rem .5rem; }
.dp-today-btn:hover { text-decoration:underline; }

/* ─── CUSTOM TIME PICKER POPOVER ─── */
.tp-popover {
  position:absolute; z-index:3000; width:260px; max-width:calc(100vw - 16px);
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  box-shadow:var(--shadow); padding:.9rem; font-family:inherit;
  animation:dpFadeIn .12s ease;
}
.tp-hdr { margin-bottom:.6rem; }
.tp-title { font-size:1rem; font-weight:700; color:var(--text); }
.tp-cols { display:flex; gap:.5rem; }
.tp-col {
  flex:1; display:flex; flex-direction:column; gap:.25rem;
  max-height:180px; overflow-y:auto; scroll-behavior:smooth;
}
.tp-ampm-col { max-height:none; justify-content:center; }
.tp-item {
  border:none; background:var(--card2); border-radius:var(--r-sm); color:var(--text);
  font-size:.92rem; font-weight:600; cursor:pointer; padding:.55rem 0; text-align:center;
  transition:all var(--ease); flex-shrink:0;
}
.tp-item:hover { background:var(--primary-bg); color:var(--primary); }
.tp-item.tp-selected { background:var(--primary); color:#fff; }
.tp-footer { display:flex; justify-content:space-between; align-items:center; margin-top:.75rem; padding-top:.6rem; border-top:1px solid var(--border); }
.tp-now-btn { border:none; background:transparent; color:var(--text2); font-weight:600; font-size:.82rem; cursor:pointer; padding:.3rem .5rem; }
.tp-now-btn:hover { color:var(--primary); }
.tp-set-btn { border:none; background:var(--primary); color:#fff; font-weight:700; font-size:.85rem; cursor:pointer; padding:.45rem 1rem; border-radius:var(--r-sm); }
.tp-set-btn:hover { background:var(--primary-h); }

/* ─── GROUP HEADER ─── */
.group-hdr {
  display:flex; align-items:center; justify-content:space-between;
  padding:.55rem .875rem; margin-bottom:.75rem; margin-top:.75rem;
  background:var(--surface2); border-radius:var(--r-sm);
  border-left:3px solid var(--primary);
}
.group-hdr:first-child { margin-top:0; }
.group-hdr-title { font-size:.86rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.group-count { font-size:.72rem; font-weight:700; padding:.15rem .55rem; border-radius:12px; }

/* ─── DATE GROUP (reports) ─── */
.date-group-hdr {
  font-size:.82rem; font-weight:700; color:var(--text3); text-transform:uppercase;
  letter-spacing:.06em; padding:.4rem 0; margin-top:.75rem; margin-bottom:.35rem;
  border-bottom:1px solid var(--border); display:flex; align-items:center; gap:.5rem;
}
.date-group-hdr:first-child { margin-top:0; }
.date-group-count { background:var(--card); padding:.15rem .55rem; border-radius:12px; font-size:.7rem; }

/* ─── STATS PILLS ROW ─── */
.stats-pills { display:flex; gap:.45rem; flex-wrap:wrap; margin-bottom:.75rem; }
.stat-pill {
  display:inline-flex; align-items:center; gap:.3rem;
  padding:.3rem .78rem; border-radius:20px; font-size:.82rem; font-weight:600;
  border:1px solid transparent; cursor:default;
}

/* ─── COLLAPSIBLE STATS ─── */
.stats-collapse {
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  margin-bottom:.875rem; overflow:hidden;
}
.stats-collapse-hdr {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap;
  padding:.75rem 1rem; cursor:pointer; gap:.5rem; touch-action:manipulation;
}
.stats-collapse-hdr:hover { background:var(--primary-bg); }
.stats-collapse-body { padding:.5rem 1rem .875rem; display:none; }
.stats-collapse-body.open { display:block; }
.stats-mini-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:.65rem; }
@media(min-width:480px){ .stats-mini-grid { grid-template-columns:repeat(3,1fr); } }
.stats-mini-card { background:var(--surface2); border:1px solid var(--border); border-radius:var(--r-sm); padding:.75rem; text-align:center; }
.stats-mini-val { font-size:1.5rem; font-weight:800; }
.stats-mini-lbl { font-size:.78rem; color:var(--text2); margin-top:.18rem; }

/* ─── PATIENT GROUP CARD ─── */
.patient-card {
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  box-shadow:var(--shadow-sm);
  padding:.875rem 1rem; margin-bottom:.55rem; cursor:pointer; transition:all var(--ease);
  touch-action:manipulation;
}
.patient-card:hover { border-color:var(--primary); box-shadow:var(--shadow); transform:translateY(-1px); }
.patient-card:active { background:var(--primary-bg); }
.revisit-badge { background:var(--warning-bg); color:var(--warning); border:1px solid rgba(255,152,0,.25); }
.first-badge   { background:var(--info-bg);    color:var(--info);    border:1px solid rgba(33,150,243,.25); }
.visit-count-ring {
  width:38px; height:38px; border-radius:50%; background:var(--primary);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:.78rem; font-weight:700; flex-shrink:0;
}
.visit-count-ring.revisit { background:var(--warning); }

/* ─── APPOINTMENT CARD (reports view) ─── */
.rpt-appt-card {
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  box-shadow:var(--shadow-sm);
  padding:.75rem .9rem; margin-bottom:.45rem; cursor:pointer; transition:all var(--ease);
}
.rpt-appt-card:hover { border-color:var(--primary); box-shadow:var(--shadow); transform:translateY(-1px); }

/* ─── SHOW ALL TOGGLE ─── */
.show-all-bar {
  display:flex; align-items:center; justify-content:space-between;
  background:var(--primary-bg); border:1px solid rgba(82,189,108,.25);
  border-radius:var(--r); padding:.6rem .875rem; margin-bottom:.75rem;
}

/* ─── CATEGORY TOGGLE ───────────────────────────────────────────
   MySlot is one platform, one app, one dashboard — the active
   company's businessCategory picks which UI shows, via a
   data-category attribute set on <body> at login (see initApp in
   app.js). Every category-specific block carries .cat-hospital or
   .cat-restaurant; blocks with neither (Staff, Settings, Sign Out,
   "Your Businesses") are shared and always visible. ── */
body:not([data-category="RESTAURANT"]) .cat-restaurant { display:none !important; }
body:not([data-category="HOSPITAL"]) .cat-hospital { display:none !important; }
/* Sports / Theater / Hotel share one set of vertical screens (js/verticals.js) */
body:not([data-category="SPORTS"]):not([data-category="THEATER"]):not([data-category="HOTEL"]) .cat-vertical { display:none !important; }

/* ─── ORDER ITEMS (New/Edit Order form) ─── */
.order-items-list { margin-top:.5rem; }
.order-item-row {
  display:flex; align-items:center; gap:.6rem;
  padding:.5rem .1rem; border-bottom:1px solid var(--border);
}
.order-item-row:last-child { border-bottom:none; }
.order-item-name { flex:1; font-size:.88rem; font-weight:600; min-width:0; }
.order-item-qty-ctrl { display:flex; align-items:center; gap:.4rem; flex-shrink:0; }
.order-item-qty-ctrl .btn-icon { padding:.3rem .5rem; font-size:.75rem; }
.order-item-price { font-size:.85rem; font-weight:600; color:var(--primary); flex-shrink:0; width:70px; text-align:right; }
.order-total-row {
  display:flex; justify-content:space-between; align-items:center;
  margin-top:.6rem; padding-top:.6rem; border-top:1.5px solid var(--border);
  font-size:1rem; font-weight:700;
}
.order-total-row span:last-child { color:var(--primary); }

/* ─── MENU GRID ─── */
.menu-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:.75rem;
}
.menu-card {
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  overflow:hidden; box-shadow:var(--shadow-sm); transition:all var(--ease);
}
.menu-card:hover { border-color:var(--primary); box-shadow:var(--shadow); }
.menu-card-img {
  position:relative; width:100%; aspect-ratio:4/3; background:var(--card2);
  display:flex; align-items:center; justify-content:center; color:var(--text3); font-size:1.6rem;
}
.menu-card-img img { width:100%; height:100%; object-fit:cover; }
.menu-card-unavail {
  position:absolute; top:.4rem; left:.4rem; background:var(--danger); color:#fff;
  font-size:.65rem; font-weight:700; padding:.15rem .45rem; border-radius:999px;
}
.menu-card-body { padding:.6rem .7rem .3rem; }
.menu-card-name { font-size:.85rem; font-weight:700; line-height:1.25; }
.menu-card-cat { font-size:.72rem; color:var(--text3); margin-top:.15rem; }
.menu-card-price { font-size:.88rem; font-weight:700; color:var(--primary); margin-top:.3rem; }
.menu-card-actions {
  display:flex; gap:.4rem; padding:.5rem .7rem .7rem;
}
.menu-card-actions .btn-icon { flex:1; text-align:center; }

/* ─── DESIGN RESTAURANT ─── */
.rp-banner-preview {
  width:100%; height:160px; border-radius:var(--r-sm); background:var(--card2);
  border:1.5px dashed var(--border); display:flex; flex-direction:column;
  align-items:center; justify-content:center; overflow:hidden;
}

/* ─── KITCHEN / KOT TICKETS ───────────────────────────────────
   High-contrast, large-text cards — kitchen staff read these at a
   glance from a distance, not up close like the other list cards. */
.board-kot { align-items: start; }
.kot-card {
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  box-shadow:var(--shadow-sm); padding:.85rem .9rem; margin-bottom:.6rem;
}
.kot-card-hdr {
  display:flex; align-items:center; gap:.5rem; flex-wrap:wrap;
  margin-bottom:.55rem; padding-bottom:.5rem; border-bottom:1px dashed var(--border);
}
.kot-table {
  font-size:.78rem; font-weight:700; color:var(--text2);
  background:var(--card2); padding:.15rem .5rem; border-radius:6px;
}
.kot-elapsed { font-size:.72rem; color:var(--text3); margin-left:auto; }
.kot-items { display:flex; flex-direction:column; gap:.3rem; }
.kot-item-row { font-size:1rem; font-weight:600; color:var(--text); line-height:1.3; }
.kot-item-qty { color:var(--primary); font-weight:800; }
.kot-notes {
  margin-top:.5rem; font-size:.8rem; color:var(--warning);
  background:var(--warning-bg); border-radius:6px; padding:.35rem .55rem;
}
.kot-advance-btn { width:100%; margin-top:.65rem; }

/* ─── PRINT SETTINGS (theme picker) ─── */
.print-theme-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.5rem; }
.print-theme-card {
  border:1.5px solid var(--border); border-radius:var(--r-sm); padding:.6rem .5rem;
  text-align:center; cursor:pointer; transition:all var(--ease);
}
.print-theme-card:hover { border-color:var(--primary); }
.print-theme-card.selected { border-color:var(--primary); background:var(--primary-bg); }
.print-theme-name { font-size:.85rem; font-weight:700; }
.print-theme-desc { font-size:.68rem; color:var(--text3); margin-top:.15rem; line-height:1.3; }

/* ─── RECEIPT / KOT PRINT AREA ───────────────────────────────────
   Hidden on screen; only shown (and only thing shown) when printing —
   isolates the 80mm receipt layout from the rest of the dashboard UI. */
#print-area { display:none; }
#print-area .receipt {
  width:80mm; font-family:'Courier New', monospace; color:#000; font-size:12px; line-height:1.45;
}
#print-area .receipt-center { text-align:center; }
#print-area .receipt-name { font-size:15px; font-weight:700; }
#print-area .receipt-sub { font-size:11px; }
#print-area .receipt-divider { border-top:1px dashed #000; margin:6px 0; }
#print-area .receipt-row { display:flex; justify-content:space-between; gap:6px; }
#print-area .receipt-row.total { font-weight:700; font-size:13px; }
#print-area .receipt-item-name { flex:1; }
#print-area .receipt-footer { text-align:center; font-size:10px; margin-top:6px; }
#print-area .kot-ticket { width:80mm; font-family:'Courier New', monospace; color:#000; font-size:13px; line-height:1.5; }
#print-area .kot-ticket .receipt-item-name { font-weight:700; font-size:15px; }

@media print {
  @page { size: 80mm auto; margin: 2mm; }
  body * { visibility:hidden; }
  #print-area, #print-area * { visibility:visible; }
  #print-area { display:block; position:absolute; top:0; left:0; }
}

/* ─── TABLES (Design Tables) ─── */
.tables-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:.75rem; }
.table-card {
  position:relative; border-radius:var(--r-md); padding:1rem .85rem;
  cursor:pointer; border:1.5px solid var(--border); transition:all var(--ease);
  background:var(--card);
}
.table-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-sm); }
.table-card.occupied { border-color:var(--warning); background:var(--warning-bg); }
.table-card.free { border-color:var(--success); background:var(--success-bg); }
.table-card-actions { position:absolute; top:.4rem; right:.4rem; display:flex; gap:.15rem; opacity:0; transition:opacity var(--ease); }
.table-card:hover .table-card-actions { opacity:1; }
.table-card-label { font-size:1.15rem; font-weight:800; margin-bottom:.2rem; }
.table-card-cap { font-size:.75rem; color:var(--text2); margin-bottom:.35rem; }
.table-card-status { font-size:.78rem; font-weight:600; }
.table-card.free .table-card-status { color:var(--success); }
.table-card.occupied .table-card-status { color:var(--warning); }

/* ─── VEG / NON-VEG TOGGLE + DOT ─── */
.veg-toggle { display:flex; gap:.5rem; }
.veg-toggle-btn {
  flex:1; display:flex; align-items:center; justify-content:center; gap:.4rem;
  padding:.55rem .5rem; border-radius:var(--r-sm); border:1.5px solid var(--border);
  background:var(--surface2); color:var(--text2); font-size:.85rem; font-weight:600;
  cursor:pointer; transition:all var(--ease);
}
.veg-toggle-btn.selected { border-color:var(--primary); background:var(--primary-bg); color:var(--primary); }
.veg-dot { display:inline-block; width:10px; height:10px; border-radius:2px; border:1.5px solid; flex-shrink:0; }
.veg-dot.veg { border-color:#2e7d32; background:#2e7d32; }
.veg-dot.nonveg { border-color:#b71c1c; background:#b71c1c; }

/* ─── REPORTS ANALYTICS TABLE ─── */
.table-scroll { overflow-x:auto; }
.data-table { width:100%; min-width:640px; border-collapse:collapse; font-size:.86rem; }
.data-table th, .data-table td { padding:.6rem .7rem; text-align:left; white-space:nowrap; }
.data-table thead th {
  background:var(--surface2); color:var(--text2); font-weight:700;
  font-size:.72rem; text-transform:uppercase; letter-spacing:.03em;
  border-bottom:1.5px solid var(--border);
}
.data-table tbody tr { border-bottom:1px solid var(--border); transition:background var(--ease); }
.data-table tbody tr:hover { background:var(--primary-bg); }
.data-table tbody tr:last-child { border-bottom:none; }
.data-table td.wrap, .data-table th.wrap { white-space:normal; }
.rep-table-hdr, .rep-table-row {
  display:grid; grid-template-columns:2fr 1fr 1fr; gap:.5rem;
  padding:.45rem .3rem; font-size:.85rem; align-items:center; min-width:320px;
}
.rep-table-hdr {
  font-weight:700; color:var(--text2); border-bottom:1.5px solid var(--border);
  font-size:.72rem; text-transform:uppercase; letter-spacing:.03em;
}
.rep-table-row { border-bottom:1px solid var(--border); }
.rep-table-row:last-child { border-bottom:none; }
.rep-table-hdr span:nth-child(2), .rep-table-hdr span:nth-child(3),
.rep-table-row span:nth-child(2), .rep-table-row span:nth-child(3) { text-align:right; }

/* ─── ORDER MENU PICKER (tap-to-add cards, shown while booking) ─── */
.order-menu-picker {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:.6rem;
  max-height:260px; overflow-y:auto; padding:.2rem;
}
.order-menu-card {
  border:1.5px solid var(--border); border-radius:var(--r-sm); padding:.5rem;
  cursor:pointer; transition:all var(--ease); background:var(--card);
}
.order-menu-card:hover { border-color:var(--primary); transform:translateY(-1px); box-shadow:var(--shadow-sm); }
.order-menu-card:active { transform:translateY(0) scale(.97); }
.order-menu-card-img {
  width:100%; height:64px; border-radius:6px; overflow:hidden; margin-bottom:.35rem;
  background:var(--surface2); display:flex; align-items:center; justify-content:center;
  color:var(--text3); font-size:1.2rem;
}
.order-menu-card-img img { width:100%; height:100%; object-fit:cover; }
.order-menu-card-name { font-size:.78rem; font-weight:600; line-height:1.25; margin-bottom:.15rem; }
.order-menu-card-price { font-size:.78rem; font-weight:700; color:var(--primary); }

/* ─── MENU OCR IMPORT (review rows) ─── */
.ocr-review-list { max-height:320px; overflow-y:auto; display:flex; flex-direction:column; gap:.4rem; }
.ocr-review-row { display:flex; align-items:center; gap:.4rem; }
.ocr-review-row input[type="checkbox"] { flex-shrink:0; width:16px; height:16px; }
.ocr-review-row .form-control { padding:.4rem .5rem; font-size:.82rem; }

/* ─── BULK CREATE TABLES (review rows) ─── */
.bulk-table-rows-list { max-height:320px; overflow-y:auto; display:flex; flex-direction:column; gap:.4rem; }
.bulk-table-row { display:grid; grid-template-columns:2fr 1fr; gap:.5rem; }
.bulk-table-row .form-control { padding:.45rem .6rem; font-size:.85rem; }
