/* ============ STG Billing System — premium admin UI ============ */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #1a1d23;
  --text-soft: #5b616e;
  --text-mute: #8b909c;
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --primary-soft: #eef2ff;
  --accent: #0f766e;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  --shadow-md: 0 4px 6px -1px rgba(16,24,40,.08), 0 12px 24px -4px rgba(16,24,40,.08);
  --sidebar-w: 256px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: #12141a; color: #c9cdd6;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 22px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 13.5px; color: #fff; }
.brand-text span { font-size: 11.5px; color: #7d828e; }
.nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: #a9adb8; margin-bottom: 2px; transition: .12s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2c2f3a; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.user-name { font-size: 13px; color: #e7e9ee; }
.logout { font-size: 12.5px; color: #8b909c; }
.logout:hover { color: #fff; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 12px 28px; }
.hamburger { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text-soft); }
.global-search { flex: 1; max-width: 460px; }
.global-search input { width: 100%; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px; background: var(--surface-2); }
.global-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
.quick-actions { display: flex; gap: 8px; margin-left: auto; }
.content { padding: 26px 28px 60px; max-width: 1400px; width: 100%; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--text-mute); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: .12s; white-space: nowrap; background: none; font-family: inherit; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--surface); border-color: var(--border-strong); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #fda29b; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-link { color: var(--primary); font-weight: 600; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.card-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: 14.5px; font-weight: 650; }

/* ---------- stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat .label { font-size: 12px; color: var(--text-mute); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 8px; letter-spacing: -.01em; }
.stat .meta { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
a.stat { display: block; transition: .12s; }
a.stat:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
a.stat .value { color: inherit; }
.stat .go { float: right; font-size: 12px; color: var(--text-mute); font-weight: 600; }
a.stat:hover .go { color: var(--primary); }
.stat.accent-green .value { color: var(--success); }
.stat.accent-red .value { color: var(--danger); }
.stat.accent-amber .value { color: var(--warn); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
table.data th { text-align: left; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-mute); font-weight: 600; white-space: nowrap; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .strong { font-weight: 650; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); cursor: pointer; font-size: 13px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); border-color: #fda29b; background: var(--danger-soft); }
.empty { text-align: center; padding: 54px 20px; color: var(--text-mute); }
.empty h3 { font-size: 15px; color: var(--text-soft); margin-bottom: 6px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #eef0f3; color: var(--text-soft); white-space: nowrap; }
.badge-draft { background: #f2f4f7; color: #475467; }
.badge-sent { background: var(--primary-soft); color: var(--primary); }
.badge-accepted, .badge-paid { background: var(--success-soft); color: var(--success); }
.badge-partially-paid { background: #fff4e5; color: var(--warn); }
.badge-rejected, .badge-cancelled, .badge-expired { background: #f2f4f7; color: #667085; }
.badge-overdue { background: var(--danger-soft); color: var(--danger); }
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-completed { background: var(--primary-soft); color: var(--primary); }
.badge-on-hold { background: var(--warn-soft); color: var(--warn); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea {
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13.5px;
  font-family: inherit; background: var(--surface); color: var(--text); width: 100%;
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .hint { font-size: 11.5px; color: var(--text-mute); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field .err { font-size: 11.5px; color: var(--danger); font-weight: 500; }
.form-section { margin-bottom: 24px; }
.form-section > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-mute); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }
.inline-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); }
.inline-check input { width: auto; }

/* ---------- line items ---------- */
.items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.items-table th { text-align: left; padding: 8px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-mute); border-bottom: 1px solid var(--border); }
.items-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.items-table input, .items-table select, .items-table textarea { padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 13px; width: 100%; font-family: inherit; }
.items-table textarea { min-height: 34px; resize: vertical; }
.items-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.items-table .line-amt { padding-top: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-remove { width: 34px; }
.totals-box { margin-left: auto; margin-top: 16px; width: 340px; max-width: 100%; }
.totals-box .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.totals-box .row.grand { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 700; }
.totals-box .row .val { font-variant-numeric: tabular-nums; }
.words-line { font-size: 12.5px; color: var(--text-soft); font-style: italic; margin-top: 8px; text-align: right; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 150px; gap: 4px; }
.filters .field label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-mute); }
.filters .field input, .filters .field select { padding: 7px 10px; font-size: 12.5px; }

/* ---------- alerts ---------- */
.alert { padding: 11px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.alert-success { background: var(--success-soft); border-color: #a6f4c5; color: var(--success); }
.alert-error { background: var(--danger-soft); border-color: #fda29b; color: var(--danger); }
.alert-info { background: var(--primary-soft); border-color: #c7d2fe; color: var(--primary); }
.alert-warn { background: var(--warn-soft); border-color: #fedf89; color: var(--warn); }

/* ---------- misc ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.muted { color: var(--text-mute); }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13px; }
.dl dt { color: var(--text-mute); font-weight: 500; }
.dl dd { color: var(--text); }
.tag-link { color: var(--primary); font-weight: 600; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.pill-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 18px; flex-wrap: wrap; }
.pill-tabs a { padding: 7px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.pill-tabs a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.pagination { display: flex; gap: 6px; margin-top: 16px; justify-content: flex-end; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 12.5px; background: var(--surface); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.doc-type-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.doc-type-card { display: block; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: .12s; }
.doc-type-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.doc-type-card .t { font-weight: 650; font-size: 14px; margin-bottom: 4px; }
.doc-type-card .d { font-size: 12px; color: var(--text-mute); }

/* icons (simple css shapes via unicode) */
.ico { width: 16px; height: 16px; display: inline-block; opacity: .9; background: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.ico-grid { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E"); }
.ico-file { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E"); }
.ico-wallet { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 12V7H5a2 2 0 0 1 0-4h14v4'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h16v-5'/%3E%3Cpath d='M18 12a2 2 0 0 0 0 4h4v-4z'/%3E%3C/svg%3E"); }
.ico-receipt { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M8 7h8M8 11h8M8 15h5'/%3E%3C/svg%3E"); }
.ico-ledger { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 3h18v18H3z'/%3E%3Cpath d='M3 9h18M9 21V9'/%3E%3C/svg%3E"); }
.ico-users { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.ico-folder { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.ico-download { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E"); }
.ico-cog { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E"); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 30% -10%, #1e293b, #0b0f1a); padding: 24px; }
.login-card { background: var(--surface); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.4); width: 100%; max-width: 400px; padding: 38px 36px; }
.login-card .brand-mark { width: 44px; height: 44px; border-radius: 10px; font-size: 16px; margin-bottom: 18px; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card p.sub { color: var(--text-mute); font-size: 13px; margin-bottom: 24px; }

/* ---------- dashboard analytics ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 14px; height: 172px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-stack { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.chart-stack .bar { width: 16px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s; }
.bar-billed, .dot-billed { background: #c7d2fe; }
.bar-recv, .dot-recv { background: var(--primary); }
.chart-x { font-size: 11px; color: var(--text-mute); font-weight: 600; }
.chart-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--text-soft); }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; }

.meter-row { margin-bottom: 12px; }
.meter-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.meter-top b { font-variant-numeric: tabular-nums; }
.meter { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 5px; min-width: 2px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 5px 9px; border-radius: 8px; }

.activity { display: flex; flex-direction: column; }
.act-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.act-row:last-child { border-bottom: 0; }
.act-row:hover { background: var(--surface-2); }
.act-ico { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--text-mute); }
.act-document { background: var(--primary); }
.act-payment { background: var(--success); }
.act-refund { background: var(--danger); }
.act-receipt { background: var(--warn); }
.act-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.act-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-sub { font-size: 11.5px; color: var(--text-mute); }
.act-amt { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- balance preview ---------- */
.balance-panel { position: sticky; top: 84px; }
.bal-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.bal-row.total { border-bottom: 0; border-top: 2px solid var(--text); margin-top: 4px; padding-top: 10px; font-size: 14px; }
.bal-row.total.ok strong { color: var(--danger); }
.bal-row.total.over strong { color: var(--danger); }
.bal-row strong { font-variant-numeric: tabular-nums; }
.bal-warn { margin-top: 10px; font-size: 12px; color: var(--danger); background: var(--danger-soft); padding: 8px 10px; border-radius: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stat-grid, .doc-type-cards { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: block; }
  .quick-actions { display: none; }
  .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 50px; }
  .topbar { padding: 10px 16px; }
}
@media (max-width: 560px) {
  .stat-grid, .doc-type-cards { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 19px; }
}
