/* Shreya Web Finance OS */
:root {
  --canvas: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --ink: #252d29;
  --ink-2: #48524d;
  --muted: #6b756f;
  --line: #e0e5df;
  --line-2: #edf0ec;
  --green: #6dae2f;
  --green-ink: #3b7213;
  --green-dark: #2f5c0f;
  --green-tint: #eaf5dc;
  --green-tint-2: #f4faec;
  --blue: #3e6fa8;
  --blue-tint: #e8f0f9;
  --amber: #9a620b;
  --amber-tint: #fdf3dc;
  --red: #b42318;
  --red-tint: #fdeceb;
  --violet: #7a4fa8;
  --violet-tint: #f2ecf8;
  --c-invoiced: #3e6fa8;
  --c-collected: #4e8f1c;
  --c-expenses: #b97a12;
  --shadow-pop: 0 12px 32px -8px rgba(30, 40, 35, .22), 0 2px 6px rgba(30, 40, 35, .08);
  --r: 8px;
  --r-sm: 6px;
  --side: 248px;
  --top: 60px;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 400 14px/1.5 var(--font);
  color: var(--ink);
  background: var(--canvas);
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 24px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--green-ink); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.shell.collapsed { --side: 68px; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px 10px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; min-height: 48px; }
.brand img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.brand b { display: block; font-size: 15px; font-weight: 700; line-height: 1.15; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.navgroup { margin-top: 10px; }
.navgroup > p { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; font-weight: 500; }
.nav {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px; text-decoration: none; position: relative; min-height: 34px;
}
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav.on { background: var(--green-tint); color: var(--green-dark); font-weight: 650; }
.nav.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 650; background: var(--red-tint); color: var(--red); border-radius: 99px; padding: 0 7px; }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); }
.collapsed .brand div, .collapsed .navgroup > p, .collapsed .nav span, .collapsed .nav .count, .collapsed .side-foot .lbl { display: none; }
.collapsed .nav { justify-content: center; padding: 8px; }
.collapsed .navgroup { margin-top: 4px; border-top: 1px solid var(--line-2); padding-top: 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; background: rgba(243, 245, 242, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.searchbox { flex: 1; max-width: 460px; position: relative; }
.searchbox input { padding-left: 34px; background: var(--surface); }
.searchbox svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; }
.searchbox kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
kbd { font: 500 11px var(--font); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); background: var(--surface); }
.top .spacer { flex: 1; }
.iconbtn {
  width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; display: inline-grid;
  place-items: center; cursor: pointer; color: var(--ink-2); position: relative;
}
.iconbtn:hover { background: var(--surface); border-color: var(--line); }
.iconbtn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn .dot { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green-tint); color: var(--green-dark); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.content { padding: 22px 24px 60px; max-width: 1480px; width: 100%; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs span::before { content: "/"; margin-right: 6px; color: var(--line); }
.pagehead { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead .t { margin-right: auto; min-width: 0; }
.pagehead .t p { color: var(--muted); margin-top: 3px; max-width: 72ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #c9d1c8; background: var(--surface-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.soft { background: var(--green-tint); border-color: transparent; color: var(--green-dark); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface); border-color: var(--line); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn.wa { color: #137a3a; }

label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 5px; }
.field { margin-bottom: 14px; min-width: 0; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 12px; color: var(--red); margin-top: 4px; font-weight: 500; }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--red); background: #fffafa; }
input, select, textarea {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  font: 400 14px var(--font); color: var(--ink); font-feature-settings: "tnum" 1;
}
textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
select { padding-right: 28px; 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='%236b756f' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(109, 174, 47, .18); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--green-ink); vertical-align: -3px; }
input[type=file] { height: auto; padding: 6px; }
input[type=color] { width: 56px; padding: 2px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; margin-bottom: 10px; }
.check input { margin-top: 2px; flex: none; }
.money-in { position: relative; }
.money-in span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.money-in input { padding-left: 44px; text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.span2 { grid-column: span 2; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel > .ph { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; flex-wrap: wrap; }
.panel > .ph h2 { margin-right: auto; }
.panel > .ph p { color: var(--muted); font-size: 12.5px; width: 100%; margin-top: -4px; }
.panel > .pb { padding: 4px 16px 16px; }
.panel > .pb.flush { padding: 0; }
.panel > .pb.flush, .panel > .pb > .tw { overflow-x: auto; }
.cols > *, .stack > *, .grid2 > *, .grid3 > *, .grid4 > * { min-width: 0; }
.stack { display: grid; gap: 16px; }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols.w2 { grid-template-columns: 2fr 1fr; }
.cols.w-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }

/* ---------- currency lanes (the dashboard signature) ---------- */
.lanes { display: grid; gap: 12px; }
.lane { display: grid; grid-template-columns: 112px 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lane-code { background: var(--green-tint-2); border-right: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; }
.lane-code b { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1; color: var(--green-dark); }
.lane-code span { font-size: 12px; color: var(--muted); margin-top: 6px; }
.lane-figs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fig { padding: 14px 16px; border-right: 1px solid var(--line-2); min-width: 0; }
.fig:last-child { border-right: 0; }
.fig .l { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.fig .v { font-size: 19px; font-weight: 700; margin-top: 3px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fig .s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.fig.alert .v { color: var(--red); }
.fig.pos .v { color: var(--green-ink); }
.fig .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- stat strip (non-dashboard pages) ---------- */
.stats { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.stats .fig { flex: 1 1 160px; border-right: 1px solid var(--line-2); }

/* ---------- tables ---------- */
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap; position: sticky; top: 0;
}
.t th.sort { cursor: pointer; user-select: none; }
.t th.sort:hover { color: var(--ink); }
.t th .ar { font-size: 10px; margin-left: 3px; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.link { cursor: pointer; }
.t tbody tr.link:hover td { background: var(--green-tint-2); }
.t td .sub { display: block; font-size: 12px; color: var(--muted); }
.t tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line); }
.t td.act { text-align: right; white-space: nowrap; width: 1%; }
.t .strong { font-weight: 650; }
.t.compact td, .t.compact th { padding: 7px 10px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); align-items: center; }
.filters input, .filters select { width: auto; min-width: 140px; height: 32px; font-size: 13px; }
.filters input[type=search] { min-width: 220px; flex: 1; max-width: 340px; }
.filters .grow { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button, .tabs a {
  border: 0; background: none; padding: 9px 12px; font: 600 13.5px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none;
}
.tabs button:hover, .tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs .on { color: var(--green-dark); border-bottom-color: var(--green); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 0 11px; height: 30px; font: 600 12.5px var(--font); color: var(--muted); cursor: pointer; border-right: 1px solid var(--line-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--green-tint); color: var(--green-dark); }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pager .grow { flex: 1; }
.pager select { width: auto; height: 28px; font-size: 12.5px; }
.totbar { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 13px; background: var(--surface-2); }
.totbar b { font-weight: 650; }

/* ---------- status badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-draft { background: #eef0ee; color: #5b645f; }
.b-sent, .b-issued, .b-awaiting { background: var(--blue-tint); color: var(--blue); }
.b-partial, .b-pending, .b-paused, .b-manual { background: var(--amber-tint); color: var(--amber); }
.b-paid, .b-accepted, .b-active, .b-verified, .b-approved, .b-received, .b-generated, .b-completed { background: var(--green-tint); color: var(--green-dark); }
.b-overdue, .b-rejected, .b-failed, .b-critical { background: var(--red-tint); color: var(--red); }
.b-void, .b-cancelled, .b-expired, .b-ended, .b-churned, .b-legacy, .b-disabled { background: #f1f1f0; color: #7d7f7c; }
.b-proforma, .b-prospect, .b-planned { background: var(--violet-tint); color: var(--violet); }
.cur { display: inline-block; font-size: 11px; font-weight: 700; color: var(--green-dark); background: var(--green-tint); padding: 0 5px; border-radius: 4px; margin-right: 4px; vertical-align: 1px; }

/* ---------- notices ---------- */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.note.info { background: var(--blue-tint); border-color: #cfdcee; color: #2b4f7c; }
.note.warn { background: var(--amber-tint); border-color: #efd9a9; color: #6e4706; }
.note.bad { background: var(--red-tint); border-color: #f2c4bf; color: #8a1a12; }
.note.good { background: var(--green-tint); border-color: #cfe5b4; color: var(--green-dark); }
.note .grow { flex: 1; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 4px; font-size: 15px; }
.empty .btn { margin-top: 12px; }
.skeleton { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--line-2), #f7f8f6, var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.loading { padding: 40px; display: grid; gap: 12px; }

/* ---------- key/value lists ---------- */
dl.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.copy { display: inline-flex; align-items: center; gap: 6px; }
.copy button { border: 1px solid var(--line); background: var(--surface); border-radius: 4px; height: 22px; padding: 0 6px; font: 600 11px var(--font); color: var(--ink-2); cursor: pointer; }
.copy button:hover { border-color: var(--green); color: var(--green-dark); }

/* ---------- timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 12px 18px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.tl li::after { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl .when { color: var(--muted); font-size: 12px; }

/* ---------- modal / drawer / popover ---------- */
.overlay { position: fixed; inset: 0; background: rgba(28, 36, 32, .38); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.dialog { background: var(--surface); border-radius: 10px; width: 100%; max-width: 540px; box-shadow: var(--shadow-pop); animation: pop .16s ease-out; }
.dialog.wide { max-width: 820px; }
.dialog.full { max-width: 1100px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.dialog > header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.dialog > header h2 { margin-right: auto; font-size: 17px; }
.dialog > .body { padding: 8px 18px 4px; }
.dialog > footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; flex-wrap: wrap; }
.dialog > footer .left { margin-right: auto; }
.pop { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); min-width: 220px; padding: 6px; }
.pop a, .pop button.mi { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 6px; border: 0; background: none; font: 500 13.5px var(--font); color: var(--ink); cursor: pointer; text-align: left; text-decoration: none; }
.pop a:hover, .pop button.mi:hover, .pop .sel { background: var(--green-tint-2); text-decoration: none; }
.pop .sep { height: 1px; background: var(--line-2); margin: 4px 0; }
.pop .grp { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; }
.notifs { width: 400px; max-height: 70vh; overflow-y: auto; padding: 0; }
.notifs .n { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; cursor: pointer; }
.notifs .n:hover { background: var(--surface-2); }
.notifs .n.unread { background: var(--green-tint-2); }
.notifs .n i { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--blue); }
.notifs .n i.critical { background: var(--red); }
.notifs .n i.warning { background: #d89a1d; }
.notifs .n b { display: block; font-weight: 600; }
.notifs .n span { color: var(--muted); font-size: 12.5px; white-space: pre-line; }
.notifs header { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.notifs header h3 { margin-right: auto; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-pop); animation: pop .18s ease-out; max-width: 90vw; }
.toast.bad { background: var(--red); }
.toast.good { background: var(--green-dark); }

/* ---------- document editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.editor .summary { position: sticky; top: calc(var(--top) + 16px); }
.items { width: 100%; border-collapse: collapse; }
.items th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); }
.items td { padding: 8px 6px; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.items td input, .items td select { height: 34px; font-size: 13.5px; }
.items .desc { min-width: 240px; }
.items .desc textarea { min-height: 34px; height: 34px; margin-top: 6px; font-size: 12.5px; }
.items .q { width: 80px; } .items .p { width: 130px; } .items .d { width: 150px; } .items .tx { width: 140px; } .items .amt { width: 120px; text-align: right; padding-top: 16px; font-weight: 600; }
.items .rm { width: 34px; padding-top: 10px; }
.disc { display: flex; gap: 4px; } .disc select { width: 58px; padding: 0 18px 0 6px; background-position: right 4px center; } .disc input { text-align: right; }
.sumrows { font-size: 13.5px; }
.sumrows div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.sumrows .grand { font-size: 18px; font-weight: 700; border: 0; padding-top: 10px; }
.sumrows .grand span:last-child { color: var(--green-dark); }
.paybox { border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: var(--r-sm); padding: 10px 12px; background: var(--green-tint-2); font-size: 13px; }
.paybox h4 { font-size: 13px; margin-bottom: 6px; }
.qr { width: 132px; height: 132px; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.qr img, .qr svg { width: 100%; height: 100%; object-fit: contain; }

/* ---------- charts ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font: 500 11px var(--font); fill: var(--muted); }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .base { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(37, 45, 41, .04); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.ranks { display: grid; gap: 10px; }
.rank .rl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.rank .rl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.rank .bar i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.rank .bar i.r { background: var(--red); }
.charttip { position: fixed; z-index: 95; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 7px 10px; border-radius: 6px; box-shadow: var(--shadow-pop); white-space: nowrap; }
.charttip b { font-weight: 650; }

/* ---------- kanban (pipeline) ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 260px; }
.kcol h3 { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; margin-bottom: 8px; font-size: 13px; }
.kcard .row { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .art { background: var(--green-tint); display: flex; flex-direction: column; justify-content: space-between; padding: 40px; border-right: 1px solid #d5e7bf; }
.auth .art h2 { font-size: 30px; line-height: 1.15; max-width: 14ch; color: var(--green-dark); font-weight: 750; }
.auth .art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--green-dark); font-size: 14px; }
.auth .art .ledger { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; color: var(--green-dark); }
.auth .art .ledger b { font-size: 22px; }
.auth form { align-self: center; justify-self: center; width: min(380px, 90vw); }
.auth form h1 { margin: 18px 0 4px; }

/* ---------- misc ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.pill-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; background: var(--line-2); border-radius: 4px; padding: 1px 6px; color: var(--ink-2); }
.preview-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 6px; background: #e9ece8; }
.matrix th, .matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

@media (max-width: 1180px) {
  .lane-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lane-figs .fig:nth-child(3) { border-right: 0; }
  .lane-figs .fig:nth-child(-n+3) { border-bottom: 1px solid var(--line-2); }
  .editor { grid-template-columns: 1fr; }
  .editor .summary { position: static; }
  .cols.w2, .cols.w-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  .shell.mobile-open .side { transform: none; }
  .shell.collapsed .brand div, .shell.collapsed .navgroup > p, .shell.collapsed .nav span { display: initial; }
  .top { padding: 0 12px; }
  .content { padding: 16px 16px 60px; }
  .searchbox kbd, .hide-sm { display: none !important; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .art { display: none; }
  .notifs { width: min(400px, 92vw); }
}
@media (max-width: 600px) {
  .lane { grid-template-columns: 1fr; }
  .lane-code { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: baseline; gap: 10px; padding: 10px 14px; }
  .lane-code span { margin: 0; }
  .lane-figs { grid-template-columns: 1fr 1fr; }
  .lane-figs .fig { border-bottom: 1px solid var(--line-2); }
  .lane-figs .fig:nth-child(odd) { border-right: 1px solid var(--line-2); }
  .lane-figs .fig:nth-child(even) { border-right: 0; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  h1 { font-size: 20px; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
  .filters input[type=search] { min-width: 0; max-width: none; flex-basis: 100%; }
  .items thead { display: none; }
  .items tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .items td { border: 0; padding: 0; }
  .items .desc { grid-column: 1 / -1; min-width: 0; }
  .items .q, .items .p, .items .d, .items .tx { width: auto; }
  .items .amt { padding-top: 6px; }
  .dialog > header, .dialog > .body, .dialog > footer { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .side, .top, .actions, .filters, .pager { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
