/* Built for a phone in one hand, outdoors in sunlight: big targets, strong
   contrast, light background only. Brand: deep green + gold. */
:root {
  --green: #0d4a2c; --green-2: #146b41; --green-soft: #e7f3ec;
  --gold: #c9a24a; --gold-soft: #fbf4e2;
  --ink: #15201a; --ink-2: #4b5a51; --line: #dfe6e1; --bg: #f4f6f4; --card: #fff;
  --red: #b42318; --red-soft: #fdecea; --amber: #a15c07; --amber-soft: #fff4e0;
  --blue: #1d4ed8; --blue-soft: #e8efff;
  --r: 14px; --tap: 52px;
  font-size: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Nastaliq Urdu", sans-serif; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-2); }
.boot { padding: 40vh 0 0; text-align: center; color: var(--ink-2); }

/* ---- top bar ---- */
.bar { position: sticky; top: 0; z-index: 5; background: var(--green); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; display: flex; align-items: center; gap: 10px; }
.bar h1 { font-size: 1.1rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sub { display: block; font-size: .78rem; font-weight: 400; opacity: .85; }
.bar button { background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 10px;
  min-width: 44px; height: 44px; padding: 0 10px; font-size: .95rem; }
.pill { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.16); white-space: nowrap; }
.pill.wait { background: var(--gold); color: #2b1d00; font-weight: 600; }
.pill.off { background: #6b7280; }

.banner { padding: 10px 14px; font-size: .9rem; background: var(--amber-soft); color: #5c3700; border-bottom: 1px solid #f3d9a8; }
.banner.red { background: var(--red-soft); color: var(--red); border-color: #f5c2bd; }
.wrap { padding: 12px; max-width: 720px; margin: 0 auto; }

/* ---- cards & lists ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px; min-height: var(--tap); text-align: start; width: 100%; cursor: pointer; }
.row:active { background: var(--green-soft); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: .82rem; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.done { background: #fbfcfb; }
.row.done .t { color: var(--ink-2); }
.sec { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 18px 4px 8px; font-weight: 600; }

.chip { display: inline-block; font-size: .75rem; padding: 3px 8px; border-radius: 999px; background: var(--bg);
  color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.water { background: var(--green-soft); color: var(--green); border-color: #bfe0cc; }
.chip.paid { background: var(--blue-soft); color: var(--blue); border-color: #c7d6fb; }
.chip.skip { background: var(--amber-soft); color: var(--amber); border-color: #f3d9a8; }
.chip.late { background: var(--red-soft); color: var(--red); border-color: #f5c2bd; }
.chip.due { background: var(--gold-soft); color: #7a5a0c; border-color: #ecd9a3; }
.chip.wait { background: var(--gold-soft); color: #7a5a0c; border-color: #ecd9a3; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.prog { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--green-2); border-radius: 99px; }
.count { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- tabs / segmented ---- */
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; min-height: 44px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--green); color: #fff; }

.seg.tabs { overflow-x: auto; scrollbar-width: none; }
.seg.tabs button { flex: none; padding: 0 14px; white-space: nowrap; }
.seg.filt button { font-size: .82rem; padding: 0 4px; min-height: 38px; }
.seg.filt button .muted { font-size: .75rem; }
.seg.filt button.on .muted { color: rgba(255,255,255,.8); }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tools .tl { font-size: .75rem; color: var(--ink-2); font-weight: 600; margin: 0 2px 4px; text-transform: uppercase; letter-spacing: .05em; }
.tools select.in, .tools .picker { min-height: 44px; font-size: .9rem; padding: 6px 10px; border-color: #dfe6e1; }
.pickrow { display: flex; gap: 6px; }
.picker { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  text-align: start; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xbtn { width: 46px; flex: none; min-height: 46px; padding: 0; cursor: pointer; color: var(--red); }

/* bottom sheet (area picker) */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 25, 16, .45); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; max-height: 82vh;
  background: var(--card); border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.sheet-h { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 16px 10px; font-size: 1.1rem; }
.sheet-list { overflow-y: auto; padding: 6px 6px; flex: 1; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.pick:active { background: var(--green-soft); }
.pick input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.pick .pn { flex: 1; font-weight: 600; }
.sheet-f { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }

button.in { background: #fff; color: var(--ink); border: 1px solid #c9d3cc; border-radius: 12px; }

.s.note { color: #6b4e00 !important; white-space: normal !important; }

.chips.smart .chip { min-height: 38px; padding: 6px 12px; font-size: .85rem; cursor: pointer; background: var(--card); }
.chips.smart .chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.plan-h { font-weight: 700; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.card.plan { margin-bottom: 0; }
.card.newc { border-color: #c7d6fb; background: var(--blue-soft); }
details.card summary { list-style: none; }
details.card summary::-webkit-details-marker { display: none; }

.bar .rfb { font-size: 1.35rem; }
.bar .rfb.spin { animation: rfspin 1s linear infinite; opacity: .8; }
@keyframes rfspin { to { transform: rotate(360deg); } }

/* ---- home: rider's day ---- */
.hero { background: linear-gradient(140deg, #0d4a2c 0%, #156a40 60%, #1d7a4b 100%); color: #fff; border-radius: 20px;
  padding: 16px 16px 14px; box-shadow: 0 8px 24px rgba(13, 74, 44, .22); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,74,.28), transparent 70%); pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hello { font-size: 1.15rem; font-weight: 700; }
.hdate { font-size: .82rem; opacity: .8; margin-top: 2px; }
.scope { font-size: .72rem; background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.hero-mid { display: flex; align-items: center; gap: 14px; margin-top: 14px; position: relative; }
.ring { width: 84px; height: 84px; flex: none; }
.ring-bg { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .5s; }
.ring-txt { position: absolute; inset-inline-start: 0; width: 84px; text-align: center; line-height: 1.05; }
.ring-txt b { display: block; font-size: 1.45rem; }
.ring-txt span { font-size: .75rem; opacity: .8; }
.ring-txt span { display: block; font-size: .68rem; margin-top: 2px; }
.ring-fg.low { stroke: #ff8a7a; }
.ring-txt.low b { color: #ffb4a8; }
.ring-load { width: 84px; height: 84px; flex: none; border-radius: 50%; border: 2px dashed rgba(255,255,255,.6);
  background: rgba(255,255,255,.08); color: #fff; font-weight: 700; font-size: .8rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.ring-load span { font-size: 1.5rem; }
.hstats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.hstats b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hstats b.low { color: #ffb4a8; }
.hstats.two { grid-template-columns: repeat(2, 1fr); }
.hstats span { font-size: .72rem; opacity: .82; }
.hload { grid-column: span 1; border: 1px dashed rgba(255,255,255,.55); background: rgba(255,255,255,.08); color: #fff;
  border-radius: 12px; font-size: .78rem; font-weight: 600; padding: 6px 4px; cursor: pointer; }
.hlinks { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.hlinks button { background: none; border: 0; color: #fff; opacity: .85; font-size: .8rem; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 4px; }
.hcta { margin-top: 14px; width: 100%; min-height: 56px; border: 0; border-radius: 14px; background: var(--gold); color: #241800;
  display: flex; justify-content: space-between; align-items: center; padding: 0 16px; font-size: 1.05rem; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.18); position: relative; }
.hcta:active { transform: translateY(1px); }
.hcta-sub { font-size: .85rem; font-weight: 700; opacity: .8; }
.hdone { margin-top: 14px; background: rgba(255,255,255,.14); border-radius: 14px; padding: 14px; text-align: center; font-weight: 700; }

.searchbox { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: #fff; border: 1px solid #d6ded9;
  border-radius: 14px; padding: 0 12px; min-height: 50px; }
.searchbox input { flex: 1; border: 0; outline: 0; font-size: 1rem; background: transparent; min-height: 48px; }
.searchbox:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px #b9dcc6; }

.wtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wt { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; }
.wt .wi { display: block; font-size: 1.1rem; }
.wt b { display: block; font-size: 1.1rem; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wt span:last-child { font-size: .7rem; color: var(--ink-2); }
.w-due b { color: #8a5a00; } .w-new b { color: var(--blue); } .w-money b { color: var(--red); font-size: .95rem; } .w-emp b { color: var(--green-2); }

.agrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.acard { display: block; width: 100%; text-align: start; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; border-inline-start: 4px solid var(--gold); }
.acard:active { background: var(--green-soft); }
.acard.is-done { border-inline-start-color: var(--green-2); background: #fbfdfb; }
.acard-top { display: flex; justify-content: space-between; align-items: baseline; }
.aname { font-weight: 700; font-size: 1.02rem; }
.afrac { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.afrac b { color: var(--ink); font-size: 1.05rem; }
.prog.thin { height: 6px; margin: 8px 0 6px; }
.ameta { font-size: .8rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ameta i { font-style: normal; color: var(--ink-2); }
.b-due { color: #8a5a00; font-weight: 600; } .b-late { color: var(--red); font-weight: 600; }
.b-money { color: var(--ink-2); } .ameta .ok { color: var(--green-2); font-weight: 600; }
@media (min-width: 560px) { .agrid { grid-template-columns: 1fr 1fr; } }

/* Customer screen: extra bottles card */
.xcard { border: 1px solid #f6c9c4; background: var(--red-soft); color: var(--ink); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.xcard b { display: block; color: var(--red); font-size: 1rem; }
.xcard .muted { margin-top: 2px; font-size: .85rem; }
.xpick { margin-top: 6px; font-weight: 700; font-size: 1.05rem; color: var(--red); }
.xcard.ok { border-color: #bfe0cc; background: var(--green-soft); }
.xcard.ok b { color: var(--green-2); }

/* Home: today's cash and extra-bottle progress */
.prbox { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.pr { display: block; width: 100%; padding: 10px 0; background: none; border: 0; color: inherit; text-align: start; font: inherit; }
button.pr { cursor: pointer; }
.pr + .pr { border-top: 1px solid var(--line); }
.pr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .92rem; font-weight: 600; }
.pr-n { font-weight: 400; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pr-n b { color: var(--ink); font-size: 1.05rem; }
.pr .prog.thin { margin: 8px 0 0; }
.pr-emp .prog i { background: var(--green-2); }
.pr-cash .prog i { background: var(--gold); }

.weekbar { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 12px;
  min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid #f3d9a8; background: var(--amber-soft);
  color: #5c3700; font-size: .98rem; cursor: pointer; text-align: start; }
.weekbar b { font-size: 1.15rem; }
.weekbar.ok { border-color: #bfe0cc; background: var(--green-soft); color: var(--green); font-weight: 600; cursor: default; }
.wk-h { display: flex; justify-content: space-between; align-items: baseline; text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); }
.wk-h a { font-size: .85rem; font-weight: 600; }

.owesbtn { border: 0; background: var(--red-soft); color: var(--red); font-weight: 700; font-size: 1rem; border-radius: 10px;
  padding: 6px 10px; cursor: pointer; display: inline-flex; gap: 8px; align-items: baseline; }
.owesbtn span { font-size: .78rem; font-weight: 600; opacity: .85; text-decoration: underline; }
.sheet table.t td.n { white-space: nowrap; }
.due-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.due-amt { text-align: end; font-weight: 700; color: var(--red); white-space: nowrap; }
.due-amt .muted { font-weight: 400; font-size: .75rem; }
.xclose { border: 0; background: var(--bg); border-radius: 50%; width: 36px; height: 36px; font-size: 1rem; cursor: pointer; }
.sheet-h { align-items: center; }
@media (min-width: 760px) {
  .sheet.side { left: auto; right: 0; top: 0; bottom: 0; margin: 0; width: 420px; max-width: 92vw; max-height: none;
    border-radius: 18px 0 0 18px; box-shadow: -8px 0 30px rgba(0,0,0,.18); }
}

.locknote { background: var(--green-soft); border: 1px solid #bfe0cc; color: var(--green); border-radius: 12px;
  padding: 10px 12px; font-size: .82rem; margin: 6px 0 4px; }
.locknote a { display: block; margin-top: 4px; font-weight: 700; }

.countbtn { margin-inline-start: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px;
  padding: 3px 8px; font-size: .8rem; font-weight: 600; cursor: pointer; vertical-align: middle; }

.gwrap { display: flex; justify-content: center; margin: 18px 0 6px; min-height: 44px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-2); margin: 14px 0 0; font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pinalt { margin-top: 14px; text-align: start; }
.pinalt summary { cursor: pointer; color: var(--ink-2); font-size: .88rem; text-align: center; }

/* the Undo bar */
#snack { position: fixed; left: 10px; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 60;
  max-width: 560px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 10px 10px 14px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform .2s, visibility .2s; }
#snack.on { transform: none; visibility: visible; }
.sn-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; }
.sn-t b, .sn-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-t span { opacity: .85; font-size: .82rem; }
.sn-b { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: transparent;
  color: #fff; font-weight: 700; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.sn-b.gold { background: var(--gold); color: #2b1d00; border-color: var(--gold); }

/* vehicle stock */
.vbtn { border-style: dashed; color: var(--green); }
.vcard { margin: 0; }
.vcard.low { border-color: var(--red); }
.vrow { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 4px; }
.vv { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vv.red { color: var(--red); }
.vl { font-size: .75rem; color: var(--ink-2); }
.sheet-f.one { grid-template-columns: 1fr; }
.sheet .reasons button { width: 100%; }

/* ---- buttons ---- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--tap);
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 1rem;
  padding: 0 14px; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.gold { background: var(--gold); color: #2b1d00; border-color: var(--gold); }
.btn.warn { background: var(--amber-soft); color: var(--amber); border-color: #f3d9a8; }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: #f5c2bd; }
.btn[disabled] { opacity: .45; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btns.three { grid-template-columns: 1fr 1fr 1fr; }
.sticky-foot { position: sticky; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%); }

/* ---- forms ---- */
label.f { display: block; font-size: .85rem; color: var(--ink-2); margin: 14px 0 6px; font-weight: 600; }
input.in, select.in, textarea.in { width: 100%; min-height: var(--tap); border: 1px solid #c9d3cc; border-radius: 12px;
  padding: 10px 12px; background: #fff; font-size: 1.05rem; }
textarea.in { min-height: 70px; }
input.in:focus, textarea.in:focus, select.in:focus { outline: 3px solid #b9dcc6; border-color: var(--green-2); }
.step { display: flex; align-items: stretch; gap: 8px; }
.step button { width: 64px; min-height: 60px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font-size: 1.6rem; font-weight: 700; color: var(--green); }
.step input { flex: 1; text-align: center; font-size: 1.6rem; font-weight: 700; min-height: 60px; }
.sum { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; }
.sum b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.big { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); font-size: .88rem; }
.err { color: var(--red); font-size: .9rem; margin-top: 8px; }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .95rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.reasons { display: grid; grid-template-columns: 1fr; gap: 8px; }
.reasons button { min-height: var(--tap); border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  text-align: start; padding: 0 14px; font-weight: 600; }
.reasons button.on { border: 2px solid var(--green); background: var(--green-soft); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.tile .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { font-size: .8rem; color: var(--ink-2); }
.tile.red .v { color: var(--red); }
.tile.green .v { color: var(--green-2); }

table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t th, table.t td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
table.t th { color: var(--ink-2); font-weight: 600; font-size: .78rem; }
table.t td.n, table.t th.n { text-align: end; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

.login { max-width: 380px; margin: 0 auto; padding: 12vh 20px 20px; text-align: center; }
.login img { width: 120px; height: 120px; border-radius: 28px; }
.login h1 { color: var(--green); margin: 14px 0 4px; }
.login form { text-align: start; margin-top: 18px; }

#toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; }

[dir="rtl"] .row, [dir="rtl"] .reasons button { text-align: right; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

/* Owner: the day as graphs */
.rptbtn { margin-top: 12px; }
.daynav { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; margin-bottom: 12px; }
.daynav button { font-size: 1.4rem; padding: 0; cursor: pointer; }
.daynav button:disabled { opacity: .35; cursor: default; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .82rem; color: var(--ink-2); }
.kpi small { font-size: .72rem; color: var(--ink-2); }
.kpi.bad b { color: #d03b3b; }
.dlt { font-size: .78rem; font-weight: 600; }
.dlt.up { color: #146b41; } .dlt.down { color: #a15c07; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { font-size: 9px; fill: var(--ink-2); }
.chart .now { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--ink-2); margin-bottom: 8px; }
.legend i, .rtop i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.rbar, .abar { padding: 10px 0; }
.rbar + .rbar, .abar + .abar { border-top: 1px solid var(--line); }
.rtop { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: .92rem; }
.rtrack { height: 10px; background: var(--bg); border-radius: 99px; margin: 7px 0 5px; overflow: hidden; }
.rtrack div { height: 100%; border-radius: 99px; }
.rnums { font-size: .85rem; } .rnums b { font-size: 1rem; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.flag { font-size: .76rem; padding: 3px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); }
.flag.bad { background: var(--red-soft); border-color: #f6c9c4; color: var(--red); font-weight: 600; }
.rareas { font-size: .76rem; margin-top: 4px; }
.stack { display: flex; gap: 2px; height: 14px; margin-top: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.stack div { height: 100%; }
.tip { position: absolute; z-index: 50; background: var(--ink); color: #fff; font-size: .8rem; padding: 6px 10px; border-radius: 8px; pointer-events: none; max-width: 260px; }
button.kpi, button.abar { width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; }
button.abar { display: block; background: none; border: 0; border-radius: 0; }

/* Urdu help line under English names, main buttons and No water reasons.
   plaintext: the Urdu runs right-to-left but lines up with the English above. */
.ur { display: block; unicode-bidi: plaintext; text-align: left; font-size: .82em; font-weight: 400; opacity: .8; line-height: 1.5; margin-top: 1px; }
.btn:has(.ur) { flex-direction: column; gap: 2px; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
.btn .ur, .sn-b .ur, .bar .ur { text-align: center; }
.bar .ur { text-align: left; }
.btn .ur, .reasons button .ur, .sheet button .ur { font-size: .78em; opacity: .85; line-height: 1.7; }
.row .t .ur { font-weight: 400; color: var(--muted, #667); opacity: 1; }
.sn-b .ur { font-size: .75em; }
.reasons button:has(.ur), .sheet button:has(.ur) { padding-top: 7px; padding-bottom: 7px; line-height: 1.3; }
.reasons button .ur, .sheet button .ur { margin-top: 3px; }
.sn-b:has(.ur) { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding-top: 4px; padding-bottom: 4px; }
.bar h1 .sub.ur { line-height: 1.6; font-size: .74rem; margin-top: 4px; }

/* Customer info card, kept short so Give water stays near the top:
   three small tiles, a thin money bar, then one-line details. */
.cinfo { padding: 10px; }
.ci-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ci-stat { background: var(--bg); border-radius: 10px; padding: 6px 4px; text-align: center; min-width: 0; }
.ci-stat span { display: block; font-size: .64rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.ci-stat b { display: block; font-size: .95rem; margin-top: 1px; color: var(--green); white-space: nowrap; }
.ci-stat small { display: block; font-size: .68rem; color: var(--ink-2); line-height: 1.25; }
.ci-stat.late { background: var(--red-soft); }
.ci-stat.late b { color: var(--red); }
.ci-money { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 7px 12px;
  border: 0; border-radius: 10px; text-align: start; }
.ci-money span { font-size: .82rem; font-weight: 600; }
.ci-money b { font-size: 1.05rem; flex: 1; text-align: end; }
.ci-money em { font-style: normal; font-size: .76rem; font-weight: 600; text-decoration: underline; opacity: .85; }
.ci-money.owe { background: var(--red-soft); color: var(--red); cursor: pointer; }
.ci-money.adv { background: var(--green-soft); color: var(--green-2); }
.ci-lines { margin-top: 6px; font-size: .9rem; font-weight: 600; }
.ci-lines > div { padding: 5px 2px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.ci-two { display: flex; justify-content: space-between; gap: 10px; }
.ci-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ci-bot .muted { font-weight: 400; font-size: .8rem; }
.ci-bot .countbtn { margin: 0; flex: none; padding: 3px 8px; font-size: .8rem; }
.ci-lines .ic { font-style: normal; display: inline-block; width: 1.6em; }
.ci-bot .muted { display: none; }   /* how the count was made; kept off to stay one line */
