/* AnB Office design system. Every colour is a CSS variable so light and dark mode stay consistent. */
:root {
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --surface-3: #EEF1F5;
  --text: #16213A;
  --text-2: #334058;
  --muted: #5F6B80;
  --border: #E1E5EC;
  --border-strong: #C9D0DB;
  --primary: #1B2D5E;
  --primary-hover: #24396F;
  --primary-text: #FFFFFF;
  --accent: #C9A84C;
  --accent-text: #14243F;
  --accent-soft: rgba(201, 168, 76, 0.14);
  --focus: rgba(201, 168, 76, 0.45);
  --danger: #C0392B;
  --danger-soft: #FDECEA;
  --success: #1E7E45;
  --success-soft: #E7F6EC;
  --warning: #9A6700;
  --warning-soft: #FFF5DB;
  --info: #1F5FA8;
  --info-soft: #E8F0FB;
  --slate-soft: #EEF1F5;
  --slate: #4A5568;
  --sidebar: #14243F;
  --sidebar-text: rgba(255, 255, 255, 0.78);
  --sidebar-active: rgba(255, 255, 255, 0.1);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --cat-aset-bg: #E3EEFC; --cat-aset-fg: #1D4F91;
  --cat-liab-bg: #FBE6E6; --cat-liab-fg: #9B2C2C;
  --cat-ekuitas-bg: #E3F4EA; --cat-ekuitas-fg: #1E6B3C;
  --cat-pend-bg: #FFF4CC; --cat-pend-fg: #7A5A00;
  --cat-beban-bg: #FDEBDC; --cat-beban-fg: #9A4A10;
  --chart-in: #1E7E45;
  --chart-out: #C9A84C;
  --radius: 8px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0F1729;
  --surface: #17223B;
  --surface-2: #1C2945;
  --surface-3: #22314F;
  --text: #E7EBF3;
  --text-2: #C9D1E0;
  --muted: #9BA7BE;
  --border: #2A3A5C;
  --border-strong: #3A4C72;
  --primary: #C9A84C;
  --primary-hover: #D8B95E;
  --primary-text: #14243F;
  --accent: #C9A84C;
  --accent-text: #14243F;
  --accent-soft: rgba(201, 168, 76, 0.16);
  --focus: rgba(201, 168, 76, 0.5);
  --danger: #F07167;
  --danger-soft: rgba(240, 113, 103, 0.14);
  --success: #5FD08A;
  --success-soft: rgba(95, 208, 138, 0.13);
  --warning: #F2C14E;
  --warning-soft: rgba(242, 193, 78, 0.14);
  --info: #79A8F0;
  --info-soft: rgba(121, 168, 240, 0.14);
  --slate-soft: rgba(155, 167, 190, 0.14);
  --slate: #B8C2D6;
  --sidebar: #0B1222;
  --sidebar-text: rgba(231, 235, 243, 0.75);
  --sidebar-active: rgba(201, 168, 76, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  --cat-aset-bg: rgba(121, 168, 240, 0.16); --cat-aset-fg: #9CC0F5;
  --cat-liab-bg: rgba(240, 113, 103, 0.16); --cat-liab-fg: #F5A39C;
  --cat-ekuitas-bg: rgba(95, 208, 138, 0.15); --cat-ekuitas-fg: #8FDDAD;
  --cat-pend-bg: rgba(242, 193, 78, 0.16); --cat-pend-fg: #F4D27E;
  --cat-beban-bg: rgba(240, 160, 90, 0.16); --cat-beban-fg: #F3B98A;
  --chart-in: #5FD08A;
  --chart-out: #C9A84C;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; color: var(--text); line-height: 1.3; }
p { margin: 0; }
img { max-width: 100%; }
code { font-size: 0.9em; background: var(--surface-3); padding: 0.1em 0.35em; border-radius: 4px; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 15px; height: 15px; flex: none; }
.ic-lg { width: 28px; height: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.break { overflow-wrap: anywhere; }
.text-danger { color: var(--danger); } .text-success { color: var(--success); } .text-warning { color: var(--warning); }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .items-start { align-items: flex-start; } .justify-between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.min-w-0 { min-width: 0; } .w-auto { width: auto; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2, .cols-3, .cols-4, .cols-5, .cols-6 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .cols-2, .cols-4, .cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3, .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.span-2 { grid-column: 1 / -1; }
@media (min-width: 1024px) { .layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; } }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 264px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; }
.sb-open .sidebar { transform: none; }
.sb-backdrop { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(5, 10, 20, 0.55); }
.sb-open .sb-backdrop { display: block; }
@media (min-width: 1024px) { .sidebar { position: sticky; top: 0; height: 100vh; transform: none; flex: none; } .sb-close, .menu-btn { display: none !important; } .sb-backdrop { display: none !important; } }
.sb-brand { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sb-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2; }
.sb-logo img { height: 36px; width: auto; }
.sb-logo small { display: block; font-weight: 400; font-size: 11px; color: rgba(255, 255, 255, 0.55); }
.sb-close { color: rgba(255, 255, 255, 0.7); border-color: transparent; background: transparent; }
.sb-nav { padding: 8px 10px 24px; }
.sb-heading { margin: 16px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.42); }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--sidebar-text); transition: background .15s, color .15s; }
.sb-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sb-link.is-active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sb-link .ic { width: 17px; height: 17px; opacity: .9; }
.sb-count { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .topbar { padding: 0 24px; } }
.topbar-title { font-weight: 600; font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.entity-switch { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 340px; flex: 1 1 auto; }
.entity-switch select { min-width: 0; width: 100%; }
.user-chip { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px 4px 4px; border-radius: 999px; }
.user-chip:hover { background: var(--surface-3); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.user-text { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
@media (max-width: 767px) { .user-text, .hide-sm { display: none; } }
.content { padding: 20px 16px 48px; width: 100%; max-width: 1320px; margin: 0 auto; }
@media (min-width: 768px) { .content { padding: 28px 24px 56px; } }
.when-dark { display: none; } [data-theme="dark"] .when-dark { display: inline-flex; } [data-theme="dark"] .when-light { display: none; }

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-title { font-size: 21px; font-weight: 700; }
.page-sub { color: var(--muted); margin-top: 2px; font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 18px; }
@media (min-width: 768px) { .card-pad { padding: 20px 22px; } }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 600; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-left: 4px solid var(--border-strong); transition: box-shadow .15s, transform .15s; }
a.stat:hover, .stat.hoverable:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.stat.c-aset { border-left-color: var(--cat-aset-fg); } .stat.c-liab { border-left-color: var(--cat-liab-fg); } .stat.c-ekuitas { border-left-color: var(--cat-ekuitas-fg); }
.stat.c-pend { border-left-color: var(--cat-pend-fg); } .stat.c-beban { border-left-color: var(--cat-beban-fg); } .stat.c-accent { border-left-color: var(--accent); }
.stat.c-danger { border-left-color: var(--danger); } .stat.c-warning { border-left-color: var(--warning); } .stat.c-success { border-left-color: var(--success); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border-radius: 6px; border: 1px solid transparent; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; }
.btn:focus-visible, .input:focus, .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
[data-theme="dark"] .btn-danger, [data-theme="dark"] .btn-success { color: #0F1729; }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.input { width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:disabled, .input[readonly] { background: var(--surface-3); color: var(--muted); }
select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }
select.input option { background: var(--surface); color: var(--text); }
textarea.input { min-height: 84px; resize: vertical; }
.input-sm { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--danger); }
.hint { font-size: 11.5px; color: var(--muted); }
.field-inline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-inline .input { width: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.custom-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.custom-range .input { width: auto; }
.search { position: relative; display: block; flex: 1 1 220px; max-width: 340px; }
.search .input, .search input { width: 100%; min-height: 36px; padding: 6px 10px 6px 34px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.search-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.seg a, .seg button { padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 0; border-right: 1px solid var(--border); cursor: pointer; font-family: inherit; }
.seg a:last-child, .seg button:last-child { border-right: 0; }
.seg .on { background: var(--primary); color: var(--primary-text); }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions > * { vertical-align: middle; }
.table .actions form { display: inline; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border-strong); }
.table .row-section td { background: var(--surface-3); font-weight: 700; }
.table .row-total td { font-weight: 700; border-top: 2px solid var(--border-strong); }
.table .row-subtotal td { font-weight: 600; }
.table .indent { padding-left: 28px; }
.table tr.is-hidden { display: none; }
.td-wrap { min-width: 180px; max-width: 420px; overflow-wrap: anywhere; }
.sortable th[data-sort] { cursor: pointer; }
.sortable th[data-sort]::after { content: " \2195"; opacity: .4; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge-green { background: var(--success-soft); color: var(--success); } .badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-amber { background: var(--warning-soft); color: var(--warning); } .badge-blue { background: var(--info-soft); color: var(--info); }
.badge-slate { background: var(--slate-soft); color: var(--slate); } .badge-gold { background: var(--accent-soft); color: var(--accent); }
[data-theme="light"] .badge-gold, :root:not([data-theme]) .badge-gold { color: #7A5A00; }
.badge-cat-aset { background: var(--cat-aset-bg); color: var(--cat-aset-fg); } .badge-cat-liab { background: var(--cat-liab-bg); color: var(--cat-liab-fg); }
.badge-cat-ekuitas { background: var(--cat-ekuitas-bg); color: var(--cat-ekuitas-fg); } .badge-cat-pend { background: var(--cat-pend-bg); color: var(--cat-pend-fg); }
.badge-cat-beban { background: var(--cat-beban-bg); color: var(--cat-beban-fg); }

/* ---------- alerts, empty, tabs ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 6px; font-size: 13px; border: 1px solid transparent; }
.alert-info { background: var(--info-soft); color: var(--info); } .alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-danger { background: var(--danger-soft); color: var(--danger); } .alert-success { background: var(--success-soft); color: var(--success); }
.alert .ic { margin-top: 1px; }
.alert p, .alert div { color: inherit; }
.empty { text-align: center; padding: 40px 20px; }
.empty-ic { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.empty-title { margin-top: 12px; font-weight: 600; font-size: 15px; }
.empty-text { margin-top: 4px; color: var(--muted); font-size: 13px; max-width: 420px; margin-left: auto; margin-right: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; font-family: inherit; }
.tabs .on { color: var(--text); border-bottom-color: var(--accent); }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- modal & toast ---------- */
.modal { border: 0; padding: 0; border-radius: 10px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(5, 10, 20, 0.6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.confirm-text { font-size: 14px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); border: 1px solid var(--border); border-left: 4px solid var(--success); font-size: 13px; opacity: 0; transform: translateY(8px); transition: all .25s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-left-color: var(--danger); } .toast.info { border-left-color: var(--info); }
.toast .ic { color: var(--success); } .toast.error .ic { color: var(--danger); } .toast.info .ic { color: var(--info); }

/* ---------- searchable select ---------- */
.ss { position: relative; width: 100%; min-width: 0; }
.ss-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.ss-btn .ss-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-btn .placeholder { color: var(--muted); }
.ss-pop { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 240px; }
.ss-pop input { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.ss-list { max-height: 240px; overflow-y: auto; margin-top: 6px; }
.ss-opt { padding: 7px 9px; border-radius: 5px; font-size: 13px; cursor: pointer; color: var(--text); overflow-wrap: anywhere; }
.ss-opt:hover, .ss-opt.active { background: var(--accent-soft); }
.ss-opt.selected { font-weight: 600; }
.ss-empty { padding: 10px; color: var(--muted); font-size: 12.5px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .bar-in { fill: var(--chart-in); } .chart .bar-out { fill: var(--chart-out); } .chart .bar-one { fill: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- auth page ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--sidebar); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 10px; border-top: 4px solid var(--accent); padding: 26px; box-shadow: var(--shadow-lg); }

/* ---------- misc ---------- */
.lines-table td { vertical-align: middle; }
.lines-table .input { min-width: 110px; }
.balance-ok { color: var(--success); font-weight: 600; } .balance-no { color: var(--danger); font-weight: 600; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
@media print { .sidebar, .topbar, .page-actions, .filter-bar, .toasts { display: none !important; } .content { padding: 0; } body { background: #fff; } }
.exp-ic { display: inline-flex; transition: transform .15s; color: var(--muted); }
tr.is-open .exp-ic { transform: rotate(90deg); }
.table .sub-row td { background: var(--surface-2); }
.inv-items .input { min-width: 90px; }
.inv-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; font-size: 13.5px; max-width: 380px; margin-left: auto; }
.inv-totals dt { color: var(--muted); } .inv-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.inv-totals .grand { font-size: 15px; color: var(--text); font-weight: 700; padding-top: 6px; border-top: 1px solid var(--border-strong); }
@media (min-width: 640px) { .col-wide { grid-column: span 2; } }
.custom-dates { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 100%; }
.custom-dates.hidden { display: none; }
.custom-dates .input, .custom-range .input { width: 150px; max-width: 100%; }
.field > span.hint { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.input.w-auto, .filter-bar select.input { width: auto; max-width: 100%; }
.filter-bar .ss { width: auto; min-width: 200px; max-width: 300px; }
.field-inline .input { font-weight: 400; }
