:root {
    --bg:        #0a0a0f;
    --bg-2:      #101019;
    --panel:     #14141f;
    --panel-2:   #191926;
    --line:      #25253a;
    --line-soft: #1e1e2e;
    --text:      #e7e7f0;
    --muted:     #8a8aa3;
    --muted-2:   #5d5d77;
    --grad:      linear-gradient(120deg, #7c3aed 0%, #4f46e5 50%, #2563eb 100%);
    --grad-soft: linear-gradient(120deg, rgba(124,58,237,.18), rgba(37,99,235,.18));
    --violet:    #8b5cf6;
    --blue:      #3b82f6;
    --green:     #22c55e;
    --amber:     #f59e0b;
    --red:       #ef4444;
    --radius:    14px;
    --radius-sm: 9px;
    --shadow:    0 8px 30px rgba(0,0,0,.45);
    --font-display: 'Sora', system-ui, sans-serif;
    --font-body: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: radial-gradient(1200px 600px at 80% -10%, rgba(124,58,237,.10), transparent 60%), var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0; }

/* ---------- Auth screens ---------- */
.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: radial-gradient(900px 500px at 50% -10%, rgba(124,58,237,.18), transparent 60%), var(--bg);
}
.auth-card {
    width: 100%; max-width: 400px; background: var(--panel);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 34px 30px; box-shadow: var(--shadow);
}
.auth-brand {
    display: flex; align-items: center; gap: 10px; font-family: var(--font-display);
    font-weight: 700; font-size: 18px; margin-bottom: 26px;
}
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-card .muted { margin: 0 0 18px; }

/* ---------- Brand mark ---------- */
.brand-mark {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border-radius: 9px; background: var(--grad); color: #fff;
    font-family: var(--font-display); font-weight: 700; font-size: 18px;
    box-shadow: 0 4px 14px rgba(124,58,237,.4);
}

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--bg-2); border-right: 1px solid var(--line-soft);
    display: flex; flex-direction: column; padding: 20px 14px;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 16px; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-link {
    display: flex; align-items: center; gap: 11px; padding: 9px 11px;
    border-radius: var(--radius-sm); color: var(--muted); font-weight: 500;
    transition: .15s; position: relative;
}
.nav-link svg { flex-shrink: 0; opacity: .85; }
.nav-link:hover { background: var(--panel); color: var(--text); }
.nav-link.active { color: #fff; background: var(--grad-soft); }
.nav-link.active::before {
    content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--grad);
}
.nav-divider {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted-2); padding: 16px 11px 6px;
}

.sidebar-foot { display: flex; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.userbox { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.userbox-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.userbox-info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox-info small { color: var(--muted); font-size: 11px; }
.avatar {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; font-size: 12px; flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.logout { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.logout:hover { background: var(--panel); color: var(--red); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 22px 30px; border-bottom: 1px solid var(--line-soft);
    position: sticky; top: 0; background: rgba(10,10,15,.8); backdrop-filter: blur(12px); z-index: 10;
}
.topbar h1 { font-size: 21px; }
.content { padding: 26px 30px 60px; max-width: 1240px; width: 100%; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
    border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
    font-family: var(--font-body); font-weight: 600; font-size: 13.5px; transition: .15s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 16px rgba(79,70,229,.35); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--violet); }
.btn-danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }

/* ---------- Flash ---------- */
.flash { padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.flash-success { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.35); color: #86efac; }
.flash-error { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.35); color: #fca5a5; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 6px;
}
.stat-card.accent { background: var(--grad-soft); border-color: rgba(124,58,237,.4); }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.stat-sub { color: var(--muted); font-size: 12px; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel.no-pad { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 .panel { margin-bottom: 0; }
.grid-2 + .panel, .grid-2 + section { margin-top: 18px; }
.span-wide { grid-column: 1 / -1; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[onclick] { cursor: pointer; transition: background .12s; }
.table tbody tr[onclick]:hover { background: var(--panel-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.db { display: block; }
.small { font-size: 12px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.result-count { margin: -6px 0 14px; font-size: 13px; }

/* ---------- Stage chips ---------- */
.stage-chip {
    display: inline-block; padding: 3px 10px; border-radius: 30px; font-size: 11.5px;
    font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.st-lead  { background: rgba(148,163,184,.14); color: #cbd5e1; border-color: rgba(148,163,184,.3); }
.st-qual  { background: rgba(56,189,248,.14); color: #7dd3fc; border-color: rgba(56,189,248,.3); }
.st-uw    { background: rgba(139,92,246,.16); color: #c4b5fd; border-color: rgba(139,92,246,.35); }
.st-ts    { background: rgba(99,102,241,.16); color: #a5b4fc; border-color: rgba(99,102,241,.35); }
.st-dd    { background: rgba(245,158,11,.14); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.st-close { background: rgba(236,72,153,.16); color: #f9a8d4; border-color: rgba(236,72,153,.35); }
.st-won   { background: rgba(34,197,94,.16); color: #86efac; border-color: rgba(34,197,94,.35); }
.st-lost  { background: rgba(239,68,68,.14); color: #fca5a5; border-color: rgba(239,68,68,.3); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

/* ---------- Dashboard stage bars ---------- */
.stage-bars { display: flex; flex-direction: column; gap: 9px; }
.stage-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 12px; }
.stage-row:hover .stage-bar span { filter: brightness(1.15); }
.stage-bar { height: 8px; background: var(--panel-2); border-radius: 30px; overflow: hidden; }
.stage-bar span { display: block; height: 100%; background: var(--grad); border-radius: 30px; transition: width .4s; }
.stage-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Activity ---------- */
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.activity li { display: flex; gap: 11px; font-size: 13px; }
.activity .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); margin-top: 6px; flex-shrink: 0; }
.activity time { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 1px; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { flex: 1; min-width: 220px; }

/* ---------- Forms ---------- */
input, select, textarea {
    width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
    border-radius: var(--radius-sm); padding: 9px 12px; font-family: var(--font-body); font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,92,246,.18);
}
textarea { resize: vertical; }
.stack label, .form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--violet); margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.form-section:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid label { font-size: 12.5px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.checks legend { color: var(--violet); font-size: 12px; padding: 0 6px; }
.chk { flex-direction: row !important; align-items: center; gap: 7px !important; display: inline-flex !important; margin: 4px 14px 4px 0; color: var(--text) !important; }
.chk input { width: auto; }

/* ---------- Deal view ---------- */
.back { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.back:hover { color: var(--violet); }
.deal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.deal-head > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-stage select { width: auto; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin: 0; }
.kv.stacked { grid-template-columns: 1fr; gap: 13px; }
.kv dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.kv dd { margin: 0; font-weight: 500; }
.kv dd.big { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.deal-notes-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.deal-notes-block p { margin: 6px 0 0; color: var(--muted); white-space: pre-wrap; }

/* progress + docs */
.progress { height: 7px; background: var(--panel-2); border-radius: 30px; overflow: hidden; margin-bottom: 8px; }
.progress span { display: block; height: 100%; background: var(--grad); transition: width .4s; }
.progress-label { font-size: 12.5px; color: var(--muted); }
.progress-label .warn { color: var(--amber); margin-left: 8px; font-style: normal; }
.doc-table td { padding: 10px 16px; }
.doc-name .req { margin-left: 8px; font-size: 10.5px; color: var(--amber); text-transform: uppercase; letter-spacing: .04em; }
.doc-received .doc-name { color: var(--muted); }
.doc-na .doc-name { color: var(--muted-2); text-decoration: line-through; }
.doc-actions { text-align: right; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg-btn { background: var(--bg-2); border: 0; border-right: 1px solid var(--line); color: var(--muted); padding: 5px 11px; font-size: 12px; cursor: pointer; width: auto; font-family: var(--font-body); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--grad); color: #fff; }
.del-inline { display: inline-block; margin-left: 6px; }
.icon-btn { background: transparent; border: 0; color: var(--muted-2); cursor: pointer; font-size: 18px; width: auto; padding: 0 4px; }
.icon-btn:hover { color: var(--red); }
.add-row { display: flex; gap: 8px; margin-top: 14px; align-items: flex-start; }
.add-row input, .add-row textarea { flex: 1; }

/* notes */
.notes { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.notes li { display: flex; gap: 11px; }
.notes p { margin: 4px 0 0; white-space: pre-wrap; }
.note-meta { font-size: 12px; }
.note-meta time { color: var(--muted-2); margin-left: 8px; }

.danger-zone { margin-top: 20px; padding-top: 16px; }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 14px; overflow-x: auto; padding-bottom: 16px; }
.board-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; }
.board-count { background: var(--panel-2); border-radius: 20px; padding: 1px 9px; font-size: 12px; color: var(--muted); }
.board-vol { font-size: 12px; color: var(--muted); margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
.board-cards { display: flex; flex-direction: column; gap: 9px; }
.deal-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; transition: .15s; }
.deal-card:hover { border-color: var(--violet); transform: translateY(-2px); }
.deal-card-amt { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.board-empty { color: var(--muted-2); text-align: center; padding: 16px 0; margin: 0; }

/* ---------- Misc ---------- */
.row-actions { white-space: nowrap; }
.row-actions a { color: var(--violet); font-size: 12.5px; margin-right: 12px; font-weight: 500; }
.row-actions a.del { color: var(--red); }
.inline-form { display: inline; }
.inline-form select { width: auto; padding: 5px 8px; font-size: 12.5px; }
.pw-reset summary { cursor: pointer; color: var(--violet); font-size: 12.5px; list-style: none; }
.pw-form { display: flex; gap: 6px; margin-top: 8px; }
.pw-form input { width: 150px; }
code { background: var(--bg-2); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; color: #c4b5fd; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .nav-divider { display: none; }
    .nav-link.active::before { display: none; }
    .sidebar-foot { border: 0; padding: 0; }
    .stat-grid, .form-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .content, .topbar { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 560px) {
    .stat-grid, .form-grid { grid-template-columns: 1fr; }
    .form-grid .span2 { grid-column: span 1; }
}

/* ---- File attachments (deal checklist) ---- */
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.file-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: 999px; padding: 3px 10px; font-size: 12px; max-width: 100%;
}
.file-chip a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file-chip a:hover { color: var(--violet); }
.file-chip small { color: var(--muted-2); }
.file-chip .file-del { display: inline; }
.file-chip .icon-btn { font-size: 14px; line-height: 1; }

.doc-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.upload-form { display: inline; position: relative; }
.upload-form input[type=file] {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; font-size: 0;
}
.upload-btn { position: relative; display: inline-flex; }
.upload-btn .icon-btn { color: var(--violet); font-weight: 700; }
.upload-btn .icon-btn:hover { color: var(--blue); }
.upload-hint { font-size: 12px; margin: 10px 2px 0; }

/* ---- Lender matching ---- */
.match-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); padding: 6px 10px; }
.match-table td { padding: 10px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.match-why { color: var(--muted); font-size: 12.5px; max-width: 320px; }
.match-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px; font-size: 12px; margin-right: 4px;
    border: 1px solid var(--line);
}
.match-dot.ok { background: rgba(34,197,94,.15); color: var(--green); border-color: rgba(34,197,94,.4); }
.match-dot.no { background: var(--bg-2); color: var(--muted-2); }
.match-strong td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.match-partial td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.match-none { opacity: .62; }

/* ---- Audit trail + overdue ---- */
.file-chip .dl-count { color: var(--muted-2); border-left: 1px solid var(--line); padding-left: 7px; }
.overdue-banner { display: block; margin-bottom: 18px; }
.access-table { width: 100%; }
.access-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); padding: 6px 10px; }
.access-table td { padding: 8px 10px; border-top: 1px solid var(--line-soft); font-size: 13px; }

/* ---- Funding line tag + Manage lists ---- */
.tag-line { background: var(--grad-soft); border-color: rgba(124,58,237,.45); color: #c7bfff; }
.list-table td { padding: 6px 8px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.list-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); padding: 6px 8px; }
.list-table input[type="text"], .list-table select { width: 100%; }
.list-table input.mini { width: 60px; text-align: center; }
.list-table .center { text-align: center; }
.hidden-form { display: none; }
.add-list-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.add-list-row input[type="text"] { flex: 1; min-width: 200px; }
.add-list-row select { min-width: 200px; }

/* ===== Netrix Financial additions ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-card .value.pos { color: var(--green); } .stat-card .value.neg { color: var(--red); }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.report { max-width: 880px; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table td, .report-table th { padding: 7px 10px; }
.report-table .section-row td { font-family: var(--font-display); font-weight: 700; color: var(--text); border-bottom: 1px solid var(--line); padding-top: 16px; }
.report-table .acct-row td { border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.report-table .acct-row td.num { color: var(--text); }
.report-table .subtotal-row td { font-weight: 700; border-top: 2px solid var(--line); }
.report-table .total-row td { font-family: var(--font-display); font-weight: 700; font-size: 16px; border-top: 2px solid var(--violet); border-bottom: 3px double var(--violet); padding-top: 12px; padding-bottom: 12px; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.report-head h2 { font-family: var(--font-display); margin: 0; }
.report-sub { color: var(--muted); margin: 0 0 18px; }
.report-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.report-tabs a { padding: 7px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13px; }
.report-tabs a.on { background: var(--grad); color: #fff; border-color: transparent; }

.lines-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.lines-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); padding: 6px; }
.lines-table td { padding: 4px 6px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.lines-table input, .lines-table select { width: 100%; }
.lines-table input.num { text-align: right; }
.line-amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-totals { margin-top: 12px; margin-left: auto; width: 280px; }
.doc-totals .row { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted); }
.doc-totals .row.grand { border-top: 2px solid var(--line); margin-top: 6px; padding-top: 10px; color: var(--text); font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.balance-note { font-size: 13px; padding: 6px 10px; border-radius: 8px; display: inline-block; }
.balance-note.ok { background: rgba(34,197,94,.15); color: var(--green); }
.balance-note.bad { background: rgba(239,68,68,.15); color: var(--red); }
.status-chip { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.status-open { background: rgba(245,158,11,.18); color: var(--amber); }
.status-paid { background: rgba(34,197,94,.18); color: var(--green); }
.status-void { background: var(--bg-2); color: var(--muted-2); }
.status-overdue { background: rgba(239,68,68,.18); color: var(--red); }
.btn-sm.btn-danger { background: rgba(239,68,68,.15); color: var(--red); border-color: rgba(239,68,68,.3); }
.icon-btn.add-line { color: var(--violet); }
