/* Camp ke safhe — Shahzaib ka aur Asif ka.
 *
 * Do baatein har faisle par bhari hain:
 *
 *   • Camp par internet nahi hota. Is liye yahan bahar ki koi font, koi
 *     library nahi — jo kuch hai isi file mein hai. Safha phone mein
 *     mehfooz ho kar bagair internet ke bhi wohi dikhta hai.
 *
 *   • Dhoop mein parhna hota hai. Is liye rangat gehri hai aur farq saaf.
 *     Halki grey khoobsurat lagti hai kamre mein — maidan mein gayab.
 */

/* Ye lakeer sab se ooper rehni chahiye.
   Browser ka apna usool `[hidden] { display: none }` hai, magar hamari apni
   likhi hui har lakeer us par bhari par jati hai — chahe wo kitni hi aam ho.
   Is liye `.gate { display: grid }` ne PIN wale safhe ko `hidden` hone ke
   bawajood saamne khara rakha: login ho jata tha, data bhi aa jata tha,
   safha neeche ban bhi jata tha — magar PIN ki screen upar pari rehti thi
   aur aadmi ko lagta tha ke kuch hua hi nahi. */
[hidden] { display: none !important; }

/* ══ Rang aur naap ═══════════════════════════════════════════ */

:root {
  --bg:        #eef2f5;
  --bg-2:      #e3eaef;
  --surface:   #ffffff;
  --surface-2: #f7f9fb;
  --ink:       #0a1218;
  --ink-2:     #33465a;
  --muted:     #5c6f80;
  --line:      #dde5ec;
  --line-2:    #eaf0f4;

  --brand:     #0d7f74;
  --brand-2:   #12a594;
  --brand-ink: #ffffff;
  --brand-dim: #e6f5f3;

  --green:     #04724d;
  --green-dim: #d8f3e6;
  --amber:     #a24d00;
  --amber-dim: #fdeccf;
  --red:       #ae1b1b;
  --red-dim:   #fde3e3;

  --shadow:   0 1px 2px rgba(10, 18, 24, .06), 0 10px 26px -14px rgba(10, 18, 24, .28);
  --shadow-2: 0 2px 6px rgba(10, 18, 24, .08), 0 22px 44px -22px rgba(10, 18, 24, .40);
  --r:   18px;
  --r-s: 13px;
  --gut: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #070c0f;
    --bg-2:      #0b1317;
    --surface:   #111a1f;
    --surface-2: #162127;
    --ink:       #e8f0f4;
    --ink-2:     #b9cbd6;
    --muted:     #8ba3b1;
    --line:      #22313a;
    --line-2:    #1a262d;

    --brand:     #17b3a0;
    --brand-2:   #2ad3bb;
    --brand-ink: #02201c;
    --brand-dim: #0c2b28;

    --green:     #3ddc9a;  --green-dim: #0b2b21;
    --amber:     #f0a850;  --amber-dim: #2e1f0c;
    --red:       #ff8080;  --red-dim:   #2e1313;

    --shadow:   0 1px 2px rgba(0, 0, 0, .5), 0 10px 26px -14px rgba(0, 0, 0, .8);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .55), 0 22px 44px -22px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -18%, var(--brand-dim), transparent 62%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
body.plain { padding-bottom: env(safe-area-inset-bottom); }   /* jis safhe par neeche patti nahi */

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 27px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.err   { color: var(--red); font-size: 14px; min-height: 18px; margin: 8px 0 0; font-weight: 600; }

/* Paison ke hindse aik doosre ke neeche seedhe rehne chahiyen */
b, .num, .hero-amount, .line > b, .stat-n { font-variant-numeric: tabular-nums; }

/* ══ Harkat ══════════════════════════════════════════════════ */

@keyframes rise  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop   { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheen { to { background-position: 200% 0; } }

/* Halki si harkat — magar bagair intezar ke. Pehle har card apni bari ka
   intezar karta tha, aur us intezar mein wo nazar hi nahi aata tha: har
   dafa tab badalne par lamha bhar ke liye safha khali dikhta. Camp par
   mareez saamne khara hota hai; wahan khoobsurti se ziada foran nazar
   aana zaroori hai. */
.pane.on > * { animation: rise .22s cubic-bezier(.22,.9,.3,1); }

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

/* ══ Internet ki patti ═══════════════════════════════════════ */

.net {
  position: sticky; top: 0; z-index: 40;
  padding: 9px 16px; font-size: 14px; font-weight: 700; text-align: center;
  color: #fff; background: var(--amber);
  box-shadow: 0 6px 18px -10px rgba(0,0,0,.6);
}
.net.ok { background: var(--green); }

/* ══ PIN ka darwaza ══════════════════════════════════════════ */

.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 360px; text-align: center;
  padding: 34px 26px 30px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 26px; box-shadow: var(--shadow-2);
  animation: pop .4s cubic-bezier(.22,.9,.3,1) both;
}
.logo {
  width: 74px; height: 74px; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 36px;
  border-radius: 24px; color: var(--brand-ink);
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 28px -12px var(--brand);
}
.gate h1 { margin-bottom: 4px; }
.gate input {
  width: 100%; margin: 20px 0 14px; padding: 17px;
  font-size: 30px; font-weight: 700; text-align: center; letter-spacing: 14px; text-indent: 14px;
  color: var(--ink); background: var(--surface-2);
  border: 2px solid var(--line); border-radius: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.gate input:focus {
  outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-dim);
}

/* ══ Sar ka hissa ════════════════════════════════════════════ */

.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) var(--gut) 34px;
  color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.9);
}
.top > div:first-child { flex: 1; min-width: 0; }
.city { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.top .muted, .top .small { color: rgba(255,255,255,.82); }
.icon {
  flex: none; width: 44px; height: 44px; border-radius: 14px; font-size: 19px;
  color: var(--brand-ink); background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  transition: transform .12s, background .15s;
}
.icon:active { transform: scale(.92); background: rgba(255,255,255,.28); }

/* Aaj ka haal — sar ke bilkul neeche, aik nazar mein */
.glance {
  display: flex; gap: 10px;
  margin: -18px var(--gut) 0; padding: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  position: relative; z-index: 31;
}
.glance > div { flex: 1; text-align: center; min-width: 0; }
.glance .stat-n { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.glance .stat-l { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.glance > div + div { border-inline-start: 1px solid var(--line-2); }

/* ══ Neeche ki patti — angoothe ki pohnch mein ═══════════════ */

.tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 35;
  display: flex; gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  flex: 1; min-width: 0; padding: 9px 2px 7px; border: 0; border-radius: 14px;
  font-size: 12px; font-weight: 700; font-family: inherit;
  background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color .15s, background .15s;
}
.tab::before { font-size: 19px; line-height: 1; }
.tab[data-tab="book"]::before  { content: "📝"; }
.tab[data-tab="fit"]::before   { content: "🦻"; }
.tab[data-tab="money"]::before { content: "💰"; }
.tab[data-tab="past"]::before  { content: "📚"; }
.tab.on { color: var(--brand); background: var(--brand-dim); }
.tab:active { transform: scale(.96); }
/* Ginti ka nishan. Neeche wali patti par ye kone mein chipakta hai, aur
   kisi unwan ke sath aaye to us ke barabar mein khara rehta hai — warna
   wo unwan ke oopar chadh jata hai. */
.pill {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800;
  vertical-align: 2px;
}
.pill:empty { display: none; }
.tab .pill { position: absolute; top: 4px; inset-inline-start: 50%; transform: translateX(6px); }

/* ══ Panel aur card ══════════════════════════════════════════ */

.pane { display: none; padding: 16px var(--gut) 8px; }
.pane.on { display: block; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.card > h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card > h3 + .muted.small { margin-top: -8px; margin-bottom: 12px; }

/* ══ Khane ══════════════════════════════════════════════════ */

label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
label:last-child { margin-bottom: 0; }

input, select, textarea {
  width: 100%; margin-top: 6px; padding: 14px;
  font: 600 17px/1.3 inherit; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-s);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0; background: var(--surface);
  border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-dim);
}
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 55%, calc(100% - 13px) 55%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-inline-end: 34px; }

.row { display: flex; gap: 11px; }
.row > label { flex: 1; min-width: 0; }
.inline { display: flex; gap: 9px; align-items: center; }
.inline input { margin-top: 0; }

/* ══ Button ═════════════════════════════════════════════════ */

.btn {
  padding: 14px 17px; border: 0; border-radius: var(--r-s);
  font: 700 16px/1 inherit; white-space: nowrap;
  color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px -12px var(--brand);
  transition: transform .12s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.big { width: 100%; padding: 17px; font-size: 17px; }
.btn.ghost {
  background: transparent; color: var(--brand);
  border: 1.5px solid var(--brand); box-shadow: none;
}
.btn.warn { background: var(--red); box-shadow: none; color: #fff; }
.linkish {
  background: 0; border: 0; padding: 6px; font: 600 14px inherit;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
}

/* ══ Baqaya ═════════════════════════════════════════════════ */

.balance {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 13px 15px; margin: 4px 0 12px; border-radius: var(--r-s);
  background: var(--brand-dim); color: var(--brand);
  font-size: 14px; font-weight: 700;
}
.balance b { font-size: 21px; letter-spacing: -.02em; }
.fixed-note {
  padding: 13px 15px; border-radius: var(--r-s);
  background: var(--surface-2); border: 1px dashed var(--line);
  font-size: 13.5px; color: var(--muted); line-height: 1.5;
}
.fixed-note b { color: var(--ink); }

/* ══ Fehrist ════════════════════════════════════════════════ */

.rows { display: flex; flex-direction: column; gap: 10px; }
.item {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 13px 13px 13px 15px; background: var(--surface-2);
  animation: rise .28s cubic-bezier(.22,.9,.3,1) both;
}
.item .who { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 9px; }
/* Naam ka pehla haraf — fehrist mein aankh ko jagah pakarne ko milti hai */
.item .who::before {
  content: attr(data-first);
  flex: none; width: 32px; height: 32px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-dim); color: var(--brand);
  font-size: 14px; font-weight: 800;
}
.item .who.plain::before { display: none; }
.item .sub { font-size: 13px; color: var(--muted); margin-top: 5px; padding-inline-start: 41px; }
.item .sub b { color: var(--ink); }
.item .acts { display: flex; gap: 9px; margin-top: 12px; }
.item .acts .btn { flex: 1; padding: 12px; font-size: 15px; }
.waiting {
  border-inline-start: 4px solid var(--amber);
  background: linear-gradient(90deg, var(--amber-dim), var(--surface-2) 44%);
}

/* ══ Neeche ka hissa ════════════════════════════════════════ */

.foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px var(--gut) 22px;
}

/* ══ Chhoti khabar ══════════════════════════════════════════ */

.toast {
  position: fixed; inset-inline: 16px; z-index: 50;
  bottom: calc(84px + env(safe-area-inset-bottom));
  padding: 15px 18px; border-radius: var(--r-s); text-align: center;
  background: var(--ink); color: var(--bg);
  font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow-2);
  animation: pop .26s cubic-bezier(.22,.9,.3,1) both;
}
.toast.bad { background: var(--red); color: #fff; }
body.plain .toast { bottom: 22px; }

/* ══ Hisab wala safha (Asif) ════════════════════════════════ */

.shift-pick {
  width: 100%; margin: 0; padding: 10px 12px;
  font: 700 15px inherit; color: var(--brand-ink);
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.26);
  border-radius: 12px;
}
.shift-pick option { color: var(--ink); background: var(--surface); }

/* Sab se ooper wohi aik cheez jis ke liye safha khola jata hai */
.hero {
  text-align: center; padding: 26px 18px 22px;
  background: linear-gradient(150deg, var(--surface), var(--brand-dim));
  border-color: var(--brand-dim);
}
.hero-label {
  font-size: 12px; font-weight: 700; color: var(--brand);
  text-transform: uppercase; letter-spacing: .09em;
}
.hero-amount {
  font-size: 40px; font-weight: 850; letter-spacing: -.035em;
  margin: 8px 0 6px; line-height: 1;
}
/* Shift chal rahi ho to ye aakhri hisab nahi — dekhne mein bhi aakhri
   hisab jaisa na lage, warna aadmi isay maang samajh lega */
.hero.pending {
  background: linear-gradient(150deg, var(--surface), var(--amber-dim));
  border-color: var(--amber-dim);
}
.hero.pending .hero-label,
.hero.pending .hero-amount { color: var(--amber); }

/* Paisa kahan se aaya, kahan gaya — aik patti mein */
.flow { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 14px 0 10px; background: var(--line-2); }
.flow span { display: block; height: 100%; transition: width .5s cubic-bezier(.22,.9,.3,1); }
.flow .f-in  { background: linear-gradient(90deg, var(--green), var(--brand-2)); }
.flow .f-out { background: linear-gradient(90deg, var(--amber), var(--red)); }
.flow-key { display: flex; gap: 16px; justify-content: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.flow-key i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 6px; }
.flow-key .k-in  i { background: var(--green); }
.flow-key .k-out i { background: var(--amber); }

.line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line-2);
}
.line:last-child { border-bottom: 0; }
.line > span { color: var(--muted); font-size: 14px; }
.line > b { white-space: nowrap; font-size: 15.5px; }
.line.total {
  border-top: 2px solid var(--line); border-bottom: 0;
  margin-top: 6px; padding-top: 13px;
}
.line.total > span { color: var(--ink); font-weight: 700; font-size: 15px; }
.line.total > b { font-size: 18px; }

/* Din ba din — har din apni lakeer par */
.day {
  position: relative; padding: 13px 14px 13px 40px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface-2);
}
.day::before {
  content: ""; position: absolute; inset-inline-start: 17px; top: 18px;
  width: 9px; height: 9px; border-radius: 999px;
  background: var(--brand); box-shadow: 0 0 0 4px var(--brand-dim);
}
.day .who { font-weight: 700; font-size: 15px; }
.day .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Hospital ko kitna gaya, aur kitna banta tha */
.bar { height: 7px; border-radius: 999px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.bar.over > span { background: var(--amber); }

/* Bookings ka amal */
.ring { display: flex; align-items: center; gap: 14px; }
.ring-n { font-size: 30px; font-weight: 850; letter-spacing: -.03em; }

@media (min-width: 720px) {
  .pane, .glance, .foot { max-width: 620px; margin-inline: auto; }
  .glance { margin-top: -18px; }
}

/* Us din ka aik number jis ke liye ye card khola jata hai — baqi lakeeron
   mein gum na ho jaye */
.line.total.big { padding-top: 14px; }
.line.total.big > span { font-size: 15.5px; }
.line.total.big > b {
  font-size: 25px; letter-spacing: -.025em; color: var(--brand);
}
