/* EasyRide design system – shared by public site, portals and admin */
:root {
  --ink: #06262e;
  --ink-2: #1d2f4d;
  --navy: #053540;
  --teal: #00687a;
  --teal-600: #005565;
  --teal-50: #e5f2f4;
  --gold: #ff751f;
  --gold-50: #fff0e6;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --line: #e3e7ee;
  --line-2: #d4dae4;
  --text: #0f1b2d;
  --muted: #5d6b82;
  --faint: #8a96a9;
  --red: #d64545;
  --red-50: #fdecec;
  --amber: #b7791f;
  --amber-50: #fdf4e3;
  --green: #1f8a4c;
  --green-50: #e6f5ec;
  --blue: #2563eb;
  --blue-50: #e8f0fe;
  --violet: #6d4ae0;
  --violet-50: #efeafd;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 1px rgba(15, 27, 45, .04);
  --shadow: 0 10px 30px -12px rgba(5, 53, 64, .25), 0 2px 6px rgba(5, 53, 64, .06);
  --shadow-lg: 0 30px 60px -20px rgba(5, 53, 64, .35);
  --font: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4.5vw, 52px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid rgba(0, 104, 122, .45); outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { height: 16px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 16px; }
.card-b { padding: 20px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- buttons ---------- */
.btn { --bg: var(--surface); --fg: var(--text); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: transform .06s, background .15s, box-shadow .15s; }
.btn:hover { box-shadow: var(--shadow-sm); filter: brightness(.98); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.loading { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn.primary { --bg: var(--teal); --fg: #fff; --bd: var(--teal); }
.btn.dark { --bg: var(--navy); --fg: #fff; --bd: var(--navy); }
.btn.gold { --bg: var(--gold); --fg: #fff; --bd: var(--gold); }
.btn.danger { --bg: #fff; --fg: var(--red); --bd: #f1c4c4; }
.btn.danger.solid { --bg: var(--red); --fg: #fff; --bd: var(--red); }
.btn.ghost { --bg: transparent; --bd: transparent; }
.btn.ghost:hover { --bg: var(--surface-2); box-shadow: none; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.wa { --bg: #25d366; --fg: #06371b; --bd: #25d366; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--text); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(0, 104, 122, .14); }
.input.sm { min-height: 34px; padding: 5px 10px; font-size: 14px; }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(214, 69, 69, .12); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 38px; height: 40px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--ink-2); }
.stepper button:hover { background: var(--surface-2); }
.stepper span { min-width: 34px; text-align: center; font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.plain::before { display: none; }
.b-green { background: var(--green-50); color: var(--green); }
.b-red { background: var(--red-50); color: var(--red); }
.b-amber { background: var(--amber-50); color: var(--amber); }
.b-blue { background: var(--blue-50); color: var(--blue); }
.b-teal { background: var(--teal-50); color: var(--teal-600); }
.b-violet { background: var(--violet-50); color: var(--violet); }
.b-gray { background: var(--surface-2); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #fafbfc; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table .sub { color: var(--muted); font-size: 12px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--line-2); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- toast / modal ---------- */
.toasts { position: fixed; z-index: 1000; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .18s ease-out; display: flex; gap: 10px; align-items: flex-start; }
.toast.error { background: #7f1d1d; }
.toast.ok { background: #14532d; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; z-index: 900; background: rgba(10, 20, 35, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: min(560px, 100%); animation: pop .18s ease-out; }
.modal.wide { width: min(900px, 100%); }
.modal-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-h h3 { margin: 0; }
.modal-b { padding: 20px 22px; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: #fbfbfc; border-radius: 0 0 18px 18px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert.info { background: var(--blue-50); color: #1e3a8a; }
.alert.warn { background: var(--amber-50); color: #7a4d0b; }
.alert.error { background: var(--red-50); color: #8a1f1f; }
.alert.ok { background: var(--green-50); color: #135c33; }
.alert svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }

/* ---------- autocomplete ---------- */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; padding: 6px; }
.ac-item { display: flex; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; align-items: flex-start; }
.ac-item:hover, .ac-item.active { background: var(--teal-50); }
.ac-item .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.ac-item .ic svg { width: 16px; height: 16px; }
.ac-item b { display: block; font-weight: 650; font-size: 14px; }
.ac-item span { font-size: 12px; color: var(--muted); }
.ac-foot { font-size: 11px; color: var(--faint); padding: 6px 10px 2px; text-align: right; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; font-size: 14px; }
.kv > dt { color: var(--muted); }
.kv > dd { margin: 0; font-weight: 600; word-break: break-word; }
.stat { padding: 16px 18px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.skeleton { background: linear-gradient(90deg, #eef1f5, #f7f8fa, #eef1f5); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; min-height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 14px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--teal); }
.map { width: 100%; height: 260px; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.map-fallback { height: 100%; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); font-size: 14px; background:
  repeating-linear-gradient(45deg, #eef2f6 0 12px, #f5f7fa 12px 24px); }
.icon { width: 18px; height: 18px; flex: none; }
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: transparent; color: inherit; border: 0; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; opacity: .75; }
.lang-switch button.active { background: rgba(255,255,255,.18); opacity: 1; }
.pill-note { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 4px 10px; border-radius: 999px; }

/* brand logo mark */
.logo-mark { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: inline-grid; place-items: center; overflow: hidden; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; }

/* Vehicle photos (Admin → Vehicle types) */
.art:has(> img.vphoto) { padding: 0; overflow: hidden; background: #e9eef5; }
.art > img.vphoto { width: 100%; height: 100%; object-fit: cover; display: block; }
.vt-thumb { width: 72px; height: 45px; border-radius: 6px; object-fit: cover; background: #e9eef5; display: block; }

/* ---------- Date picker (language follows the site, not the computer) ---------- */
.dp { position: relative; }
.dp-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.dp-btn svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.dp-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 296px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.2); padding: 12px; }
.dp-pop.right { left: auto; right: 0; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head b { font-size: 15px; }
.dp-nav { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; }
.dp-nav:disabled { opacity: .3; cursor: default; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-wd { font-size: 11px; font-weight: 600; color: var(--muted, #6b7280); padding: 4px 0; }
.dp-day { height: 36px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 14px; cursor: pointer; color: inherit; }
.dp-day:hover:not(:disabled) { background: rgba(0,104,122,.1); }
.dp-day.off { color: #a3a9b1; }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--teal, #00687a); }
.dp-day.sel { background: var(--teal, #00687a); color: #fff; font-weight: 700; }
.dp-day:disabled { color: #d0d4d9; cursor: default; text-decoration: line-through; }
/* Time: hour : minute selects */
.tp { display: flex; align-items: center; gap: 6px; }
.tp-sel { flex: 1; min-width: 0; text-align: center; cursor: pointer; }
.tp-colon { font-weight: 700; }
@media (max-width: 560px) { .dp-pop { width: min(296px, calc(100vw - 32px)); } }

/* flag language picker (public pages) */
.lang-pick { position: relative; display: inline-block; }
.lang-pick .lang-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: inherit; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.lang-pick .flag { width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); object-fit: cover; flex: none; }
.lang-pick .lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 170px; background: #fff; color: #1d1d1f; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px; display: grid; gap: 2px; }
.lang-pick .lang-menu[hidden] { display: none; }
.lang-pick .lang-menu button { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; color: inherit; cursor: pointer; text-align: left; }
.lang-pick .lang-menu button:hover { background: #f2f4f7; }
.lang-pick .lang-menu button.active { background: #e8f3f5; font-weight: 700; }
