/* ThengaKula */
:root {
  --green-900: #143D27;
  --green-800: #1F5A3A;
  --green-700: #1F7A3A;
  --green-500: #2E7D4F;
  --green-100: #E3F1E6;
  --husk: #7A4A26;
  --copra: #E0A468;
  --cream: #F6EFE2;
  --cream-2: #EFE5D2;
  --ink: #241A12;
  --muted: #6B5B4B;
  --line: #E2D6C1;
  --amber-bg: #FFF1D6; --amber-ink: #7A4B00;
  --red-bg: #FDE4E1; --red-ink: #9B2C1F;
  --blue-bg: #E2EEFB; --blue-ink: #1C4E86;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(36, 26, 18, .06), 0 4px 16px rgba(36, 26, 18, .06);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); line-height: 1.45; }
a { color: var(--green-700); }
a:hover { color: var(--green-900); }
h1 { font-size: 1.6rem; margin: .2em 0 .5em; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
img { max-width: 100%; }
code { background: var(--cream-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; }
[hidden] { display: none !important; }

.script-title { font-family: "Kaushan Script", cursive; font-weight: 400; color: var(--green-700); font-size: 2.6rem; margin: .1em 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: #fff; color: var(--ink); }
.btn-primary { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-900); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--cream-2); color: var(--ink); }
.btn-danger { background: #B23A2B; color: #fff; }
.btn-whatsapp { background: #128C4A; color: #fff; }
.btn-whatsapp:hover { background: #0E6E3A; color: #fff; }
.btn-google { background: #fff; border-color: #C9CDD2; color: #1F1F1F; }
.btn-google:hover { background: #F5F7F9; color: #1F1F1F; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--green-700); cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--red-ink); }
summary.link-btn { list-style: none; display: inline-block; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; }
label > input, label > select, label > textarea { display: block; margin-top: 6px; }
label .muted { font-weight: 400; }
.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
input, select, textarea { font: inherit; font-weight: 400; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #CDBFA6;
  border-radius: 10px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(46, 125, 79, .35); outline-offset: 1px; }
input:disabled { background: var(--cream-2); color: var(--muted); }
.check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
.check input { display: inline-block; width: 22px; min-height: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green-800); flex: none; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.field-error { color: var(--red-ink); font-size: .88rem; margin: -6px 0 0; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; font-weight: 500; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 10px 14px; border: 1px solid #CDBFA6; border-radius: 999px; background: #fff; cursor: pointer; }
.chip input:checked + span { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid rgba(46, 125, 79, .35); }

/* Cards & lists */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.list { display: flex; flex-direction: column; gap: 10px; }
.booking-card { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.booking-card:hover { color: inherit; border-color: #CDBFA6; }
.booking-card.needs-action { border-color: var(--copra); box-shadow: 0 0 0 2px rgba(224, 164, 104, .35); }
.booking-card.past { opacity: .85; }
.action-hint { color: var(--husk); font-weight: 600; font-size: .9rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.section-title { font-size: 1rem; color: var(--muted); margin: 22px 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.empty { text-align: center; padding: 30px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty h1, .empty h2 { margin: 6px 0 0; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-100); color: #17532F; }
.badge-amber { background: var(--amber-bg); color: var(--amber-ink); }
.badge-red { background: var(--red-bg); color: var(--red-ink); }
.badge-blue { background: var(--blue-bg); color: var(--blue-ink); }
.badge-gray { background: #ECE7DF; color: #554A3F; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.flash-ok { background: var(--green-100); color: #17532F; }
.flash-error { background: var(--red-bg); color: var(--red-ink); }
.flash-info { background: var(--blue-bg); color: var(--blue-ink); }

.step-n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--green-800); color: #fff;
  align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; flex: none; }

/* App (customer + collector) */
.app-body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(246, 239, 226, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--green-700); }
.brand-name { font-family: "Kaushan Script", cursive; font-size: 1.6rem; line-height: 1; }
.brand-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--copra); color: var(--ink); padding: 2px 8px; border-radius: 999px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green-800); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; overflow: hidden; text-decoration: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.app-main { max-width: 560px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 0; }
.back { text-decoration: none; font-weight: 600; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: #fff;
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; font-size: .78rem; font-weight: 600;
  color: var(--muted); text-decoration: none; border-radius: 10px; min-height: 48px; }
.tabbar a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--green-800); background: var(--green-100); }
.tabbar .tab-book svg { background: var(--green-800); color: #fff; border-radius: 50%; padding: 3px; }

.hero { text-align: center; padding: 10px 6px 4px; }
.hero-mark { width: 190px; height: auto; }
.hero-title { font-size: 3.2rem; margin: 0; }
.hero-tag { font-family: Georgia, "Times New Roman", serif; font-style: italic; color: #8A6216; font-size: 1.15rem; margin: 0 0 12px; }
.hero-text { color: var(--muted); margin: 0 0 18px; }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }

.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 20px 0; }
.auth-card { width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.auth-card form { text-align: left; }
.auth-mark { margin: 0 auto; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.map { height: 230px; border-radius: 12px; border: 1px solid var(--line); margin: 12px 0 6px; z-index: 0; }
.map-tall { height: 340px; }
.area-result { padding: 10px 12px; border-radius: 10px; background: var(--cream-2); margin-bottom: 12px; font-weight: 500; }
.area-result.ok { background: var(--green-100); color: #17532F; }
.area-result.warn { background: var(--amber-bg); color: var(--amber-ink); }

.stepper { display: flex; align-items: stretch; gap: 8px; }
.stepper input { text-align: center; font-size: 1.4rem; font-weight: 700; }
.stepper-btn { width: 56px; flex: none; border-radius: 12px; border: 1px solid #CDBFA6; background: #fff; font-size: 1.6rem; cursor: pointer; color: var(--green-800); }
.price-table { margin-top: 12px; }
.price-table summary { cursor: pointer; color: var(--green-700); font-weight: 600; }
.price-table table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.price-table td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.price-table td:last-child { text-align: right; font-weight: 600; }
.price-card { background: var(--green-900); color: #fff; border-color: var(--green-900); }
.price-card .muted { color: #CFE3D5; }
.price-card .check { margin-top: 12px; color: #fff; }
.price-card .field-error { color: #FFD3CC; margin-top: 8px; }
.price-total { font-size: 1.9rem; font-weight: 700; }

.status-card { border-top: 6px solid var(--green-500); }
.status-review { border-top-color: #E3A33B; }
.status-quoted { border-top-color: #3C7BC7; }
.status-cancelled, .status-completed { border-top-color: #B5A893; }
.status-rejected { border-top-color: #C24A3A; }
.status-title { margin: 8px 0 2px; }
.quote-box { background: var(--blue-bg); border-radius: 12px; padding: 14px; margin: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; background: var(--cream); border-radius: 12px; }
.person > div:nth-child(2) { flex: 1; }
.person-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--husk); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.details { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; margin: 0; }
.details dt { color: var(--muted); font-size: .9rem; }
.details dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--green-500); }
.cancel-box summary { cursor: pointer; color: var(--red-ink); font-weight: 600; padding: 8px 0; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.segmented { display: flex; background: var(--cream-2); border-radius: 12px; padding: 4px; }
.segmented a { flex: 1; text-align: center; padding: 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; }
.segmented a.active { background: #fff; color: var(--green-800); box-shadow: var(--shadow); }
.count { display: inline-block; background: var(--copra); color: var(--ink); border-radius: 999px; padding: 0 8px; font-size: .75rem; margin-left: 4px; }

.install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 10px;
  background: var(--green-900); color: #fff; padding: 10px 12px; border-radius: 14px; box-shadow: var(--shadow); max-width: 540px; margin: 0 auto; }
.install-banner span { flex: 1; font-weight: 500; }
.install-banner .link-btn { color: #fff; text-decoration: none; font-size: 1.1rem; padding: 6px; }

/* Staff (admin) */
.staff-body { background: #F4F1EA; }
.staff-shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.staff-nav { flex: 1 1 220px; max-width: 100%; background: var(--green-900); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 900px) { .staff-nav { flex: 0 0 240px; position: sticky; top: 0; height: 100vh; } }
.brand-light { color: #fff; }
.brand-light:hover { color: #fff; }
.staff-nav nav { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 899px) { .staff-nav nav { flex-direction: row; flex-wrap: wrap; } }
.staff-nav nav a { color: #D9EADF; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.staff-nav nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.staff-nav nav a.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; }
.staff-me { margin-top: auto; font-size: .9rem; color: #D9EADF; display: flex; flex-direction: column; gap: 6px; }
.staff-me .link-btn { color: #fff; }
.staff-main { flex: 999 1 560px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.staff-main .auth-wrap, .staff-body > .auth-wrap { padding: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.grid-2.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 500; }
.stat span { display: block; font-size: 1.7rem; font-weight: 700; color: var(--ink); }
.stat-amber { border-left: 5px solid #E3A33B; }
.stat-green { border-left: 5px solid var(--green-500); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid #EFE7DA; vertical-align: top; }
.table tr[onclick] { cursor: pointer; }
.table tr[onclick]:hover td { background: #FBF8F2; }
.tier-table td { padding: 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 500; }
.tabs a.active { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.search { display: flex; gap: 6px; }
.search input { min-width: 220px; }
.inline { display: inline; }
.inline-form { display: flex; gap: 6px; margin-top: 14px; }
.narrow { max-width: 560px; }
details.card summary { cursor: pointer; }

.stat-red { border-left: 5px solid #C24A3A; }
.done-card { border: 2px solid var(--green-500); }
.track-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.track-map { flex: 999 1 520px; height: 70vh; min-height: 420px; margin: 0; }
.track-list { flex: 1 1 280px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow: auto; }
.t-list { display: flex; flex-direction: column; gap: 10px; }
.t-item { display: flex; align-items: flex-start; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.t-item > div { flex: 1; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: none; vertical-align: -1px; }
.dot-live { background: #1F8A4C; box-shadow: 0 0 0 3px rgba(31,138,76,.25); }
.dot-stale { background: #E3A33B; }
.dot-off, .dot-never { background: #8C8C8C; }
.duty-card { display: flex; align-items: center; gap: 12px; }
.duty-card > div { flex: 1; }
.switch { position: relative; width: 58px; height: 34px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #CBBFAA; border-radius: 999px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + span { background: var(--green-500); }
.switch input:checked + span::after { transform: translateX(24px); }
.switch input:focus-visible + span { outline: 3px solid rgba(46,125,79,.35); }
.app-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; border-color: var(--copra); }
.app-card img { border-radius: 12px; }

.stat-blue { border-left: 5px solid #3C7BC7; }
.confirm-card { border: 2px solid #3C7BC7; }
.dispatch-map { height: 380px; margin: 0; }
.dispatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start; }
.dispatch-card { display: flex; flex-direction: column; gap: 10px; }
.dispatch-card.state-free { border: 2px solid var(--green-500); }
.dispatch-card p { margin: 0; }
.swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.suggest { background: var(--green-100); border-radius: 12px; padding: 12px; }
.suggest-label { color: #17532F; font-weight: 700; margin-bottom: 4px; }
.km { text-align: right; }
.chain a { font-weight: 600; }
.job-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #EFE7DA; }
.nearby summary { cursor: pointer; color: var(--green-700); font-weight: 600; }
.seq span { display: flex; width: 22px; height: 22px; border-radius: 50%; color: #fff; font: 700 12px/22px Inter, sans-serif; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.best-list .job-line:first-child { border-top: 0; }
.ready-list .job-line { padding: 10px 0; }
.directions-btn { margin-top: -4px; }

/* Wordmark: the coconut tree is the "l" of ThengaKula */
.wordmark { display: inline-block; white-space: nowrap; line-height: 1; padding-top: .55em; }
.wm-tree { display: inline-block; height: 1.95em; width: auto; vertical-align: -0.06em; margin: 0 -0.78em 0 -0.42em; }
.brand-name .wordmark { padding-top: .5em; }
.hero-title .wordmark, .script-title .wordmark { padding-top: .6em; }
