:root {
  --ink: #10151c;
  --muted: #66717d;
  --paper: #ffffff;
  --canvas: #f2f4f6;
  --line: #dfe4e8;
  --red: #e21d2f;
  --red-dark: #b80e20;
  --aqua: #13c6dd;
  --green: #14945e;
  --amber: #d88b00;
  --shadow: 0 14px 38px rgba(11, 17, 24, .09);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100%; margin: 0; background: radial-gradient(circle at 12% -10%, rgba(19,198,221,.09), transparent 28rem), var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(19,198,221,.45); outline-offset: 2px; }
.hidden, [hidden] { display: none !important; }

.app-shell { width: min(100%, 1180px); margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }
.topbar { height: 76px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 6px 0; color: var(--ink); }
.brand-mark { position: relative; display: grid; place-items: center; width: 36px; height: 36px; color: white; font-weight: 950; font-size: 21px; font-style: italic; background: var(--red); border: 2px solid var(--ink); border-radius: 10px 16px 12px 10px; transform: skew(-8deg); }
.brand-mark span { position: absolute; right: 4px; top: 5px; color: var(--aqua); font-size: 9px; text-shadow: 0 0 0 var(--ink); }
.brand-name { font-weight: 950; font-style: italic; letter-spacing: -.06em; font-size: 1.6rem; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.demo-pill { padding: 6px 9px; border: 1px solid #efb6bd; border-radius: 999px; color: var(--red-dark); background: #fff4f5; font-size: .7rem; font-weight: 850; letter-spacing: .08em; }
.icon-button, .avatar { border: 0; display: grid; place-items: center; }
.icon-button { width: 38px; height: 38px; border-radius: 12px; background: white; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 800; }

main { padding: 10px 22px 40px; }
.view { display: none; animation: fade-in .25s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: .4; transform: translateY(4px); } }
.eyebrow { margin: 0 0 7px; font-size: .72rem; letter-spacing: .14em; font-weight: 850; color: var(--red); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.85rem, 7vw, 3rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 1.25rem; letter-spacing: -.025em; }
h3 { margin-bottom: 4px; font-size: 1rem; }
.greeting-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 12px 0 24px; }
.greeting-row h1 { max-width: 700px; margin-bottom: 0; }
.weather-chip { flex: 0 0 auto; padding: 9px 12px; border-radius: 999px; background: white; color: #34404c; font-weight: 750; box-shadow: 0 5px 16px rgba(0,0,0,.05); }

.balance-card { position: relative; overflow: hidden; padding: 24px; border-radius: 28px; color: white; background: linear-gradient(135deg, #151b22 0%, #080b0f 72%); box-shadow: 0 18px 40px rgba(11,17,24,.22); }
.balance-card::before { content: ""; position: absolute; width: 210px; height: 210px; border: 34px solid rgba(226,29,47,.24); border-radius: 50%; right: -100px; top: -98px; }
.balance-top { position: relative; display: flex; justify-content: space-between; align-items: start; }
.balance-top p { margin-bottom: 7px; color: #bdc5cd; font-size: .9rem; }
.balance-top strong { display: block; font-size: 2.3rem; letter-spacing: -.04em; }
.drop-mark { width: 42px; height: 50px; }
.drop-mark path { fill: var(--aqua); stroke: white; stroke-width: 3; }
.balance-actions { position: relative; display: flex; gap: 10px; margin-top: 25px; }
.primary-button, .secondary-button, .scan-button, .text-button { min-height: 46px; border-radius: 14px; border: 0; font-weight: 800; }
.primary-button { padding: 0 22px; color: white; background: var(--red); box-shadow: 0 8px 20px rgba(226,29,47,.28); }
.primary-button:hover { background: var(--red-dark); }
.secondary-button { padding: 0 18px; background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.22); }
.primary-button.full { width: 100%; }
.secondary-button.small { min-height: 40px; color: var(--ink); border-color: var(--line); background: white; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 30px 0 13px; }
.section-heading.compact { margin-top: 26px; }
.text-button { min-height: auto; padding: 7px 0; background: transparent; color: var(--red); }
.location-card, .panel { border: 1px solid rgba(16,21,28,.07); background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.location-card { padding: 17px; }
.location-main { display: flex; align-items: center; gap: 13px; }
.location-main p { margin-bottom: 0; color: var(--muted); font-size: .88rem; }
.pin-icon { flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #fff0f1; color: var(--red); }
.pin-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 2; }
.location-meta { display: flex; justify-content: space-between; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: .79rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; background: var(--green); }
.scan-button { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid var(--line); }
.scan-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bay-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.bay-card { position: relative; min-height: 116px; text-align: left; padding: 17px; border: 1px solid var(--line); border-radius: 19px; background: white; overflow: hidden; }
.bay-card::after { content: ""; position: absolute; right: -24px; bottom: -32px; width: 80px; height: 80px; border-radius: 50%; background: rgba(19,198,221,.08); }
.bay-card.available { border-color: rgba(20,148,94,.35); }
.bay-card.occupied { opacity: .62; cursor: not-allowed; background: #eef1f3; }
.bay-card.maintenance { opacity: .55; cursor: not-allowed; background: repeating-linear-gradient(135deg,#fff,#fff 8px,#f7f8f9 8px,#f7f8f9 16px); }
.bay-number { display: block; font-size: 1.08rem; font-weight: 900; }
.bay-label { display: block; margin-top: 18px; font-size: .78rem; color: var(--muted); }
.bay-status { position: absolute; right: 13px; top: 13px; padding: 5px 7px; border-radius: 999px; color: var(--green); background: #e9f8f1; font-size: .65rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.occupied .bay-status { color: #59636e; background: #e0e4e7; }
.maintenance .bay-status { color: #9b6500; background: #fff4dc; }

.page-title { margin: 14px 0 24px; }
.page-title > p:last-child, .admin-title > div > p:last-child { margin-bottom: 0; color: var(--muted); }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.filter-chip { flex: 0 0 auto; min-height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; color: #4e5964; background: white; font-weight: 750; }
.filter-chip.active { color: white; background: var(--ink); border-color: var(--ink); }
.transaction-list { display: grid; gap: 10px; }
.transaction-row { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 15px; border: 1px solid rgba(16,21,28,.06); background: white; border-radius: 17px; }
.transaction-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; font-weight: 900; }
.transaction-icon.topup { color: var(--green); background: #e9f8f1; }
.transaction-icon.wash { color: var(--red); background: #fff0f1; }
.transaction-row strong { display: block; margin-bottom: 3px; }
.transaction-row small { color: var(--muted); }
.transaction-amount { font-weight: 900; }
.transaction-amount.positive { color: var(--green); }
.empty-state { padding: 42px 20px; text-align: center; border-radius: var(--radius); background: white; color: var(--muted); }

.admin-title { display: flex; justify-content: space-between; gap: 22px; align-items: end; }
.period-select { display: grid; gap: 5px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.period-select select { min-width: 132px; padding: 11px 34px 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi-card { position: relative; min-height: 140px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #adb6be; }
.kpi-card.card::before { background: var(--aqua); }
.kpi-card.manual::before { background: var(--amber); }
.kpi-card.total { color: white; background: var(--ink); border-color: var(--ink); }
.kpi-card.total::before { background: var(--red); }
.kpi-card span, .kpi-card small { display: block; color: var(--muted); }
.kpi-card.total span, .kpi-card.total small { color: #aeb8c1; }
.kpi-card strong { display: block; margin: 18px 0 5px; font-size: 1.55rem; letter-spacing: -.04em; }
.kpi-card small { font-size: .75rem; }
.admin-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-top: 14px; }
.panel { padding: 20px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 17px; }
.sync-time { color: var(--muted); font-size: .75rem; }
.source-list { display: grid; gap: 9px; }
.source-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 11px; border-radius: 15px; background: #f6f7f8; }
.source-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-weight: 900; }
.source-logo.sm { color: white; background: #47667c; }
.source-logo.nx { color: #112b3d; background: #52d5e4; }
.source-logo.mn { color: white; background: var(--amber); }
.source-row strong, .source-row small { display: block; }
.source-row small { margin-top: 2px; color: var(--muted); }
.source-status { padding: 5px 8px; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.source-status.demo { background: #f1eafb; color: #66439a; }
.source-status.live { background: #e9f8f1; color: var(--green); }
.manual-panel form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.manual-panel label { display: grid; gap: 6px; font-size: .78rem; font-weight: 750; color: var(--muted); }
.manual-panel label:first-child { grid-column: 1/-1; }
.manual-panel input, .manual-panel select { width: 100%; min-height: 44px; padding: 0 11px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: white; }
.manual-panel button { grid-column: 1/-1; }
.reconciliation-panel { margin-top: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 13px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
tfoot th { border-bottom: 0; font-size: .95rem; }
.diff-ok { color: var(--green); font-weight: 800; }
.diff-warn { color: var(--red); font-weight: 800; }
.accounting-note { margin: 14px 0 0; color: var(--muted); font-size: .78rem; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 14px; transform: translateX(-50%); display: grid; grid-template-columns: repeat(3,1fr); width: min(calc(100% - 28px), 520px); padding: 7px; border: 1px solid rgba(255,255,255,.18); border-radius: 22px; background: rgba(11,17,24,.94); box-shadow: 0 16px 42px rgba(0,0,0,.28); backdrop-filter: blur(18px); }
.nav-item { display: grid; place-items: center; gap: 3px; min-height: 55px; border: 0; border-radius: 16px; color: #9ba5ae; background: transparent; font-size: .69rem; font-weight: 750; }
.nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-item.active { color: white; background: var(--red); }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: end center; padding: 16px; background: rgba(6,9,12,.66); backdrop-filter: blur(5px); }
.modal { position: relative; width: min(100%, 460px); padding: 26px; border-radius: 26px; background: white; box-shadow: 0 24px 70px rgba(0,0,0,.32); animation: modal-up .2s ease; }
@keyframes modal-up { from { transform: translateY(18px); opacity: 0; } }
.modal-close { position: absolute; right: 17px; top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f0f2f4; font-size: 1.45rem; }
.modal > p:not(.eyebrow):not(.qr-id) { color: var(--muted); line-height: 1.5; }
.amount-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 20px 0; }
.amount-grid button { min-height: 54px; border: 1px solid var(--line); border-radius: 14px; background: white; font-weight: 850; }
.amount-grid button.selected { color: white; border-color: var(--red); background: var(--red); }
.secure-note { display: block; margin-top: 12px; text-align: center; color: var(--muted); }
.wash-amount { position: relative; display: block; margin: 22px 0; color: var(--muted); font-size: .78rem; font-weight: 750; }
.wash-amount input { width: 100%; height: 58px; margin-top: 7px; padding: 0 48px 0 15px; border: 1px solid var(--line); border-radius: 14px; font-size: 1.35rem; font-weight: 850; }
.wash-amount span { position: absolute; right: 18px; bottom: 16px; font-size: 1.1rem; font-weight: 850; color: var(--ink); }
.qr-modal { text-align: center; }
.fake-qr { width: 210px; aspect-ratio: 1; margin: 22px auto 15px; border: 12px solid white; outline: 2px solid var(--ink); border-radius: 10px; background-color: white; background-image: linear-gradient(90deg, var(--ink) 50%, transparent 50%), linear-gradient(var(--ink) 50%, transparent 50%); background-size: 22px 22px; mix-blend-mode: multiply; }
.fake-qr::after { content: "P"; display: grid; place-items: center; width: 62px; height: 62px; margin: 62px auto; color: white; background: var(--red); border: 8px solid white; border-radius: 17px; font-size: 2rem; font-weight: 950; }
.qr-id { color: var(--muted); font-weight: 800; letter-spacing: .05em; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 95px; transform: translate(-50%, 16px); width: max-content; max-width: calc(100% - 36px); padding: 12px 17px; border-radius: 13px; color: white; background: var(--ink); box-shadow: 0 12px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  .app-shell { padding-bottom: 118px; }
  .topbar, main { padding-left: 34px; padding-right: 34px; }
  .balance-card { padding: 30px; }
  .balance-card, .location-card { max-width: 740px; }
  .bay-grid { grid-template-columns: repeat(6, 1fr); }
  .bottom-nav { bottom: 22px; }
  .modal-backdrop { place-items: center; }
}

@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-title { display: block; }
  .period-select { margin-top: 16px; max-width: 150px; }
  .kpi-card { min-height: 126px; }
}

@media (max-width: 420px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  main { padding-left: 16px; padding-right: 16px; }
  .greeting-row { align-items: start; }
  .weather-chip { font-size: .8rem; }
  .balance-actions { display: grid; }
  .location-meta { display: grid; gap: 6px; }
  .section-heading.compact { align-items: center; }
  .scan-button { font-size: .76rem; }
  .kpi-card strong { font-size: 1.25rem; }
  .source-row { grid-template-columns: auto 1fr; }
  .source-status { grid-column: 2; justify-self: start; }
  .amount-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
