/* ============================================================
   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;
  --chk-bg:        #000000;
  --chk-border:    rgba(255,255,255,0.70);
}

/* ─── 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%);
  min-height: 100vh;
}
[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:.75rem;  }
.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); 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); }
.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:.82rem; 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); }
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; }
.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:.75rem; margin-top:.25rem; }

/* ─── 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 1rem;
  z-index:500; transition:background var(--ease),border-color var(--ease);
}
.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 ─── */
.app-wrap { display:flex; min-height:100vh; padding-top:var(--nav-h); }

/* Sidebar */
.sidebar {
  width:var(--side-w); background:var(--surface);
  border-right:1px solid var(--border);
  position:fixed; top:var(--nav-h); left:0; bottom:0;
  overflow-y:auto; padding:.75rem 0; display:none; z-index:200;
}
@media(min-width:768px) {
  .sidebar { display:block; }
  .app-main { margin-left:var(--side-w); }
  .btm-nav  { display:none !important; }
}
.nav-item {
  display:flex; align-items:center; gap:.7rem; padding:.72rem 1.1rem;
  cursor:pointer; color:var(--text2); font-size:.9rem; font-weight:500;
  transition:all var(--ease); border-left:3px solid transparent;
  user-select:none; touch-action:manipulation;
}
.nav-item:hover  { background:var(--card2); color:var(--text); }
.nav-item.active { background:var(--primary-bg); color:var(--primary); border-left-color:var(--primary); font-weight:600; }
.nav-item i      { width:18px; text-align:center; font-size:.95rem; }
.nav-sep { height:1px; background:var(--border); margin:.5rem 1rem; }

/* Content */
.app-main {
  flex:1; padding:1.1rem; min-width:0;
  padding-bottom:calc(var(--btm-h) + 1.25rem);
}
@media(min-width:768px){ .app-main { padding-bottom:1.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:.6rem; 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; animation:fadeIn .2s ease; }
@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:.82rem; 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:.95rem; 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);
  border-radius:var(--r); padding:.95rem; transition:all var(--ease);
}
.stat-card:hover { border-color:var(--primary); transform:translateY(-1px); }
.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:.72rem; color:var(--text2); margin-top:.2rem; }

/* 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:.82rem; color:var(--text2); margin-top:.1rem; }

/* 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);
  padding:.875rem 1rem; margin-bottom:.6rem; cursor:pointer; transition:all var(--ease);
  touch-action:manipulation;
}
.list-card:hover  { border-color:var(--primary); }
.list-card:active { background:var(--primary-bg); }
.list-hdr  { display:flex; align-items:center; justify-content:space-between; margin-bottom:.3rem; flex-wrap:wrap; gap:.35rem; }
.list-name { font-weight:600; font-size:.9rem; }
.list-sub  { font-size:.78rem; color:var(--text2); }
.list-meta { display:flex; gap:.7rem; margin-top:.35rem; flex-wrap:wrap; }
.list-meta span { font-size:.72rem; color:var(--text3); display:flex; align-items:center; gap:.25rem; }

/* Badges */
.badge { display:inline-flex; align-items:center; gap:.22rem; padding:.2rem .6rem; border-radius:20px; font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }
.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-primary   { background:var(--primary-bg); color:var(--primary); }

/* 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;
}

/* 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; }

/* FAB */
.fab {
  position:fixed; bottom:calc(var(--btm-h) + .85rem); right:.9rem;
  width:52px; height:52px; border-radius:50%; background:var(--primary); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:1.4rem;
  cursor:pointer; border:none; box-shadow:0 4px 18px rgba(82,189,108,.42);
  transition:all var(--ease); z-index:100; touch-action:manipulation;
}
.fab:hover  { transform:scale(1.08); }
.fab:active { transform:scale(.96); }
@media(min-width:768px){ .fab { bottom:.85rem; } }

/* 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:.82rem; }

/* 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:.85rem; 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:.4rem .875rem; border-radius:20px; font-size:.8rem; 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.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; }

/* ─── 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:.22rem .65rem; font-size:.75rem; font-weight:600;
}
.spec-chip .rm { cursor:pointer; opacity:.7; font-size:.7rem; }
.spec-chip .rm:hover { opacity:1; }
.spec-add-hint { font-size:.78rem; 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:.7rem; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:.06em; }
.spec-opt { padding:.52rem .85rem; font-size:.85rem; 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:'✓'; }

/* ─── 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:.88rem; 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:.72rem; 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(3,1fr); gap:.65rem; margin-top:.6rem; }
.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:.7rem; 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:.9rem; }
.unconf-meta { font-size:.75rem; color:var(--text2); margin-top:.15rem; }
.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:flex-start; 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:.8rem; color:var(--info); line-height:1.5;
}

/* ─── 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 ─── */
.quick-scroll { display:flex; gap:.7rem; overflow-x:auto; padding-bottom:.5rem; margin-bottom:1.1rem; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.quick-scroll::-webkit-scrollbar { display:none; }
.quick-scroll-item {
  flex-shrink:0; background:var(--card); border:1px solid var(--border);
  border-radius:var(--r); padding:.85rem .9rem; text-align:center;
  cursor:pointer; transition:all var(--ease); min-width:88px; touch-action:manipulation;
}
.quick-scroll-item:hover  { border-color:var(--primary); background:var(--primary-bg); 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:.78rem; color:var(--text3); min-width:110px; padding-top:.05rem; }
.detail-value  { font-size:.88rem; font-weight:500; flex:1; }
.status-actions { display:flex; gap:.45rem; flex-wrap:wrap; margin-top:.85rem; }

/* ─── SETTINGS ─── */
.settings-sec { background:var(--card); border:1px solid var(--border); border-radius:var(--r); margin-bottom:.9rem; overflow:hidden; }
.settings-sec-title { padding:.65rem 1rem; font-size:.72rem; font-weight:600; color:var(--text3); text-transform:uppercase; letter-spacing:.06em; border-bottom:1px solid var(--border); background:var(--surface2); }
.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); }
.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:.9rem; font-weight:500; }
.s-desc  { font-size:.72rem; 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:.875rem; color:var(--text2); }
.report-val { font-weight:700; font-size:.95rem; }
.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; }
  .app-main { padding:.875rem; }
  .stats-grid { gap:.6rem; }
  .stat-val { font-size:1.4rem; }
}

@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 {
  flex:1; min-width:fit-content; padding:.45rem .6rem; text-align:center;
  font-size:.8rem; 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); }

/* ─── 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; background:var(--card); border:1.5px solid var(--border);
  border-radius:var(--r-sm); color:var(--text); font-size:.875rem;
  padding:.5rem .75rem .5rem 2.2rem; font-family:inherit; outline:none;
  transition:border-color var(--ease); -webkit-appearance:none;
}
.search-input:focus { border-color:var(--primary); }
.search-input::placeholder { color:var(--text3); }
.search-wrap { position:relative; flex:1; min-width:160px; }
.search-wrap .s-ico { position:absolute; left:.75rem; top:50%; transform:translateY(-50%); color:var(--text3); font-size:.85rem; pointer-events:none; }
.sort-btn {
  display:flex; align-items:center; gap:.35rem; padding:.5rem .75rem;
  background:var(--card); border:1.5px solid var(--border); border-radius:var(--r-sm);
  color:var(--text2); font-size:.78rem; 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:.55rem; align-items:center; margin-bottom:.75rem;
  flex-wrap:wrap; background:var(--card); border:1px solid var(--border);
  border-radius:var(--r); padding:.65rem .875rem;
}
.date-range-row label { font-size:.75rem; color:var(--text3); 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:.82rem; padding:.38rem .6rem; font-family:inherit;
  outline:none; transition:border-color var(--ease); -webkit-appearance:none; flex:1; min-width:120px;
}
.date-range-row input[type=date]:focus { border-color:var(--primary); }
.date-range-row .dr-sep { color:var(--text3); font-size:.8rem; }

/* ─── GROUP HEADER ─── */
.group-hdr {
  display:flex; align-items:center; justify-content:space-between;
  padding:.55rem .875rem; margin-bottom:.5rem; 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:.8rem; 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:.75rem; 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:.28rem .72rem; border-radius:20px; font-size:.75rem; 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:.72rem; color:var(--text2); margin-top:.18rem; }

/* ─── PATIENT GROUP CARD ─── */
.patient-card {
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  padding:.875rem 1rem; margin-bottom:.55rem; cursor:pointer; transition:all var(--ease);
  touch-action:manipulation;
}
.patient-card:hover { border-color:var(--primary); }
.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);
  padding:.75rem .9rem; margin-bottom:.45rem; cursor:pointer; transition:all var(--ease);
}
.rpt-appt-card:hover { border-color:var(--primary); }

/* ─── 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;
}
