/* Web đặt xe — tông núi rừng Sa Pa: xanh rừng thông, xanh ruộng bậc thang, trắng sương mù, vàng nắng sớm */
:root {
  --bg: #eef3ec; --card: #ffffff; --ink: #14281d; --muted: #56675c; --line: #d3ddd3;
  --brand: #1b4332; --go: #2d6a4f; --go-ink: #fff; --money: #f4c95d; --money-ink: #3a2a00;
  --ok: #2d6a4f; --ok-bg: #dcefe3; --wait: #7a5000; --wait-bg: #fbefcc;
  --run: #1f6f8b; --run-bg: #e0eff4; --bad: #b0302b; --bad-bg: #fbe3e1;
  --leaf: #52b788; --glass: rgb(255 255 255 / .82);
  --r: 12px;
  color-scheme: light dark;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1813; --card: #16241c; --ink: #e6efe8; --muted: #9fb2a5; --line: #26392d;
    --brand: #95d5b2; --go: #52b788; --go-ink: #06140c; --money: #f4c95d;
    --ok: #74c69d; --ok-bg: #173323; --wait: #ffcf6b; --wait-bg: #33280e;
    --run: #8ecae6; --run-bg: #16303a; --bad: #ff8f86; --bad-bg: #3a1a19;
    --leaf: #74c69d; --glass: rgb(22 36 28 / .85);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; }
a { color: var(--brand); }
small { color: var(--muted); font-weight: 400; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
code { background: var(--bg); padding: 0 .3rem; border-radius: 4px; }

/* ---------- Nút & ô nhập ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; text-decoration: none;
  padding: .55rem 1rem; font-weight: 600; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: wait; }
.btn.primary { background: var(--go); border-color: var(--go); color: var(--go-ink); }
.btn.call { background: var(--money); border-color: var(--money); color: var(--money-ink); }
.btn.danger { color: var(--bad); border-color: currentColor; background: transparent; }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger-text { color: var(--bad); }
.btn.block { width: 100%; }
.btn.big { min-height: 52px; font-size: 1.05rem; padding: .7rem 1.4rem; }
.btn.icon { padding: .5rem .7rem; min-width: 44px; }
.link { border: 0; background: none; color: var(--brand); text-decoration: underline; cursor: pointer; padding: 0; }

label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; align-content: start; }
label > small { display: inline; }
label.check, label.inline { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
label.check input, label.inline input { width: auto; min-height: 0; accent-color: var(--go); }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  padding: .6rem .75rem; font-weight: 400; font-size: 1rem; min-height: 44px;
}
textarea { resize: vertical; }
input[readonly] { opacity: .8; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: .92rem; margin-bottom: .35rem; padding: 0; }
.form-error { color: var(--bad); margin: 0; min-height: 1.2em; font-size: .92rem; }
.ok-text { color: var(--ok); margin: .3rem 0; }
.bad-text { color: var(--bad); }
.note { color: var(--muted); font-size: .88rem; margin: 0; }
.center { text-align: center; justify-content: center; }
.break { word-break: break-all; }
.stack { display: grid; gap: .7rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem; }
.grid { display: grid; gap: .8rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 700px) { .grid { grid-template-columns: 1fr 1fr; } .grid .full { grid-column: 1 / -1; } }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Trang chủ ---------- */
.pub-top, .top {
  position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; flex-wrap: wrap;
  padding-top: calc(.55rem + env(safe-area-inset-top, 0px));
}
.brand { font-weight: 800; color: var(--brand); font-size: 1.2rem; margin-right: auto; display: flex; align-items: center; gap: .5rem; letter-spacing: -.01em; }
.logo-img { display: block; border-radius: 10px; }
.auth { display: grid; gap: 2rem; padding: 2rem 1rem 3rem; max-width: 1080px; margin: 0 auto; align-items: start; }
@media (min-width: 860px) { .auth { grid-template-columns: 1fr 420px; padding-top: 3.5rem; } }
.hero-tag {
  margin: 0; font-size: clamp(4rem, 14vw, 7.5rem); font-weight: 800; line-height: .9; letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 2px var(--brand);
}
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.02em; margin-top: .3rem; max-width: 16ch; }
.hero-intro { color: var(--muted); font-size: 1.08rem; max-width: 42ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.6rem; }
.fares { border-top: 2px solid var(--ink); padding-top: .8rem; max-width: 560px; }
.fares h2 { margin-bottom: .4rem; }
.fare-row { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.fare-row div { display: grid; }
.fare-row span { color: var(--muted); font-size: .9rem; }
.auth-card { display: grid; gap: 1rem; }
.auth-card form { display: grid; gap: .9rem; }
.ref-banner { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: .7rem .9rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 10px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: .6rem; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }
.roles legend { grid-column: 1 / -1; }
.role-opt, .vt-opt { position: relative; }
.role-opt input, .vt-opt input { position: absolute; opacity: 0; }
.role-opt span, .vt-opt span { display: grid; border: 2px solid var(--line); border-radius: 10px; padding: .6rem; cursor: pointer; height: 100%; }
.role-opt input:checked + span, .vt-opt input:checked + span { border-color: var(--go); background: var(--ok-bg); }
.role-opt input:focus-visible + span, .vt-opt input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- Khung chính ---------- */
.who { display: grid; line-height: 1.2; text-align: right; }
.top-actions { display: flex; gap: .2rem; flex-wrap: wrap; }
@media (max-width: 640px) { .who { text-align: left; } .top-actions { width: 100%; } .top-actions .btn { flex: 1; padding: .5rem; font-size: .88rem; } }
.wrap { max-width: 1120px; margin: 0 auto; padding: 1rem; display: grid; gap: 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .9rem; display: grid; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat b { font-size: clamp(1.1rem, 2.4vw, 1.35rem); font-weight: 700; white-space: nowrap; }
.stat.money b { background: var(--money); color: var(--money-ink); justify-self: start; padding: 0 .4rem; border-radius: 4px; }

/* Tài xế bật trực */
.online-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; }
.online-bar > div { display: grid; flex: 1 1 220px; }
.online-bar.on { border-color: var(--go); background: var(--ok-bg); }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 0 var(--go); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* Biểu mẫu đặt xe */
.book h2 { margin-bottom: .8rem; }
.admin-book summary { cursor: pointer; list-style: none; }
.admin-book summary::-webkit-details-marker { display: none; }
.admin-book[open] summary { margin-bottom: .8rem; }
.admin-book summary h2 { margin: 0; color: var(--go); }
.book-form { display: grid; gap: .9rem; }
.addr { display: grid; gap: .3rem; position: relative; padding-left: 1.4rem; }
.addr > label { font-weight: 600; font-size: .92rem; }
.addr::before { content: ''; position: absolute; left: 0; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--go); }
.addr.to::before { background: var(--bad); border-radius: 2px; }
.addr.from::after { content: ''; position: absolute; left: 5px; top: 1.3rem; bottom: -1.2rem; border-left: 2px dashed var(--line); }
.addr-row { display: flex; gap: .35rem; }
.pin-state { color: var(--ok); font-size: .82rem; min-height: 0; }
.vts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .45rem; }
.vts legend { grid-column: 1 / -1; }
.vt-opt em { font-style: normal; font-size: .82rem; color: var(--go); font-weight: 600; }
.when { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.when legend { width: 100%; }
.when input[type="datetime-local"] { flex: 1 1 100%; }
.promo-row { display: flex; gap: .5rem; align-items: end; }
.promo-row label { flex: 1; }
.quote:empty { display: none; }
.quote { background: var(--bg); border-radius: 10px; padding: .8rem 1rem; }
.q-main { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.q-main b { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.q-rows { display: grid; grid-template-columns: auto 1fr; gap: .15rem 1rem; font-size: .9rem; color: var(--muted); }
.q-rows span:nth-child(even) { text-align: right; color: var(--ink); }
.minus { color: var(--ok) !important; font-weight: 600; }

/* Thanh công cụ & tab */
.tabs { display: flex; gap: .2rem; border-bottom: 2px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; padding: .7rem 1rem; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; min-height: 44px;
}
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.count:not(:empty) { margin-left: .4rem; background: var(--bad); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .78rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.toolbar h2 { margin-right: auto; }
.toolbar input[type="search"] { flex: 1 1 260px; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .35rem .85rem; cursor: pointer; font-size: .9rem; min-height: 36px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }

.list { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.list > .full { grid-column: 1 / -1; }
.empty { color: var(--muted); text-align: center; padding: 2.5rem 1rem; grid-column: 1 / -1; }

/* Thẻ cuốc / tài khoản / mã giảm giá */
.ride, .user, .promo, .vt { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; display: grid; gap: .6rem; }
.ride header, .user header, .promo header, .vt header { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.ride time, .user time { margin-left: auto; color: var(--muted); font-size: .85rem; }
.code { font-size: 1.02rem; }
.badge { font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--bg); }
.s-wait { background: var(--wait-bg); color: var(--wait); }
.s-go { background: var(--run-bg); color: var(--run); }
.s-ok { background: var(--ok-bg); color: var(--ok); }
.s-bad { background: var(--bad-bg); color: var(--bad); }
.r-taixe { background: var(--run-bg); color: var(--run); }
.r-daily { background: var(--wait-bg); color: var(--wait); }
.r-admin { background: var(--ink); color: var(--card); }
.tag { font-size: .75rem; font-weight: 600; padding: .05rem .45rem; border-radius: 4px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.wait { background: var(--wait-bg); color: var(--wait); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.ride-when { font-size: .85rem; font-weight: 600; }
.ride-when.later { color: var(--wait); }
.route { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.pt { position: relative; padding-left: 1.4rem; }
.pt a { color: inherit; text-decoration: none; font-weight: 500; }
.pt a:hover { text-decoration: underline; }
.pt::before { content: ''; position: absolute; left: 0; top: .4rem; width: 11px; height: 11px; border-radius: 50%; background: var(--go); }
.pt.b::before { background: var(--bad); border-radius: 2px; }
.pt.a::after { content: ''; position: absolute; left: 4.5px; top: 1.1rem; bottom: -.9rem; border-left: 2px dashed var(--line); }
.ride-meta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.price { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; background: var(--money); color: var(--money-ink); padding: .25rem .7rem; border-radius: 8px; }
.price span { font-size: .78rem; font-weight: 600; }
.price b { font-size: 1.3rem; font-weight: 800; }
.price small { color: var(--money-ink); opacity: .8; font-size: .78rem; }
.line { margin: 0; }
.line.small, .small { font-size: .86rem; color: var(--muted); }
.note-line { background: var(--bg); padding: .4rem .6rem; border-radius: 8px; }
.plate { font-family: inherit; font-weight: 700; border: 1.5px solid currentColor; padding: 0 .35rem; border-radius: 4px; font-size: .85rem; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.actions:empty { display: none; }
.promo-code, .ref-code { letter-spacing: .08em; font-weight: 800; }
.promo-code { font-size: 1.15rem; }
.promo-val { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--go); }

/* Bảng */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: .8rem; color: var(--muted); font-weight: 600; background: var(--bg); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.owe { background: var(--money); color: var(--money-ink); padding: 0 .3rem; border-radius: 4px; }

/* Đại lý: QR */
.qr-card { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; }
.qr { background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--line); width: max-content; margin: 0 auto; }
.qr img, .qr canvas { display: block; max-width: 100%; }
.qr-info { flex: 1 1 280px; display: grid; gap: .6rem; }
.qr-info p { margin: 0; }
.ref-code { color: var(--go); }
.copy-row { display: flex; gap: .4rem; }

/* Cài đặt */
.settings { display: grid; gap: .9rem; }
.settings h2 { margin-top: .6rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.settings h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.policy { display: grid; gap: .4rem; border: 1px solid var(--line); border-radius: 10px; padding: .7rem; margin-bottom: .6rem; }
.policy .btn { justify-self: start; }
.steps { margin: 0; padding-left: 1.2rem; }

/* Hộp thoại */
.dlg { border: 0; padding: 0; border-radius: 16px; background: var(--card); color: var(--ink); width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); }
.dlg.small { width: min(430px, calc(100vw - 1.5rem)); }
.dlg.wide { width: min(780px, calc(100vw - 1.5rem)); }
.dlg::backdrop { background: rgb(10 15 25 / .55); }
.dlg-body { padding: 1.2rem; display: grid; gap: .9rem; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.role-box { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; }
.confirm-msg { margin: 0; font-size: 1.02rem; }
.big-money { font-size: 1.5rem; background: var(--money); color: var(--money-ink); padding: 0 .4rem; border-radius: 4px; }
.map-dlg { gap: .6rem; }
.map-search { display: flex; gap: .4rem; }
.map-results { display: grid; max-height: 180px; overflow-y: auto; }
.res { display: grid; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: .5rem .2rem; cursor: pointer; }
.map-box { position: relative; }
.map { height: min(52dvh, 440px); border-radius: 10px; border: 1px solid var(--line); z-index: 0; }
.map-gps { position: absolute; right: 10px; bottom: 24px; z-index: 500; }

/* Chân trang */
.foot { border-top: 1px solid var(--line); background: var(--card); margin-top: 2rem; }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem 2rem; display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .foot-in { grid-template-columns: 1fr 1.4fr; } }
.foot-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--brand); font-size: 1.1rem; margin-bottom: .4rem; }
.foot p { margin: .15rem 0; }
.policies details { border-bottom: 1px solid var(--line); padding: .55rem 0; }
.policies summary { cursor: pointer; font-weight: 600; }
.policy-body { white-space: pre-line; color: var(--muted); font-size: .92rem; padding-top: .4rem; }

#toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--card); padding: .75rem 1.1rem; border-radius: 10px; z-index: 3000; max-width: calc(100vw - 2rem);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 6px 20px rgb(0 0 0 / .25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); color: #fff; }

/* ---------- Tuyến giá cố định ---------- */
.route-board { margin-bottom: 1.6rem; }
.route-board h2 { margin-bottom: .6rem; }
.rb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.rb-card { align-content: start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--money); border-radius: 10px; padding: .6rem .8rem; display: grid; gap: .15rem; }
.rb-name { font-size: .95rem; }
.rb-card > small { font-size: .78rem; }
.rb-card dl, .opt-list { margin: .3rem 0 0; display: grid; gap: .15rem; }
.rb-card dl div, .opt-list div { display: flex; justify-content: space-between; gap: .6rem; border-top: 1px dashed var(--line); padding-top: .15rem; }
.rb-card dt, .opt-list dt { color: var(--muted); font-size: .88rem; }
.rb-card dd, .opt-list dd { margin: 0; font-weight: 800; color: var(--bad); white-space: nowrap; }
.rb-card dd small { color: var(--muted); font-weight: 400; }
.mode-seg label { display: block; cursor: pointer; }
.mode-seg input { position: absolute; opacity: 0; }
.mode-seg span { display: block; text-align: center; padding: .6rem .4rem; border-radius: 8px; font-weight: 600; color: var(--muted); font-size: .92rem; }
.mode-seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.mode-seg input:focus-visible + span { outline: 3px solid var(--brand); }
.route-pick { display: grid; gap: .5rem; }
.route-note:empty { display: none; }
.route-tag { margin: 0; font-weight: 600; font-size: .9rem; color: var(--brand); }
.opt-rows { display: grid; gap: .6rem; }
.opt-row { display: grid; gap: .5rem; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 10px; padding: .7rem; }
@media (min-width: 700px) { .opt-row { grid-template-columns: 1.3fr 1fr 1.4fr; align-items: end; } .opt-row .check, .opt-row [data-del-opt] { grid-column: span 1; } }

.dlg-body > .btn, .settings > .btn { justify-self: start; }

/* Tải ứng dụng */
.app-tile { display: flex; gap: .8rem; align-items: center; background: var(--bg); border-radius: 12px; padding: .8rem; }
.app-tile div { display: grid; }
.big-steps { display: grid; gap: .45rem; font-size: 1.02rem; }
.warn-box { background: var(--wait-bg); color: var(--wait); border-radius: 10px; padding: .7rem .9rem; margin: 0; }
.ico { display: inline-block; border: 1.5px solid currentColor; border-radius: 4px; padding: 0 .25rem; font-size: .85rem; }
@media (max-width: 640px) { .pub-top .btn { padding: .5rem .7rem; } }
.pub-top { flex-wrap: nowrap; gap: .4rem; }
.pub-top .brand { min-width: 0; }
.pub-top .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .pub-top .brand { font-size: 1.05rem; } .pub-top .logo-img { width: 34px; height: 34px; } }

/* Điện thoại / máy tính bảng: đưa ô Đăng nhập / Đăng ký lên đầu trang, giới thiệu & bảng giá xuống dưới */
@media (max-width: 859px) {
  .auth { padding-top: 1rem; gap: 1.5rem; }
  .auth-card { order: -1; }
  .hero-tag { font-size: clamp(3rem, 18vw, 4.5rem); }
}
@media (max-width: 420px) { .pub-top .btn-txt { display: none; } .pub-top .btn { min-width: 44px; } }

/* Bản đồ nhúng & điểm dừng */
.dlg.map-wide { width: min(1000px, calc(100vw - 1rem)); }
.map-frame { width: 100%; height: min(72dvh, 640px); border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.stops-box { display: grid; gap: .3rem; background: var(--bg); border-radius: 10px; padding: .6rem .8rem; }
.stop-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pt.s::before { background: #c98204; }
.pt.s::after { content: ''; position: absolute; left: 4.5px; top: 1.1rem; bottom: -.9rem; border-left: 2px dashed var(--line); }
@media (max-width: 640px) { .dlg.map-wide .dlg-body { padding: .6rem; } .map-frame { height: 70dvh; } }

/* Vị trí xe & lời mời nhận cuốc */
.loc-state { display: block; margin-top: .2rem; color: var(--ok); font-weight: 600; }
.loc-state.bad { color: var(--bad); }
.line.live { color: var(--run); font-weight: 600; }
.near-cars { display: block; color: var(--run); font-weight: 600; font-size: .85rem; }
.car-mk div { transition: transform .4s; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35)); }
.track-map { height: min(60dvh, 480px); border-radius: 10px; border: 1px solid var(--line); }
.track-info { margin: 0; }
.tpin { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 800; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .4); font-size: 12px; }
.offer-dlg { border: 3px solid var(--go); }
.offer { gap: .8rem; }
.offer-tag { margin: 0; font-weight: 700; color: var(--go); font-size: 1.05rem; }
.offer-count { display: flex; align-items: baseline; gap: .3rem; justify-content: center; }
.offer-count span { font-size: 3.4rem; font-weight: 800; line-height: 1; color: var(--go); font-variant-numeric: tabular-nums; }
.offer-actions { display: grid; grid-template-columns: 1fr 2fr; gap: .5rem; }

/* Cuốc cần xe gấp (không có xe trực) */
.line.urgent { background: var(--wait-bg); color: var(--wait); font-weight: 700; padding: .35rem .6rem; border-radius: 8px; }
.pool-alert { display: block; width: 100%; margin-top: .6rem; text-align: left; border: 2px solid var(--money); background: var(--wait-bg); color: var(--wait);
  border-radius: var(--r); padding: .8rem 1rem; font: inherit; font-weight: 600; cursor: pointer; animation: poolPulse 1.6s infinite; }
@keyframes poolPulse { 50% { box-shadow: 0 0 0 6px rgb(255 210 63 / .35); } }
@media (prefers-reduced-motion: reduce) { .pool-alert { animation: none; } }

.warn-box ul { margin: .4rem 0 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
code.break { word-break: break-all; }


/* ================= Giao diện núi rừng Sa Pa ================= */
/* Dải tranh Sa Pa ở đầu trang: núi Hoàng Liên Sơn, Fansipan, mây, rừng thông, ruộng bậc thang, nhà thờ đá */
.scene {
  height: clamp(190px, 34vw, 460px);
  background: linear-gradient(to bottom, transparent 84%, var(--bg) 100%), url(bg-sapa.svg?v=1) center bottom / cover no-repeat;
}
.scene.small { height: clamp(150px, 24vw, 300px); }
@media (prefers-color-scheme: dark) {
  .scene { background: linear-gradient(to bottom, rgb(14 24 19 / .5), rgb(14 24 19 / .3) 80%, var(--bg) 100%), url(bg-sapa.svg?v=1) center bottom / cover no-repeat; }
}
/* Thanh đầu trang: kính mờ trên nền tranh */
.pub-top, .top { background: var(--glass); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); border-bottom-color: transparent; box-shadow: 0 1px 0 rgb(27 67 50 / .08); }
.brand { color: var(--brand); }
/* Trang chủ: phần giới thiệu và ô đăng nhập nổi lên trên tranh */
.auth { margin-top: calc(-1 * clamp(30px, 5vw, 70px)); position: relative; padding-top: 0; }
.hero, .auth-card { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 18px; }
.hero { padding: 1.4rem; border: 1px solid rgb(255 255 255 / .6); box-shadow: 0 10px 30px rgb(27 67 50 / .12); }
.auth-card { box-shadow: 0 14px 36px rgb(27 67 50 / .18); border-color: rgb(255 255 255 / .7); }
.hero-tag { -webkit-text-stroke: 2px var(--brand); }
.hero h1 { color: var(--brand); }
.fares { border-top-color: var(--brand); }
.rb-card { border-left-color: var(--leaf); }
.rb-card dd { color: var(--go); }
/* Trang sau đăng nhập: thẻ số liệu nổi lên trên dải tranh */
.wrap.over { margin-top: calc(-1 * clamp(28px, 4vw, 56px)); position: relative; }
.wrap.over > .stats .stat, .wrap.over > #onlineBox .online-bar, .wrap.over > .qr-card, .wrap.over > .book:first-child {
  box-shadow: 0 8px 24px rgb(27 67 50 / .12);
}
.stat { border-radius: 14px; }
.panel, .ride, .user, .promo, .vt { border-radius: 16px; }
.ride { border-top: 4px solid var(--leaf); }
.tabs button[aria-selected="true"] { color: var(--go); border-bottom-color: var(--go); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--card); }
.btn.primary { box-shadow: 0 3px 10px rgb(45 106 79 / .25); }
.btn.primary:hover { filter: brightness(1.08); }
.foot { background: linear-gradient(to bottom, var(--card), var(--bg)); }
.foot-brand { color: var(--brand); }
/* Hoạ tiết thổ cẩm nhỏ ở đầu chân trang */
.foot::before { content: ''; display: block; height: 6px;
  background: repeating-linear-gradient(90deg, var(--brand) 0 14px, var(--money) 14px 20px, var(--go) 20px 34px, #b0302b 34px 38px); opacity: .85; }
@media (max-width: 859px) {
  .auth { margin-top: -30px; }
  .scene:not(.small) { height: 200px; }
  .scene.small { height: 140px; }
  /* phóng to vùng phố Sa Pa & nhà thờ đá trên màn hình hẹp */
  .scene { background-size: auto, 760px auto !important; background-position: center, 50% 100% !important; }
  .scene.small { background-size: auto, 620px auto !important; }
}
