/* ============================================================
   चक्की बुक — 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; }

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

body.no-scroll { overflow: hidden; }

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

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 52px 56px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(90% 70% at 8% 4%, #342a9b 0%, rgba(52, 42, 155, 0) 60%),
    radial-gradient(70% 60% at 96% 92%, #4c2f9e 0%, rgba(76, 47, 158, 0) 62%),
    linear-gradient(160deg, #17152f 0%, #0d0c1c 100%);
}
.auth-brand::after {
  content: "";
  position: absolute;
  right: -160px; bottom: -140px;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 107, 255, .34), transparent 66%);
  pointer-events: none;
}

.brand-lock { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.logo-mark {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  font-size: 21px; font-weight: 800;
  color: #3a2708;
  background: linear-gradient(145deg, #ffe08a, #f0a828);
  box-shadow: 0 10px 26px -12px rgba(240, 168, 40, .9);
  flex: 0 0 auto;
}
.brand-name { font-size: 18.5px; font-weight: 800; letter-spacing: .1px; }
.brand-tag { font-size: 11.5px; opacity: .7; margin-top: 2px; }

.auth-hero { position: relative; z-index: 1; max-width: 460px; }
.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #cfcaff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 6px 11px;
  border-radius: 999px;
}
.auth-hero-title {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -.9px;
  margin: 22px 0 14px;
}
.auth-hero-sub { color: #c5c2ea; font-size: 15px; line-height: 1.7; max-width: 36ch; }

.feature-list { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 13px; }
.feature-list li { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; color: #dedbff; }
.fi {
  width: 22px; height: 22px;
  flex: 0 0 auto;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 11px;
  color: #231d00;
  background: linear-gradient(145deg, #ffe08a, #f0a828);
  margin-top: 1px;
}

.auth-proof {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #9491bd;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 18px;
}
.auth-proof b { display: block; color: #fff; font-size: 15px; font-weight: 700; }

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 24px;
  background: #fff;
}
.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); }

.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 ------------------------------ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17, 18, 37, .45);
  backdrop-filter: blur(3px);
}
.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow: auto;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-up .22s ease;
  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: 80;
  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 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 > .card + .card { margin-top: 14px; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { padding: 13px 16px; }
  .topbar .pill-date { display: none; }
  .page { padding: 18px 16px 100px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 21px; }
  .token-no { font-size: 50px; }
  .token-card { padding: 18px; }

  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar button {
    border: 0;
    background: transparent;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 7px 2px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 650;
    color: #767a8f;
    cursor: pointer;
  }
  .tabbar button.is-on { color: var(--brand); }
  .tabbar svg { width: 21px; height: 21px; }
  .toast { bottom: 96px; }
}

@media (max-width: 880px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-panel { padding: 30px 22px 44px; background: linear-gradient(180deg, #f7f6ff 0%, #fff 48%); align-items: flex-start; }
  .auth-panel::before {
    content: "चक्की बुक";
    display: block;
    position: absolute;
    top: 22px;
    font-weight: 800;
    color: var(--brand-ink);
    font-size: 15px;
  }
  .auth-panel { position: relative; }
  .auth-card { margin-top: 42px; }
}

@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;
}
