/* Mart Billing: compact, neutral interface with colour used for meaning.
   Indigo = actions & current place. Green = money in / done. Red = owed, short, cancelled.
   Amber = needs attention. Payment modes each have their own colour. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f4f6f9; --surface: #fff; --subtle: #f9fafb; --line: #e7e8ec; --line-strong: #d6d8de;
  --text: #111827; --text-2: #4b5563; --muted: #8a909c;
  --brand: #2370cf; --brand-hover: #1c5cab; --brand-soft: #eaf2fc; --brand-ring: rgba(35, 112, 207, .18);
  --green: #059669; --green-soft: #e7f8f1; --red: #dc2626; --red-soft: #fdecec; --amber: #b45309; --amber-soft: #fef5e4;
  --blue: #0369a1; --blue-soft: #e8f4fb; --violet: #7c3aed; --violet-soft: #f3edff;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-pop: 0 10px 30px rgba(17, 24, 39, .12), 0 2px 6px rgba(17, 24, 39, .06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 13px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 18px; font-weight: 650; letter-spacing: -.015em; margin: 0; }
h2 { font-size: 13.5px; font-weight: 650; margin: 0 0 .65rem; }
code { font: 12px ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--subtle); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3em; }
.icon { flex: none; vertical-align: -3px; }

/* Layout */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .logo { font-weight: 700; font-size: 14px; padding: 2px 8px 14px; display: flex; gap: 9px; align-items: center; letter-spacing: -.01em; }
.sidebar .logo span { background: var(--brand); color: #fff; border-radius: 8px; width: 28px; height: 28px; display: grid; place-items: center; }
.sidebar nav { flex: 1; }
.sidebar nav a { display: flex; gap: 9px; align-items: center; color: var(--text-2); padding: 6px 9px; border-radius: 7px; margin-bottom: 1px; font-weight: 500; }
.sidebar nav a .icon { color: var(--muted); }
.sidebar nav a:hover { background: var(--subtle); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); }
.sidebar nav a.active .icon { color: var(--brand); }
.sidebar .section { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 9px 5px; }
.sidebar .user { border-top: 1px solid var(--line); margin-top: 10px; padding: 10px 6px 0; display: flex; align-items: center; gap: 8px; }
.sidebar .user .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.sidebar .user a { color: var(--text); font-weight: 600; display: block; line-height: 1.2; }
.sidebar .user .role { color: var(--muted); font-size: 11.5px; }
.sidebar .user form { margin-left: auto; }
.sidebar .user button { background: none; border: 0; color: var(--muted); padding: 5px; height: auto; }
.sidebar .user button:hover { color: var(--red); background: var(--red-soft); }
.main { padding: 18px 22px 40px; min-width: 0; max-width: 1480px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .row { align-items: center; }
.menu-toggle { display: none; }

/* Building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.grid { display: grid; gap: 12px; margin-bottom: 12px; }
.grid > .card { margin-bottom: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* Stat tiles: a tinted icon says what kind of number it is */
.stat { display: flex; flex-direction: column; gap: 2px; position: relative; }
.stat .label { color: var(--text-2); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .chip { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); } .text-brand { color: var(--brand); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--subtle); color: var(--text-2); border: 1px solid var(--line); line-height: 1.6; white-space: nowrap; }
.badge.saved, .badge.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.cancelled, .badge.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.draft, .badge.warn, .badge.order { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.mode-cash { background: var(--green-soft) !important; color: var(--green) !important; border-color: transparent !important; }
.mode-upi { background: var(--violet-soft) !important; color: var(--violet) !important; border-color: transparent !important; }
.mode-card { background: var(--blue-soft) !important; color: var(--blue) !important; border-color: transparent !important; }
.mode-credit { background: var(--amber-soft) !important; color: var(--amber) !important; border-color: transparent !important; }

/* Forms */
label { display: block; font-weight: 500; font-size: 12px; margin: 8px 0 4px; color: var(--text-2); }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 9px; height: 32px; width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 7px 9px; }
select { padding-right: 4px; }
input::placeholder, textarea::placeholder { color: #a8adb7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
input[type=checkbox], input[type=radio] { width: auto; height: auto; accent-color: var(--brand); }
input[type=file] { height: auto; padding: 6px; }
.check { display: flex; gap: 7px; align-items: center; font-weight: 400; color: var(--text); margin: 6px 0; font-size: 13px; }
.field { flex: 1 1 150px; }
.btn, button { font: inherit; font-weight: 550; border: 1px solid transparent; border-radius: var(--radius-sm); height: 32px; padding: 0 12px; cursor: pointer; background: var(--brand); color: #fff; display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover, button:hover { background: var(--brand-hover); text-decoration: none; }
.btn:focus-visible, button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.btn.secondary, button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover, button.secondary:hover { background: var(--subtle); border-color: #c5c8d0; }
.btn.danger, button.danger { background: var(--surface); color: var(--red); border-color: #f4c7c7; }
.btn.danger:hover, button.danger:hover { background: var(--red-soft); }
.btn.success, button.success { background: var(--green); }
.btn.success:hover, button.success:hover { background: #047857; }
.btn.whatsapp, button.whatsapp { background: #1fa855; color: #fff; }
.btn.whatsapp:hover, button.whatsapp:hover { background: #178c46; }
button.link { background: none; color: var(--muted); height: auto; padding: 3px; border: 0; }
button.link:hover { color: var(--red); background: var(--red-soft); }
.btn.big, button.big { height: 40px; font-size: 14px; padding: 0 16px; }
.kbd { font: 600 10px/1 Inter, sans-serif; border: 1px solid currentColor; opacity: .7; border-radius: 4px; padding: 2px 4px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--subtle); white-space: nowrap; }
thead th:first-child, tr:first-child > th:first-child { border-top-left-radius: 7px; }
thead th:last-child, tr:first-child > th:last-child { border-top-right-radius: 7px; }
tbody tr:hover td, table tr:hover td { background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; background: var(--subtle); border-top: 1px solid var(--line-strong); }
tr.flash-row td { animation: flashrow 1.4s ease-out; }
@keyframes flashrow { from { background: var(--brand-soft); } to { background: transparent; } }
td input, td select { height: 28px; padding: 0 7px; min-width: 64px; text-align: right; }

/* Background saving: thin progress line, error toast */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--brand); z-index: 100; opacity: 0; transition: width .3s ease, opacity .2s; pointer-events: none; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; box-shadow: var(--shadow-pop); }

/* Flash messages */
.flash { padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 10px; border: 1px solid; font-weight: 500; }
.flash.error { background: var(--red-soft); color: #b91c1c; border-color: #f7d0d0; }
.flash.success { background: var(--green-soft); color: #047857; border-color: #c4ecd9; }

/* Product photos */
.thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; background: var(--subtle); border: 1px solid var(--line); flex: none; display: inline-grid; place-items: center; color: var(--muted); }
.thumb.lg { width: 64px; height: 64px; border-radius: 10px; }

/* Tabs */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; color: var(--text-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Live search dropdown */
.ac-wrap { position: relative; flex: 1; min-width: 0; }
.ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); max-height: 340px; overflow-y: auto; padding: 4px; }
.ac-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 9px; cursor: pointer; border-radius: 7px; }
.ac-item:hover, .ac-item.active { background: var(--brand-soft); }
.ac-empty { padding: 8px 10px; color: var(--muted); }

/* Billing screen */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.scanbar { display: flex; gap: 8px; }
.scanbar input { height: 40px; font-size: 15px; padding: 0 12px; border-color: var(--line-strong); }
.scanbar input[data-scan] { padding-left: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a909c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 5v14M8 5v14M12 5v14M17 5v14M21 5v14'/%3E%3C/svg%3E") no-repeat 12px center; }
.scanbar button, .scanbar .btn { height: 40px; }
.totals { position: sticky; top: 14px; }
.totals .line { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; gap: 8px; }
.totals .sums { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.totals .line input.mini, .line input.mini { width: 96px; height: 28px; text-align: right; }
.quick-add { position: relative; }
.quick-add summary { list-style: none; cursor: pointer; color: var(--brand); font-weight: 550; display: inline-flex; align-items: center; gap: 3px; }
.quick-add summary::-webkit-details-marker { display: none; }
.quick-add .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 10px; display: grid; gap: 6px; }
.totals .net { font-size: 28px; font-weight: 750; color: var(--text); text-align: right; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; }
.totals .net.refund { color: var(--red); }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.modes label { margin: 0; }
.modes input { display: none; }
.modes span { display: block; text-align: center; padding: 7px 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; color: var(--text-2); background: var(--surface); }
.modes span:hover { border-color: #c5c8d0; }
.modes input[value=cash]:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.modes input[value=upi]:checked + span { background: var(--violet); border-color: var(--violet); color: #fff; }
.modes input[value=card]:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.modes input[value=credit]:checked + span { background: var(--amber); border-color: var(--amber); color: #fff; }
.qr { text-align: center; }
.qr svg { width: 160px; height: 160px; }
#camera { max-width: 420px; margin-top: 10px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }

/* Order progress */
.steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; counter-reset: step; flex-wrap: wrap; }
.steps li { flex: 1 1 0; min-width: 0; font-size: 11.5px; line-height: 1.25; font-weight: 600; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); }
.steps li.done { color: var(--green); border-top-color: var(--green); }
.nav-count { margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px; border-radius: 999px; padding: 0 6px; line-height: 17px; }

/* Customer shop */
.shop-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.shop-bar { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 14px; align-items: center; }
.shop-brand { display: flex; gap: 9px; align-items: center; font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; }
.shop-brand:hover { text-decoration: none; }
.shop-brand .chip { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.shop-search { flex: 1; position: relative; display: flex; align-items: center; }
.shop-search .icon { position: absolute; left: 11px; color: var(--muted); }
.shop-search input { padding-left: 34px; height: 36px; border-radius: 999px; background: var(--subtle); }
.shop-nav { display: flex; gap: 4px; align-items: center; }
.shop-nav a { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); font-weight: 550; padding: 7px 10px; border-radius: 8px; position: relative; }
.shop-nav a:hover { background: var(--subtle); text-decoration: none; }
.cart-btn .count { background: var(--brand); color: #fff; font-size: 10.5px; border-radius: 999px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; }
.preview-bar { background: var(--amber-soft); color: var(--amber); text-align: center; padding: 6px 12px; font-size: 12.5px; }
.shop-main { max-width: 1180px; margin: 0 auto; padding: 16px; }
.shop-note { background: var(--brand-soft); color: var(--brand); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 12px; font-weight: 500; }
.shop-login { max-width: 380px; margin: 8vh auto; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; scrollbar-width: none; }
.chips a { white-space: nowrap; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); font-weight: 550; font-size: 12.5px; }
.chips a:hover { text-decoration: none; border-color: #c5c8d0; }
.chips a.on { background: var(--text); border-color: var(--text); color: #fff; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.product { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.pic { aspect-ratio: 1; background: var(--subtle); display: grid; place-items: center; position: relative; }
.pic img { width: 100%; height: 100%; object-fit: contain; }
.pic span { color: #c9ccd3; display: grid; }
.pic .off { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; color: #fff; background: var(--green); padding: 1px 7px; border-radius: 999px; }
.pic.sm { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex: none; }
.product .info { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pname { font-weight: 600; line-height: 1.3; }
.pprice b { font-size: 15px; } .pprice s { color: var(--muted); font-size: 12px; }
.addrow { display: flex; gap: 6px; margin-top: auto; }
.addrow input { width: 60px; text-align: center; padding: 0 4px; }
.addrow button { flex: 1; }
.cart-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-info { flex: 1; min-width: 0; }
.cart-qty { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.cart-qty input { width: 76px; }
.cart-qty b { margin-left: auto; }
.cart-line:last-of-type { border-bottom: 0; }
.order-row { display: flex; justify-content: space-between; color: var(--text); }
.order-row:hover { text-decoration: none; border-color: var(--line-strong); }
@media (max-width: 640px) {
  .shop-bar { flex-wrap: wrap; gap: 8px; } .shop-search { order: 3; flex-basis: 100%; }
  .shop-nav { margin-left: auto; } .shop-nav span { display: none; }
  .products { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

@media (max-width: 1100px) { .pos { grid-template-columns: 1fr; } .totals { position: static; } .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .main { padding: 12px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}
/* Dashboard */
.period-bar { gap: 8px; align-items: center; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 2px; }
.segmented a { padding: 4px 11px; border-radius: 5px; color: var(--text-2); font-weight: 550; font-size: 12.5px; }
.segmented a:hover { text-decoration: none; background: var(--subtle); color: var(--text); }
.segmented a.on { background: var(--brand); color: #fff; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper .btn { width: 30px; padding: 0; font-size: 17px; line-height: 1; }
.period-label { min-width: 132px; text-align: center; font-weight: 600; }
.kpi { display: flex; flex-direction: column; gap: 3px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi .label { color: var(--text-2); font-size: 12px; font-weight: 550; }
.kpi-value { font-size: 23px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.delta { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.delta.good { color: #047857; background: var(--green-soft); }
.delta.bad { color: #b91c1c; background: var(--red-soft); }
.split { display: flex; gap: 2px; height: 5px; margin-top: 10px; background: var(--subtle); border-radius: 3px; overflow: hidden; }
.split i { background: #2a78d6; min-width: 0; }
.split i.b { background: #eb6834; }
.meter { height: 5px; margin-top: 10px; background: var(--brand-soft); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: #2a78d6; border-radius: 0 3px 3px 0; }
.split-legend { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); margin-top: 5px; }
.split-legend span { display: inline-flex; align-items: center; gap: 5px; }
.split-legend span > i { width: 8px; height: 8px; border-radius: 2px; background: #2a78d6; }
.split-legend span > i.b { background: #eb6834; }
.split-legend b { color: var(--text); font-weight: 600; }
.split-legend.dues { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); flex-wrap: nowrap; }
.split-legend.dues a { display: flex; flex-direction: column; color: inherit; flex: 1; line-height: 1.35; }
.split-legend.dues a + a { border-left: 1px solid var(--line); padding-left: 10px; }
.split-legend.dues a:hover { text-decoration: none; }
.split-legend.dues a:hover b { color: var(--brand); }
.split-legend.dues .label { font-size: 11.5px; }
.split-legend.dues b { font-size: 13.5px; }
.dash-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.chart-head h2 { margin: 0 0 1px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.line { width: 14px; height: 2px; border-radius: 1px; background: #2a78d6; }
.legend i.line.gray { background: #a9aeb7; }
.viz { min-height: 40px; position: relative; }
.viz svg { display: block; overflow: visible; }
.viz svg:focus { outline: none; }
.viz svg:focus-visible { box-shadow: 0 0 0 3px var(--brand-ring); border-radius: 6px; }
.viz-axis { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.viz-center { font-size: 16px; font-weight: 650; fill: var(--text); }
.viz-seg { transition: opacity .12s; cursor: default; }
.viz-seg:hover { opacity: .8; }
.viz-empty { padding: 28px 0; text-align: center; }
.viz-donut { display: flex; align-items: center; gap: 18px; }
.viz-legend { flex: 1; min-width: 0; display: grid; gap: 7px; }
.viz-legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 34px; align-items: center; gap: 7px; font-size: 12px; }
.viz-legend-row .muted { text-align: right; font-size: 11.5px; }
.viz-legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.viz-key { width: 12px; height: 2px; border-radius: 1px; display: inline-block; flex: none; }
.viz-key.dot { width: 9px; height: 9px; border-radius: 50%; }
.viz-bars { display: grid; gap: 9px; }
.viz-bar-row { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto; align-items: center; gap: 9px; font-size: 12px; }
.viz-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.viz-bar-track { height: 10px; }
.viz-bar { height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; transition: opacity .12s; }
.viz-bar-row:hover .viz-bar { opacity: .8; }
.viz-bar-value { font-weight: 600; min-width: 44px; text-align: right; }
.viz-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow-pop); padding: 7px 10px; font-size: 12px; min-width: 130px; }
.viz-tip-title { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.viz-tip-row + .viz-tip-row { margin-top: 2px; }
.viz-tip-row b { font-weight: 650; }
.viz-tip-row span:last-child { color: var(--text-2); }
.list-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.list-row:last-child { border-bottom: 0; }
.list-row .spacer { flex: 1; }
.list-row .time { font-size: 11.5px; width: 58px; text-align: right; }
.list-row > span:not(.spacer):not(.badge):not(.time) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.report-links { display: flex; flex-wrap: wrap; gap: 6px; }
.report-links a { border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 12px; color: var(--text-2); background: var(--subtle); }
.report-links a:hover { text-decoration: none; color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 1100px) { .dash-main { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .period-bar { width: 100%; }
  .segmented { flex: 1 1 100%; } .segmented a { flex: 1; text-align: center; }
  .period-bar .stepper { flex: 1; justify-content: space-between; }
  .period-label { min-width: 0; white-space: nowrap; }
  .kpi-value { font-size: 20px; }
}

@media print {
  .sidebar, .no-print, .flash, .menu-toggle { display: none !important; }
  .app { display: block; } .main { padding: 0; } body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
}
