:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1c2430; --muted: #667085; --line: #e4e7ec;
  --brand: #0b1b3f; --brand-ink: #fff; --warn: #b54708; --bad: #b42318; --ok: #067647;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Google Sans", "Noto Sans Thai", -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); }
header.top { background: var(--brand); color: #fff; padding: 10px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
header.top .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .3px; line-height: 1.1; }
header.top .brand .logo { width: 34px; height: 34px; background: #fff; border-radius: 9px; display: grid; place-items: center; flex: none; }
header.top .brand .logo img { width: 28px; height: 28px; display: block; }
header.top .brand small { display: block; font-size: 11px; font-weight: 500; color: #98a2b3; letter-spacing: .4px; }
.login-brand { text-align: center; margin-bottom: 8px; }
.login-brand img { display: block; margin: 0 auto 6px; }
.login-brand h1 { margin: 0; }
.login-brand p { margin: 2px 0 10px; }
header.top nav { display: flex; gap: 14px; flex-wrap: wrap; }
header.top nav a { color: #cfd6e0; text-decoration: none; }
header.top nav a.on, header.top nav a:hover { color: #fff; }
header.top .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
header.top select, header.top button { font: inherit; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 18px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stat .n { font-size: 26px; font-weight: 700; }
.muted { color: var(--muted); }
.flash { background: #ecfdf3; border: 1px solid #abefc6; color: var(--ok); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef2f6; }
.pill.Available, .pill.active, .pill.completed { background: #dcfae6; color: var(--ok); }
.pill.Charging, .pill.charging, .pill.starting, .pill.Preparing { background: #d1e9ff; color: #175cd3; }
.pill.pending, .pill.SuspendedEV, .pill.Finishing { background: #fef0c7; color: var(--warn); }
.pill.Faulted, .pill.Unavailable, .pill.suspended, .pill.rejected, .pill.failed, .pill.Unknown { background: #fee4e2; color: var(--bad); }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input[type=number] { width: 110px; }
button, .btn { font: inherit; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
button.danger { background: #fff; color: var(--bad); border-color: #fda29b; }
label.field { display: block; margin: 8px 0; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.login { max-width: 360px; margin: 10vh auto; }
.neg { color: var(--bad); font-weight: 600; }

/* Driver page (inside LINE) */
.driver { max-width: 480px; margin: 0 auto; padding: 14px; }
.driver .socket { font-size: 20px; font-weight: 700; }
.driver .big { width: 100%; padding: 16px; font-size: 18px; border-radius: 14px; margin-top: 10px; }
.driver .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.driver .err { background: #fef3f2; color: var(--bad); border: 1px solid #fecdca; padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.driver .ok { background: #ecfdf3; color: var(--ok); border: 1px solid #abefc6; padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.hidden { display: none; }
.driver .warn { background: #fffaeb; color: var(--warn); border: 1px solid #fedf89; padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.driver .row.muted b { font-weight: 400; }
.driver label.consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; font-size: 14px; }
.driver label.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
footer.ver { text-align: center; color: #98a2b3; font-size: 11px; padding: 18px 0 14px; }
.login input, .login button { width: 100%; }
.login button { margin-top: 6px; padding: 10px 14px; }
.driver-brand { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; }
.driver-brand b { font-size: 15px; }
.driver-brand .muted { font-size: 13px; }
/* Brand: thin logo-ring line under the console header */
header.top { border-bottom: 3px solid; border-image: linear-gradient(90deg, #FFC83D 0 25%, #A3E636 25% 50%, #21D3ED 50% 75%, #ED1E79 75%) 1; }
main a { text-underline-offset: 2px; }
.driver label.field input { width: 100%; }
/* Thai first, short English underneath */
small.en { display: block; font-size: 11px; color: #98a2b3; font-weight: 400; line-height: 1.3; letter-spacing: 0; }
.driver .row small.en, .driver label.field small.en, .driver label.consent small.en { font-size: 10.5px; }
.driver .big small.en { color: rgba(255,255,255,.72); font-size: 11px; margin-top: 1px; }
.driver .err small.en { color: #d0756b; } .driver .ok small.en { color: #4c9a72; } .driver .warn small.en { color: #c4793f; }
.driver h2 small.en { font-size: 12px; }

/* Top-up: confirm screen and quick amounts */
.who .who-name { font-size: 1.5rem; font-weight: 700; color: var(--brand, #0B1B3F); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.quick .radio, label.radio { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #D0D5DD; border-radius: 8px; cursor: pointer; }
.big-input { font-size: 1.4rem; width: 100%; max-width: 260px; padding: 8px 10px; }
span.label { display: block; font-weight: 600; margin-top: 10px; }
.confirm .amount { font-size: 2.6rem; font-weight: 800; color: var(--brand, #0B1B3F); line-height: 1.1; }
.confirm .words { font-size: 1.1rem; margin-bottom: 12px; }
.confirm table.facts { margin: 8px 0 14px; }
.confirm table.facts th { text-align: left; padding-right: 14px; font-weight: 500; color: #667085; }
.flash.bad { background: #FEF3F2; border-color: #FDA29B; color: #912018; }

/* Console language switch (ไทย | EN) */
.lang-switch { display: inline-flex; }
.lang-switch button { padding: 4px 10px; font-size: .85rem; border-radius: 0; }
.lang-switch button:first-of-type { border-radius: 8px 0 0 8px; }
.lang-switch button:last-of-type { border-radius: 0 8px 8px 0; }
.lang-switch button.on { background: #fff; color: var(--brand); border-color: #fff; font-weight: 700; }
.settings h2 { margin: 22px 0 6px; font-size: 16px; }
.settings label.field span small { display: block; font-size: 12px; margin-top: 2px; }
