/* TechMinds Accounting Solution — design system */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f6;
  --border: #e4e7ef;
  --border-strong: #d3d8e4;
  --text: #0e1628;
  --text-2: #475169;
  --muted: #8790a5;

  --brand: #2a55e0;
  --brand-hover: #1f45c5;
  --brand-soft: #edf1fe;
  --brand-ink: #1a3aa8;
  --gold: #0d8a7f;
  --gold-soft: #e4f5f2;

  --pos: #0b8a5f;
  --pos-soft: #e6f6ef;
  --neg: #cf3341;
  --neg-soft: #fdecee;
  --warn: #b57400;
  --warn-soft: #fdf4e0;

  --side-bg: #0a1121;
  --side-bg-2: #0f1a33;
  --side-text: #a6b0c7;
  --side-strong: #ffffff;
  --side-line: rgba(255,255,255,.07);

  /* chart series (validated categorical order) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --grid: #e8e9ef; --axis: #c3c6d2;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.04);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 20px -6px rgba(16,24,40,.08);
  --shadow-lg: 0 20px 50px -12px rgba(16,24,40,.25);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #090d17;
  --surface: #111827;
  --surface-2: #151d2f;
  --surface-3: #1b2439;
  --border: #222c41;
  --border-strong: #2e3a54;
  --text: #e9edf6;
  --text-2: #b3bcd0;
  --muted: #7c869c;
  --brand: #5b82f5;
  --brand-hover: #7396f7;
  --brand-soft: #1a2647;
  --brand-ink: #a9c0ff;
  --gold: #3cc9b9;
  --gold-soft: #0f2e2b;
  --pos: #2cc48a; --pos-soft: #0f2a21;
  --neg: #f0646f; --neg-soft: #33161b;
  --warn: #e8a93a; --warn-soft: #2f2410;
  --side-bg: #060a14; --side-bg-2: #0b1325;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --grid: #222a3b; --axis: #39445c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.ico { flex: none; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .zero { color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 600; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 20px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 20px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 258px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 0% 0%, #16264d 0%, transparent 60%), linear-gradient(180deg, var(--side-bg-2), var(--side-bg));
  color: var(--side-text); border-right: 1px solid var(--side-line); z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 20px; color: var(--side-strong); border-bottom: 1px solid var(--side-line); }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; filter: drop-shadow(0 6px 14px rgba(42,85,224,.45)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: .005em; }
.brand-text small { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #7fd8cc; margin-top: 3px; }
.nav { padding: 10px 12px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: #5f6b86; padding: 18px 12px 8px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--side-text); font-weight: 500; margin: 1px 0; position: relative; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(61,107,245,.28), rgba(61,107,245,.08)); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(#5ee0cf, #0d8a7f); }
.nav-link.active .ico { color: #8fb0ff; }
.side-foot { padding: 14px 22px 18px; border-top: 1px solid var(--side-line); font-size: 12px; display: flex; justify-content: space-between; align-items: center; color: #6c7894; }
.side-company { display: flex; gap: 8px; align-items: center; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.top-title { flex: 1; min-width: 0; }
.top-title h1 { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -.005em; line-height: 1.2; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--brand); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.content { padding: 26px 32px 40px; flex: 1; }
.foot { padding: 18px 32px 26px; color: var(--muted); font-size: 12px; }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; border-color: transparent; background: transparent; }
.icon-btn.sm:hover { background: var(--surface-3); }
.icon-btn.danger:hover { color: var(--neg); background: var(--neg-soft); }
[data-theme="light"] .when-dark, [data-theme="dark"] .when-light { display: none; }
.only-mobile { display: none; }

.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text-2); cursor: pointer; font: inherit; }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: #fff; background: linear-gradient(135deg, #3d6bf5, #1636a8); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta strong { font-size: 13px; color: var(--text); } .user-meta small { font-size: 11px; color: var(--muted); }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.dropdown.open { display: block; }
.dropdown a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--text-2); }
.dropdown a:hover { background: var(--surface-3); color: var(--text); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: 600 13.5px/1 var(--font); cursor: pointer; transition: all .15s; white-space: nowrap; }
.btn-primary { background: linear-gradient(180deg, #3563ec, var(--brand)); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -6px rgba(42,85,224,.6); }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-gold { background: linear-gradient(180deg, #14a294, #0d8a7f); color: #fff; }
.btn-danger { background: var(--neg); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; justify-content: center; height: 44px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search], input[type=file], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 14px var(--font); transition: border-color .15s, box-shadow .15s; outline: none;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input[type=file] { padding: 8px; height: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.money-input { position: relative; }
.money-input::before { content: attr(data-cur); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }
.money-input input { padding-left: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-form .full { grid-column: 1 / -1; }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 18px 22px 22px; }
.card-body.flush { padding: 8px 0 0; }
.grid { display: grid; gap: 20px; }
.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-2-1 { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.g-1-2 { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-title h2 { font-family: var(--font-display); font-weight: 600; font-size: 18px; }

/* hero band */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 24px 26px; color: #fff; background:
  radial-gradient(90% 140% at 100% 0%, rgba(20,184,166,.22) 0%, transparent 45%),
  radial-gradient(70% 120% at 0% 100%, rgba(61,107,245,.55) 0%, transparent 55%),
  linear-gradient(135deg, #0d1834 0%, #13265a 55%, #0d1834 100%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000 60%); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 24px; align-items: end; }
.hero .eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #8be3d6; font-weight: 600; }
.hero .big { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1.05; margin-top: 8px; letter-spacing: -.01em; }
.hero .cap { color: #b6c2e0; font-size: 12.5px; margin-top: 6px; }
.hero .mini { border-left: 1px solid rgba(255,255,255,.14); padding-left: 20px; }
.hero .mini .lbl { color: #9fb0d6; font-size: 12px; }
.hero .mini .val { font-size: 20px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero .mini .val small { font-size: 12px; font-weight: 500; color: #9fb0d6; margin-left: 4px; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-head { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.stat-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat.pos .stat-ico { background: var(--pos-soft); color: var(--pos); }
.stat.neg .stat-ico { background: var(--neg-soft); color: var(--neg); }
.stat.warn .stat-ico { background: var(--warn-soft); color: var(--warn); }
.stat.gold .stat-ico { background: var(--gold-soft); color: var(--gold); }
.stat-val { font-size: 23px; font-weight: 650; margin-top: 8px; letter-spacing: -.02em; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--s3), color-mix(in srgb, var(--s3) 70%, #fff)); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table th.num { text-align: right; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { padding: 12px 14px; font-weight: 650; border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table a.row-link { color: var(--text); font-weight: 600; }
.table a.row-link:hover { color: var(--brand); }
.table .sub { color: var(--muted); font-size: 12px; }
.table.compact td, .table.compact th { padding: 9px 10px; }
.table.compact td:first-child, .table.compact th:first-child { padding-left: 22px; } .table.compact td:last-child, .table.compact th:last-child { padding-right: 22px; }
.table td.num { font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--pos-soft); color: var(--pos); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--neg-soft); color: var(--neg); }
.badge-muted { background: var(--surface-3); color: var(--text-2); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.pill { display: inline-block; white-space: nowrap; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; }

.entity { display: flex; align-items: center; gap: 12px; }
.entity-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; color: var(--brand-ink); background: var(--brand-soft); }
.entity-ico.gold { color: var(--gold); background: var(--gold-soft); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.filters-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 12.5px; margin-right: 4px; }
.fchip { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding-left: 12px; box-shadow: var(--shadow-sm); }
.fchip > span { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.fchip input, .fchip select { border: 0; height: 34px; background: transparent; box-shadow: none !important; width: auto; min-width: 0; padding: 0 10px 0 6px; font-weight: 500; font-size: 13px; }
.link-reset { font-size: 12.5px; font-weight: 600; margin-left: 4px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); }
.seg a, .seg button { padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 12.5px; border: 0; background: none; cursor: pointer; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }

.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; width: 280px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12px; min-width: 160px; opacity: 0; transition: opacity .12s; }
.chart-tip.on { opacity: 1; }
.chart-tip .t { font-weight: 650; color: var(--text); margin-bottom: 6px; }
.chart-tip .r { display: flex; align-items: center; gap: 8px; color: var(--text-2); margin-top: 3px; }
.chart-tip .r i { width: 8px; height: 8px; border-radius: 2px; }
.chart-tip .r b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; padding-left: 14px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; height: 100%; }
.donut-wrap svg { flex: none; }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; }
.donut-legend .row { display: flex; align-items: center; gap: 9px; }
.donut-legend .row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend .row span { flex: 1; min-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.donut-legend .row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-legend .row em { font-style: normal; color: var(--muted); width: 40px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- invoice ---------- */
.inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.inv-meta { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 28px; font-size: 13px; }
.inv-meta dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.inv-meta dd { margin: 0; font-weight: 600; }
.summary-list { display: flex; flex-direction: column; }
.summary-list .row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.summary-list .row:last-child { border-bottom: 0; }
.summary-list .row.total { border-top: 1px solid var(--border-strong); border-bottom: 0; margin-top: 6px; padding-top: 14px; font-weight: 700; font-size: 15px; }
.summary-list .row span { color: var(--text-2); }
.line-form { display: grid; grid-template-columns: 1.1fr 1.6fr 130px 150px 1fr auto; gap: 8px; align-items: end; padding: 14px 22px; background: var(--surface-2); border-top: 1px solid var(--border); }
.line-form.no-acc { grid-template-columns: 1.1fr 1.6fr 130px 150px auto; }
.share-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.share-bar i { display: block; height: 100%; }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(620px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(8,12,24,.55); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.modal-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.modal-body { padding: 18px 24px 24px; }

/* ---------- toasts / empty ---------- */
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; }
.toast-success { background: var(--pos-soft); color: var(--pos); border-color: color-mix(in srgb, var(--pos) 25%, transparent); }
.toast-error { background: var(--neg-soft); color: var(--neg); border-color: color-mix(in srgb, var(--neg) 25%, transparent); }
.toast-info { background: var(--brand-soft); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.empty { text-align: center; padding: 48px 20px; }
.empty-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); }
.empty h3 { font-size: 16px; } .empty p { color: var(--muted); margin: 6px auto 18px; max-width: 420px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; }
.note.gold { background: var(--gold-soft); color: var(--gold); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(70% 60% at 85% 10%, rgba(20,184,166,.26) 0%, transparent 60%), radial-gradient(80% 80% at 0% 100%, rgba(61,107,245,.6) 0%, transparent 60%), linear-gradient(140deg, #0a1229, #132a63 60%, #0a1229); }
.auth-art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(80% 80% at 70% 40%, #000, transparent); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h2 { font-family: var(--font-display); font-weight: 600; font-size: 42px; line-height: 1.1; max-width: 520px; letter-spacing: -.01em; }
.auth-art h2 em { font-style: italic; color: #7fe3d5; }
.auth-art p { color: #b9c5e3; max-width: 460px; font-size: 15px; }
.auth-feats { display: flex; gap: 26px; color: #cbd5ee; font-size: 13px; }
.auth-feats span { display: inline-flex; align-items: center; gap: 8px; }
.auth-form { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 30px; }
.auth-card .lead { color: var(--muted); margin: 6px 0 28px; }

/* ---------- print ---------- */
@media print {
  .sidebar, .topbar, .foot, .no-print, .toast { display: none !important; }
  body, .content { background: #fff; padding: 0; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .hero-grid { grid-template-columns: 1fr 1fr; } .hero .mini:nth-child(3) { border-left: 0; padding-left: 0; } }
@media (max-width: 1100px) {
  .stats, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g3, .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
  .line-form, .line-form.no-acc { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .25s; }
  body.side-open .sidebar { transform: none; }
  body.side-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .only-mobile { display: inline-grid; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .g2, .grid-form { grid-template-columns: 1fr; }
  .user-meta { display: none; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .hero-grid { grid-template-columns: 1fr; } .hero .mini { border-left: 0; padding-left: 0; }
  .inv-meta { grid-template-columns: repeat(2, auto); }
}

/* sortable headers */
.table th.sortable { cursor: pointer; user-select: none; position: relative; transition: color .12s; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid currentColor; opacity: .25; transition: opacity .12s, transform .12s; }
.table th.sortable:hover::after { opacity: .6; }
.table th.sort-asc, .table th.sort-desc { color: var(--brand); }
.table th.sort-asc::after { opacity: 1; transform: rotate(180deg); }
.table th.sort-desc::after { opacity: 1; }
.table th.sortable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* profit split editor */
.split-cols { display: grid; grid-template-columns: minmax(0,1fr) 110px 110px 30px; gap: 10px; padding: 0 14px 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.split-party { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.split-head { display: grid; grid-template-columns: minmax(0,1fr) 110px 110px 30px; gap: 10px; align-items: center; }
.split-max { text-align: left; }
.pct-input { position: relative; display: block; }
.pct-input::after { content: "%"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pct-input input { padding-right: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.tiers { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tiers:empty { margin-top: 0; }
.tier-row { display: grid; grid-template-columns: auto 160px auto 90px 30px; gap: 8px; align-items: center; font-size: 13px; padding-left: 14px; border-left: 2px solid var(--gold); }
.tier-row input { height: 34px; }
.link-btn { background: none; border: 0; padding: 0; margin-top: 8px; color: var(--brand); font: 600 12.5px var(--font); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.link-btn:hover { color: var(--brand-hover); }
.sim { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: linear-gradient(180deg, var(--brand-soft), transparent 70%); align-self: start; }
.sim-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; color: var(--brand-ink); }
.sim .table th:first-child, .sim .table td:first-child { padding-left: 4px; }
.sim .table th:last-child, .sim .table td:last-child { padding-right: 4px; }
.tier-chip { display: inline-block; margin: 2px 4px 0 0; padding: 1px 7px; border-radius: 6px; background: var(--gold-soft); color: var(--gold); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
@media (max-width: 860px) { .split-head, .split-cols { grid-template-columns: 1fr 90px 30px; } .split-max, .split-cols span:nth-child(3) { display: none; } .tier-row { grid-template-columns: 1fr 1fr; } }
.side-group { border-radius: 14px; padding: 14px; margin-bottom: 14px; border: 1px dashed var(--border-strong); }
.side-group.side-us { background: linear-gradient(180deg, var(--gold-soft), transparent 80%); border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); }
.side-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 10px; }
.side-title b { font-size: 14px; }
.side-sum { font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.side-group .split-party { background: var(--surface); }
.side-card.side-us { border-top: 3px solid var(--gold); }
.side-card.side-bd { border-top: 3px solid var(--brand); }
.flag-unpaid { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); margin-left: 6px; vertical-align: -2px; cursor: help; }
.flag-unpaid em { font-style: normal; font-size: 11.5px; font-weight: 600; }
.flag-unpaid .ico { flex: none; }
.stat-sub .flag-unpaid { margin-left: 0; }

/* projects tree table */
.tree-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--border); }
.tree-toolbar .seg button { display: inline-flex; align-items: center; gap: 5px; }
.tree-toolbar .seg button:hover { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.table.tree td { padding-top: 9px; padding-bottom: 9px; }
.table.tree .grp-row { cursor: pointer; }
.table.tree .grp-row td { background: var(--surface); transition: background .12s; }
.table.tree .grp-row:hover td { background: var(--surface-2); }
.table.tree tbody.open .grp-row td { background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface)); border-bottom-color: var(--border); }
.table.tree tbody.open .grp-row td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.grp-cell, .child-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table.tree .caret { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--muted); transition: transform .18s, background .18s, color .18s; flex: none; }
.table.tree .grp-row:hover .caret { background: var(--surface-3); }
.table.tree tbody.open .caret { transform: rotate(90deg); color: var(--brand); }
.mini-av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none;
  background: linear-gradient(135deg, #3d6bf5, #1636a8); box-shadow: 0 3px 8px -3px rgba(42,85,224,.6); }
.table.tree .grp-name { color: var(--text); font-weight: 650; font-size: 14px; white-space: nowrap; }
.table.tree .grp-name:hover { color: var(--brand); }
.table.tree .grp-count { padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.table.tree .grp-row td.num { font-weight: 650; }
.table.tree .child-row { display: none; }
.table.tree tbody.open .child-row { display: table-row; animation: rowIn .18s ease-out; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.table.tree .child-row td { background: var(--surface); }
.table.tree tbody.open .child-row td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.table.tree .child-row:hover td { background: var(--surface-2); }
.table.tree .child-row td:first-child { padding-left: 62px; position: relative; }
.table.tree .child-row td:first-child::before { content: ""; position: absolute; left: 41px; top: 0; bottom: 0; border-left: 1.5px solid var(--border-strong); }
.table.tree .child-row:last-child td:first-child::before { bottom: 50%; }
.table.tree .child-row td:first-child::after { content: ""; position: absolute; left: 41px; top: 50%; width: 12px; border-top: 1.5px solid var(--border-strong); }
.child-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: none; }
.table.tree .child-name { color: var(--text); font-weight: 500; white-space: nowrap; }
.table.tree .child-name:hover { color: var(--brand); }
.code-tag { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; white-space: nowrap; }
.split-mini { display: flex; gap: 2px; height: 6px; width: 150px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.split-mini i { display: block; height: 100%; }
.split-mini .us, .split-txt .k.us { background: var(--s4); }
.split-mini .bd, .split-txt .k.bd { background: var(--s7); }
.split-mini .tm, .split-txt .k.tm { background: color-mix(in srgb, var(--s7) 55%, var(--surface)); }
.split-txt { display: flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.split-txt .k { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.split-txt .k:first-child { margin-left: 0; }
.cmeter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.cmeter span { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cmeter i { display: block; height: 100%; border-radius: 99px; }
.cmeter.full i { background: var(--pos); } .cmeter.mid i { background: var(--s3); } .cmeter.low i { background: var(--s2); }
.cmeter b { font-size: 11.5px; font-weight: 600; color: var(--text-2); width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.active { background: var(--pos-soft); color: var(--pos); }
.status-pill.paused { background: var(--warn-soft); color: var(--warn); }

/* bulk selection */
.table th.chk, .table td.chk { width: 44px; padding-right: 0 !important; }
.table .chk input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
.table tr.row-selected td { background: var(--brand-soft); }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 22px; background: var(--brand-soft); border-bottom: 1px solid var(--border); color: var(--brand-ink); position: sticky; top: 70px; z-index: 5; }
.bulk-bar[hidden] { display: none; }
.scope-opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }
.scope-opt input { accent-color: var(--brand); }
.scope-opt.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.gen-pick { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.gen-pick[hidden] { display: none; }
.gen-pick-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.gen-list { max-height: 260px; overflow-y: auto; padding: 6px 14px 10px; }
.gen-client { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 10px 0 4px; }
.gen-item { display: flex; padding: 5px 0 5px 4px; }

/* payable breakdown */
.pay-toggle { background: none; border: 0; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-bottom: 1px dashed currentColor; border-radius: 0; }
.pay-toggle .ico { transition: transform .15s; opacity: .7; }
.pay-toggle.open .ico { transform: rotate(180deg); }
.table tr.row-open td { background: var(--surface-2); }
.table tr.detail-row > td { padding: 0 22px 16px !important; background: var(--surface-2); }
.detail-box { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.detail-title { padding: 10px 16px; font-size: 12px; font-weight: 700; color: var(--text-2); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table.breakdown th:first-child, .table.breakdown td:first-child { padding-left: 16px; }
.table.breakdown th:last-child, .table.breakdown td:last-child { padding-right: 16px; }
.detail-box .table-wrap, .detail-box table { width: 100%; }
.table.breakdown { table-layout: fixed; }
.table.breakdown td, .table.breakdown th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* payouts: payable list with breakdown */
.pay-list { display: flex; flex-direction: column; gap: 14px; }
.pay-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.pay-name { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); font-weight: 600; min-width: 0; }
.pay-name .ico { color: var(--muted); transition: transform .15s; flex: none; }
.pay-item.open .pay-name .ico { transform: rotate(90deg); color: var(--brand); }
.pay-row:hover .pay-name { color: var(--brand); }
.pay-amt { font-variant-numeric: tabular-nums; font-weight: 650; }
.pay-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.pay-bar i { display: block; height: 100%; border-radius: 99px; background: var(--s7); }
.pay-warn { font-size: 11.5px; color: var(--warn); font-weight: 600; margin-top: 5px; display: flex; gap: 5px; align-items: center; }
.pay-detail { margin-top: 10px; }
.pay-detail[hidden] { display: none; }
.table.breakdown tr.month-break td { border-top: 1px solid var(--border-strong); }
.pay-link { margin-left: 6px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); }
.pay-link:hover { background: var(--brand); color: #fff; }

/* payouts (compact) */
.side-strip { display: flex; gap: 22px; align-items: center; padding: 8px 22px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.side-strip b { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.side-strip.bd { background: var(--brand-soft); } .side-strip.bd b { color: var(--brand-ink); }
.side-strip.us { background: var(--gold-soft); } .side-strip.us b { color: var(--gold); }
.side-strip .strong { margin-left: auto; color: var(--text); }
.payable-tbl tr.pay-head td { padding-top: 8px; padding-bottom: 8px; }
.payable-tbl tr.pay-head.open td { background: var(--surface-2); }
.exp-btn { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: transform .15s, color .15s, border-color .15s; }
.exp-btn:hover { color: var(--brand); border-color: var(--brand); }
tr.open .exp-btn { transform: rotate(90deg); color: var(--brand); border-color: var(--brand); }
.payable-tbl .detail-box .table.breakdown { table-layout: auto; }
.rates-card > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; cursor: pointer; gap: 10px; }
.rates-card > summary::-webkit-details-marker { display: none; }
.rates-card > summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.rates-card[open] > summary { border-bottom: 1px solid var(--border); }
.rates-body { padding: 14px 22px 18px; }
.rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.rate-cell { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.rate-cell span { font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.rate-cell input { height: 32px; font-variant-numeric: tabular-nums; }
.rate-cell.missing { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); background: var(--warn-soft); }
.usd-eq { height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border); font-variant-numeric: tabular-nums; color: var(--text-2); }

/* client monthly statement */
.ms-month { border-top: 1px solid var(--border); }
.ms-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 22px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ms-title { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.ms-title .ico { color: var(--gold); }
.ms-split { display: flex; align-items: center; gap: 8px; }
.ms-pill { font-size: 12px; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.ms-pill b { font-variant-numeric: tabular-nums; }
.ms-pill.us { background: var(--gold-soft); color: var(--gold); }
.ms-pill.bd { background: var(--brand-soft); color: var(--brand-ink); }
.ms-bar { display: flex; width: 120px; height: 6px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.ms-bar i { display: block; height: 100%; }
.ms-bar .us { background: var(--s4); } .ms-bar .bd { background: var(--s7); }
.ms-table tfoot .sub, .ms-table td .sub { font-size: 11px; }
.table.breakdown td { padding-top: 7px; padding-bottom: 7px; }
.payable-tbl .grp-count { padding: 1px 8px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 600; white-space: nowrap; }
.ms-table { table-layout: fixed; }
.need-amt { font-size: 11.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 99px; }
.table tr.row-empty td { background: color-mix(in srgb, var(--warn-soft) 45%, transparent); }

/* rates (top of payouts) */
.rates-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px 12px 22px; gap: 12px; }
.rates-now { display: flex; align-items: center; gap: 12px; }
.rates-now > .ico { color: var(--gold); }
.rate-big { font-size: 15px; font-variant-numeric: tabular-nums; }
.rate-big b { font-size: 18px; }
.auto-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.rates-card .rates-body { border-top: 1px solid var(--border); }
.rates-card .rates-body[hidden] { display: none; }
.rate-cell em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.rate-cell.auto { background: var(--surface); border-style: dashed; }
.rate-cell.auto input { color: var(--muted); }
.rate-cell.changed { border-color: var(--brand); background: var(--brand-soft); }
.rate-cell.changed input { color: var(--text); }
.auto-em { font-style: normal; font-weight: 600; }
.bulk-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.bulk-item { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.bulk-item em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; }
.bulk-item.total { background: var(--surface-2); font-weight: 700; border-bottom: 0; }
.payable-tbl .grp-count { margin-left: 4px; }

/* period picker */
.period-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px 12px 20px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.period-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pp-custom { display: inline-flex; align-items: center; gap: 6px; padding: 3px 3px 3px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-3); }
.pp-custom.on { border-color: var(--brand); background: var(--brand-soft); }
.pp-custom input[type=month] { height: 30px; width: 150px; font-size: 12.5px; padding: 0 8px; }
.pp-custom span { color: var(--muted); font-size: 12px; }
.pp-custom .btn-sm { height: 30px; }

/* hover hints (bonus, what-if, info) */
.hint { position: relative; display: inline-flex; align-items: center; gap: 3px; cursor: help; vertical-align: middle; }
.hint-pop { display: none; position: absolute; z-index: 60; top: calc(100% + 8px); right: -8px; min-width: 210px; padding: 10px 12px; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 12.5px; font-weight: 400; white-space: normal; cursor: default; }
.hint-pop::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.hint:hover > .hint-pop, .hint:focus-within > .hint-pop { display: block; }
.hp-title { display: block; font-weight: 700; font-size: 12.5px; }
.hp-sub { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.hp-row { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-top: 1px dashed var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hp-row b { font-weight: 650; }
.hp-row.hp-total { border-top: 1px solid var(--border-strong); font-weight: 700; }
.hp-row.hp-hit { color: var(--gold); font-weight: 700; }
.hp-sep { margin-top: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.bonus-hint { color: var(--gold); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); border-radius: 99px; padding: 1px 7px 1px 5px; font-size: 11px; font-weight: 700; line-height: 16px; }
.bonus-hint em { font-style: normal; }
.bonus-dot { color: var(--gold); display: inline-flex; vertical-align: -1px; }
.info-hint { color: var(--muted); margin-left: 4px; }
.info-hint .hint-pop { left: -10px; right: auto; }
.sim-hint { padding: 0 12px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); gap: 6px; }
.sim-hint:hover { border-color: var(--brand); color: var(--brand); }
.sim-pop { width: 380px; bottom: calc(100% + 8px); top: auto; right: 0; }
.sim-pop::before { top: auto; bottom: -10px; }
.sim-pop .table th:first-child, .sim-pop .table td:first-child { padding-left: 4px; }
.sim-pop .table th:last-child, .sim-pop .table td:last-child { padding-right: 4px; }
/* split editor: tiers hidden until ⚡ clicked */
.split-cols, .split-head { grid-template-columns: minmax(0,1fr) 110px 150px 64px 30px !important; }
.tier-toggle { cursor: pointer; justify-self: start; }
.tier-toggle.none { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.split-party .tiers, .split-party .tier-add { display: none; }
.split-party.tiers-open .tiers { display: flex; }
.split-party.tiers-open .tier-add { display: inline-flex; }
.split-party.tiers-open .tier-toggle { outline: 2px solid color-mix(in srgb, var(--gold) 40%, transparent); }

/* =====================================================================
   v1.22 — compact, friendlier layout (overrides the roomier defaults)
   ===================================================================== */
body { font-size: 13.5px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.grid { gap: 14px; }

/* sidebar */
.sidebar { width: 212px; }
.brand { padding: 14px 16px; gap: 10px; }
.brand-mark svg { width: 30px; height: 30px; }
.brand-text strong { font-size: 16.5px; }
.brand-text small { font-size: 9px; letter-spacing: .14em; }
.nav { padding: 6px 10px; }
.nav-group { padding: 12px 10px 4px; font-size: 10px; }
.nav-link { padding: 6px 10px; gap: 10px; border-radius: 8px; font-size: 13px; }
.nav-link .ico { width: 16px; height: 16px; }
.nav-link.active::before { left: -10px; top: 6px; bottom: 6px; }
.side-foot { padding: 10px 16px; font-size: 11px; }

/* top bar + content */
.topbar { padding: 8px 22px; gap: 12px; min-height: 52px; }
.top-title h1 { font-size: 19px; }
.crumbs { font-size: 11.5px; margin-bottom: 0; }
.top-actions { gap: 8px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.sm { width: 26px; height: 26px; }
.user-chip { padding: 2px 8px 2px 2px; gap: 8px; border-radius: 10px; }
.avatar { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
.user-meta strong { font-size: 12px; } .user-meta small { font-size: 10.5px; }
.content { padding: 16px 22px 28px; }
.foot { padding: 10px 22px 16px; font-size: 11px; }

/* buttons & inputs */
.btn { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-sm { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-block { height: 40px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search], select { height: 34px; font-size: 13px; border-radius: 8px; padding: 0 10px; }
textarea { font-size: 13px; border-radius: 8px; min-height: 70px; }
.field { gap: 4px; } .field > span, .label { font-size: 12px; }
.grid-form { gap: 12px; }
.form-actions { margin-top: 16px; gap: 8px; }

/* cards */
.card { border-radius: 12px; }
.card-head { padding: 12px 16px 0; }
.card-head h2, .card-head h3 { font-size: 14px; }
.card-head .sub { font-size: 12px; margin-top: 0; }
.card-body { padding: 12px 16px 14px; }
.card-body.flush { padding: 6px 0 0; }
.section-title { margin: 18px 0 8px; } .section-title h2 { font-size: 16px; }

/* hero + stat tiles */
.hero { padding: 16px 20px; border-radius: 14px; }
.hero-grid { gap: 16px; }
.hero .big { font-size: 30px; margin-top: 4px; }
.hero .cap { margin-top: 4px; font-size: 12px; }
.hero .mini { padding-left: 16px; }
.hero .mini .val { font-size: 17px; margin-top: 2px; }
.stats { gap: 12px; }
.stat { padding: 11px 14px; border-radius: 12px; }
.stat-head { font-size: 12px; }
.stat-ico { width: 24px; height: 24px; border-radius: 7px; }
.stat-ico svg { width: 14px; height: 14px; }
.stat-val { font-size: 19px; margin-top: 4px; }
.stat-sub { font-size: 11.5px; margin-top: 2px; }
.meter { margin-top: 6px; height: 5px; }

/* tables: one line per row, tighter cells */
.table { font-size: 13px; }
.table th { padding: 7px 10px; font-size: 10.5px; }
.table td { padding: 7px 10px; white-space: nowrap; }
.table td.wrap { white-space: normal; }
.table th:first-child, .table td:first-child, .table.compact td:first-child, .table.compact th:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child, .table.compact td:last-child, .table.compact th:last-child { padding-right: 16px; }
.table.compact td, .table.compact th { padding-top: 6px; padding-bottom: 6px; }
.table tfoot td { padding: 8px 10px; }
.table .sub { font-size: 11px; line-height: 1.3; }
.table td .row-link { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.table td > .sub { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.entity { gap: 9px; }
.entity-ico { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.badge { padding: 2px 8px 2px 7px; font-size: 11px; }
.table tr.detail-row > td { padding: 0 16px 10px !important; white-space: normal; }
.table.tree td { padding-top: 6px; padding-bottom: 6px; }
.table.tree .child-row td:first-child { padding-left: 54px; }
.table.tree .child-row td:first-child::before, .table.tree .child-row td:first-child::after { left: 33px; }
.mini-av { width: 24px; height: 24px; font-size: 10px; border-radius: 7px; }
.child-ico { width: 20px; height: 20px; border-radius: 6px; }
.tree-toolbar { padding: 8px 12px 8px 16px; }
.cmeter { min-width: 90px; }

/* table tools: search + show more */
.tbl-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.card-head + .tbl-tools { margin-top: 10px; border-top: 1px solid var(--border); }
.tbl-search { position: relative; display: inline-flex; align-items: center; color: var(--muted); }
.tbl-search svg { position: absolute; left: 9px; pointer-events: none; }
.tbl-search input { width: 240px; height: 28px; padding-left: 28px; font-size: 12.5px; background: var(--surface-2); }
.tbl-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbl-more { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 8px; border-top: 1px solid var(--border); }
.tbl-more[hidden] { display: none; }
.tbl-more .link-btn { margin: 0; }
.table tr.q-hide, .table tr.pg-hide { display: none; }
.table tfoot.q-dim { opacity: .45; }

/* filters: one tidy row */
.filters { gap: 6px; margin-bottom: 14px; }
.fchip { height: 30px; padding-left: 8px; border-radius: 8px; box-shadow: none; }
.fchip > span { font-size: 11.5px; }
.fchip input, .fchip select { height: 28px; font-size: 12.5px; padding: 0 6px 0 2px; }
.seg { padding: 2px; border-radius: 8px; }
.seg a, .seg button { padding: 4px 10px; border-radius: 6px; font-size: 12px; }
.fcustom { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border: 1px solid var(--brand); border-radius: 8px; background: var(--brand-soft); }
.fcustom[hidden] { display: none; }
.fcustom input { height: 26px; width: 140px; font-size: 12px; padding: 0 6px; border: 0; }
.fcustom i { font-style: normal; color: var(--muted); font-size: 12px; }
.period-bar { padding: 8px 12px 8px 16px; margin-bottom: 14px; gap: 10px; border-radius: 12px; }
.pp-custom[hidden] { display: none; }
.pp-custom input[type=month] { height: 26px; width: 140px; }
.pp-custom .btn-sm { height: 26px; }
.tabs { margin-bottom: 14px; } .tabs a { padding: 7px 12px; font-size: 13px; }
.toolbar { margin-bottom: 12px; }
.search input { width: 240px; }

/* modals, toasts, misc */
dialog.modal { border-radius: 14px; }
.modal-head { padding: 14px 18px 0; } .modal-head h3 { font-size: 17px; }
.modal-body { padding: 12px 18px 18px; }
.toast { padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.note { padding: 9px 12px; border-radius: 10px; font-size: 12.5px; }
.empty { padding: 30px 16px; }
.empty-ico { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 10px; }
.legend { margin-bottom: 6px; font-size: 11.5px; }
.donut-legend { gap: 6px; font-size: 12px; }
.summary-list .row { padding: 7px 0; }
.line-form { padding: 10px 16px; }
.kv { gap: 6px 14px; font-size: 13px; }
.side-strip { padding: 6px 16px; }
.rates-top { padding: 8px 14px 8px 16px; }
.ms-head { padding: 8px 16px; } .ms-title { font-size: 14.5px; }
.split-party { padding: 9px 12px; border-radius: 10px; }
.side-group { padding: 10px; border-radius: 12px; margin-bottom: 10px; }
.bulk-bar { padding: 7px 16px; top: 52px; }
@media (max-width: 860px) { .content, .topbar { padding-left: 12px; padding-right: 12px; } .tbl-search input { width: 160px; } }
.table.oneline td .sub { display: none; }
.table.oneline td.has-tip { cursor: default; }
.table.oneline td, .table.oneline th { padding-left: 8px; padding-right: 8px; }
.all-due { margin-left: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.table.oneline .entity-ico { width: 22px; height: 22px; font-size: 9.5px; border-radius: 6px; }
.table.oneline td:first-child, .table.oneline th:first-child { padding-left: 16px; }
.table.oneline td:last-child, .table.oneline th:last-child { padding-right: 16px; }
.pb-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.pb-label .muted { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .top-title { flex: 1 1 calc(100% - 50px); order: 1; }
  .topbar > .only-mobile { order: 0; }
  .top-actions { order: 2; width: 100%; justify-content: flex-end; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg a, .seg button { white-space: nowrap; }
  .fchip { flex: 1 1 140px; } .fchip select { width: 100%; }
  .tbl-tools { padding: 8px 12px; }
}

/* payout lines (salary / profit share / loan deduction) */
.pay-lines { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.pl-head, .pl-row { display: grid; grid-template-columns: 128px 130px minmax(0,1fr) 150px 26px; gap: 6px; align-items: center; }
.pl-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0 2px 4px; }
.pl-head small { text-transform: none; letter-spacing: 0; }
.pl-row { margin-bottom: 6px; }
.pl-row input, .pl-row select { height: 32px; font-size: 12.5px; background: var(--surface); }
.pl-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; padding-top: 2px; }
.pl-sum { color: var(--text-2); font-variant-numeric: tabular-nums; }
.pl-loan { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--gold-soft); color: var(--gold); font-size: 12px; font-variant-numeric: tabular-nums; }
.pl-loan[hidden] { display: none; }
.ptype { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--brand-soft); color: var(--brand-ink); }
.ptype-salary { background: var(--pos-soft); color: var(--pos); }
.ptype-loan_deduct, .ptype-loan { background: var(--gold-soft); color: var(--gold); }
@media (max-width: 860px) { .pl-head { display: none; } .pl-row { grid-template-columns: 1fr 1fr; } }
.ledger-tbl { table-layout: fixed; }
.table td.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* inline-editable invoice lines */
.lines-tbl { table-layout: fixed; }
.lines-tbl td { overflow: hidden; text-overflow: ellipsis; }
.lines-tbl:not(.editing-all) .line-row .e { display: none !important; }
.lines-tbl.editing-all .line-row .v { display: none !important; }
.lines-tbl.editing-all .line-row td { background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); padding-top: 4px; padding-bottom: 4px; overflow: visible; }
.lines-tbl.editing-all .line-row.new-line td { background: color-mix(in srgb, var(--brand-soft) 75%, var(--surface)); }
.lines-tbl .line-row.removed td { opacity: .45; text-decoration: line-through; }
.lines-tbl .line-row.removed input { text-decoration: line-through; }
.lines-tbl:not(.editing-all) .add-line-save { display: none; }
.lines-editing [data-lines-edit] { border-color: var(--brand); color: var(--brand); }
.line-row input.e, .line-row .e input { height: 30px; font-size: 12.5px; width: 100%; padding: 0 8px; }
.line-row .e.money-input { display: block; }
.line-row .e.money-input input { padding-left: 22px; }
.line-row .e.money-input::before { left: 8px; font-size: 12px; }
.line-row[data-editable]:not(.editing) { cursor: default; }
.line-row .actions { white-space: nowrap; }
.line-save { color: var(--pos) !important; }
.line-row .actions form.inline { display: inline; }
.pl-head, .pl-row { grid-template-columns: minmax(0,1.3fr) 150px minmax(0,1fr) 26px !important; }
.pl-type { display: flex; gap: 4px; min-width: 0; }
.pl-type select { flex: 1 1 auto; min-width: 0; }
.pl-row .pl-other { display: none; flex: 1 1 55%; min-width: 0; }
.pl-row.is-other .pl-other { display: block; }
.pl-row.is-other .pl-type select { flex: 0 0 82px; }
.pl-row.is-deduct select[name="acct[]"] { visibility: hidden; }
.ptype-nominee { background: color-mix(in srgb, var(--s5) 18%, var(--surface)); color: color-mix(in srgb, var(--s5) 75%, var(--text)); }
.ptype-other { background: var(--surface-3); color: var(--text-2); }
/* parties with an open loan */
.table tr.has-loan > td { background: color-mix(in srgb, var(--gold-soft) 70%, var(--surface)); }
.table tr.has-loan:hover > td { background: var(--gold-soft); }
.loan-amt { color: var(--gold); font-weight: 650; }
.loan-key { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); vertical-align: -1px; }
.cp-wrap { border: 1px solid var(--border); border-radius: 10px; max-height: 420px; overflow-y: auto; }
.cp-tbl td { padding-top: 5px !important; padding-bottom: 5px !important; }
.cp-tbl .money-input input { height: 30px; font-size: 12.5px; padding-left: 26px; }
.cp-tbl .money-input::before { left: 8px; font-size: 12px; }

/* manual party rate */
.prate { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.prate-chk { width: 13px; height: 13px; accent-color: var(--gold); cursor: pointer; margin: 0; }
.prate-in { width: 74px !important; height: 24px !important; padding: 0 5px !important; font-size: 12px !important; text-align: right; font-variant-numeric: tabular-nums;
  border: 1px solid transparent !important; background: transparent !important; color: var(--muted); box-shadow: none !important; }
.prate-in[readonly] { cursor: default; }
.prate.manual .prate-in { border-color: color-mix(in srgb, var(--gold) 55%, transparent) !important; background: var(--gold-soft) !important; color: var(--gold); font-weight: 700; }
.prate.saving { opacity: .5; pointer-events: none; }
.prate-ro { color: var(--muted); font-variant-numeric: tabular-nums; }
.prate-ro.manual { color: var(--gold); font-weight: 700; background: var(--gold-soft); padding: 1px 6px; border-radius: 5px; }
.lock-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.lock-ico { color: var(--muted); display: inline-flex; vertical-align: -1px; }
.bonus-only { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--gold-soft); color: var(--gold); white-space: nowrap; }
.split-party.is-bonus-only [data-base] { color: var(--muted); }
.split-party.is-empty { border-color: color-mix(in srgb, var(--neg) 45%, var(--border)); }
.split-max .bonus-only { margin-right: 3px; }
.prate-ro { display: inline-block; padding-right: 6px; }
.prate-ro.manual { padding-right: 6px; }
/* "Try it — what if profit is…" always beside the split editor */
.split-layout { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 16px; align-items: start; }
.sim-side { position: sticky; top: 64px; }
.sim-side .sim-head b { font-size: 13.5px; }
.sim-side .table th:first-child, .sim-side .table td:first-child { padding-left: 4px; }
.sim-side .table th:last-child, .sim-side .table td:last-child { padding-right: 4px; }
.sim-side .table td { white-space: normal; }
@media (max-width: 1100px) { .split-layout { grid-template-columns: 1fr; } .sim-side { position: static; } }
/* narrower split editor, wider "Try it" */
.split-layout { grid-template-columns: minmax(0,1.15fr) minmax(400px,1fr); }
.split-layout .split-cols, .split-layout .split-head { grid-template-columns: minmax(0,1fr) 84px 118px 50px 28px !important; gap: 6px; }
.split-layout .split-party { padding: 7px 9px; }
.split-layout .split-head select, .split-layout .split-head input { height: 32px; font-size: 12.5px; }
.split-layout .split-max { font-size: 11.5px; line-height: 1.25; }
.split-layout .side-group { padding: 9px; }
.split-layout .side-title { margin-bottom: 6px; }
.split-layout .side-title .muted { display: none; }
.split-layout .tier-row { grid-template-columns: auto 130px auto 74px 26px; font-size: 12.5px; }
.split-layout [data-split-total] { font-size: 12px; }
@media (max-width: 1100px) { .split-layout { grid-template-columns: 1fr; } }

/* ---- split editor: US End and BD End as separate cards ---- */
.split-party .tier-add { margin-top: 6px; font-size: 12px; }
.tier-toggle.none { opacity: .55; filter: grayscale(1); }
.tier-toggle.none:hover { opacity: 1; filter: none; }
.split-party.tiers-open .tier-toggle { opacity: 1; filter: none; outline: 2px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.side-card2 { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.side-card2 .sc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.side-card2 .sc-head b { font-size: 14px; }
.side-card2 .sc-sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.side-card2 .sc-body { padding: 8px 10px 4px; }
.side-card2 .sc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px 10px; }
.side-card2.side-us { border-color: color-mix(in srgb, var(--gold) 35%, var(--border)); }
.side-card2.side-us .sc-head { background: linear-gradient(90deg, var(--gold-soft), var(--surface)); box-shadow: inset 4px 0 0 var(--gold); }
.side-card2.side-us .sc-head b, .side-card2.side-us .side-sum { color: var(--gold); }
.side-card2.side-bd { border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.side-card2.side-bd .sc-head { background: linear-gradient(90deg, var(--brand-soft), var(--surface)); box-shadow: inset 4px 0 0 var(--brand); }
.side-card2.side-bd .sc-head b, .side-card2.side-bd .side-sum { color: var(--brand-ink); }
.side-card2.side-us .sc-save { background: linear-gradient(180deg, #14a294, var(--gold)); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--gold) 70%, transparent); }
.side-card2 .split-party { background: var(--surface-2); }
.split-summary { display: flex; align-items: center; gap: 8px; }
.split-note { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.split-note b { color: var(--text); }
.span-opts { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); gap: 6px; }
.span-opts[hidden] { display: none; }
.span-tag { display: inline-block; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 600; background: var(--brand-soft); color: var(--brand-ink); vertical-align: 1px; white-space: nowrap; }
.lines-tbl .add-line-row td { padding: 6px 16px !important; background: var(--surface); }
.lines-tbl .add-line-row .link-btn { margin: 0; }
.lines-tbl .add-line-row td { overflow: visible; }
.add-line-save { float: right; display: inline-flex; align-items: center; gap: 8px; }
.add-line-save[hidden] { display: none; }
