/* ============================================================================
   HUAYU KJ Equipment — "Yardbook" design system
   Warm editorial-industrial: concrete & paper, stamped steel, safety stripes.
   ========================================================================== */

/* ── Fonts (self-hosted woff2, latin subset) ─────────────────────────────── */
@font-face { font-family:"Fraunces"; font-weight:400; font-display:swap; src:url("/admin/static/fonts/fraunces-400.woff2") format("woff2"); }
@font-face { font-family:"Fraunces"; font-weight:500; font-display:swap; src:url("/admin/static/fonts/fraunces-500.woff2") format("woff2"); }
@font-face { font-family:"Fraunces"; font-weight:600; font-display:swap; src:url("/admin/static/fonts/fraunces-600.woff2") format("woff2"); }
@font-face { font-family:"Fraunces"; font-weight:700; font-display:swap; src:url("/admin/static/fonts/fraunces-700.woff2") format("woff2"); }
@font-face { font-family:"Fraunces"; font-weight:900; font-display:swap; src:url("/admin/static/fonts/fraunces-900.woff2") format("woff2"); }
@font-face { font-family:"Saira SC"; font-weight:400; font-display:swap; src:url("/admin/static/fonts/saira-semicondensed-400.woff2") format("woff2"); }
@font-face { font-family:"Saira SC"; font-weight:500; font-display:swap; src:url("/admin/static/fonts/saira-semicondensed-500.woff2") format("woff2"); }
@font-face { font-family:"Saira SC"; font-weight:600; font-display:swap; src:url("/admin/static/fonts/saira-semicondensed-600.woff2") format("woff2"); }
@font-face { font-family:"Saira SC"; font-weight:700; font-display:swap; src:url("/admin/static/fonts/saira-semicondensed-700.woff2") format("woff2"); }
@font-face { font-family:"Plex Mono"; font-weight:400; font-display:swap; src:url("/admin/static/fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family:"Plex Mono"; font-weight:500; font-display:swap; src:url("/admin/static/fonts/ibm-plex-mono-500.woff2") format("woff2"); }
@font-face { font-family:"Plex Mono"; font-weight:600; font-display:swap; src:url("/admin/static/fonts/ibm-plex-mono-600.woff2") format("woff2"); }

:root {
  /* color */
  --bg:#F4EEE0; --surface:#FBF7EF; --surface-band:#F0E9D9;
  --ink:#1C2A2E; --muted:#7C7460; --line:#E2DAC9;
  --accent:#E5532D; --accent2:#0C6B5E;
  --online:#14B8A6; --warn:#E8A317; --offline:#A39B8A; --danger:#C0392B;
  --cat-vehicle:#1C2A2E; --cat-genset:#0C6B5E; --cat-heavy-equipment:#E8A317; --cat-other:#7C7460;
  --attn:#FBEFD6; --attn-line:#F0D9A8; --mono-tint:#F1ECDE;
  --fuel-amber:#E0A53A; --fuel-low:#D8542A;
  /* type */
  --f-display:"Fraunces", Georgia, serif;
  --f-body:"Saira SC", system-ui, sans-serif;
  --f-mono:"Plex Mono", ui-monospace, monospace;
  --f-cjk:"PingFang SC","Microsoft YaHei","Noto Sans CJK SC", sans-serif;
  /* space */ --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px;
  /* radius */ --r-sm:3px; --r:4px; --r-lg:6px;
  --rail-w:194px; --strip-h:52px;
  --shadow-pop:0 8px 28px rgba(28,42,46,.16);
}

* { box-sizing:border-box; }
[x-cloak] { display:none !important; }
html,body { margin:0; height:100%; }
body { background:var(--bg); color:var(--ink); font-family:var(--f-body); font-size:13px; font-weight:500;
       -webkit-font-smoothing:antialiased; }
a { color:inherit; text-decoration:none; }
h1,h2,h3 { font-family:var(--f-display); font-weight:600; margin:0; }
.mono { font-family:var(--f-mono); font-size:12.5px; }
.muted { color:var(--muted); }
.eyebrow { font-family:var(--f-body); font-size:11px; font-weight:600; letter-spacing:.1em;
           text-transform:uppercase; color:var(--muted); }

/* ── App shell ───────────────────────────────────────────────────────────── */
/* Rail is FIXED (not a grid column): it overlays content on hover-expand
   without shifting layout, and can never be covered by the map. The frame is
   simply offset by the collapsed rail width. z-index scale: plates 500,
   strip 900, rail 1000, drawer 2000. */
.app { min-height:100vh; }

/* Fixed, always-labeled sidebar — predictable, never overlaps content. */
.rail { position:fixed; left:0; top:0; height:100vh; background:var(--ink); color:#C7D0CC;
        display:flex; flex-direction:column; width:var(--rail-w); z-index:1000; }
.rail .nav-txt { white-space:nowrap; }
.brand { display:flex; flex-direction:column; align-items:flex-start; gap:1px; padding:18px 0 16px 22px;
         border-bottom:1px solid #2B3A3E; position:relative; }
.brand::after { content:""; position:absolute; left:22px; bottom:11px; width:26px; height:2px; background:var(--accent); }
.brand-cjk { font-family:var(--f-cjk); font-size:21px; font-weight:600; color:#fff; line-height:1; }
.brand-en { font-family:var(--f-body); font-size:10px; font-weight:600; letter-spacing:.18em; color:#8FA09A;
            white-space:nowrap; }
.rail-nav { display:flex; flex-direction:column; gap:2px; padding:12px 0; flex:1; }
.nav-link { display:flex; align-items:center; gap:14px; padding:11px 0 11px 24px; color:#9DAAA5;
            font-size:13.5px; font-weight:600; border-left:3px solid transparent; position:relative; }
.nav-badge { position:absolute; top:6px; left:36px; background:var(--accent); color:#fff;
             font-size:10px; font-weight:700; min-width:16px; height:16px; border-radius:8px;
             display:flex; align-items:center; justify-content:center; padding:0 4px; }
.nav-ico { font-size:16px; width:18px; text-align:center; flex:0 0 18px; }
.nav-link:hover { background:#222F33; color:#fff; }
.nav-link.active { color:#fff; border-left-color:var(--accent); background:#222F33; }
.rail-foot { display:flex; align-items:center; gap:9px; padding:14px 0 16px 26px; border-top:1px solid #2B3A3E;
             font-size:11.5px; font-weight:600; color:#8FA09A; text-transform:uppercase; letter-spacing:.05em; }

.frame { margin-left:var(--rail-w); display:flex; flex-direction:column; min-width:0; min-height:100vh; }
.strip { height:var(--strip-h); flex:0 0 var(--strip-h); display:flex; align-items:center; gap:16px;
         padding:0 22px; background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:900; }
.crumb { font-family:var(--f-display); font-size:16px; font-weight:600; }
.strip-right { margin-left:auto; display:flex; align-items:center; gap:16px; }
.clock { color:var(--muted); font-size:12px; letter-spacing:.02em; }
.link-pill { display:inline-flex; align-items:center; gap:7px; font-family:var(--f-body); font-size:11px;
             font-weight:600; letter-spacing:.06em; padding:4px 10px; border-radius:var(--r-sm);
             background:#E3F2EF; color:var(--accent2); }
.link-pill.down { background:#FBEAD9; color:var(--accent); }
/* language switcher — compact segmented toggle, Yardbook concrete/paper */
.lang-switch { display:inline-flex; border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.lang-opt { font-family:var(--f-mono); font-size:11px; line-height:1; padding:5px 9px; color:var(--muted);
            text-decoration:none; background:transparent; transition:background .12s,color .12s; }
.lang-opt + .lang-opt { border-left:1px solid var(--line); }
.lang-opt:hover { background:var(--surface-band); color:var(--ink); }
.lang-opt.on { background:var(--ink); color:var(--surface); }
/* In Chinese, route the Latin-only display/body fonts to the CJK stack so
   headings + labels shape correctly (numbers keep the mono face). */
html[lang^="zh"] { --f-display: var(--f-cjk); --f-body: var(--f-cjk); }
.main { padding:22px 24px; min-width:0; flex:1; }

/* ── Pulse dot ───────────────────────────────────────────────────────────── */
.pulse-dot { width:8px; height:8px; border-radius:50%; display:inline-block; flex:0 0 8px; }
.pulse-dot.on { background:var(--online); box-shadow:0 0 0 0 rgba(20,184,166,.5); animation:pulse 2s infinite; }
.pulse-dot.off { background:transparent; border:2px solid var(--offline); }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(20,184,166,.45);} 70%{box-shadow:0 0 0 7px rgba(20,184,166,0);} 100%{box-shadow:0 0 0 0 rgba(20,184,166,0);} }

/* ── Page head ───────────────────────────────────────────────────────────── */
.page-head { display:flex; align-items:center; gap:14px; margin:0 0 18px; }
.page-head h1 { font-size:22px; }
.page-head .btn { margin-left:auto; }

/* ── Plates (cards) ──────────────────────────────────────────────────────── */
.plate { background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
         border-top:3px solid var(--accent2); padding:14px 16px; }
.plate > h2 { font-family:var(--f-body); font-size:11px; font-weight:600; letter-spacing:.08em;
              text-transform:uppercase; color:var(--muted); margin:0 0 12px; padding-bottom:9px;
              border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.plate--attn { background:var(--attn); border-color:var(--attn-line); border-top-color:var(--warn);
               position:relative; }
.plate--attn::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--warn); }

/* KPI cluster */
.kpis { display:flex; flex-wrap:wrap; gap:12px; }
.kpi { background:var(--surface); border:1px solid var(--line); border-left:3px solid var(--accent2);
       border-radius:var(--r); padding:12px 16px; min-width:120px; flex:1; }
.kpi.attn { border-left-color:var(--accent); }
.kpi-n { font-family:var(--f-display); font-size:34px; font-weight:600; line-height:1; }
.kpi-l { font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin-top:4px; }
.kpi.attn .kpi-n { color:var(--accent); }
.kpi.attn a { color:inherit; }

/* ── Pills + dots ────────────────────────────────────────────────────────── */
.pill { display:inline-flex; align-items:center; gap:6px; height:20px; padding:0 8px; border-radius:var(--r-sm);
        font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; line-height:1;
        background:#ECE6D8; color:#6E6552; }
.pill--leased { background:#DCEDEA; color:#0C6B5E; }
.pill--in-stock { background:#E4EFD9; color:#3E6B1F; }
.pill--maintenance { background:#FBEAC9; color:#9A6309; }
.pill--retired { background:#ECE6D8; color:#8A8270; }
.pill--active { background:#E3F5EA; color:#1A9E5C; }
.pill--inactive { background:#ECE6D8; color:#8A8270; }
/* lease lifecycle */
.pill--lease-draft { background:#ECE6D8; color:#6E6552; }
.pill--lease-active { background:#DCEDEA; color:#0C6B5E; }
.pill--lease-returned { background:#E6EFFD; color:#1F6FEB; }
.pill--lease-closed { background:#ECE6D8; color:#8A8270; }
.pill--lease-cancelled { background:#F1E6E2; color:#9A6309; }
.pill--overdue { background:#FBE0DA; color:#C0392B; }
/* P2: roles (|trole) · grant reasons (|treason) · user/org status (|tustatus) */
.pill--sys_admin { background:#FCE3D6; color:#B5471E; }   /* safety-orange */
.pill--sys_user { background:#DCEDEA; color:#0C6B5E; }    /* diesel-teal */
.pill--customer { background:#E6EFFD; color:#1F6FEB; }
.pill--invited { background:#FBEAC9; color:#9A6309; }
.pill--disabled { background:#ECE6D8; color:#8A8270; }
.pill--lease { background:#DCEDEA; color:#0C6B5E; }
.pill--monitoring { background:#E6EFFD; color:#1F6FEB; }
.pill--leasing { background:#DCEDEA; color:#0C6B5E; }
/* lease board overdue row */
.logbook tr.overdue td { background:#FCEEEA; }
.logbook tr.overdue td.cat { box-shadow:inset 3px 0 0 var(--danger); }
/* custody timeline */
.timeline { list-style:none; margin:0; padding:0 0 0 4px; }
.timeline li { position:relative; padding:0 0 12px 18px; border-left:2px solid var(--line); }
.timeline li:last-child { border-left-color:transparent; }
.tl-dot { position:absolute; left:-5px; top:3px; width:8px; height:8px; border-radius:50%; background:var(--accent2); border:2px solid var(--surface); }
.tl-handover .tl-dot { background:var(--accent2); }
.tl-return .tl-dot { background:var(--brand, #1F6FEB); }
.tl-body { font-size:13px; }
.util-block { margin:6px 0 4px; }
.util-block .kpis { gap:8px; }
.util-block .kpi { min-width:84px; padding:8px 12px; }
.util-block .kpi-n { font-size:24px; }
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; flex:0 0 8px; }
.dot--fresh { background:var(--online); }
.dot--stale { background:var(--warn); }
.dot--offline { background:transparent; border:2px solid var(--offline); }
.ign { font-size:11px; font-weight:600; letter-spacing:.04em; padding:1px 7px; border-radius:var(--r-sm); }
.ign--on { background:#FBE3D9; color:var(--accent); }
.ign--off { background:#ECE6D8; color:var(--muted); }
.chip { display:inline-block; font-family:var(--f-mono); font-size:11px; padding:1px 6px; border-radius:var(--r-sm); }
.chip--fresh { background:#DCF1EE; color:#0C7C6E; }
.chip--stale { background:#FBEFD6; color:#9A6309; }
.chip--offline { background:#ECE6D8; color:var(--muted); }

/* ── Fuel rod (signature) ────────────────────────────────────────────────── */
.fuel-rod { --fuel-level:0%; position:relative; width:22px; height:120px; border-radius:11px;
            border:1px solid #CFC6B3; background:#F3EEE2; box-shadow:inset 0 2px 6px rgba(28,42,46,.14);
            overflow:hidden; }
.fuel-rod__fill { position:absolute; left:0; right:0; bottom:0; height:var(--fuel-level);
                  background:linear-gradient(180deg,#E8B85A,var(--fuel-amber));
                  transition:height .55s cubic-bezier(.4,0,.2,1); }
.fuel-rod__fill::after { content:""; position:absolute; top:0; left:0; right:0; height:2px; background:#F4D79A; }
.fuel-rod__ticks { position:absolute; inset:0; pointer-events:none;
                   background:repeating-linear-gradient(0deg, transparent 0, transparent calc(25% - 1px), rgba(28,42,46,.16) 25%, transparent calc(25% + 1px)); }
.fuel-rod.low .fuel-rod__fill { background:linear-gradient(180deg,#E8794A,var(--fuel-low)); }
.fuel-rod.na { background:repeating-linear-gradient(45deg,#F3EEE2,#F3EEE2 5px,#EBE3D2 5px,#EBE3D2 10px); }
.fuel-rod.uncal, .fuel-rod.fault { background:#ECE6D8; }
.fuel-rod--mini { width:8px; height:30px; border-radius:4px; }
.fuel-gauge { display:flex; flex-direction:column; align-items:center; gap:6px; }
.fuel-gauge .pct { font-family:var(--f-display); font-size:18px; font-weight:600; }
.fuel-gauge .pct.low { color:var(--fuel-low); }
.fuel-gauge .sub { font-size:11px; color:var(--muted); text-align:center; }
.fuel-na-txt { font-size:9px; font-weight:600; color:var(--muted); text-transform:uppercase;
               writing-mode:vertical-rl; transform:rotate(180deg); }
.trend-arrow { font-size:12px; }
.trend-arrow.falling { color:var(--accent); } .trend-arrow.rising { color:var(--accent2); } .trend-arrow.steady { color:var(--muted); }

/* ── Logbook tables ──────────────────────────────────────────────────────── */
.logbook { width:100%; border-collapse:collapse; }
.logbook th { font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--muted);
              text-align:left; padding:9px 12px; background:var(--surface-band); border-bottom:2px solid #D8CFBC; }
.logbook th.num, .logbook td.num { text-align:right; font-variant-numeric:tabular-nums; }
.logbook td { padding:11px 12px; border-bottom:1px solid #EAE3D4; }
.logbook tbody tr { position:relative; }
.logbook tbody tr:hover { background:#FFFDF8; cursor:pointer; }
.logbook td.cat { border-left:3px solid var(--muted); }
.logbook td.cat.vehicle { border-left-color:var(--cat-vehicle); }
.logbook td.cat.genset { border-left-color:var(--cat-genset); }
.logbook td.cat.heavy-equipment { border-left-color:var(--cat-heavy-equipment); }
.logbook .mono { background:var(--mono-tint); padding:1px 5px; border-radius:var(--r-sm); }
.empty { color:var(--muted); padding:18px 12px; }

/* ── Buttons + forms ─────────────────────────────────────────────────────── */
.btn { font-family:var(--f-body); font-size:13px; font-weight:600; padding:7px 14px; border-radius:var(--r);
       border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; }
.btn:hover { background:#F3EEE2; }
.btn-primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-primary:hover { background:#cf4624; }
.btn-sm { padding:4px 10px; font-size:12px; }
.btn-icon { border:0; background:none; font-size:18px; cursor:pointer; color:var(--muted); }

/* ── Live map ────────────────────────────────────────────────────────────── */
.map-wrap { position:relative; }
.hero-map { position:relative; height:56vh; min-height:360px; border-radius:var(--r); overflow:hidden;
            border:1px solid var(--line); margin-bottom:18px; }
.hero-map #map { position:absolute; inset:0; }
.main:has(.fullmap) { padding:0; }
/* contained, not viewport-absolute → can never cover the rail */
.fullmap { position:relative; height:calc(100vh - var(--strip-h)); }
#map { width:100%; height:100%; }
.leaflet-tile-pane { filter:saturate(.82) contrast(1.02) brightness(1.03); }
.leaflet-container { background:#E8E1D2; font-family:var(--f-body); }

/* floating paper plates over the map */
.map-plate { position:absolute; z-index:500; background:var(--surface); border:1px solid var(--line);
             border-radius:var(--r); box-shadow:var(--shadow-pop); }
.map-masthead { top:14px; left:14px; padding:10px 14px; border-top:3px solid var(--accent); }
.map-masthead .eyebrow { color:var(--accent); }
.map-masthead .ttl { font-family:var(--f-display); font-size:16px; font-weight:600; }
.map-masthead .sub { font-family:var(--f-mono); font-size:11px; color:var(--muted); }
.map-kpis { top:14px; right:14px; display:flex; gap:1px; background:var(--line); padding:1px; }
.map-kpis .mk { background:var(--surface); padding:8px 14px; text-align:center; min-width:74px; }
.map-kpis .mk .n { font-family:var(--f-display); font-size:22px; font-weight:600; line-height:1; }
.map-kpis .mk .l { font-size:10px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); }
.map-legend { bottom:14px; left:14px; display:flex; gap:4px; padding:6px; }
.map-legend .lg { display:inline-flex; align-items:center; gap:6px; padding:4px 9px; border-radius:var(--r-sm);
                  font-size:11px; font-weight:600; cursor:pointer; background:transparent; }
.map-legend .lg.off { opacity:.4; }
.map-status { position:absolute; bottom:14px; right:14px; z-index:500; background:#FBEAD9; color:var(--accent);
              padding:6px 12px; border-radius:var(--r); font-size:12px; font-weight:600; box-shadow:var(--shadow-pop); }

/* markers (divIcon) */
.eq-marker { background:none; border:0; }
.eq-pin { position:relative; width:26px; height:26px; border-radius:7px; border:2px solid var(--surface);
          display:flex; align-items:center; justify-content:center; color:#fff; font-size:13px; font-weight:700;
          box-shadow:0 3px 8px rgba(28,42,46,.35); transform:translate(-13px,-13px); }
.eq-pin::after { content:""; position:absolute; bottom:-7px; left:50%; transform:translateX(-50%);
                 border-left:5px solid transparent; border-right:5px solid transparent; border-top:7px solid var(--surface); }
.eq-fresh .eq-pin { background:var(--online); }
.eq-fresh .eq-pin::before { content:""; position:absolute; inset:-6px; border-radius:11px; border:2px solid var(--online);
                            opacity:.5; animation:ping 2s infinite; }
.eq-stale .eq-pin { background:var(--warn); }
.eq-offline .eq-pin { background:var(--offline); opacity:.78; }
.eq-sel .eq-pin { transform:translate(-13px,-13px) scale(1.18); box-shadow:0 0 0 4px rgba(20,184,166,.35),0 3px 8px rgba(28,42,46,.4); }
@keyframes ping { 0%{transform:scale(.8);opacity:.6;} 80%,100%{transform:scale(1.6);opacity:0;} }

/* leaflet popup as paper plate */
.leaflet-popup-content-wrapper { border-radius:var(--r); border:1px solid var(--line); box-shadow:var(--shadow-pop);
                                 background:var(--surface); }
.leaflet-popup-content { margin:12px 14px; font-family:var(--f-body); font-size:13px; }
.leaflet-popup-tip { background:var(--surface); }
.eq-popup .name { font-family:var(--f-display); font-size:15px; font-weight:600; }
.eq-popup .row { display:flex; justify-content:space-between; gap:14px; padding:3px 0; border-top:1px solid var(--line); margin-top:5px; }
.eq-popup .row .k { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.eq-popup .row .v { font-family:var(--f-mono); font-size:12px; }
.eq-popup .popup-rod { display:flex; align-items:center; gap:8px; margin-top:6px; }
.leaflet-control-zoom a { background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:var(--r-sm)!important; }

/* ── Drawer ──────────────────────────────────────────────────────────────── */
.drawer:empty { display:none; }
.drawer-panel { position:fixed; inset:0; background:rgba(28,42,46,.38); display:flex; justify-content:flex-end; z-index:2000; }
.drawer-body { width:440px; max-width:92vw; height:100%; background:var(--surface); padding:18px 22px;
               overflow-y:auto; display:flex; flex-direction:column; gap:12px; box-shadow:var(--shadow-pop); }
.drawer-head { display:flex; align-items:center; justify-content:space-between; }
.drawer-head h2 { font-size:18px; }
.drawer-foot { margin-top:auto; display:flex; gap:8px; justify-content:flex-end; padding-top:12px; border-top:1px solid var(--line); }
.drawer-body label { display:flex; flex-direction:column; gap:4px; font-size:11px; font-weight:600;
                     letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.drawer-body input, .drawer-body select, .drawer-body textarea { font-family:var(--f-body); font-size:14px;
   font-weight:500; padding:8px 10px; border:1px solid var(--line); border-radius:var(--r); color:var(--ink); background:#fff; }
.drawer-body fieldset { border:1px solid var(--line); border-radius:var(--r); padding:10px 12px; display:flex; flex-direction:column; gap:10px; }
.drawer-body legend { font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:0 4px; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
label.check { flex-direction:row; align-items:center; gap:8px; text-transform:none; }
.kv { display:grid; grid-template-columns:128px 1fr; gap:6px 12px; font-size:13px; margin:0; }
.kv dt { color:var(--muted); font-weight:600; text-transform:uppercase; font-size:11px; letter-spacing:.04em; }
.kv dd { margin:0; }

/* ── Dashboard layout ────────────────────────────────────────────────────── */
.shelf { display:grid; grid-template-columns:2fr 1fr; gap:18px; align-items:start; }
.stack { display:flex; flex-direction:column; gap:18px; }
.fuel-panel-row { display:flex; gap:22px; flex-wrap:wrap; }
.fuel-panel-item { display:flex; flex-direction:column; align-items:center; gap:8px; }
.fuel-panel-item .lab { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); text-align:center; }
.feed { list-style:none; margin:0; padding:0; }
.feed li { display:flex; justify-content:space-between; gap:10px; padding:7px 0; border-bottom:1px solid #EAE3D4; font-size:12.5px; }
.feed li:last-child { border-bottom:0; }

/* ── Analytics ───────────────────────────────────────────────────────────── */
.ana-select { font-family:var(--f-body); font-size:14px; font-weight:600; padding:7px 10px;
              border:1px solid var(--line); border-radius:var(--r); background:#fff; color:var(--ink); }
.page-head .ana-select { margin-left:auto; }
.seg { display:inline-flex; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.seg-btn { font-family:var(--f-body); font-size:13px; font-weight:600; padding:7px 14px; border:0;
           background:var(--surface); color:var(--muted); cursor:pointer; border-left:1px solid var(--line); }
.seg-btn:first-child { border-left:0; }
.seg-btn.on { background:var(--accent2); color:#fff; }
.ana-note { color:var(--warn); font-size:13px; }
.chart-wrap { position:relative; height:260px; }

/* ── Motion ──────────────────────────────────────────────────────────────── */
@media (max-width:980px){ .shelf{ grid-template-columns:1fr; } .app{ grid-template-columns:var(--rail-w) 1fr; } }
body.loaded .stagger { animation:rise .4s ease backwards; }
@keyframes rise { from{ opacity:0; transform:translateY(7px);} to{ opacity:1; transform:none;} }
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after { animation:none!important; transition:none!important; }
}

/* ── Reports / client statement ─────────────────────────────────────────── */
.stmt-actions { display:flex; gap:10px; margin-bottom:14px; }
.statement { max-width:880px; }
.stmt-head { display:flex; justify-content:space-between; align-items:flex-start;
  gap:20px; padding-bottom:14px; border-bottom:2px solid var(--ink,#2a2622); margin-bottom:16px; }
.stmt-co { font-family:"Fraunces",Georgia,serif; font-size:18px; font-weight:600; }
.stmt-meta { text-align:right; }
.stmt-doc { font-family:"Saira SC","Saira",sans-serif; font-size:22px; letter-spacing:.12em;
  text-transform:uppercase; }
.stmt-billto { margin-bottom:18px; }
.stmt-billto .muted { text-transform:uppercase; letter-spacing:.08em; margin-bottom:2px; }
.stmt-client { font-size:15px; font-weight:600; }
.stmt-table tfoot .stmt-total td { border-top:2px solid var(--ink,#2a2622);
  font-weight:600; font-size:14px; padding-top:8px; }
.stmt-foot { text-transform:none; letter-spacing:0; font-size:11px; margin-top:12px; }

/* ── Trip playback controls ─────────────────────────────────────────────── */
.trip-controls { display:flex; align-items:center; gap:12px; }
.trip-controls input[type=range] { flex:1; accent-color:var(--diesel,#0C6B5E); }

@media print {
  .rail, .strip, .stmt-actions { display:none !important; }
  .main { padding:0 !important; }
  .plate, .statement { border:none !important; box-shadow:none !important; background:none !important;
    padding:0 !important; }
  body { background:#fff !important; }
}

/* ══ Brand wordmark (Huayu) — replaces the legacy 华宇 CJK lockup everywhere ══ */
.brand { flex-direction:row; align-items:center; gap:11px; padding:15px 0 14px 18px; }
.brand::after { content:none; }
.brand-mark { flex:none; display:block; }
.brand-text { display:flex; flex-direction:column; gap:2px; }
.brand-wm { font-family:var(--f-display); font-weight:700; font-size:20px; line-height:1;
            color:#FBF7EF; letter-spacing:-.005em; }
.brand-tag { font-family:var(--f-body); font-weight:600; font-size:9px; letter-spacing:.2em;
             color:#8FA09A; text-transform:uppercase; }

/* ══ Customer portal login ══ */
.login-shell { display:grid; grid-template-columns:1.06fr .94fr; min-height:100vh; }
.login-hero { position:relative; overflow:hidden; color:#FBF7EF; padding:44px 52px;
              display:flex; flex-direction:column; justify-content:space-between;
              background:linear-gradient(152deg,#15272E 0%,#123F3A 58%,#0C6B5E 128%); }
.login-hero::before { content:""; position:absolute; inset:0;
  background-image:linear-gradient(rgba(255,255,255,.055) 1px,transparent 1px),
                   linear-gradient(90deg,rgba(255,255,255,.055) 1px,transparent 1px);
  background-size:32px 32px;
  -webkit-mask-image:radial-gradient(120% 90% at 28% 32%,#000 35%,transparent 78%);
          mask-image:radial-gradient(120% 90% at 28% 32%,#000 35%,transparent 78%); }
.login-hero__accent { position:absolute; top:0; right:72px; width:3px; height:108px;
                      background:var(--accent); }
.login-hero > * { position:relative; }
.login-hero .brand { padding:0; border:none; }
.login-hero .brand-wm { font-size:22px; }
.login-eyebrow { font-family:var(--f-body); font-size:11px; font-weight:600; letter-spacing:.24em;
                 text-transform:uppercase; color:#86C0B5; margin-bottom:16px; }
.login-tagline { font-family:var(--f-display); font-weight:600; font-size:40px; line-height:1.07;
                 letter-spacing:-.015em; max-width:11em; }
.login-tagline b { color:var(--accent); font-weight:600; }
.login-hero__foot { font-family:var(--f-mono); font-size:11px; letter-spacing:.04em; color:#7FB3A9;
                    display:flex; align-items:center; gap:8px; }
.login-hero__foot .dot { width:6px; height:6px; border-radius:50%; background:var(--online);
                         box-shadow:0 0 0 3px rgba(20,184,166,.2); }

.login-pane { background:var(--surface); display:flex; align-items:center; justify-content:center;
              padding:40px 32px; }
.login-card { width:100%; max-width:344px; }
.login-card__kicker { font-family:var(--f-body); font-size:11px; font-weight:600; letter-spacing:.2em;
                      text-transform:uppercase; color:var(--accent2); margin-bottom:7px; }
.login-card h1 { font-family:var(--f-display); font-weight:600; font-size:30px; line-height:1;
                 color:var(--ink); margin:0 0 22px; }
.login-banner { display:block; padding:9px 12px; border-radius:var(--r); margin-bottom:18px;
                font-size:12.5px; font-weight:600; }
.login-banner--info { background:var(--attn); border:1px solid var(--attn-line); color:#8A6D1E; }
.login-banner--ok { background:#E3F1EC; border:1px solid #BFE0D4; color:#0C6B5E; }
.login-banner--err { background:#FBE0DA; border:1px solid #F2C3B8; color:#C0392B; }
.login-field { margin-bottom:15px; }
.login-field label { display:block; font-family:var(--f-body); font-size:10.5px; font-weight:600;
                     letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-bottom:6px; }
.login-field input { width:100%; box-sizing:border-box; padding:11px 13px; border:1px solid var(--line);
                     border-radius:var(--r); background:#fff; font-family:var(--f-body); font-size:14px;
                     color:var(--ink); transition:border-color .12s, box-shadow .12s; }
.login-field input::placeholder { color:#B9B19E; }
.login-field input:focus { outline:none; border-color:var(--accent2);
                           box-shadow:0 0 0 3px rgba(12,107,94,.13); }
.login-submit { width:100%; padding:12px; margin-top:8px; background:var(--accent); color:#fff;
                border:none; border-radius:var(--r); font-family:var(--f-body); font-weight:600;
                font-size:14px; letter-spacing:.04em; cursor:pointer;
                transition:background .12s, transform .05s; }
.login-submit:hover { background:#D2491F; }
.login-submit:active { transform:translateY(1px); }
.login-foot { margin-top:22px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.login-foot .muted { font-size:11px; }
@media (max-width:860px) {
  .login-shell { grid-template-columns:1fr; }
  .login-hero { padding:30px 30px 28px; gap:26px; }
  .login-hero__accent { display:none; }
  .login-tagline { font-size:27px; }
  .login-hero__foot { display:none; }
  .login-pane { padding:34px 28px 44px; }
}
