/* ============================================================
   तौल-माल (TolMaal by Solidrix) — Design System
   ============================================================ */

:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --ink: #111225;
  --ink-2: #3a3c52;
  --muted: #767a8f;
  --line: #e6e7f0;
  --line-2: #eff0f6;
  --brand: #4f46e5;
  --brand-2: #6d63f5;
  --brand-ink: #3730a3;
  --brand-soft: #eef0ff;
  --green: #0f9d6b;
  --green-soft: #e7f8f1;
  --amber: #b8730a;
  --amber-soft: #fdf4e3;
  --red: #d93a3a;
  --red-soft: #fdecec;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(17, 18, 37, .04), 0 14px 34px -22px rgba(17, 18, 37, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans Devanagari", "Nirmala UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.root {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }
body.no-scroll .tabbar {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transform: translateY(100%) !important;
}

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }

.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.boot-mark {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .55 } }

.muted { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.tiny { color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.strong { font-weight: 700; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-20 { margin-top: 20px; }
.ta-r { text-align: right; }

/* ------------------------------ buttons ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 650;
  font-size: 14.5px;
  cursor: pointer;
  background: #f1f2f8;
  color: var(--ink);
  transition: background .16s ease, transform .06s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 12px 22px -14px rgba(79, 70, 229, .85);
}
.btn-primary:hover { background: linear-gradient(180deg, #7a71f7, #4a41dd); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-ghost { background: #fff; border-color: var(--line); }
.btn-ghost:hover { background: #fafaff; }
.btn-danger { background: var(--red-soft); color: #b02222; }
.btn-gold {
  background: linear-gradient(180deg, #ffd166, #efa625);
  color: #3a2708;
  box-shadow: 0 12px 24px -16px rgba(216, 148, 15, .9);
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover { background: #f2f3f9; color: var(--ink); }

/* ------------------------------- fields ------------------------------ */

.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }

.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #a7a1f9;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .1);
}
.field input::placeholder { color: #a4a7b8; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: #f1f2f8;
  border-radius: 13px;
}
.seg label { display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  text-align: center;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 650;
  color: #5f6379;
}
.seg input:checked + span {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 18, 37, .14);
}
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(79, 70, 229, .25); }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ------------------------------- auth -------------------------------- */

/* ==================== Public Screen (Status-First & Mobile-Optimized) ==================== */
.public-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  color: var(--ink);
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, calc(8px + env(safe-area-inset-top, 0px))) 20px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: 100vw;
  box-sizing: border-box;
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-brand-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.public-brand-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.public-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-header-actions .btn-apk-dl {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.public-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
  width: 100%;
}

.public-card {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

.status-card-header {
  text-align: center;
  margin-bottom: 20px;
}

.status-pill {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin: 4px 0 6px;
}

.status-subtitle {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.btn-qr-scan {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 52px;
  width: 100%;
}
.btn-qr-scan:active {
  transform: scale(0.98);
}
.btn-qr-scan .qr-icon {
  font-size: 20px;
}

.or-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 650;
}
.or-separator::before,
.or-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}
.or-separator span {
  padding: 0 12px;
}

.btn-lg {
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 750;
  border-radius: 12px;
  min-height: 50px;
}

.public-switch-card {
  width: 100%;
  max-width: 480px;
  margin-top: 18px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-info b {
  display: block;
  font-size: 13px;
  color: #1e293b;
  font-weight: 750;
}

.switch-info span {
  font-size: 11.5px;
  color: #64748b;
}

.btn-login-switch {
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 750;
  padding: 8px 14px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.status-result-wrap:not(:empty) {
  margin-top: 16px;
}

@media (max-width: 480px) {
  .public-header {
    padding: max(16px, calc(10px + env(safe-area-inset-top, 0px))) 14px 10px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .public-brand-title {
    font-size: 16px;
  }
  .public-brand-sub {
    display: none;
  }
  .public-card {
    padding: 20px 15px;
    border-radius: 16px;
  }
  .status-title {
    font-size: 19px;
  }
  .public-switch-card {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .public-switch-card .btn-login-switch {
    width: 100%;
  }
}
.auth-card { width: 100%; max-width: 392px; }
.auth-card h1 { font-size: 25px; font-weight: 800; letter-spacing: -.5px; }
.auth-card .muted { margin-top: 7px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #f0f1f8;
  border-radius: 999px;
  padding: 4px;
  margin: 24px 0 20px;
}
.auth-tab {
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 13.5px;
  color: #5b5f78;
  cursor: pointer;
}
.auth-tab.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(17, 18, 37, .12); }
.auth-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.auth-error {
  background: var(--red-soft);
  color: #a52020;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 650; cursor: pointer; padding: 0; }

/* ------------------------------- shell ------------------------------- */

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 22px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side .brand-lock { margin: 0 6px 16px; }
.side .brand-name { color: var(--ink); font-size: 16px; }
.side .brand-tag { color: var(--muted); opacity: 1; }

.nav { display: grid; gap: 3px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #5c6076;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background .14s ease, color .14s ease;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .8; }
.nav-item:hover { background: #f6f7fc; color: var(--ink); }
.nav-item.is-on { background: var(--brand-soft); color: var(--brand-ink); }
.nav-item.is-on svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-ink);
  border: 1px solid #d9d7fb;
}

.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.who .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.who-name { font-size: 13px; font-weight: 650; }
.who-sub { font-size: 11px; color: var(--muted); }
.side-logout {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.side-logout:hover { background: #f7f7fc; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 14px; font-weight: 700; }
.topbar-sub { font-size: 11.5px; color: var(--muted); }
.topbar-spacer { flex: 1; }
.pill-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  padding: 7px 11px;
  border-radius: 999px;
}
.topbar-cta { display: flex; gap: 8px; }

.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 26px 28px 100px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 5px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title { font-size: 15px; font-weight: 750; letter-spacing: -.1px; }
.section-link { border: 0; background: none; color: var(--brand); font-size: 12.5px; font-weight: 650; cursor: pointer; padding: 0; }

/* -------------------------------- cards ------------------------------ */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-tight { padding: 14px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px 13px;
  box-shadow: var(--shadow);
}
.kpi-label { font-size: 12px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 23px; font-weight: 800; letter-spacing: -.8px; margin-top: 7px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.kpi.accent { background: linear-gradient(155deg, #211c57, #13112f); border-color: #2a2464; color: #fff; }
.kpi.accent .kpi-label, .kpi.accent .kpi-sub { color: #b6b2e8; }
.kpi.green .kpi-value { color: #0b7d57; }
.kpi.amber .kpi-value { color: #9a5f07; }

.token-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  padding: 20px 22px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(124, 107, 255, .45), transparent 60%),
    linear-gradient(135deg, #1d1950, #2b2378 65%, #322a8f);
  box-shadow: 0 22px 44px -30px rgba(43, 35, 120, .9);
}
.token-card.is-idle { background: linear-gradient(135deg, #232338, #17172a); }
.token-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #c3c0f5; }
.token-no { font-size: 58px; font-weight: 800; line-height: .9; letter-spacing: -2.5px; font-variant-numeric: tabular-nums; margin: 8px 0 6px; }
.token-no.is-empty { color: #6f6b9e; }
.token-who { font-size: 14px; font-weight: 650; color: #e6e4ff; }
.token-who span { font-weight: 500; color: #b8b4e6; }
.token-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.token-stats { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; color: #b7b3e6; }
.token-stats b { color: #fff; font-size: 14px; display: block; font-variant-numeric: tabular-nums; }
.token-stats > div { min-width: 64px; }

/* ------------------------------- service ----------------------------- */

.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 9px; margin-bottom: 14px; }
.svc-card {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 11px 12px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.svc-card strong { font-size: 13.5px; font-weight: 700; }
.svc-card span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-card:hover { border-color: #d5d3f5; }
.svc-card.is-on {
  border-color: #a9a3f8;
  background: linear-gradient(180deg, #f6f5ff, #fff);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .08);
}
.svc-card.is-on strong { color: var(--brand-ink); }

.amount-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #f8f8ff, #fff);
  border: 1px dashed #cdc8f7;
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 14px;
}
.amount-box .amt-label { font-size: 12px; font-weight: 650; color: var(--muted); }
.amount-box .amt-value { margin-left: auto; font-size: 24px; font-weight: 800; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }

/* -------------------------------- lists ------------------------------ */

.row-list { display: grid; }
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-top: 1px solid var(--line-2);
  background: none;
  border-left: 0; border-right: 0; border-bottom: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
.row-item:first-child { border-top: 0; }
button.row-item { cursor: pointer; border-radius: 10px; }
button.row-item:hover { background: #fafaff; }
.row-title { font-size: 14px; font-weight: 650; }
.row-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.row-amt { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt-plus { color: #0b7d57; }
.amt-due { color: #9a5f07; }

.avatar {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 750;
  font-size: 14px;
  color: var(--brand-ink);
  background: var(--brand-soft);
}
.avatar.small { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.avatar.pay { background: var(--green-soft); color: #08744f; }

.bal {
  font-size: 12.5px;
  font-weight: 750;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: #f2f3f9;
  color: #575b70;
}
.bal.due { background: var(--amber-soft); color: #8f5a05; }
.bal.adv { background: var(--green-soft); color: #08744f; }
.bal.zero { background: #f2f3f9; color: #6b6f85; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f2f3f9;
  color: #5f6379;
  white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: #08744f; }
.badge.amber { background: var(--amber-soft); color: #8f5a05; }

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-ink);
  background: var(--brand-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.queue-no {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.queue-no.serving { background: linear-gradient(145deg, var(--brand-2), var(--brand)); color: #fff; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  padding: 26px 12px;
}
.empty-mark { font-size: 26px; margin-bottom: 6px; opacity: .6; }

/* -------------------------------- table ------------------------------ */

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  font-weight: 700;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 10px 6px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table .sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

/* -------------------------------- sheet & modals ------------------------------ */

#modal:empty {
  display: none !important;
  pointer-events: none !important;
}

#modal:not(:empty) {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: block;
}

body.no-scroll .tabbar,
#modal:not(:empty) ~ * .tabbar,
body:has(#modal:not(:empty)) .tabbar {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(100%) !important;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(38px + env(safe-area-inset-bottom, 0px));
  animation: sheet-up .22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -20px 50px -20px rgba(17, 18, 37, .4);
}
@keyframes sheet-up { from { transform: translateY(26px); opacity: .7 } to { transform: none; opacity: 1 } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sheet-head h3 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.bal-panel {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-radius: 14px;
  padding: 14px 16px;
  background: #f5f5fb;
  margin-bottom: 16px;
}
.bal-panel.due { background: var(--amber-soft); }
.bal-panel.adv { background: var(--green-soft); }
.bal-label { font-size: 12px; font-weight: 650; color: #5f6379; }
.bal-val { font-size: 22px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.bal-panel.due .bal-val { color: #8f5a05; }
.bal-panel.adv .bal-val { color: #08744f; }
.tok-row { display: flex; gap: 8px; align-items: center; }

.done-mark {
  width: 54px; height: 54px;
  margin: 2px auto 10px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 24px;
  color: #fff;
  background: linear-gradient(145deg, #22c48b, #0f9d6b);
  box-shadow: 0 12px 26px -14px rgba(15, 157, 107, .8);
}
.done-card { background: #f8f8fd; border-radius: 14px; padding: 14px; text-align: center; margin: 8px 0 16px; }
.done-amount { font-size: 30px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }

/* ------------------------------- toast ------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translate(-50%, 14px);
  z-index: 2200;
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  border-radius: 12px;
  background: #17182b;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 16px 36px -18px rgba(0, 0, 0, .6);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------- tabbar ------------------------------ */

.tabbar { display: none; }
.mobile-brand { display: none; }

@media (max-width: 900px) {
  .mobile-brand { display: block; }
}

/* ------------------------------ responsive ---------------------------- */

@media (max-width: 960px) {
  .grid-2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 14px !important;
  }
  .grid-2 > .card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .grid-2 > .card + .card { margin-top: 14px !important; }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .side { display: none; }
  .hide-mobile { display: none !important; }

  .topbar {
    padding: max(16px, calc(10px + env(safe-area-inset-top, 0px))) 14px 10px;
    gap: 8px;
    justify-content: space-between;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .topbar-info {
    max-width: 175px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }
  .topbar-title {
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-sub {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .lang-select {
    padding: 4px 8px !important;
    font-size: 11.5px !important;
  }
  .topbar .btn-topbar-status {
    padding: 5px 9px !important;
    font-size: 12px !important;
  }

  .two-col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .page {
    padding: 14px 12px 110px !important;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .card {
    padding: 16px 14px;
    border-radius: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 21px; }
  .token-no { font-size: 46px; }

  .token-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 14px;
  }
  .token-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .token-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .token-stats {
    justify-content: space-between;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  .svc-card {
    padding: 12px 8px;
    font-size: 13px;
  }

  /* Responsive Queue List Row */
  .queue-item {
    flex-wrap: wrap !important;
    padding: 12px 0;
    gap: 8px;
  }
  .queue-item .grow {
    min-width: 140px;
  }
  .queue-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px dashed var(--line-2);
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin: 12px 0 6px;
    scrollbar-width: none;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chips .chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Premium Native Bottom Navigation Bar */
  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 4px 6px env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    border-top: 1.5px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
  }
  .tabbar .tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    border: none;
    background: transparent;
    color: #64748b;
    padding: 4px 0;
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar .tab-btn .tab-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .tabbar .tab-btn svg {
    width: 22px;
    height: 22px;
    stroke: #64748b;
    stroke-width: 2.1;
    transition: transform 0.15s ease, stroke 0.15s ease;
  }
  .tabbar .tab-btn .tab-label {
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
    line-height: 1.2;
    white-space: nowrap;
    color: #64748b;
  }
  .tabbar .tab-btn.is-on {
    color: #4f46e5;
  }
  .tabbar .tab-btn.is-on svg {
    stroke: #4f46e5;
    transform: scale(1.08);
  }
  .tabbar .tab-btn.is-on .tab-label {
    color: #4f46e5;
  }

  .tabbar .tab-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
  }

  /* Center Elevated Hero Action Button (+ नया काम) */
  .tabbar .tab-hero {
    position: relative;
  }
  .tabbar .tab-hero .hero-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    margin-top: -16px;
    border: 3px solid #ffffff;
    transition: transform 0.15s ease;
  }
  .tabbar .tab-hero:active .hero-circle {
    transform: scale(0.92);
  }
  .tabbar .tab-hero .hero-circle svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    stroke-width: 2.4;
  }
  .tabbar .tab-hero .tab-label {
    font-size: 10.5px;
    font-weight: 800;
    color: #4f46e5;
    margin-top: 1px;
  }

  .toast { bottom: 85px; }
}



@media (max-width: 560px) {
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .page-title { font-size: 21px; }
  .card { padding: 15px; border-radius: 16px; }
  .sheet-actions { grid-template-columns: 1fr; }
  .token-stats { gap: 14px; }
  .amount-box .amt-value { font-size: 21px; }
}

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

/* -------------------------------- print ------------------------------ */

.print-area { display: none; }
@page { margin: 5mm; }

@media print {
  body { background: #fff; }
  .shell, .auth, .toast, .tabbar, .sheet-backdrop, .boot { display: none !important; }
  .print-area { display: block; }
  .receipt {
    width: 76mm;
    margin: 0 auto;
    color: #000;
    font-family: var(--font);
    font-size: 12px;
    line-height: 1.5;
  }
  .r-shop { font-size: 17px; font-weight: 800; text-align: center; }
  .r-sub { text-align: center; font-size: 10.5px; margin-top: 2px; }
  .r-line { border-top: 1px dashed #000; margin: 8px 0; }
  .r-row { display: flex; justify-content: space-between; gap: 10px; margin: 3px 0; }
  .r-row span:last-child { text-align: right; }
  .r-total { font-size: 15px; font-weight: 800; margin: 7px 0; }
  .r-thanks { text-align: center; margin-top: 10px; font-size: 11px; }
}

/* ----------------------------- extra ui ------------------------------ */

.tiny-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  background: var(--line);
  color: var(--ink-2);
  border-radius: 99px;
  margin-left: 6px;
  vertical-align: middle;
}

.cust-banner {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cust-banner.due { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(184, 115, 10, .2); }
.cust-banner.adv { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid rgba(79, 70, 229, .2); }
.cust-banner.zero { background: var(--green-soft); color: var(--green); border: 1px solid rgba(15, 157, 107, .2); }

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 10px 0;
}

.req { color: var(--red); font-weight: bold; }
.badge.blue { background: var(--brand-soft); color: var(--brand); }


/* Sync & Offline Status Indicator */
.sync-badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.sync-badge.online { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.sync-badge.pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; cursor: pointer; }
.sync-badge.offline { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.sync-badge.syncing { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.sync-dot.online { background: #22c55e; }
.sync-dot.pending { background: #f59e0b; }
.sync-dot.offline { background: #ef4444; }
.sync-dot.pulsing {
  background: #3b82f6;
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Machine Hardware & Camera Animations */
@keyframes scanLaser {
  0% { top: 5%; opacity: 0.8; }
  50% { top: 90%; opacity: 1; }
  100% { top: 5%; opacity: 0.8; }
}

.hardware-quick-bar button {
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.15s ease;
  font-weight: 600;
  border-radius: 10px;
}
.hardware-quick-bar button:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.ocr-reading-bar {
  transition: border-color 0.2s ease, background 0.2s ease;
}
.reading-active {
  color: #16a34a !important;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.voice-mic-wave::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  opacity: 0.4;
  animation: pulse 1.5s infinite ease-out;
}
