/* RTMS — hand-written UI. Roboto, calm neutrals, one ledger-green accent. */
@font-face { font-family: Roboto; font-weight: 300; font-display: swap; src: url(../fonts/roboto-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 400; font-display: swap; src: url(../fonts/roboto-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/roboto-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 500; font-display: swap; src: url(../fonts/roboto-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 700; font-display: swap; src: url(../fonts/roboto-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-weight: 400; font-display: swap; src: url(../fonts/roboto-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-weight: 500; font-display: swap; src: url(../fonts/roboto-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e1e7eb;
  --line-2: #cfd8de;
  --text: #172630;
  --text-2: #4a5b66;
  --muted: #788891;
  --side: #0b3549;
  --side-2: #114259;
  --side-text: #bcd0da;
  --accent: #00628a;
  --accent-2: #004f70;
  --accent-soft: #e3f0f6;
  --cross: #e63a05;
  --cross-soft: #fdebe4;
  --green: #1d7a4c; --green-soft: #e3f3ea;
  --blue: #1f5fa8; --blue-soft: #e6eef8;
  --amber: #a15c07; --amber-soft: #fbf0dc;
  --red: #b42318; --red-soft: #fbe9e7;
  --violet: #5b3fa3; --violet-soft: #eeeaf8;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(10, 35, 50, .06);
  --shadow-lg: 0 12px 32px rgba(10, 35, 50, .16);
  --mono: "Roboto Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 500; }
.nowrap { white-space: nowrap; }
.text-red { color: var(--red); } .text-green { color: var(--accent); } .text-amber { color: var(--amber); }
.hide { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { flex: none; margin-top: 1px; width: 34px; height: 34px; border-radius: 6px; background: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { color: #fff; font-weight: 500; font-size: 15px; line-height: 1.2; }
.brand > div:last-child { min-width: 0; flex: 1; }
.brand-shop { font-size: 11.5px; color: #8fb0c0; line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.nav { padding: 8px 10px 18px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #7097aa; padding: 16px 10px 6px; font-weight: 500; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 5px; color: var(--side-text); font-size: 13.5px; text-decoration: none; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.on { background: #15506b; color: #fff; box-shadow: inset 3px 0 0 var(--cross); }
.nav a .ic { color: #86a9ba; }
.nav a.on .ic, .nav a:hover .ic { color: #d6ebf4; }
.nav .count { margin-left: auto; background: var(--cross); color: #fff; font-size: 11px; padding: 0 6px; border-radius: 9px; line-height: 18px; }
.side-foot { padding: 12px 18px; font-size: 11.5px; color: #7097aa; border-top: 1px solid rgba(255,255,255,.06); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 58px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 17px; }
.crumbs { font-size: 12.5px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.today { font-size: 12.5px; color: var(--text-2); padding-right: 6px; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; color: var(--text); cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 6px; cursor: pointer; position: relative; border: 1px solid transparent; background: none; font: inherit; color: inherit; }
.user-chip:hover { background: var(--surface-2); border-color: var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #d9e9f1; color: var(--accent-2); display: grid; place-items: center; font-size: 12px; font-weight: 500; }
.user-chip .u-name { font-size: 13px; line-height: 1.15; text-align: left; }
.user-chip .u-role { font-size: 11.5px; color: var(--muted); }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; display: none; z-index: 40; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; gap: 9px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 4px; color: var(--text); font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }

.content { padding: 22px 24px 40px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- elements ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 500 13.5px Roboto, sans-serif; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: #b5c3cb; }
.btn:focus-visible, .input:focus, .select:focus, textarea:focus { outline: 2px solid #7db7d1; outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: #f0b7b0; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #e9eff2; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 30px; padding: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

.stat { padding: 15px 16px; }
.stat .label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.stat .label .ic { color: var(--muted); }
.stat .value { font-size: 23px; font-weight: 500; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat.link { color: inherit; text-decoration: none; display: block; }
.stat.link:hover { border-color: var(--line-2); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid #edf1f3; vertical-align: middle; }
.table tbody tr:hover td { background: #f7fafc; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 500; background: var(--surface-2); border-top: 1px solid var(--line); }
.table .actions { text-align: right; white-space: nowrap; }
.table a.row-link { color: var(--text); font-weight: 500; }
.table.compact td { padding: 6px 10px; }
.table th.num, .table td.num { text-align: right; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 10px; line-height: 19px; background: #edf1f4; color: var(--text-2); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.teal { background: var(--accent-soft); color: var(--accent-2); }
.badge.orange { background: var(--cross-soft); color: #b42d03; }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .label-sm { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--red); }
.input, .select, textarea.input { height: 36px; width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 10px; font: 400 14px Roboto, sans-serif; color: var(--text); background: #fff; }
textarea.input { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d867f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.input.sm, .select.sm { height: 30px; font-size: 13px; }
.input.num { text-align: right; }
.input-group { display: flex; }
.input-group .addon { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--surface-2); color: var(--muted); font-size: 13px; }
.input-group .input { border-radius: 0 var(--radius) var(--radius) 0; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; }
.toolbar .grow { flex: 1; min-width: 180px; }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 34px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--accent-2); border-bottom-color: var(--accent); font-weight: 500; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; font-size: 13.5px; }
.alert.ok { background: var(--green-soft); border-color: #b9dcc8; color: #13563a; }
.alert.bad { background: var(--red-soft); border-color: #f3c3bd; color: #8a1c12; }
.alert.warn { background: var(--amber-soft); border-color: #efd29f; color: #7a4505; }
.alert ul { margin: 0; padding-left: 18px; }

.empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: #aebdc6; margin-bottom: 8px; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages a, .pager .pages span { min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--text-2); background: #fff; text-decoration: none; }
.pager .pages .on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager .pages .off { opacity: .45; }

.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 4px 12px; align-items: center; font-size: 13px; padding: 6px 0; }
.bar { height: 6px; background: #e8eef1; border-radius: 3px; overflow: hidden; grid-column: 1 / -1; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #edf1f3; font-size: 13.5px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(8, 30, 42, .45); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 8vh 16px 16px; overflow-y: auto; }
.modal-back.open { display: flex; }
.modal { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15.5px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-side { background: var(--side); color: #d5e3ea; padding: 44px 52px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 100% 28px; pointer-events: none; }
.auth-side > * { position: relative; z-index: 1; }
.auth-side h1 { color: #fff; font-size: 30px; font-weight: 500; line-height: 1.25; max-width: 460px; margin-top: auto; }
.auth-side .lead { color: #a9c3d0; font-size: 15px; max-width: 440px; margin-top: 12px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 auto; display: grid; gap: 12px; max-width: 440px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #c9dbe4; }
.auth-points .ic { color: #ff8a5c; margin-top: 1px; }
.auth-foot { font-size: 12px; color: #7fa0b0; margin-top: 30px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 22px; }
.demo-list { display: grid; gap: 8px; margin: 14px 0 6px; }
.demo-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; cursor: pointer; font: inherit; color: inherit; }
.demo-btn:hover { border-color: var(--accent); background: #f4f9fc; }
.demo-btn.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #eef6fa; }
.demo-btn .role { font-weight: 500; font-size: 13.5px; }
.demo-btn .what { font-size: 12px; color: var(--muted); }
.demo-btn .go { margin-left: auto; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- documents / print ---------- */
.doc { background: #fff; max-width: 860px; margin: 0 auto; padding: 34px 38px; border: 1px solid var(--line); border-radius: var(--radius); }
.doc-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--text); }
.doc-head .shop { font-size: 20px; font-weight: 700; }
.doc-title { text-align: right; }
.doc-title .t { font-size: 22px; font-weight: 300; letter-spacing: .08em; text-transform: uppercase; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 16px 0; font-size: 13.5px; }
.doc .table th { background: #f1f5f7; }
.doc-total { margin-left: auto; width: 300px; margin-top: 10px; font-size: 13.5px; }
.doc-total .sum-row { padding: 4px 0; }
.doc-total .sum-row.big { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 8px; font-size: 16px; font-weight: 700; }
.doc-foot { margin-top: 36px; display: flex; justify-content: space-between; gap: 30px; font-size: 12.5px; color: var(--text-2); }
.sign { border-top: 1px solid var(--text-2); padding-top: 6px; width: 180px; text-align: center; }

.receipt { width: 76mm; margin: 0 auto; background: #fff; padding: 10px 8px; font: 12px/1.4 Roboto, sans-serif; color: #000; }
.receipt .c { text-align: center; }
.receipt .shop { font-size: 15px; font-weight: 700; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td, .receipt th { padding: 2px 0; vertical-align: top; }
.receipt th { text-align: left; border-bottom: 1px dashed #000; font-weight: 500; }
.receipt .r { text-align: right; }
.receipt .dash { border-top: 1px dashed #000; margin: 6px 0; }
.receipt .big { font-size: 15px; font-weight: 700; }

.print-bar { display: flex; gap: 8px; justify-content: center; margin: 0 auto 16px; max-width: 860px; }

@media print {
  body { background: #fff; }
  .side, .top, .print-bar, .no-print, .page-head .actions { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 12mm; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 60; transform: translateX(-100%); transition: transform .18s; }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; }
  .menu-btn { display: block; }
  .g-main, .g3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .today { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .top { padding: 0 12px; }
  .g2, .g4, .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .user-chip .u-meta { display: none; }
  .doc { padding: 18px; }
  .doc-meta { grid-template-columns: 1fr; }
  .doc-total { width: 100%; }
}

/* ---------- ZHCH additions ---------- */
.brand-org { font-size: 11.5px; color: #8fb0c0; line-height: 1.35; margin-top: 2px; }
.auth-side { background: var(--side); }
.auth-side::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cross); z-index: 1; }
.auth-logo { background: #fff; border-radius: 8px; padding: 10px 14px; display: inline-block; }
.auth-logo img { height: 74px; display: block; }
.stat.edge { border-left: 3px solid var(--accent); }
.stat.edge.orange { border-left-color: var(--cross); }
.stat.edge.green { border-left-color: var(--green); }
.stat.edge.amber { border-left-color: var(--amber); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.meter-row td { vertical-align: top; }
.meter-row .input.sm { width: 96px; }
.meter-row .calc { font-size: 12.5px; line-height: 1.45; }
.meter-row.off td { opacity: .45; }
.meter-row .over { color: var(--cross); font-weight: 500; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.doc-logo { height: 54px; }
.doc .doc-head { border-bottom-color: var(--accent); }
.doc-band { height: 4px; background: linear-gradient(90deg, var(--accent) 0 82%, var(--cross) 82% 100%); margin: -34px -38px 26px; border-radius: var(--radius) var(--radius) 0 0; }
.bill-sheet { page-break-after: always; }
.bill-sheet:last-child { page-break-after: auto; }
.bill-sheet + .bill-sheet { margin-top: 24px; }
.elec-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; }
.elec-box h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-bottom: 8px; }
.elec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; }
.elec-grid b { display: block; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.elec-grid span { font-size: 11.5px; color: var(--muted); }
.paid-stamp { display: inline-block; border: 2px solid var(--green); color: var(--green); font-weight: 700; letter-spacing: .12em; padding: 3px 12px; border-radius: 4px; transform: rotate(-4deg); }
@media print {
  .bill-sheet + .bill-sheet { margin-top: 0; }
  .doc-band { margin: 0 0 18px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.sum-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; padding: 3px 0; }
.sum-row .num { font-weight: 500; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.seg label { padding: 7px 12px; font-size: 13px; cursor: pointer; border-right: 1px solid var(--line-2); }
.seg label:last-child { border-right: 0; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--accent); color: #fff; }
.top > div:nth-child(2) { min-width: 0; }
.top h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .top .crumbs, .top-right .lbl { display: none; }
  .top h1 { font-size: 15px; }
  .top-right { gap: 6px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 18px; }
  .page-head h2 { font-size: 18px; }
  .toolbar .input, .toolbar .select { max-width: 100%; }
}
