/* Apon Partner. The palette is the farmer app's (deep ocean, fintech blue, aqua, harvest gold). Built for one hand and a phone in
   daylight: large type, one clear action per screen, 52px touch targets, and strong contrast in both light and dark. */
:root {
  --ocean: #123b67; --blue: #1769e0; --aqua: #08b9d6; --gold: #f2a33a; --emerald: #0f8f58; --coral: #c62f4c;
  --bg: #eef3f9; --surface: #ffffff; --line: #d3deeb; --text: #0f1f33; --muted: #4a5d73;
  --tint: #e7eff9; --on-primary: #ffffff; --radius: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c1523; --surface: #18283d; --line: #2b4160; --text: #eaf1fa; --muted: #b0bfd2; --tint: #22364f;
    --blue: #5b9bff; --aqua: #3cd3ea; --emerald: #3ecf8e; --coral: #ff8196; --ocean: #1b4a7e; --on-primary: #06162b; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Noto Sans Devanagari", sans-serif; background: var(--bg); color: var(--text); overscroll-behavior-y: contain; }
[hidden] { display: none !important; }
h1, h2, p, ul, ol { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; } h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, Consolas, monospace; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--ocean); }
@media (prefers-color-scheme: dark) { .boot { color: var(--aqua); } }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 18px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; width: 100%; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-primary); }
.btn.danger { color: var(--coral); border-color: var(--coral); }
.btn.big { min-height: 60px; font-size: 18px; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--aqua); animation: spin .8s linear infinite; }
.btn.primary.busy::after { border-color: rgba(255,255,255,.45); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.busy::after { animation-duration: 2.4s; } }
.link { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 700; padding: 12px 8px; min-height: 48px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; color: var(--muted); }
input, select, textarea { width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 17px; }
textarea { min-height: 80px; resize: vertical; }
input.code { text-align: center; font-size: 34px; font-weight: 800; letter-spacing: .45em; padding-left: .45em; font-family: ui-monospace, Consolas, monospace; min-height: 72px; }
.msg { min-height: 22px; color: var(--coral); font-weight: 600; font-size: 14px; } .msg.ok { color: var(--emerald); }
.stack { display: grid; gap: 14px; width: 100%; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* language and sign-in */
.center { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 28px 20px; max-width: 460px; margin: 0 auto; text-align: center; }
.shell .center { min-height: 60vh; }
.logo { width: 104px; height: 104px; object-fit: contain; border-radius: 24px; background: #fff; padding: 6px; }
.lang-title { font-size: 24px; } .lang-sub { color: var(--muted); font-weight: 600; }
.login { width: 100%; text-align: left; }

/* shell */
.shell { max-width: 620px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--ocean); color: #fff; }
.top img { width: 40px; height: 40px; border-radius: 10px; background: #fff; padding: 2px; }
.top div { display: grid; line-height: 1.25; flex: 1; min-width: 0; } .top strong { font-size: 17px; }
.top span { font-size: 13px; color: #cfe0fb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .offline { flex: none; background: var(--gold); color: #1d1300; font-weight: 800; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; min-height: 64px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.tab.on { color: var(--blue); } .tab.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
.dot { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--coral); color: #fff; font-style: normal; font-size: 12px; line-height: 20px; text-align: center; }
@media (prefers-color-scheme: dark) { .dot { color: #2a0009; } }
.page { display: grid; gap: 14px; padding: 16px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; }
button.card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border-left-width: 6px; }
.order.new { border-left-color: var(--gold); } .order.accepted { border-left-color: var(--blue); } .order.dispatched { border-left-color: var(--aqua); }
.order.delivered { border-left-color: var(--emerald); } .order.cancelled { border-left-color: var(--muted); opacity: .8; }
.name { font-size: 20px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--tint); color: var(--text); }
.tag.new { background: var(--gold); color: #1d1300; } .tag.accepted { background: var(--blue); color: var(--on-primary); }
.tag.dispatched { background: var(--aqua); color: #04222a; } .tag.delivered { background: var(--emerald); color: var(--on-primary); }
.cash { color: var(--text); background: color-mix(in srgb, var(--gold) 30%, var(--surface)); padding: 2px 10px; border-radius: 8px; }
.paid { color: var(--emerald); font-weight: 700; }
.due { font-weight: 800; color: #8a4b00; background: color-mix(in srgb, var(--gold) 26%, var(--surface)); border-radius: 10px; padding: 6px 12px; justify-self: start; }
@media (prefers-color-scheme: dark) { .due { color: var(--gold); } }
.stats { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; }
.stat b { font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; } .stat span { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat.hot { background: var(--gold); border-color: var(--gold); color: #1d1300; } .stat.hot span { color: #3a2800; }
.segs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--tint); border-radius: 14px; padding: 5px; }
.seg { min-height: 46px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 800; cursor: pointer; }
.seg.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.empty { text-align: center; padding: 44px 16px; display: grid; gap: 6px; font-weight: 700; }

/* one order */
.detail .back { justify-self: start; padding-left: 0; }
.note { background: var(--tint); border-radius: 10px; padding: 10px 12px; }
.note.bad { background: color-mix(in srgb, var(--coral) 16%, var(--surface)); color: var(--text); font-weight: 700; border: 1px solid var(--coral); }
.items { list-style: none; padding: 0; display: grid; }
.items li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.items li:last-child { border-bottom: 0; }
.qty { font-weight: 800; white-space: nowrap; }
.total { border-top: 2px solid var(--line); padding-top: 10px; }
.money .amount { font-size: 30px; font-weight: 800; display: block; line-height: 1.2; }
.actions { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); display: grid; gap: 10px; padding: 12px; margin: 0 -4px; background: var(--bg); border-radius: 18px; box-shadow: 0 -6px 18px rgba(0,0,0,.12); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-top: 1px solid var(--line); } .kv span:last-child { text-align: right; overflow-wrap: anywhere; font-weight: 600; }
.hero { background: var(--ocean); color: #fff; border-color: var(--ocean); } .hero > span { color: #cfe0fb; font-weight: 700; } .hero b { font-size: 38px; line-height: 1.15; }
.hero .row { font-size: 14px; color: #dbe8fb; }
.steps { padding-left: 22px; display: grid; gap: 10px; }

/* sheets and messages */
#sheet { position: fixed; inset: 0; z-index: 20; display: grid; align-items: end; }
.scrim { position: absolute; inset: 0; background: rgba(4, 12, 24, .6); }
.panel { position: relative; width: 100%; max-width: 620px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 16px; }
.panel h2 { font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.chip.on { background: var(--blue); border-color: var(--blue); color: var(--on-primary); }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 14px; background: #0f1f33; color: #fff; font-weight: 700; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
#toast.err { background: #8f1730; }
