/* FuelExperts — "canopy" theme.
   Dark structural chrome like a fuel-station canopy with a lime light strip; the work area is bright daylight.
   Numbers are set in Barlow Semi Condensed like a price board. One shadow level, three radii. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

/* Two themes share one set of names. Light is the default palette; [data-theme="dark"] overrides it.
   Brand: FuelExperts gold on black (from the logo); green stays the colour of good / positive figures. */
:root {
  color-scheme: light;
  --canopy: #07090c;
  --canopy-2: #12161c;
  --canopy-3: #1d232c;
  --canopy-text: #aab3bd;
  --canopy-link: #c9d2db;     /* sidebar links */
  --canopy-faint: #8b97a3;    /* secondary text on the canopy */
  --canopy-muted: #7a8692;    /* section titles and icons on the canopy */
  --canopy-dim: #5d6a77;      /* disabled items on the canopy */
  --meter-warn: #e3a21a;
  --toast-danger: #ff6b5b;
  --toast-warn: #f5b335;
  --toast-info: #6ea8ff;
  --lime: #f5b014;            /* brand gold (kept under the old name so every component follows) */
  --lime-glow: #ffcb47;
  --lime-ink: #8a5f00;        /* gold dark enough for text on white */
  --lime-ink-hover: #6b4900;
  --lime-soft: #fff5d9;
  --lime-line: #f1d48a;
  --brand-rgb: 245, 176, 20;
  --good: #1f8a3a;
  --good-soft: #e3f4e6;
  --paper: #f4f5f7;
  --card: #ffffff;
  --line: #e3e6ea;
  --line-2: #eef0f3;
  --line-strong: #cfd5dc;
  --surface-2: #f7f8fa;
  --surface-3: #fafbfc;
  --input-line: #d3d9e0;
  --input-line-hover: #b9c1ca;
  --disabled-ink: #9aa4ad;
  --ink: #11161c;
  --ink-2: #3d4752;
  --muted: #66717c;
  --danger: #c8382b;
  --danger-soft: #fcebe9;
  --danger-line: #efc2bd;
  --warn: #8a5200;
  --warn-soft: #fff4de;
  --warn-line: #f0c36a;
  --info: #1d63c9;
  --info-soft: #e8f0fc;
  --violet-soft: #f1eafb;
  --violet-ink: #5e2fa3;
  --fuel-petrol: #2f9a3e;
  --fuel-diesel: #7d45c9;
  --fuel-hobc: #e8870e;
  --fuel-other: #1d63c9;
  --r-lg: 16px;
  --r-md: 11px;
  --r-sm: 7px;
  --shadow: 0 1px 2px rgba(14, 20, 27, .05), 0 8px 24px rgba(14, 20, 27, .06);
  --shadow-lift: 0 2px 4px rgba(14, 20, 27, .05), 0 14px 32px rgba(14, 20, 27, .10);
  --font: "Barlow", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-num: "Barlow Semi Condensed", "Bahnschrift", "Barlow", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --canopy: #050608;
  --canopy-2: #0f1317;
  --canopy-3: #1a2027;
  --lime-ink: #ffc63a;
  --lime-ink-hover: #ffd873;
  --lime-soft: rgba(245, 176, 20, .12);
  --lime-line: rgba(245, 176, 20, .35);
  --good: #52c46b;
  --good-soft: rgba(82, 196, 107, .14);
  --paper: #090b0e;
  --card: #11151a;
  --line: #222931;
  --line-2: #191e24;
  --line-strong: #333c46;
  --surface-2: #151a20;
  --surface-3: #161b21;
  --input-line: #2d353f;
  --input-line-hover: #414b57;
  --disabled-ink: #5f6a75;
  --ink: #eaeef2;
  --ink-2: #c4ccd4;
  --muted: #8f9aa6;
  --danger: #ff6b5b;
  --danger-soft: rgba(255, 107, 91, .13);
  --danger-line: rgba(255, 107, 91, .4);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, .12);
  --warn-line: rgba(255, 181, 71, .45);
  --info: #6ea8ff;
  --info-soft: rgba(110, 168, 255, .13);
  --violet-soft: rgba(167, 123, 240, .15);
  --violet-ink: #c6a6ff;
  --fuel-petrol: #52c46b;
  --fuel-diesel: #a77bf0;
  --fuel-hobc: #ffa53d;
  --fuel-other: #6ea8ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 28px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 16px 36px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--lime-ink); text-underline-offset: 2px; }
a:hover { color: var(--lime-ink-hover); }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--ink); }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .55); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num, td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.text-danger { color: var(--danger); }
.text-good { color: var(--good); }
.text-warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.table td:first-child > a:first-child, .table td.col-check + td > a:first-child { white-space: nowrap; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Buttons ----------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card); color: var(--ink); text-decoration: none; font: 600 14px/1.2 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:hover { border-color: var(--input-line-hover); background: var(--surface-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--lime); border-color: var(--lime); color: #0b0d10; box-shadow: 0 4px 14px rgba(var(--brand-rgb), .28); }
.btn-primary:hover { background: var(--lime-glow); border-color: var(--lime-glow); color: #0b0d10; }
.btn-dark { background: var(--canopy); border-color: var(--canopy); color: #fff; }
.btn-dark:hover { background: var(--canopy-3); border-color: var(--canopy-3); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b02f24; border-color: #b02f24; color: #fff; }
.btn-danger-outline { color: var(--danger); border-color: var(--danger-line); background: var(--card); }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; margin-top: 18px; padding: 12px; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-icon { padding: 6px; width: 32px; height: 32px; border-radius: 9px; }
.canopy .btn-ghost-light { background: transparent; border-color: rgba(255, 255, 255, .28); color: #fff; }
.canopy .btn-ghost-light:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .5); color: #fff; }

/* ---- Panels, cards, sections ------------------------------------------------------------ */
.panel-intro { margin-bottom: 20px; }
.panel-intro h2 { margin: 0 0 2px; font-size: 24px; }
.panel-intro p { margin: 0; }
.section-title { font-size: 17px; margin: 0 0 12px; color: var(--ink); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head .section-title { margin: 0; }
.section-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.sub-title { font-size: 15px; font-weight: 700; margin: 18px 0 8px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel-narrow { max-width: 600px; }
[data-tab-panel][hidden] { display: none !important; }
.panel.notice { border-left: 4px solid var(--lime); background: var(--lime-soft); }
.panel.danger-zone { border: 1px solid var(--danger-line); background: var(--danger-soft); }
.panel-flat { box-shadow: none; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card-grid-small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.card-grid-wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid-5 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row-form .form-field { margin: 0; min-width: 170px; flex: 1 1 170px; }
.row-form .form-field.narrow { flex: 0 1 110px; min-width: 90px; }
.row-form .btn { flex: 0 0 auto; min-height: 42px; }

.stat-card { position: relative; display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 18px 16px;
  box-shadow: var(--shadow); color: inherit; text-decoration: none; overflow: hidden; min-width: 0; container-type: inline-size; }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--lime)); }
a.stat-card { transition: border-color .15s, box-shadow .15s, transform .15s; }
a.stat-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); transform: translateY(-2px); color: inherit; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: color-mix(in srgb, var(--accent, var(--lime)) 14%, var(--card)); color: var(--accent, var(--lime-ink)); }
.stat-value { margin: 10px 0 2px; font-family: var(--font-num); font-size: 28px; font-size: clamp(18px, 11.5cqi, 28px); font-weight: 700;
  letter-spacing: -.2px; line-height: 1.1; color: var(--ink); white-space: nowrap; }
.stat-card.is-empty .stat-value { font-family: var(--font); font-size: 16px; font-weight: 600; color: var(--muted); }
.stat-note { margin: 0; font-size: 13px; color: var(--muted); }
.stat-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--lime-ink); }
.stat-card.highlight { border-color: var(--lime-line); background: var(--lime-soft); }
.stat-card.is-warning { --accent: #e3a21a; }
.stat-card.is-danger { --accent: var(--danger); }
.stat-card .meter { margin-top: 10px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; font-family: var(--font); }
.delta-up { background: var(--good-soft); color: var(--good); }
.delta-down { background: var(--danger-soft); color: var(--danger); }
.delta-flat { background: var(--line-2); color: var(--muted); }

.master-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start; box-shadow: var(--shadow); }
.master-card h3 { margin: 0; font-size: 17px; }
.master-card p { margin: 0; font-size: 14px; }
.master-step { font-size: 12.5px; font-weight: 600; color: var(--lime-ink); }
.master-card.is-empty { background: var(--surface-3); }

.two-col { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 20px; align-items: start; }
.two-col .panel { margin-bottom: 0; }
.two-col.equal { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-3 .panel, .grid-2 .panel { margin-bottom: 0; }
.facts { display: flex; gap: 32px; margin: 0 0 16px; flex-wrap: wrap; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-size: 24px; font-weight: 700; font-family: var(--font-num); }
.limit-big { font-size: 24px; font-weight: 700; font-family: var(--font-num); }

/* ---- Canopy hero (dashboard) ------------------------------------------------------------ */
.canopy { position: relative; overflow: hidden; border-radius: 22px; padding: 28px 30px 30px; margin-bottom: 22px; color: #fff;
  background: radial-gradient(700px 260px at 88% -20%, rgba(var(--brand-rgb), .22), transparent 62%), linear-gradient(118deg, #0a0f15 0%, #121b25 58%, #182533 100%);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr); gap: 26px; align-items: center; }
.canopy::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--lime);
  box-shadow: 0 -6px 26px rgba(155, 225, 93, .55), 0 0 10px rgba(155, 225, 93, .9); }
.canopy h2 { color: #fff; margin: 6px 0 8px; font-family: var(--font-num); font-size: 36px; font-weight: 700; letter-spacing: -.3px; line-height: 1.05; }
.canopy .canopy-sub { color: #9eabb8; margin: 0 0 18px; font-size: 15px; max-width: 46ch; }
.canopy .canopy-kicker { color: var(--lime-glow); font-weight: 600; font-size: 14px; margin: 0; }
.canopy .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.price-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; position: relative; z-index: 1; }
.price-tile { background: var(--card); color: var(--ink); border-radius: 16px; padding: 14px 12px 12px; text-align: center; box-shadow: 0 10px 28px rgba(0, 0, 0, .25); }
.price-tile .pt-name { font-weight: 700; font-size: 14px; color: var(--fuel, var(--fuel-other)); margin: 0; }
.price-tile .pt-dot { width: 44px; height: 44px; margin: 9px auto; border-radius: 50%; display: grid; place-items: center; background: var(--fuel, var(--fuel-other)); color: #fff; }
.price-tile .pt-value { font-family: var(--font-num); font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.price-tile .pt-unit { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.price-tile.is-missing .pt-value { font-size: 16px; color: var(--muted); font-family: var(--font); font-weight: 600; }
.board-note { grid-column: 1 / -1; margin: 2px 0 0; font-size: 12.5px; color: #8b97a3; text-align: right; }
.board-note a { color: var(--lime-glow); }

/* ---- Meters, bars, chips ---------------------------------------------------------------- */
.meter { position: relative; height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--lime); width: 0; transition: width .9s var(--ease); }
.meter.is-warning > span { background: #e3a21a; }
.meter.is-danger > span { background: var(--danger); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.status-active, .status-posted, .status-confirmed, .status-paid, .status-approved, .status-ok { background: var(--good-soft); color: var(--good); }
.status-inactive, .status-reversed, .status-rejected, .status-cancelled, .status-overdue { background: var(--danger-soft); color: var(--danger); }
.status-suspended, .status-leave, .status-draft, .status-submitted, .status-requested, .status-soon, .status-due-soon { background: var(--warn-soft); color: var(--warn); }
.status-closed { background: var(--line-2); color: var(--muted); }
.status-info, .status-open { background: var(--info-soft); color: var(--info); }
.type-chip, .kind-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.type-credit_holder { background: var(--violet-soft); color: var(--violet-ink); }
.type-personal { background: var(--lime-soft); color: var(--lime-ink); }
.type-outsider { background: var(--warn-soft); color: var(--warn); }
.kind-bank { background: var(--info-soft); color: var(--info); }
.kind-cash { background: var(--warn-soft); color: var(--warn); }
.kind-pump_cash { background: var(--lime-soft); color: var(--lime-ink); }
.licence-expired { color: var(--danger); font-weight: 700; }
.licence-expiring { color: var(--warn); font-weight: 700; }
.notice-text { color: var(--warn); }

/* ---- Tables ------------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-2); border-radius: 12px; }
.panel > .table-wrap:first-child { margin-top: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--card); }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-3); }
.table tr:last-child td { border-bottom: 0; }
.table td small, .table td .sub { display: block; color: var(--muted); font-size: 12.5px; }
.table tfoot th, .table tfoot td { border-top: 2px solid var(--line-strong); border-bottom: 0; color: var(--ink); background: var(--surface-2); }
.table th.num, .table td.num { text-align: right; }
.table-num td:not(:first-child), .table-num th:not(:first-child) { text-align: right; }
.table .group-row td, .table .group-row th { background: var(--surface-2); font-size: 14px; color: var(--ink); padding-top: 10px; }
.table .indent { padding-left: 30px; }
.table .subtotal-row td { border-top: 1px solid var(--line-strong); }
.table .total-row td, .table .total-row th { border-top: 2px solid var(--line-strong); font-size: 15px; }
.table a { font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.narrow-table .table { max-width: 780px; }
.row-reversed td { color: var(--muted); text-decoration: line-through; }
.row-reversed td:nth-child(5), .row-reversed td:nth-child(6) { text-decoration: none; }
tr.row-over td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
tr.is-deleted td { color: var(--disabled-ink); }
tr.is-deleted td a { color: var(--disabled-ink); }
.hide-deleted tr.is-deleted { display: none; }
td.actions, .row-actions { white-space: nowrap; text-align: right; }
td.actions .inline-form { display: inline-block; }
.row-actions .btn { margin-left: 4px; }
.col-check { width: 38px; text-align: center !important; padding-right: 4px !important; }
.col-check input { width: 17px; height: 17px; accent-color: var(--lime-ink); cursor: pointer; vertical-align: middle; }
.empty { margin: 6px 0; color: var(--muted); }
.empty-state { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-state .ic { color: var(--line-strong); margin-bottom: 6px; }
.empty-state p { margin: 4px 0 14px; }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

/* ---- Bulk actions ------------------------------------------------------------------------ */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; margin: 0 0 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13.5px; }
.bulk-bar .bulk-count { font-weight: 600; color: var(--ink-2); min-width: 92px; }
.bulk-bar .bulk-spacer { flex: 1; }
.bulk-bar .toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); cursor: pointer; user-select: none; }
.bulk-bar .toggle input { accent-color: var(--lime-ink); width: 16px; height: 16px; }
.bulk-bar.has-selection { background: var(--lime-soft); border-color: var(--lime-line); }
.row-del { color: var(--disabled-ink); border-color: transparent; background: transparent; }
.row-del:hover { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

/* ---- Navigation helpers ------------------------------------------------------------------ */
.breadcrumb { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--lime-ink); text-decoration: underline; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar p { margin: 0; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 160px; }
.filters label.small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; font-size: 14.5px; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--lime); }
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--line-2); gap: 2px; }
.segmented a { padding: 6px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.segmented a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 20, 27, .12); }

/* ---- Forms ------------------------------------------------------------------------------- */
.input { width: 100%; padding: 10px 12px; border: 1.5px solid var(--input-line); border-radius: var(--r-md); font: inherit; font-size: 15px; background: var(--card); color: var(--ink);
  transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: var(--input-line-hover); }
.input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .18); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
select.input { padding-right: 30px; }
textarea.input { min-height: 84px; resize: vertical; }
.input-num { max-width: 190px; text-align: right; margin-left: auto; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-bottom: 20px; }
.form-grid.nested { margin-bottom: 0; }
.form-grid .wide, .form-grid.wide, .form-field.wide { grid-column: 1 / -1; }
.form-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; color: var(--ink-2); }
.form-field .checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 8px; }
.form-field.has-error .input { border-color: var(--danger); background: var(--danger-soft); }
.panel-narrow .form-field { margin-bottom: 14px; }
.hint { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.req { color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; margin: 4px 0 0; }
.form-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--lime-ink); }
.checkbox-row { display: flex; gap: 14px; flex-wrap: wrap; }
.checkbox-row ul { display: flex; gap: 14px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.check-grid .checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.type-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.type-option { display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; border: 1.5px solid var(--input-line); border-radius: 12px; cursor: pointer; background: var(--card);
  transition: border-color .15s, background .15s; }
.type-option:hover { border-color: var(--input-line-hover); }
.type-option:has(input:checked) { border-color: var(--lime); background: var(--lime-soft); }
.type-option input { margin-top: 3px; }
.type-option > span { display: flex; flex-direction: column; gap: 2px; }
.row-inline { display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 8px; margin-bottom: 8px; }
.row-inline .input-num { max-width: none; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.reverse-box summary { list-style: none; display: inline-block; }
.reverse-box summary::-webkit-details-marker { display: none; }
.reverse-box form { display: flex; gap: 6px; margin-top: 6px; }

/* ---- Detail lists ------------------------------------------------------------------------ */
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 14px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.detail-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 24px; margin-bottom: 16px; }
.detail-inline > div { display: flex; flex-direction: column; gap: 2px; padding: 0; border-bottom: 0; }
.detail-inline dt { font-size: 13px; color: var(--muted); }
.detail-inline dd { font-weight: 600; margin: 0; }
.history { list-style: none; margin: 0; padding: 0; }
.history > li { padding: 9px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.history .changes { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.plain-list { list-style: none; padding: 0; margin: 0 0 12px; }
.plain-list li { padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.compact-facts { margin: 10px 0 12px; font-size: 13.5px; border: 0; }
.compact-facts td { padding: 6px 0; }

/* ---- People ------------------------------------------------------------------------------ */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--lime-soft); color: var(--lime-ink); font-weight: 700; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 44px; height: 44px; font-size: 15px; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }
.photo-field { display: flex; gap: 16px; align-items: center; }
.person-head { display: flex; gap: 14px; align-items: center; }
.person-head .status { margin-left: 4px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.person-card { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.person-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-name { font-weight: 700; color: var(--ink); text-decoration: none; }
a.person-name:hover { color: var(--lime-ink); }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-bottom: 20px; }
.action-grid .panel { margin-bottom: 0; }
.action-grid .form-field { margin-bottom: 10px; }

/* ---- Charts ------------------------------------------------------------------------------ */
.chart { position: relative; width: 100%; min-width: 0; }
.chart canvas { display: block; width: 100%; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend .key { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.chart-legend .key.line { height: 3px; border-radius: 2px; width: 16px; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 150px; padding: 9px 12px; border-radius: 10px; background: var(--canopy); color: #fff;
  box-shadow: 0 12px 30px rgba(14, 20, 27, .3); font-size: 13px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.chart-tip .tip-title { color: #9eabb8; font-size: 12px; margin-bottom: 4px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; }
.chart-tip .tip-row b { font-family: var(--font-num); font-size: 15px; margin-left: auto; padding-left: 12px; }
.chart-tip .tip-key { width: 12px; height: 3px; border-radius: 2px; background: var(--c); }
.chart-empty { display: grid; place-items: center; min-height: 160px; color: var(--muted); font-size: 14px; text-align: center; }
.chart-table { margin-top: 10px; }
.chart-table summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: center; }
.donut-wrap .donut-facts { display: flex; flex-direction: column; gap: 10px; }
.donut-wrap .donut-facts div { display: flex; flex-direction: column; }
.donut-wrap .donut-facts span { font-size: 13px; color: var(--muted); }
.donut-wrap .donut-facts b { font-family: var(--font-num); font-size: 20px; }

/* ---- Modal & drawer ---------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 70; background: rgba(8, 12, 17, .55); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.is-open { opacity: 1; pointer-events: auto; }
.modal { position: fixed; z-index: 80; left: 50%; top: 50%; width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--card);
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none;
  transition: transform .22s var(--ease), opacity .2s; }
.modal.is-open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); flex-shrink: 0; }
.modal-body { padding: 12px 22px 4px; color: var(--ink-2); }
.modal-body p { margin: 0 0 12px; }
.modal-body .form-field { margin-bottom: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; flex-wrap: wrap; }
.drawer { position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; width: min(920px, 100vw); background: var(--paper); box-shadow: -24px 0 60px rgba(0, 0, 0, .28);
  transform: translateX(102%); transition: transform .3s var(--ease); display: flex; flex-direction: column; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--canopy); color: #fff; position: relative; }
.drawer-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--lime); box-shadow: 0 0 14px rgba(155, 225, 93, .7); }
.drawer-head h3 { margin: 0; color: #fff; font-size: 19px; flex: 1; min-width: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-body .breadcrumb, .drawer-body .page-only { display: none; }
.drawer-loading { display: grid; place-items: center; height: 200px; color: var(--muted); }
body.has-overlay { overflow: hidden; }

/* ---- Drill-down and capital --------------------------------------------------------------- */
.drill-total { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.drill-total b { font-family: var(--font-num); font-size: 34px; font-weight: 700; line-height: 1; }
.drill-total span { color: var(--muted); font-size: 14px; }
.split-list { list-style: none; margin: 0; padding: 0; }
.split-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.split-list li:last-child { border-bottom: 0; }
.split-list .meter { grid-column: 1 / -1; height: 6px; }
.split-list .val { font-family: var(--font-num); font-weight: 700; font-size: 16px; text-align: right; }
.capital-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; margin-bottom: 18px; }
.capital-head .big { font-family: var(--font-num); font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.4px; }
.change-pos { color: var(--good); font-weight: 700; }
.change-neg { color: var(--danger); font-weight: 700; }

/* ---- Login ------------------------------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); background: #030405; }
.login-hero { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 26px; padding: 48px;
  background: radial-gradient(700px 420px at 50% 40%, rgba(var(--brand-rgb), .14), transparent 70%), #030405; overflow: hidden; }
.login-hero img { width: min(100%, 640px); height: auto; mix-blend-mode: lighten; filter: drop-shadow(0 20px 60px rgba(var(--brand-rgb), .18)); }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: #b9c2cc; font-size: 15px; }
.login-points li { display: flex; align-items: center; gap: 10px; }
.login-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(var(--brand-rgb), .8); }
.login-card { align-self: stretch; display: flex; flex-direction: column; justify-content: center; background: var(--card); padding: 48px clamp(28px, 5vw, 64px);
  position: relative; border-left: 1px solid rgba(var(--brand-rgb), .25); }
.login-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--lime), transparent); }
.login-card form { max-width: 380px; width: 100%; }
.login-logo-sm { display: none; width: 220px; height: auto; margin: 0 0 8px; }
.login-card h1 { margin: 0 0 4px; font-size: 30px; }
.login-card > p.muted { margin: 0 0 22px; }
.login-card label { display: block; margin-top: 16px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.login-card input[type=email], .login-card input[type=password], .login-card .pw-wrap > input { width: 100%; padding: 12px 13px; margin-top: 6px;
  border: 1.5px solid var(--input-line); border-radius: var(--r-md); font: inherit; font-size: 15px; background: var(--card); color: var(--ink); }
.login-card .pw-wrap { margin-top: 6px; } .login-card .pw-wrap > input { margin-top: 0; }
.login-card input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .18); }
.login-card .checkbox { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.login-card .btn-block { margin-top: 22px; padding: 13px; font-size: 16px; background: var(--lime); border-color: var(--lime); color: #0b0d10; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-card { border-left: 0; min-height: 100vh; background: var(--card); }
  .login-card::before { width: auto; right: 0; bottom: auto; height: 3px; background: var(--lime); }
  .login-logo-sm { display: block; }
  [data-theme="dark"] .login-logo-sm, .login-logo-sm { background: #030405; padding: 10px 14px; border-radius: 12px; }
}

/* ---- Small screens ---------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .canopy { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .two-col, .two-col.equal, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .detail-list > div { grid-template-columns: 1fr; gap: 2px; }
  .filters .input { min-width: 0; flex: 1 1 140px; }
  .row-inline { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .canopy { padding: 22px 18px 24px; border-radius: 18px; }
  .canopy h2 { font-size: 28px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .capital-head { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-grid-3 { grid-template-columns: 1fr; }
  .stat-card { padding: 14px 12px 12px; }
  .stat-value { font-size: 21px; }
  .stat-icon { display: none; }
  .price-board { grid-template-columns: 1fr 1fr; }
  .panel { padding: 16px 14px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Info box beside a field (customer balance, PSO credit left, stock available) */
.lookup-box { margin: 8px 0 4px; padding: 11px 14px; border: 1px solid var(--lime-line); border-left: 3px solid var(--lime); border-radius: var(--r-md);
  background: var(--lime-soft); font-size: 13.5px; animation: lookup-in .2s var(--ease); }
.lookup-box.is-loading { opacity: .65; }
.form-grid > .lookup-box { grid-column: 1 / -1; }
.lookup-box.is-compact { margin: 6px 0 10px; padding: 7px 10px; grid-column: 1 / -1; width: 100%; }
.lookup-title { margin: 0 0 6px; font-weight: 700; color: var(--ink); }
.lookup-box dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 18px; }
.lookup-line { display: flex; justify-content: space-between; gap: 10px; }
.lookup-line dt { color: var(--muted); }
.lookup-line dd { margin: 0; font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.lookup-line.tone-good dd { color: var(--good); } .lookup-line.tone-danger dd { color: var(--danger); } .lookup-line.tone-warn dd { color: var(--warn); }
.lookup-note { margin: 6px 0 0; color: var(--ink-2); font-size: 12.5px; }
@keyframes lookup-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* Tables: sortable headings, tall tables scroll inside their frame with the heading kept in view */
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--ink); }
.table th.is-sortable::after { content: "\2195"; margin-left: 5px; opacity: .3; font-size: 11px; }
.table th[aria-sort="ascending"]::after { content: "\2191"; opacity: .9; color: var(--lime-ink); }
.table th[aria-sort="descending"]::after { content: "\2193"; opacity: .9; color: var(--lime-ink); }
.table-wrap.is-tall { max-height: min(72vh, 900px); overflow: auto; }
.table-wrap.is-tall .table thead th { position: sticky; top: 0; z-index: 2; }
/* Live search: the list fades while it refreshes */
#main-content.is-refreshing > *:not(:has(form.filters)) { opacity: .55; transition: opacity .15s; pointer-events: none; }
#main-content.is-refreshing::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 100;
  background: linear-gradient(90deg, transparent, var(--lime), transparent); background-size: 50% 100%; animation: fe-progress 1s linear infinite; }
@keyframes fe-progress { from { background-position: -50% 0; } to { background-position: 150% 0; } }
/* One click = one save */
.is-waiting { opacity: .7; cursor: progress !important; position: relative; }
.is-waiting::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; vertical-align: -1px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: fe-spin .7s linear infinite; }
@keyframes fe-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lookup-box, #main-content.is-refreshing::before, .is-waiting::after { animation: none; } }
html.theme-fade, html.theme-fade * { transition: background-color .25s ease, border-color .25s ease, color .2s ease !important; }
/* Show / hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 44px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-wrap .ic-hide { display: none; }
.pw-wrap.is-shown .ic-hide { display: inline-flex; }
.pw-wrap.is-shown .ic-show { display: none; }
.badge-ok { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.salary-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); gap: 8px; margin-bottom: 8px; }
@media (max-width: 720px) { .salary-row { grid-template-columns: 1fr 1fr; } }
.order-calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0 6px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.order-calc div { display: flex; flex-direction: column; gap: 2px; }
.order-calc strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.btn-print { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 12px; }

@media print {
  @page { size: A4; margin: 12mm; }
  .hint, .drawer, .modal, .overlay { display: none !important; }
  .btn, button, .breadcrumb, .row-form, .inline-form, .no-print, .bulk-bar { display: none !important; }
  a { color: inherit; text-decoration: none; }
  input, select, textarea { border: none !important; background: none !important; padding: 0 !important; }
  tr, .stat-card { break-inside: avoid; }
  html, body { background: #fff !important; overflow: visible !important; height: auto !important; }
  * { box-shadow: none !important; }
  .table-wrap { overflow: visible !important; max-height: none !important; box-shadow: none !important; background: none !important; }
  .table thead th { position: static !important; }
  .table th.is-sortable::after { content: none !important; }
  .table { font-size: 11px; width: 100%; }
  .table th, .table td { padding: 4px 6px !important; }
  .bulk-bar, .toolbar-actions, .form-actions, .col-check, td.actions, .row-actions { display: none !important; }
  body { background: #fff; }
  .panel, .stat-card { box-shadow: none; border-color: #ccc; }
  .canopy { background: #0e141b !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.notice-warn { border-left: 4px solid var(--warn-line); background: var(--warn-soft); }
.notice-warn .btn { margin-top: 6px; }
