:root {
  --ink: #14352f;
  --muted: #688079;
  --paper: #f5f5ed;
  --surface: #ffffff;
  --line: #dde6df;
  --brand: #1e735f;
  --brand-dark: #123c35;
  --lime: #d9f36a;
  --lime-soft: #eff8c9;
  --danger: #b94a3d;
  --danger-soft: #fbe9e4;
  --warning: #9a6a12;
  --shadow: 0 20px 50px rgba(18, 60, 53, 0.09);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.brand-mark { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-dark); color: var(--lime); font: 800 32px/1 Georgia, serif; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.03em; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.brand .brand-mark { width: 38px; height: 38px; border-radius: 13px; font-size: 24px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); background: var(--brand-dark); }
.login-visual { position: relative; overflow: hidden; padding: clamp(36px, 7vw, 100px); color: white; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(217,243,106,.2); }
.login-visual::before { width: 600px; height: 600px; right: -150px; bottom: -270px; }
.login-visual::after { width: 400px; height: 400px; right: -50px; bottom: -170px; background: radial-gradient(circle, rgba(217,243,106,.16), transparent 68%); }
.login-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.login-logo .brand-mark { background: var(--lime); color: var(--brand-dark); }
.login-logo strong { font-size: 21px; }
.login-copy { position: relative; z-index: 1; max-width: 660px; margin: 80px 0; }
.eyebrow { display: flex; align-items: center; gap: 9px; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; color: #5b766f; }
.login-copy .eyebrow { color: var(--lime); }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.login-copy h1 { margin: 22px 0; font: 500 clamp(48px, 6.4vw, 88px)/.96 Georgia, serif; letter-spacing: -.055em; }
.login-copy p { color: #b6cac4; max-width: 500px; font-size: 17px; line-height: 1.7; }
.feature-row { position: relative; z-index: 1; display: flex; gap: 26px; flex-wrap: wrap; color: #b6cac4; font-size: 13px; }
.feature-row span { display: inline-flex; align-items: center; gap: 8px; }
.feature-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(217,243,106,.1); }
.login-panel { background: var(--paper); padding: 36px clamp(28px, 6vw, 86px); display: grid; align-content: center; }
.login-form { width: min(100%, 440px); margin: auto; }
.login-form h2 { margin: 18px 0 8px; font: 500 38px/1.1 Georgia, serif; letter-spacing: -.035em; }
.login-form > p { margin: 0 0 30px; color: var(--muted); line-height: 1.6; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 800; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: white; padding: 15px 16px; color: var(--ink); outline: none; transition: border .2s, box-shadow .2s; }
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(30,115,95,.1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { border: 0; border-radius: 14px; min-height: 48px; padding: 0 20px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; font-weight: 800; transition: transform .15s, opacity .15s, background .15s; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.btn-primary { color: white; background: var(--brand-dark); }
.btn-primary:hover { background: #195247; }
.btn-lime { color: var(--brand-dark); background: var(--lime); }
.btn-danger { color: white; background: var(--danger); }
.btn-ghost { color: var(--ink); background: #edf1ed; }
.btn-block { width: 100%; }
.demo-box { margin-top: 22px; padding: 14px 16px; border: 1px dashed #becdc5; border-radius: 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.demo-box strong { color: var(--ink); }
.demo-box a { color: var(--brand); font-weight: 800; }
.demo-phone { border: 0; padding: 0; background: none; color: var(--brand); font-size: 18px; font-weight: 850; letter-spacing: .02em; }
.demo-phone:hover { text-decoration: underline; }
.login-feedback { margin: 0 0 16px; padding: 14px 16px; border: 1px solid #edc3b9; border-radius: 14px; background: var(--danger-soft); color: #77433a; font-size: 12px; line-height: 1.5; }
.login-feedback strong, .login-feedback span, .login-feedback a { display: block; }
.login-feedback strong { margin-bottom: 4px; color: var(--danger); }
.login-feedback a { width: fit-content; margin-top: 7px; color: var(--danger); font-size: 17px; font-weight: 850; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; height: 76px; background: rgba(245,245,237,.9); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(20,53,47,.08); }
.topbar-inner { max-width: 1180px; height: 100%; margin: auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.7); border-radius: 999px; }
.user-chip div { text-align: right; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 12px; }
.user-chip small { font-size: 10px; color: var(--muted); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-dark); color: white; font-size: 12px; font-weight: 800; }
.desktop-nav { display: flex; gap: 5px; }
.nav-link { border: 0; background: transparent; color: var(--muted); padding: 10px 13px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.nav-link.active { color: var(--ink); background: white; box-shadow: 0 4px 15px rgba(18,60,53,.06); }
.main { max-width: 1180px; margin: auto; padding: 42px 24px 100px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-head h1 { margin: 7px 0 0; font: 500 clamp(34px, 5vw, 54px)/1 Georgia, serif; letter-spacing: -.045em; }
.page-head p { color: var(--muted); margin: 8px 0 0; }
.grid { display: grid; gap: 18px; }
.dashboard-grid { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); align-items: start; }
.card { background: var(--surface); border: 1px solid rgba(20,53,47,.08); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: clamp(20px, 3vw, 32px); }
.charge-card { overflow: hidden; background: var(--brand-dark); color: white; position: relative; }
.charge-card::after { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(217,243,106,.2), transparent 68%); right: -130px; top: -160px; pointer-events: none; }
.charge-top { padding: 26px 28px 10px; display: flex; justify-content: space-between; position: relative; z-index: 1; }
.status { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.1); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a9bbb6; }
.status.available::before, .status.charging::before { background: var(--lime); box-shadow: 0 0 0 4px rgba(217,243,106,.12); }
.status.offline::before, .status.fault::before { background: #ff8e7e; }
.charge-main { position: relative; z-index: 1; padding: 24px 28px 30px; }
.charge-main h2 { font: 500 31px/1.1 Georgia, serif; margin: 0 0 6px; }
.charge-main .location { color: #afc2bd; margin: 0; }
.energy-reading { margin: 44px 0 34px; }
.energy-reading strong { font: 500 clamp(56px, 8vw, 88px)/.9 Georgia, serif; letter-spacing: -.055em; }
.energy-reading span { color: var(--lime); font-weight: 800; margin-left: 8px; }
.meter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.1); border-radius: 16px; overflow: hidden; }
.meter { background: rgba(255,255,255,.055); padding: 16px; }
.meter small { color: #9db3ad; display: block; margin-bottom: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.meter strong { font-size: 16px; }
.charge-actions { padding: 20px 28px 28px; position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.charge-actions .btn { min-width: 180px; }
.charge-actions small { color: #a9bdb7; line-height: 1.4; }
.side-stack { display: grid; gap: 18px; }
.summary-card h3, .list-card h3 { margin: 0 0 18px; font-size: 14px; }
.cost { font: 500 38px/1 Georgia, serif; letter-spacing: -.04em; }
.cost small { font: 700 12px/1 system-ui; color: var(--muted); }
.summary-row { display: flex; justify-content: space-between; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.summary-row strong { color: var(--ink); }
.hint-card { padding: 24px; background: var(--lime-soft); box-shadow: none; }
.hint-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--lime); font-weight: 900; margin-bottom: 20px; }
.hint-card h3 { margin: 0 0 8px; }
.hint-card p { color: #5b7068; font-size: 13px; line-height: 1.6; margin: 0; }
.station-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.station-item { padding: 20px; display: flex; justify-content: space-between; gap: 16px; align-items: center; box-shadow: none; }
.station-item h3 { margin: 0 0 5px; font-size: 15px; }
.station-item p { margin: 0; color: var(--muted); font-size: 12px; }
.station-meta { margin-top: 9px; font-size: 11px; color: var(--brand); font-weight: 800; }
.empty { text-align: center; padding: 54px 22px; color: var(--muted); }
.empty-icon { font: 500 44px/1 Georgia, serif; color: var(--brand); margin-bottom: 14px; }
.empty h3 { color: var(--ink); margin: 0 0 7px; }
.empty p { margin: 0 auto 20px; max-width: 420px; line-height: 1.6; }

.history-list { display: grid; gap: 10px; }
.history-item { padding: 18px 20px; display: grid; grid-template-columns: 1.4fr repeat(3, .7fr); align-items: center; gap: 16px; box-shadow: none; }
.history-item h3 { margin: 0 0 4px; font-size: 14px; }
.history-item p, .history-item small { color: var(--muted); margin: 0; font-size: 11px; }
.history-value small { display: block; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.history-value strong { font-size: 14px; }
.account-card { max-width: 600px; }
.profile-line { display: flex; align-items: center; gap: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.profile-line .avatar { width: 56px; height: 56px; font-size: 18px; }
.profile-line h3 { margin: 0 0 4px; }
.profile-line p { margin: 0; color: var(--muted); }

.metrics { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.resident-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 720px; }
.metric { padding: 22px; box-shadow: none; }
.metric small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 12px; }
.metric strong { font: 500 32px/1 Georgia, serif; }
.metric strong em { font: 800 11px/1 system-ui; color: var(--brand); }
.metric > span { display: block; margin-top: 11px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.usage-filter-card { margin-bottom: 18px; box-shadow: none; }
.period-controls { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.period-current { min-width: 245px; margin-right: auto; }
.period-current small, .period-current strong { display: block; }
.period-current small { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.period-current strong { font: 500 23px/1.1 Georgia, serif; letter-spacing: -.025em; }
.compact-field { margin: 0; min-width: 170px; }
.compact-field label { margin-bottom: 5px; }
.compact-field input, .compact-field select { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
.custom-period { display: flex; align-items: flex-end; gap: 9px; }
.is-hidden { display: none !important; }
.usage-metrics { margin-top: 0; }
.usage-content-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); align-items: stretch; margin-bottom: 18px; }
.usage-chart-card { min-width: 0; }
.usage-chart-card .form-title small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.usage-chart { min-height: 220px; display: flex; align-items: stretch; gap: 7px; padding-top: 16px; overflow-x: auto; }
.usage-bar-item { min-width: 37px; flex: 1; display: grid; grid-template-rows: 18px 1fr 18px; justify-items: center; gap: 5px; }
.usage-bar-value { color: var(--muted); font-size: 8px; }
.usage-bar-track { width: 100%; max-width: 34px; min-height: 145px; display: flex; align-items: flex-end; overflow: hidden; border-radius: 8px 8px 4px 4px; background: #edf1ed; }
.usage-bar-track i { display: block; width: 100%; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--lime), #98c764); }
.usage-bar-item > span { color: var(--muted); font-size: 8px; }
.usage-chart-empty { min-height: 220px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.charger-breakdown h3 { margin: 0 0 18px; font-size: 14px; }
.breakdown-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.breakdown-row > div:last-child { text-align: right; }
.breakdown-row strong, .breakdown-row small { display: block; }
.breakdown-row strong { font-size: 12px; }
.breakdown-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.muted-copy { color: var(--muted); font-size: 12px; }
.usage-session-card { margin-bottom: 18px; }
.table-status { padding: 5px 8px; background: #edf1ed; color: var(--ink); }
.compact-empty { padding: 30px 16px; }
.admin-grid { grid-template-columns: 1fr 1fr; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 11px 10px; border-bottom: 1px solid var(--line); }
td { padding: 13px 10px; border-bottom: 1px solid #edf1ed; white-space: nowrap; }
.tiny-btn { border: 1px solid var(--line); background: white; padding: 6px 9px; border-radius: 8px; color: var(--ink); font-weight: 700; font-size: 10px; }
.form-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.form-title h3 { margin: 0; }
.form-description { color: var(--muted); font-size: 12px; line-height: 1.55; margin: -7px 0 18px; }
.inline-status { font-size: 10px; font-weight: 800; padding: 5px 8px; border-radius: 999px; background: var(--lime-soft); color: var(--brand); }
.resident-admin-grid { grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); }
.resident-state { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; }
.resident-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.resident-state.active::before { background: var(--brand); }
.billing-cycle-form { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.billing-cycle-form small, .billing-cycle-form strong { display: block; }
.billing-cycle-form small { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.billing-cycle-form strong { font-size: 12px; }
.billing-cycle-action { display: flex; gap: 8px; }
.billing-cycle-action label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.billing-cycle-action select, .billing-cycle-action input, .resident-list-toolbar select, .resident-search input { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); padding: 0 11px; }
.billing-cycle-action input { width: 170px; }
.resident-list-toolbar { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(250px, .8fr) auto; align-items: end; gap: 13px; margin-bottom: 18px; }
.resident-list-toolbar h3 { margin: 0 0 5px; }
.resident-list-toolbar small { color: var(--muted); font-size: 10px; }
.resident-search { display: flex; gap: 6px; }
.resident-search input { min-width: 0; width: 100%; }
.row-actions { display: flex; gap: 5px; }
.create-resident-panel { margin-top: 18px; box-shadow: none; }
.create-resident-panel summary { cursor: pointer; font-weight: 800; font-size: 13px; }
.create-resident-panel[open] summary { margin-bottom: 22px; }
.create-resident-panel form { max-width: 680px; }
.resident-usage-detail { width: min(100%, 1080px); }
.detail-loading { min-height: 380px; }
.resident-detail-body { padding: 24px 28px 28px; }
.detail-period-line { display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; margin-bottom: 18px; border-radius: 13px; background: var(--brand-dark); color: white; font-size: 12px; }
.detail-period-line span { color: #aec1bc; }
.resident-detail-metrics { grid-template-columns: repeat(3, 1fr); }
.resident-detail-metrics .metric { background: white; border: 1px solid var(--line); }
.admin-fleet { margin: 28px 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 7px 0 0; font: 500 31px/1 Georgia, serif; letter-spacing: -.035em; }
.fleet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fleet-card { padding: 23px; box-shadow: none; position: relative; overflow: hidden; }
.fleet-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #b9c7c0; }
.fleet-card.charging::before, .fleet-card.available::before { background: var(--lime); }
.fleet-card.fault::before, .fleet-card.offline::before { background: #e27362; }
.fleet-card-top { display: flex; justify-content: space-between; align-items: center; }
.fleet-card .status { background: #eef2ed; color: var(--ink); }
.provider-badge { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.fleet-card-title { display: flex; align-items: center; gap: 13px; margin: 20px 0; }
.station-glyph { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-dark); color: var(--lime); font-size: 21px; font-weight: 900; }
.fleet-card-title h3 { margin: 0 0 4px; font-size: 17px; }
.fleet-card-title p { margin: 0; color: var(--muted); font-size: 11px; }
.fleet-power { margin-bottom: 18px; }
.fleet-power strong { font: 500 43px/1 Georgia, serif; letter-spacing: -.04em; }
.fleet-power span { margin-left: 7px; color: var(--brand); font-size: 12px; font-weight: 850; }
.fleet-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fleet-stats div + div { padding-left: 13px; border-left: 1px solid var(--line); }
.fleet-stats small, .fleet-stats b { display: block; }
.fleet-stats small { margin-bottom: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.fleet-stats b { font-size: 12px; }
.fleet-user { min-height: 48px; margin: 15px 0; display: flex; align-items: center; gap: 10px; }
.fleet-user small, .fleet-user strong { display: block; }
.fleet-user small { color: var(--muted); font-size: 9px; margin-bottom: 3px; }
.fleet-user strong { font-size: 11px; }
.empty-user { color: var(--muted); font-size: 11px; }

.detail-backdrop { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; padding: 20px; background: rgba(8,31,27,.67); backdrop-filter: blur(7px); animation: fade-in .18s ease; }
.charger-detail { width: min(100%, 920px); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 26px; background: var(--paper); box-shadow: 0 28px 90px rgba(0,0,0,.28); animation: detail-in .23s ease; }
.detail-head { position: sticky; top: 0; z-index: 2; padding: 25px 28px 19px; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(245,245,237,.96); backdrop-filter: blur(10px); }
.detail-head h2 { margin: 8px 0 4px; font: 500 35px/1 Georgia, serif; letter-spacing: -.04em; }
.detail-head p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-close { width: 39px; height: 39px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #e7ece7; color: var(--ink); font-size: 25px; line-height: 1; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, .7fr); gap: 28px; padding: 26px 28px; }
.detail-status { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.detail-status .status { background: #e7ece7; color: var(--ink); }
.detail-power { margin: 27px 0 22px; }
.detail-power strong, .detail-power span { display: block; }
.detail-power strong { font: 500 61px/.9 Georgia, serif; letter-spacing: -.05em; }
.detail-power span { margin-top: 8px; color: var(--muted); font-size: 11px; }
.detail-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-metrics div { padding: 15px; border-radius: 13px; background: white; border: 1px solid var(--line); }
.detail-metrics small, .detail-metrics strong { display: block; }
.detail-metrics small { margin-bottom: 6px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.detail-metrics strong { font-size: 14px; }
.detail-meta { margin-top: 14px; padding: 4px 15px; border-radius: 13px; background: #e9eee9; }
.detail-meta div { padding: 10px 0; display: flex; justify-content: space-between; gap: 15px; font-size: 10px; }
.detail-meta div + div { border-top: 1px solid #d7e0d9; }
.detail-meta span { color: var(--muted); }
.detail-meta code, .detail-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-resident { margin-top: 14px; padding: 14px; display: flex; gap: 11px; align-items: center; border-radius: 14px; background: var(--brand-dark); color: white; }
.active-resident small, .active-resident strong, .active-resident span { display: block; }
.active-resident small, .active-resident span { color: #a9bdb7; font-size: 9px; }
.active-resident strong { margin: 3px 0; font-size: 12px; }
.active-resident.available { display: block; background: var(--lime-soft); color: var(--ink); }
.active-resident.available span { margin-top: 4px; color: var(--muted); }
.device-error { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 10px; }
.device-error strong, .device-error span { display: block; }
.device-error strong { margin-bottom: 3px; }
.detail-qr { padding: 20px; border-radius: 20px; background: white; border: 1px solid var(--line); text-align: center; align-self: start; }
.detail-qr > span { color: var(--brand); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.detail-qr-frame { width: 210px; height: 210px; padding: 8px; margin: 13px auto; border: 2px solid var(--brand-dark); border-radius: 17px; }
.detail-qr-frame img { display: block; width: 100%; height: 100%; }
.detail-qr > code { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: 8px; line-height: 1.45; }
.qr-actions { margin-top: 13px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.detail-actions { padding: 18px 28px 25px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; border-top: 1px solid var(--line); }
@keyframes detail-in { from { transform: translateY(12px) scale(.985); opacity: 0; } }

.mobile-nav { display: none; position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(15px); border-top: 1px solid var(--line); }
.mobile-nav button { flex: 1; border: 0; background: none; color: var(--muted); padding: 7px 4px; font-size: 10px; font-weight: 700; }
.mobile-nav button span { display: block; font-size: 18px; margin-bottom: 2px; }
.mobile-nav button.active { color: var(--brand); }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 10px; }
.toast { max-width: 360px; padding: 14px 18px; border-radius: 13px; color: white; background: var(--brand-dark); box-shadow: 0 15px 40px rgba(18,60,53,.2); font-size: 13px; animation: toast-in .25s ease; }
.toast.error { background: var(--danger); }
.spinner { width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; align-items: end; background: rgba(8,31,27,.62); backdrop-filter: blur(5px); animation: fade-in .18s ease; }
.bottom-sheet { width: min(100%, 520px); margin: 0 auto; padding: 10px 24px calc(24px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--paper); box-shadow: 0 -24px 70px rgba(8,31,27,.22); animation: sheet-up .25s ease; }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 20px; border-radius: 99px; background: #c5d0c9; }
.sheet-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 17px; background: var(--lime); color: var(--brand-dark); font-size: 25px; font-weight: 900; }
.bottom-sheet h2 { margin: 10px 0 7px; font: 500 32px/1.05 Georgia, serif; letter-spacing: -.035em; }
.sheet-subtitle { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.safety-check { display: flex; align-items: flex-start; gap: 13px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px; background: white; cursor: pointer; }
.safety-check:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,115,95,.1); }
.safety-check input { width: 21px; height: 21px; margin: 1px 0 0; accent-color: var(--brand); flex: 0 0 auto; }
.safety-check strong, .safety-check small { display: block; }
.safety-check strong { font-size: 14px; }
.safety-check small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.sheet-price { display: flex; justify-content: space-between; margin: 0 0 18px; padding: 0 4px; color: var(--muted); font-size: 12px; }
.sheet-price strong { color: var(--ink); }
.bottom-sheet .btn + .btn { margin-top: 9px; }

.label-page { min-height: 100vh; padding: 34px 20px 60px; background: #e8ece6; }
.label-toolbar { width: min(100%, 480px); margin: 0 auto 20px; display: flex; justify-content: space-between; gap: 10px; }
.station-label { width: min(100%, 480px); margin: auto; overflow: hidden; background: white; border: 1px solid #d4ded7; border-radius: 28px; box-shadow: 0 24px 70px rgba(18,60,53,.14); }
.label-brand { padding: 24px 26px; display: flex; align-items: center; gap: 12px; background: var(--brand-dark); color: white; }
.label-brand .brand-mark { width: 46px; height: 46px; border-radius: 15px; background: var(--lime); color: var(--brand-dark); }
.label-brand strong, .label-brand small { display: block; }
.label-brand strong { font-size: 20px; letter-spacing: -.03em; }
.label-brand small { margin-top: 3px; color: #a9c0b9; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.label-copy { padding: 30px 26px 10px; text-align: center; }
.label-copy > span { color: var(--brand); font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.label-copy h1 { margin: 10px 0 4px; font: 500 38px/1 Georgia, serif; letter-spacing: -.045em; }
.label-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.qr-frame { width: 280px; height: 280px; margin: 10px auto; padding: 12px; border: 2px solid var(--brand-dark); border-radius: 24px; background: white; position: relative; }
.qr-frame::before, .qr-frame::after { content: ""; position: absolute; width: 44px; height: 44px; border-color: var(--lime); }
.qr-frame::before { left: -5px; top: -5px; border-left: 6px solid var(--lime); border-top: 6px solid var(--lime); border-radius: 9px 0 0 0; }
.qr-frame::after { right: -5px; bottom: -5px; border-right: 6px solid var(--lime); border-bottom: 6px solid var(--lime); border-radius: 0 0 9px 0; }
.qr-frame img { width: 100%; height: 100%; display: block; }
.label-scan-line { display: flex; align-items: center; gap: 12px; padding: 8px 26px 24px; color: var(--brand-dark); font-size: 11px; }
.label-scan-line i { height: 1px; background: var(--line); flex: 1; }
.label-steps { list-style: none; margin: 0; padding: 21px 26px; display: grid; gap: 13px; background: var(--lime-soft); }
.label-steps li { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 750; }
.label-steps b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-dark); color: white; font-size: 10px; }
.station-label footer { padding: 17px 26px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 9px; }
.station-label footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-label footer strong { color: var(--ink); white-space: nowrap; font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(35px); opacity: 0; } }

@media (max-width: 850px) {
  .login-page { display: block; background: var(--paper); }
  .login-visual { min-height: auto; padding: 28px 24px 36px; border-radius: 0 0 34px 34px; background: var(--brand-dark); }
  .login-copy { margin: 54px 0 22px; }
  .login-copy h1 { font-size: 46px; }
  .login-copy p { font-size: 14px; }
  .feature-row { display: none; }
  .login-panel { padding: 38px 24px 60px; }
  .desktop-nav { display: none; }
  .mobile-nav { display: flex; }
  .dashboard-grid, .admin-grid, .resident-admin-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .usage-content-grid { grid-template-columns: 1fr; }
  .resident-list-toolbar { grid-template-columns: 1fr 1fr; }
  .resident-list-toolbar > div:first-child { grid-column: 1 / -1; }
  .fleet-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-qr { order: -1; }
  .main { padding-top: 28px; }
}

@media (max-width: 560px) {
  .topbar { height: 66px; }
  .topbar-inner, .main { padding-left: 16px; padding-right: 16px; }
  .brand small, .user-chip div { display: none; }
  .user-chip { padding: 3px; border: 0; background: none; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .page-head h1 { font-size: 39px; }
  .station-list { grid-template-columns: 1fr; }
  .charge-top, .charge-main { padding-left: 21px; padding-right: 21px; }
  .charge-actions { padding: 18px 21px 24px; display: block; }
  .charge-actions .btn { width: 100%; }
  .charge-actions small { display: block; margin-top: 11px; text-align: center; }
  .energy-reading { margin: 36px 0 28px; }
  .meter-grid { grid-template-columns: 1fr 1fr; }
  .history-item { grid-template-columns: 1fr 1fr; }
  .history-item > div:first-child { grid-column: 1 / -1; }
  .history-value:last-child { display: none; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .metrics { gap: 10px; }
  .resident-metrics { grid-template-columns: repeat(3, 1fr); }
  .period-controls, .custom-period, .billing-cycle-form { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .period-current { min-width: 0; margin: 0 0 3px; }
  .compact-field { min-width: 0; }
  .custom-period .btn { width: 100%; }
  .billing-cycle-action { display: grid; grid-template-columns: 1fr 1fr; }
  .billing-cycle-action input { width: 100%; }
  .billing-cycle-action .btn { grid-column: 1 / -1; }
  .resident-list-toolbar { grid-template-columns: 1fr; }
  .resident-list-toolbar > div:first-child { grid-column: auto; }
  .resident-search { width: 100%; }
  .resident-detail-body { padding-left: 16px; padding-right: 16px; }
  .resident-detail-metrics { grid-template-columns: 1fr; }
  .metric { padding: 17px; }
  .section-heading { align-items: flex-start; }
  .section-heading .btn { min-height: 42px; padding: 0 13px; font-size: 11px; }
  .detail-backdrop { padding: 0; place-items: end; }
  .charger-detail { max-height: 94vh; border-radius: 24px 24px 0 0; }
  .detail-head, .detail-layout, .detail-actions { padding-left: 18px; padding-right: 18px; }
  .detail-head h2 { font-size: 30px; }
  .detail-qr-frame { width: 190px; height: 190px; }
  .detail-actions .btn { width: 100%; }
  .toast-region { left: 16px; right: 16px; bottom: 82px; }
  .toast { max-width: none; }
}

@media print {
  @page { size: A5 portrait; margin: 8mm; }
  body, .label-page { background: white; }
  .label-page { min-height: 0; padding: 0; }
  .label-toolbar { display: none; }
  .station-label { width: 100%; max-width: 112mm; border: 1px solid #cfd8d2; box-shadow: none; break-inside: avoid; }
}
