/* AutoRaseed: petrol-pump board look. Deep pump green shell, signal yellow for the one main action,
   and money shown on a rate board. Built for bright daylight, big thumbs and small Android phones. */
:root {
  --pump: #0a4a31;
  --pump-deep: #063423;
  --ink: #0d2b1f;
  --muted: #486056;
  --ground: #edf2ee;
  --panel: #ffffff;
  --tint: #e1efe7;
  --line: #c6d3ca;
  --yellow: #ffc815;
  --yellow-deep: #e3ac00;
  --on-yellow: #20180a;
  --board: #12160f;
  --tile: #222a1c;
  --digit: #ffd53d;
  --danger: #b3261e;
  --danger-tint: #fbe9e7;
  --ok: #0b6b3a;
  --wa: #0e7c45;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(6, 52, 35, 0.14);
  --col: 560px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  caret-color: var(--pump);
  accent-color: var(--pump);
  -webkit-tap-highlight-color: transparent;
}
html[lang="ur"] body {
  font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", system-ui, "Segoe UI", sans-serif;
  line-height: 2.05;
}
::selection { background: var(--yellow); color: var(--on-yellow); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
h1, h2, p, ol { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--pump); }
img { max-width: 100%; }
.icon { flex: none; }
[dir="rtl"] .icon-back, [dir="rtl"] .icon-forward { transform: scaleX(-1); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#app { max-width: var(--col); margin: 0 auto; min-height: 100dvh; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--pump); color: #fff;
}
.top :focus-visible { outline-color: var(--yellow); }
.top-title { flex: 1; min-width: 0; font-size: 1.15rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--yellow); color: var(--on-yellow); flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.14); color: inherit; flex: none; }
.icon-btn:active { background: rgba(255, 255, 255, 0.26); }
.icon-btn-plain { background: transparent; color: var(--muted); }
.icon-btn-plain:active { background: var(--tint); }
.lang-btn { min-height: 48px; padding: 0 14px; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 22px; background: transparent; color: #fff; font-weight: 700; font-size: 0.95rem; line-height: 1.6; flex: none; }
.lang-btn[lang="ur"] { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif; }
.lang-btn[lang="en"] { font-family: system-ui, "Segoe UI", Roboto, sans-serif; }

.main { display: flex; flex-direction: column; gap: 16px; padding: 16px 16px 32px; }
.main.has-tabs { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.sync { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 16px; background: #fff3c4; color: #4a3800; font-size: 0.92rem; }

/* ---------- bottom tabs ---------- */
.tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: var(--col); margin: 0 auto;
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; padding: 6px 4px; color: var(--muted); text-decoration: none; font-size: 0.82rem; font-weight: 600; line-height: 1.5; border-top: 4px solid transparent; }
.tab.on { color: var(--pump); border-top-color: var(--yellow); font-weight: 800; }
.tab:active { background: var(--tint); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 8px 18px; width: 100%;
  border: 2px solid transparent; border-radius: var(--radius);
  font-weight: 700; font-size: 1.05rem; text-decoration: none; text-align: center;
  transition: transform 120ms ease-out, background-color 120ms ease-out;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn-xl { min-height: 68px; font-size: 1.25rem; font-weight: 800; }
.btn-primary { background: var(--yellow); color: var(--on-yellow); box-shadow: var(--shadow); }
.btn-primary:hover { background: #ffd23d; }
.btn-primary:active { background: var(--yellow-deep); }
.btn-secondary { background: var(--panel); color: var(--pump); border-color: var(--pump); }
.btn-secondary:active { background: var(--tint); }
.btn-plain { background: transparent; color: var(--pump); border-color: var(--line); }
.btn-plain:active { background: var(--tint); }
.btn-wa { background: var(--wa); color: #fff; box-shadow: var(--shadow); }
.btn-wa:active { background: #0a6537; }
.btn-danger { background: transparent; color: var(--danger); border-color: #e5b5b0; }
.btn-danger:active { background: var(--danger-tint); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 2px; border: 0; background: none; color: var(--pump); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 700; font-size: 0.98rem; }
.field-hint { color: var(--muted); font-size: 0.9rem; }
.input {
  width: 100%; min-height: 54px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--panel);
  font-size: 1.08rem;
}
textarea.input { min-height: 80px; resize: vertical; line-height: inherit; }
.input::placeholder { color: #5c7067; opacity: 1; }
.input:focus { outline: none; border-color: var(--pump); box-shadow: 0 0 0 3px rgba(10, 74, 49, 0.2); }
.pin { font-size: 1.9rem; font-weight: 800; letter-spacing: 0.4em; text-align: center; min-height: 68px; }
.code { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.12em; text-align: center; text-transform: uppercase; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; }
.check input { width: 26px; height: 26px; flex: none; }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.wa-ink { color: var(--wa); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 12px; }
.note { color: var(--muted); font-size: 0.92rem; }
.lead { font-size: 1.05rem; }
.empty { padding: 22px 14px; text-align: center; color: var(--muted); background: var(--panel); border: 2px dashed var(--line); border-radius: var(--radius); }
.count { color: var(--muted); font-weight: 600; margin-bottom: 8px; }

/* ---------- the rate board (totals) ---------- */
.board { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--board); max-width: 100%; }
.board-cur { color: var(--digit); font-weight: 800; font-size: 1rem; font-family: system-ui, "Segoe UI", Roboto, sans-serif; line-height: 1; }
.board-digits { display: inline-flex; align-items: center; gap: 3px; font-family: system-ui, "Segoe UI", Roboto, sans-serif; }
.board-digit {
  display: inline-grid; place-items: center; min-width: 0.95em; height: 1.5em; padding: 0 0.1em;
  border-radius: 5px; color: var(--digit); font-weight: 800; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(var(--tile) 0 47%, #0b0e08 47% 53%, var(--tile) 53% 100%);
  animation: tick 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.board-sep { color: var(--digit); font-weight: 800; font-size: 1.4rem; line-height: 1; align-self: flex-end; }
.board-caption { color: var(--muted); font-weight: 700; margin-top: -8px; }
@keyframes tick { from { transform: translateY(-3px); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .board-digit { animation: none; } .btn { transition: none; } }

/* ---------- strips, blocks, rows ---------- */
.strip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--tint); color: var(--pump-deep); font-weight: 700; text-decoration: none; }
.strip > span { flex: 1; }
.strip-bad { background: var(--danger-tint); color: #7a1610; }
.strip-plain { background: var(--panel); border: 2px solid var(--line); }
.block { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.block-title { font-size: 1.12rem; font-weight: 800; }
.list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 14px; color: inherit; text-decoration: none; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); text-align: start; width: 100%; }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--tint); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.row-no { display: inline-block; margin-inline-end: 8px; padding: 0 7px; border-radius: 8px; background: var(--tint); color: var(--pump); font-weight: 800; font-size: 0.86rem; font-variant-numeric: tabular-nums; font-family: system-ui, "Segoe UI", Roboto, sans-serif; line-height: 1.6; vertical-align: middle; }
.row-sub { color: var(--muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.row-amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.row-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.82rem; }
.row-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--pump); flex: none; }
.row-link > .icon-forward { color: var(--muted); }
.row-edit { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--tint); border-bottom: 1px solid var(--line); }
.pill { padding: 1px 8px; border-radius: 10px; font-weight: 700; font-size: 0.78rem; line-height: 1.6; }
.pill-ok { background: #d6efe0; color: #07512b; }
.pill-due { background: var(--danger-tint); color: #7a1610; }
.pill-wait { background: #fff3c4; color: #4a3800; }
.search { display: flex; align-items: center; gap: 8px; padding-inline-start: 14px; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.search:focus-within { border-color: var(--pump); }
.search-go { width: 100%; min-height: 58px; padding: 8px 14px; text-align: start; font-size: 0.98rem; line-height: 1.35; }
.search-go:active { background: var(--tint); }
html[lang="ur"] .search-go { line-height: 1.9; }
.search .input { border: 0; background: transparent; padding-inline-start: 4px; color: var(--ink); }
.search .input:focus { box-shadow: none; }

/* ---------- welcome and sign-up ---------- */
.welcome { display: flex; flex-direction: column; gap: 18px; min-height: 100dvh; padding: 16px 20px 28px; background: var(--pump); color: #fff; }
.welcome :focus-visible { outline-color: var(--yellow); }
.welcome-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.welcome-brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.4rem; font-weight: 800; font-family: system-ui, "Segoe UI", Roboto, sans-serif; }
.welcome-title { font-size: 2.1rem; line-height: 1.2; font-weight: 800; margin-top: 18px; text-wrap: balance; }
html[lang="ur"] .welcome-title { line-height: 1.9; font-size: 1.9rem; }
.welcome-line { font-size: 1.12rem; color: #dcebe2; max-width: 34ch; }
.demo { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; background: var(--pump-deep); }
.demo .chips { width: 100%; }
.welcome .seg-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); font-size: 1.1rem; }
.welcome .seg-btn.on { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }
.offer { text-align: center; font-weight: 700; color: var(--yellow); }
.welcome .btn-plain { color: #fff; border-color: rgba(255, 255, 255, 0.55); margin-top: auto; }
.welcome .btn-plain:active { background: rgba(255, 255, 255, 0.12); }
.steps { display: flex; gap: 8px; }
.steps span { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--pump); }
.ask { font-size: 1.5rem; font-weight: 800; line-height: 1.3; text-wrap: balance; }
html[lang="ur"] .ask { line-height: 1.9; }
.ask-sub { color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 108px; padding: 12px 8px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); font-weight: 700; text-align: center; }
.tile .icon { color: var(--pump); }
.tile:active, .tile.on { border-color: var(--pump); background: var(--tint); }

/* ---------- receipt editor ---------- */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.chip { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 66px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); text-align: start; }
.chip:active { background: var(--tint); }
.chip.on { border-color: var(--pump); background: var(--tint); }
.chip-name { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
html[lang="ur"] .chip-name { line-height: 1.9; }
.chip-price { color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; font-family: system-ui, "Segoe UI", Roboto, sans-serif; line-height: 1.3; }
.chip-count { position: absolute; top: -8px; inset-inline-end: -6px; min-width: 30px; padding: 0 6px; border-radius: 15px; background: var(--yellow); color: var(--on-yellow); font-weight: 800; font-size: 0.9rem; line-height: 1.7; text-align: center; font-family: system-ui, sans-serif; }
.chip-new { flex-direction: row; align-items: center; gap: 8px; border-style: dashed; border-color: var(--pump); color: var(--pump); }
.demo .chip { min-height: 58px; border-color: transparent; }
.newjob { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--tint); }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.line-top { display: flex; align-items: center; gap: 6px; }
.line-name { font-weight: 700; border-color: transparent; background: transparent; padding-inline: 6px; min-height: 48px; }
.line-name:hover { border-color: var(--line); }
.line-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.qty-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 0; background: var(--tint); color: var(--pump); }
.qty-btn:active { background: #cfe3d7; }
.qty-n { min-width: 40px; text-align: center; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.price { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); }
.price-in { width: 124px; min-height: 48px; font-weight: 800; font-variant-numeric: tabular-nums; }
.line-total { margin-inline-start: auto; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.line-extra { display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.seg-btn { min-height: 52px; padding: 6px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
html[lang="ur"] .seg-btn { line-height: 1.8; }
.seg-btn.on { border-color: var(--pump); background: var(--pump); color: #fff; }
.balance { font-weight: 800; color: var(--danger); }
.suggest { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 12px; border: 2px solid var(--pump); border-radius: 12px; background: var(--tint); color: var(--ink); text-align: start; }
.suggest > span { flex: 1; }
.bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 10px; max-width: var(--col); margin: 0 auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--pump-deep); }
.bar .btn { width: auto; flex: 1; min-width: 132px; }
.bar-board { min-width: 0; }
.bar-space { height: 84px; }

/* ---------- a finished receipt ---------- */
.paper-wrap { border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.paper-wrap .empty { border: 0; }
.paper { display: block; width: 100%; height: auto; }

/* ---------- my shop ---------- */
.shop-head { display: flex; align-items: center; gap: 14px; }
.shop-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: contain; background: var(--panel); border: 1px solid var(--line); flex: none; }
.shop-logo-empty { display: inline-grid; place-items: center; color: var(--muted); }
.shop-name { font-size: 1.25rem; font-weight: 800; }
.shop-phone { color: var(--muted); font-variant-numeric: tabular-nums; text-align: start; }
[dir="rtl"] .shop-phone { text-align: end; }
.logo-box { display: grid; place-items: center; min-height: 220px; padding: 18px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--panel); }
.logo-box img { max-height: 260px; object-fit: contain; }
.logo-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.pad-wrap { position: relative; border: 2px solid var(--pump); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.pad { display: block; width: 100%; height: 230px; touch-action: none; cursor: crosshair; }
.pad-line { position: absolute; inset-inline: 24px; bottom: 54px; border-bottom: 2px dashed var(--line); pointer-events: none; }
.sig-now { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.sig-now img { max-height: 64px; max-width: 55%; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--panel); box-shadow: 0 0 0 2px var(--line); color: #fff; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }
.steps-list, .how { margin: 0; padding-inline-start: 1.4em; display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
.how { list-style: none; padding: 0; gap: 12px; }
.how li { display: flex; align-items: center; gap: 12px; }

/* ---------- toast ---------- */
#toast { position: fixed; inset-inline: 16px; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 20; max-width: 520px; margin: 0 auto; padding: 14px 16px; border-radius: 12px; background: var(--board); color: #fff; font-weight: 700; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 160ms ease-out, transform 160ms ease-out; }
#toast.show { opacity: 1; transform: none; }
/* mistakes show at the top, where the keyboard cannot cover them */
#toast.bad { background: var(--danger); top: calc(72px + env(safe-area-inset-top)); bottom: auto; }

/* ---------- printing: only the receipt ---------- */
@media print {
  body { background: #fff; }
  .top, .tabs, .btn, .grid-2, #toast, #sync-note, .bar { display: none !important; }
  .main { padding: 0; }
  .paper-wrap { border: 0; box-shadow: none; border-radius: 0; }
}

/* ---------- owner's admin page ---------- */
.admin { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }
.admin-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--pump); color: #fff; }
.admin-top h1 { flex: 1; font-size: 1.2rem; }
.admin-top .btn { width: auto; min-height: 44px; color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.admin-card { max-width: 440px; margin: 40px auto; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 12px; }
.admin-tools .input { flex: 1; min-width: 220px; }
.admin-tools .btn { width: auto; }
.admin-sum { font-weight: 700; margin-top: 18px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { background: var(--tint); font-weight: 800; position: sticky; top: 0; }
td.num { font-variant-numeric: tabular-nums; text-align: end; }
td .btn { width: auto; min-height: 40px; padding: 4px 10px; font-size: 0.88rem; }
.acts { display: flex; gap: 6px; }
.codebox { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; padding: 14px; border: 2px solid var(--pump); border-radius: var(--radius); background: var(--tint); }
.codebox .btn { width: auto; }
.codebig { font-size: 1.7rem; font-weight: 800; letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
