/* Billants UI - own design system (built on Bootstrap 5 grid/utilities only) */
:root {
    --bp: #5b3df5;          /* brand violet */
    --bp-2: #8b5cf6;
    --bp-soft: #efecff;
    --ink: #1b1f3a;
    --muted: #6b7190;
    --line: #e6e8f2;
    --bg: #f4f5fb;
    --card: #ffffff;
    --sb-bg: #11132b;
    --sb-ink: #b8bdd9;
    --sb-line: rgba(255, 255, 255, .08);
    --sb-w: 224px;
    --sb-w-mini: 68px;
    --top-h: 60px;
    --radius: 7px;
    --shadow: 0 1px 2px rgba(20, 24, 60, .05), 0 4px 14px rgba(20, 24, 60, .04);
    --bs-primary: #5b3df5;
    --bs-primary-rgb: 91, 61, 245;
    --bs-link-color: #5b3df5;
    --bs-link-color-rgb: 91, 61, 245;
    --bs-link-hover-color: #4529d6;
    --bs-body-font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-color: #1b1f3a;
    --bs-body-bg: #f4f5fb;
    --bs-border-color: #e6e8f2;
    --bs-border-radius: 5px;
    --bs-border-radius-lg: 7px;
    --bs-success: #12a150;
    --bs-danger: #e5484d;
    --bs-warning: #f5a524;
    --bs-info: #0ea5e9;
}
[data-bs-theme="dark"] {
    --ink: #e8eaf8; --muted: #9aa0c0; --line: #2a2e4d; --bg: #0c0e22; --card: #151834; --bp-soft: #26225a;
    --sb-bg: #0a0c1d; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --bs-body-color: #e8eaf8; --bs-body-bg: #0c0e22; --bs-border-color: #2a2e4d;
    --bs-link-color: #a99bff; --bs-link-color-rgb: 169, 155, 255;
}

* { -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
.text-muted, .muted { color: var(--muted) !important; }
.fs-10{font-size:10px!important}.fs-11{font-size:11px!important}.fs-12{font-size:12px!important}.fs-13{font-size:13px!important}.fs-14{font-size:14px!important}
.fs-15{font-size:15px!important}.fs-16{font-size:16px!important}.fs-18{font-size:18px!important}.fs-20{font-size:20px!important}.fs-22{font-size:22px!important}.fs-24{font-size:24px!important}
.fs-26{font-size:26px!important}.fs-28{font-size:28px!important}.fs-32{font-size:32px!important}
.fw-medium { font-weight: 550 !important; }
::selection { background: rgba(91, 61, 245, .2); }
::-webkit-scrollbar { width: 9px; height: 9px; } ::-webkit-scrollbar-thumb { background: #c9cce0; border-radius: 4.5px; } [data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: #353a63; }

/* ---------- shell ---------- */
.sb { position: fixed; inset: 0 auto 0 0; width: var(--sb-w); background: var(--sb-bg); color: var(--sb-ink); z-index: 1040; display: flex; flex-direction: column; transition: width .2s, transform .25s; }
.sb-top { height: var(--top-h); display: flex; align-items: center; padding: 0 18px; justify-content: flex-start; border-bottom: 1px solid var(--sb-line); flex: none; }
.sb-brand { display: flex; align-items: center; }
.sb-brand .logo-full { height: 30px; width: auto; }
.sb-brand .logo-mini { display: none; height: 30px; width: auto; }
.sb-scroll { flex: 1; overflow-y: auto; padding: 10px 10px 24px; scrollbar-width: thin; scrollbar-color: #343862 transparent; }
.sb-group { margin: 0; }
.sb-parent { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; font: inherit; font-weight: 500; }
.sb-parent .sb-chev { margin-left: auto; font-size: 15px !important; opacity: .6 !important; transition: transform .2s; }
.sb-group.open > .sb-parent { color: #fff; }
.sb-group.open > .sb-parent .sb-chev { transform: rotate(180deg); }
.sb-sub { display: none; margin: 1px 0 6px 21px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .13); }
.sb-group.open > .sb-sub { display: block; }
.sb-sub .sb-link { padding: 6px 10px; font-size: 13px; font-weight: 450; margin: 0; }
.sb-sub .sb-link.active::before { left: -11px; top: 6px; bottom: 6px; }.sb-link { display: flex; align-items: center; gap: 11px; padding: 8px 12px; margin: 1px 0; color: var(--sb-ink); border-radius: 4.5px; font-weight: 500; position: relative; }
.sb-link .bi, .sb-link .isax { font-size: 18px; opacity: .85; }
.sb-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-link.active { background: linear-gradient(90deg, rgba(139, 92, 246, .30), rgba(91, 61, 245, .12)); color: #fff; }
.sb-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #a78bfa; }
.sb-link .sb-badge { margin-left: auto; font-size: 10px; background: #f5a524; color: #1b1f3a; border-radius: 20px; padding: 1px 7px; font-weight: 700; }
.sb-foot { padding: 12px 14px; border-top: 1px solid var(--sb-line); font-size: 12px; color: #6f759c; flex: none; }
.sb-foot kbd { background: #23274d; color: #cfd3f2; border: 0; font-size: 11px; }

.topbar { position: fixed; top: 0; left: var(--sb-w); right: 0; height: var(--top-h); background: var(--card); border-bottom: 1px solid var(--line); z-index: 1030; display: flex; align-items: center; gap: 10px; padding: 0 22px; transition: left .2s; }
.main { margin-left: var(--sb-w); padding-top: var(--top-h); min-height: 100vh; transition: margin .2s; display: flex; flex-direction: column; }
.content { padding: 16px 20px 26px; max-width: none; width: 100%; flex: 1; }
.app-foot { padding: 14px 24px 16px; margin-top: 8px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; border-top: 1px solid var(--line); line-height: 1.4; }
.app-foot .af-l { display: flex; align-items: center; gap: 10px; }
.app-foot .af-l b { color: var(--ink); font-weight: 700; letter-spacing: .01em; }
.app-foot .af-ver { background: var(--bp-soft); color: var(--bp); border-radius: 999px; padding: 1px 10px; font-weight: 600; font-size: 11px; }
.app-foot a { color: inherit; text-decoration: none; font-weight: 600; }
.app-foot a:hover { color: var(--bp); text-decoration: underline; }
@media (max-width: 575px) { .app-foot { justify-content: center; text-align: center; } }
body.sb-mini:not(.sb-peek) .sb { width: var(--sb-w-mini); }
body.sb-mini .topbar { left: var(--sb-w-mini); }
body.sb-mini .main { margin-left: var(--sb-w-mini); }
body.sb-mini:not(.sb-peek) .sb .sb-brand .logo-full { display: none; } body.sb-mini:not(.sb-peek) .sb .sb-brand .logo-mini { display: block; }
body.sb-mini:not(.sb-peek) .sb .sb-label, body.sb-mini:not(.sb-peek) .sb .sb-title span, body.sb-mini:not(.sb-peek) .sb .sb-foot, body.sb-mini:not(.sb-peek) .sb .sb-badge { display: none; }

body.sb-mini:not(.sb-peek) .sb .sb-top { justify-content: center; padding: 0; } body.sb-mini:not(.sb-peek) .sb .sb-link { justify-content: center; padding: 10px 0; } body.sb-mini:not(.sb-peek) .sb .sb-title { justify-content: center; padding: 8px 0 2px; }
body.sb-mini:not(.sb-peek) .sb .sb-title .bi-chevron-down { display: none; } body.sb-mini:not(.sb-peek) .sb .sb-sub, body.sb-mini:not(.sb-peek) .sb .sb-chev { display: none !important; }
.sb-scrim { display: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 5px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 19px; cursor: pointer; }
.icon-btn:hover { background: var(--bp-soft); color: var(--bp); }
.search-trigger { display: flex; align-items: center; gap: 10px; min-width: 280px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 7px 12px; color: var(--muted); cursor: pointer; }
.search-trigger:hover { border-color: var(--bp); }
.search-trigger kbd { margin-left: auto; }
kbd { background: var(--bp-soft); color: var(--bp); border-radius: 2.5px; padding: 1px 6px; font-size: 11px; font-weight: 600; font-family: inherit; border: 1px solid rgba(91, 61, 245, .15); }
.panel-pill { white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; background: var(--bp-soft); color: var(--bp); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--bp), var(--bp-2)); color: #fff; font-weight: 650; flex: none; }
.avatar-md { width: 36px; height: 36px; } .avatar-lg { width: 46px; height: 46px; font-size: 18px; } .avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.user-menu .dropdown-menu { min-width: 250px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--bp); } .crumbs .sep { opacity: .5; }

/* settings tabs */
.set-hub { margin-bottom: 18px; }
.set-hub h5 { margin: 0 0 10px; }
.set-tabs-wrap { position: relative; }
.set-arrow { position: absolute; top: 0; bottom: 1px; z-index: 2; width: 38px; border: 0; cursor: pointer; font-size: 26px; line-height: 1; color: var(--bp); }
.set-arrow[hidden] { display: none; }
.set-arrow.left { left: 0; background: linear-gradient(90deg, var(--card, #fff) 55%, transparent); text-align: left; padding-left: 6px; }
.set-arrow.right { right: 0; background: linear-gradient(270deg, var(--card, #fff) 55%, transparent); text-align: right; padding-right: 6px; }
.set-arrow:hover { color: var(--ink); }
.set-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.set-tabs a { display: flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--muted); font-weight: 550; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.set-tabs a:hover { color: var(--ink); }
.set-tabs a.active { color: var(--bp); border-bottom-color: var(--bp); }

/* ---------- components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 14px 18px; font-weight: 650; }
.card-footer { background: transparent; border-top: 1px solid var(--line); padding: 12px 18px; }
.card-body { padding: 18px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; color: var(--ink); }
.table > :not(caption) > * > * { padding: 11px 14px; border-bottom-color: var(--line); }
.table thead th, .thead-light th { background: var(--bg) !important; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: var(--bp-soft); --bs-table-accent-bg: transparent; }
.table-responsive { border-radius: var(--radius); }
.form-label { font-weight: 550; font-size: 13px; color: var(--ink); margin-bottom: 5px; }
.form-control, .form-select { border-radius: 5px; border-color: #d9dcec; padding: .5rem .75rem; background-color: var(--card); color: var(--ink); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { border-color: #353a63; }
.form-control:focus, .form-select:focus { border-color: var(--bp); box-shadow: 0 0 0 3px rgba(91, 61, 245, .15); background-color: var(--card); color: var(--ink); }
.form-control-sm, .form-select-sm { border-radius: 4px; padding: .3rem .6rem; }
.form-text { color: var(--muted); font-size: 12px; }
.btn { border-radius: 6px; font-weight: 550; font-size: 13.5px; line-height: 1.35; padding: .38rem .85rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-sm { padding: .25rem .6rem; border-radius: 5px; font-size: 12.5px; }
.btn-lg { padding: .55rem 1.2rem; border-radius: 6px; font-size: 14.5px; }
.btn-primary { background: var(--bp); border-color: var(--bp); --bs-btn-hover-bg: #4a2fe0; --bs-btn-hover-border-color: #4a2fe0; --bs-btn-active-bg: #4025c4; --bs-btn-active-border-color: #4025c4; --bs-btn-disabled-bg: var(--bp); --bs-btn-disabled-border-color: var(--bp); }
.btn-outline-primary { --bs-btn-color: var(--bp); --bs-btn-border-color: var(--bp); --bs-btn-hover-bg: var(--bp); --bs-btn-hover-border-color: var(--bp); --bs-btn-active-bg: var(--bp); }
.btn-light { background: var(--card); border-color: var(--line); color: var(--ink); } .btn-light:hover { background: var(--bp-soft); border-color: var(--bp-soft); color: var(--bp); }
.btn-bp { background: linear-gradient(90deg, var(--bp), var(--bp-2)); color: #fff; border: 0; } .btn-bp:hover { color: #fff; filter: brightness(1.07); }
.bg-primary-gradient { background: linear-gradient(90deg, var(--bp), var(--bp-2)) !important; }
.badge { font-weight: 600; padding: .38em .7em; border-radius: 20px; }
.bg-primary-subtle { background: var(--bp-soft) !important; } .text-primary { color: var(--bp) !important; }
.alert { border-radius: 6px; border: 0; padding: 11px 16px; }
.alert-success { background: #e7f8ef; color: #0c6b37; } .alert-danger { background: #fdecec; color: #a4262c; }
.alert-warning { background: #fff5e0; color: #8a5a00; } .alert-info { background: #e5f4fd; color: #0a5d86; }
[data-bs-theme="dark"] .alert-success { background: #12301f; color: #6fe3a1; } [data-bs-theme="dark"] .alert-danger { background: #3a1517; color: #ff9aa0; }
[data-bs-theme="dark"] .alert-warning { background: #382a0c; color: #ffcf7a; } [data-bs-theme="dark"] .alert-info { background: #0e2c3d; color: #7fd0f7; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(20, 24, 60, .14); padding: 6px; background: var(--card); }
.dropdown-item { border-radius: 4px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.dropdown-item:hover { background: var(--bp-soft); color: var(--bp); }
.dropdown-divider { border-color: var(--line); }
.page-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.page-title h6, .page-title h5, .content > .mb-3 > h6:first-child { font-size: 20px; font-weight: 700; }
.content > .mb-3 > h6.mb-0, .content > div.mb-3 > h6 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.stat-icon { width: 44px; height: 44px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.secret-box { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bp-soft); border: 1px dashed #b9a6ff; border-radius: 5px; padding: 10px 14px; }
.perm-grid th, .perm-grid td { text-align: center; vertical-align: middle; } .perm-grid th:first-child, .perm-grid td:first-child { text-align: left; }
.perm-grid .group-row td { background: var(--bg); font-weight: 650; text-align: left; }
.table-actions form { display: inline; }
.pagination .page-link { border-radius: 4px; margin: 0 2px; color: var(--ink); border-color: var(--line); background: var(--card); } .pagination .active .page-link { background: var(--bp); border-color: var(--bp); color: #fff; }
.accordion-item { background: var(--card); border-color: var(--line); } .accordion-button:not(.collapsed) { background: var(--bp-soft); color: var(--bp); box-shadow: none; }
.nav-tabs .nav-link.active, .nav-pills .nav-link.active { background: var(--bp); color: #fff; }
.bg-light { background: var(--bg) !important; }

/* clickable rows */
.table tbody tr.row-link { cursor: pointer; }
.table tbody tr.row-link:hover > * { background: var(--bp-soft); }

/* typeahead (party / account pickers) */
.pick { position: relative; }
.pick-list { position: absolute; z-index: 1060; left: 0; right: 0; min-width: 340px; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 12px 34px rgba(20, 24, 60, .18); max-height: 320px; overflow: auto; padding: 5px; display: none; }
.pick.open .pick-list { display: block; }
.pick-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.pick-item small { color: var(--muted); }
.pick-item.on, .pick-item:hover { background: var(--bp-soft); }
.pick-add { color: var(--bp); font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 4px 4px; }
.pick-empty { padding: 10px; color: var(--muted); }
.pick .pick-clear { position: absolute; right: 8px; top: 8px; border: 0; background: none; color: var(--muted); display: none; }
.pick.has-value .pick-clear { display: block; }

/* command palette + shortcuts */
.cmdk-back { position: fixed; inset: 0; background: rgba(12, 14, 34, .55); backdrop-filter: blur(3px); z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk-back.open { display: flex; }
.cmdk { width: min(640px, 92vw); background: var(--card); border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); overflow: hidden; }
.cmdk-in { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 20px; font-size: 16px; background: transparent; color: var(--ink); outline: 0; }
.cmdk-list { max-height: 52vh; overflow: auto; padding: 8px; }
.cmdk-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; font-weight: 650; }
.cmdk-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 5px; cursor: pointer; color: var(--ink); }
.cmdk-row.on { background: var(--bp-soft); color: var(--bp); }
.cmdk-row kbd { margin-left: auto; }
.cmdk-foot { padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; gap: 16px; }
.keys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; padding: 6px 22px 22px; }
.keys-grid div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.keys-grid h6 { grid-column: 1 / -1; margin: 14px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* dashboard tiles used across views */
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; align-items: center; gap: 14px; }
.kpi-label { color: var(--muted); font-size: 12.5px; }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

/* auth */
.auth-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(900px 500px at 80% -10%, #e4dcff 0%, transparent 60%), radial-gradient(700px 400px at 0% 100%, #efe9ff 0%, transparent 60%), var(--bg); }
.auth-box { width: min(440px, 100%); }
.auth-box.wide { width: min(660px, 100%); }
.auth-panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: 0 24px 60px rgba(60, 40, 170, .14); }
.auth-panel .card { border: 0; box-shadow: none !important; background: transparent; margin: 0; padding: 0 !important; }
.auth-panel .card-body { padding: 0; }
@media (max-width: 480px) { .auth-panel { padding: 22px 18px; } }
/* print preview helpers */
.tpl-card { border: 2px solid var(--line); border-radius: 7px; padding: 12px; cursor: pointer; background: var(--card); height: 100%; transition: border-color .15s, transform .15s; }
.tpl-card:hover { transform: translateY(-2px); }
.tpl-card.on { border-color: var(--bp); box-shadow: 0 0 0 3px rgba(91, 61, 245, .12); }
.tpl-thumb { background: #fff; border: 1px solid var(--line); border-radius: 4px; height: 150px; padding: 8px; overflow: hidden; position: relative; }
.tpl-thumb.wide { height: 110px; } .tpl-thumb.narrow { width: 62%; margin: 0 auto; }
.tpl-thumb i { display: block; height: 5px; border-radius: 3px; background: #d7dbea; margin-bottom: 5px; }

/* ---------- mobile ---------- */
@media (max-width: 991.98px) {
    .sb { transform: translateX(-100%); width: 280px; }
    body.sb-open .sb { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
    body.sb-open .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(12, 14, 34, .5); z-index: 1035; }
    .topbar, body.sb-mini .topbar { left: 0; padding: 0 12px; }
    .main, body.sb-mini .main { margin-left: 0; }
    .search-trigger { min-width: 0; flex: none; width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 5px; } .search-trigger span, .search-trigger kbd { display: none; }
    .content { padding: 16px 14px 26px; }
    .panel-pill { display: none; }
    body.sb-mini .sb { width: 280px; } body.sb-mini .sb .sb-brand .logo-full { display: block; } body.sb-mini .sb .sb-brand .logo-mini { display: none; } body.sb-mini .sb .sb-label, body.sb-mini .sb .sb-title span { display: initial; }
    body.sb-mini .sb .sb-link { justify-content: flex-start; padding: 8px 12px; }
    body.sb-mini .sb .sb-chev { display: inline-block !important; } body.sb-mini .sb .sb-group.open > .sb-sub { display: block !important; } body.sb-mini .sb .sb-sub .sb-link { padding: 6px 10px; }
    .keys-grid { grid-template-columns: 1fr; }
}
@media print { .sb, .topbar, .app-foot, .set-hub, .crumbs, .no-print, .alert { display: none !important; } .main { margin: 0; padding: 0; } .content { padding: 0; max-width: none; } .card { box-shadow: none; border: 0; } body { background: #fff; } }

/* ---- compact, full-width layout (space utilisation) ---- */
.card { margin-bottom: 14px; }
.card-body { padding: 14px 16px; }
.card-header, .card-footer { padding: 10px 16px; }
.table > :not(caption) > * > * { padding: .5rem .7rem; }
.table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.table td { font-size: 13.5px; }
.table-hover tbody tr:hover { background: var(--bp-soft); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-row .st { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.stat-row .st small { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; display: block; }
.stat-row .st b { font-size: 19px; font-weight: 800; }
.form-label { font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }
.row.g-3 { --bs-gutter-y: .75rem; --bs-gutter-x: .9rem; }
.mb-3 { margin-bottom: .8rem !important; }
/* date cells stay on one line */
.table td.text-nowrap { white-space: nowrap; }

/* ---------- Organised layout (docs list + entry form) ---------- */
.dx-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.dx-head h6 { font-size: 20px; font-weight: 700; margin: 0; }
.dx-head .sub { color: var(--muted); font-size: 12.5px; }
.dx-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.dx-filter .lbl { font-weight: 600; font-size: 13px; margin-right: 4px; }
.dx-filter .form-control, .dx-filter .form-select { width: auto; font-size: 13px; padding: .3rem .6rem; height: 34px; }
.dx-filter .dx-q { min-width: 210px; }
.dx-filter .btn { height: 34px; }
.dx-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 12px; }
.dx-sumcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.dx-sumcard small { color: var(--muted); font-size: 12.5px; display: block; }
.dx-sumcard .amt { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.dx-sumcard .foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.dx-sumcard .foot b { color: var(--ink); }
.dx-txn { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.dx-txn-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dx-txn-h h6 { margin: 0; font-size: 15px; }
.dx-table thead th { background: var(--bg) !important; font-size: 11.5px; }
.dx-table td.num, .dx-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dx-table tbody tr:hover > * { background: var(--bp-soft); }
.dx-act { display: inline-flex; gap: 2px; justify-content: flex-end; }
.dx-act a { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; color: var(--muted); font-size: 16px; }
.dx-act a:hover { background: var(--bp-soft); color: var(--bp); }
.dx-empty { text-align: center; color: var(--muted); padding: 44px 0 !important; }

/* entry form: header block = party left, doc meta right */
.dx-top { display: grid; grid-template-columns: minmax(300px, 1.1fr) 1fr; gap: 20px; align-items: start; }
.dx-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--card); }
.dx-box > h6 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.dx-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; }
.dx-sec-t { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; margin: 0 0 8px; }
.dx-bottom { display: grid; grid-template-columns: 1fr minmax(340px, 440px); gap: 22px; align-items: start; margin-top: 16px; }
.dx-totals { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; }
.dx-totals .table { --bs-table-bg: transparent; }
.dx-totals .table td { border: 0; padding: .3rem 0; }
.dx-totals tr.grand td { border-top: 1px solid var(--line); padding-top: .55rem; font-size: 16px; font-weight: 700; }
.dx-foot { position: sticky; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(20, 24, 60, .06); border-radius: 0 0 var(--radius) var(--radius); }
#lines thead th { background: var(--bg) !important; border-top: 1px solid var(--line); }
@media (max-width: 991.98px) { .dx-top, .dx-bottom { grid-template-columns: 1fr; } }
.dx-meta > [class*="col-"] { width: auto; max-width: none; flex: none; padding: 0; }
.dx-filter .form-select { min-width: 130px; padding-right: 2rem; }

/* document list: status tabs, period chips, sortable headers, keyboard row */
.dx-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 12px; scrollbar-width: none; }
.dx-tabs a { display: flex; align-items: center; gap: 7px; padding: 9px 14px; color: var(--muted); font-weight: 550; font-size: 13.5px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dx-tabs a:hover { color: var(--ink); }
.dx-tabs a.on { color: var(--bp); border-bottom-color: var(--bp); }
.dx-tabs a span { background: var(--bp-soft); color: var(--bp); border-radius: 20px; padding: 0 8px; font-size: 11.5px; font-weight: 650; line-height: 19px; }
.dx-chip { padding: 3px 11px; border: 1px solid var(--line); border-radius: 5px; font-size: 12.5px; color: var(--muted); background: var(--card); white-space: nowrap; }
.dx-chip:hover { border-color: var(--bp); color: var(--bp); }
.dx-chip.on { background: var(--bp-soft); border-color: var(--bp); color: var(--bp); font-weight: 600; }
.dx-table th.dx-sort { cursor: pointer; user-select: none; }
.dx-table th.dx-sort:hover { color: var(--bp); }
.dx-table th[data-dir="asc"]::after { content: " \25B2"; font-size: 9px; }
.dx-table th[data-dir="desc"]::after { content: " \25BC"; font-size: 9px; }
.dx-table tbody tr.dx-sel > * { background: var(--bp-soft); box-shadow: inset 0 0 0 0 transparent; }
.dx-table tbody tr.dx-sel > :first-child { box-shadow: inset 3px 0 0 var(--bp); }

/* record payment */
.dx-pay { color: #12a150 !important; }
.dx-pay:hover { background: #e7f8ef !important; color: #0c6b37 !important; }
.dx-pay-sum { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.dx-pay-sum small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.dx-pay-sum b { font-size: 14px; word-break: break-word; }
.modal-content { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); }
.modal-header, .modal-footer { border-color: var(--line); }

/* icon-only buttons inside dx-act (delete forms) */
.dx-act form { display: inline-flex; margin: 0; }
.dx-act button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; border-radius: 5px; color: var(--muted); font-size: 16px; padding: 0; }
.dx-act button:hover { background: #fee2e2; color: #dc2626; }
.dx-tabs a span { margin-left: 2px; }


/* ---- internal tabs ---- */
#bk-tabs { position: sticky; top: var(--top-h); z-index: 25; display: flex; align-items: flex-end; gap: 4px; background: var(--bg); padding: 6px 20px 0; border-bottom: 1px solid var(--line); }
#bk-tabs .bk-wrap { display: flex; align-items: flex-end; gap: 4px; min-width: 0; max-width: 100%; }
#bk-tabs .bk-list { display: flex; gap: 3px; align-items: flex-end; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; }
.bk-tab { display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-bottom: 0; border-top: 2px solid transparent; border-radius: 8px 8px 0 0; background: var(--bg); color: var(--muted); font-size: 12.5px; font-weight: 550; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.bk-tab:hover { color: var(--ink); background: var(--card); }
.bk-tab.on { color: var(--bp); background: var(--card); border-top-color: var(--bp); }
.bk-tab .t { overflow: hidden; text-overflow: ellipsis; }
.bk-tab .x { width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; color: var(--muted); }
.bk-tab .x:hover { background: #fee2e2; color: #dc2626; }
.bk-add { border: 0; background: none; color: var(--muted); width: 28px; height: 26px; border-radius: 6px; font-size: 18px; line-height: 1; margin-bottom: 4px; }
.bk-add:hover { background: var(--bp-soft); color: var(--bp); }
#bk-frames { display: none; height: calc(100vh - var(--top-h) - 40px); }
#bk-frames iframe { width: 100%; height: 100%; border: 0; display: none; background: transparent; }
body.embed .sb, body.embed .sb-scrim, body.embed .topbar, body.embed .crumbs, body.embed .app-foot { display: none !important; }
body.embed .main { margin-left: 0 !important; padding-top: 0 !important; min-height: 0; }
body.embed .content { padding-top: 12px; }

/* text buttons inside dx-act (Approve / Pause / Disable ...) */
.dx-act .dx-t { width: auto; height: 28px; padding: 0 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 600; border-radius: 5px; text-decoration: none; }
.dx-act .dx-t:hover { background: var(--bp-soft); color: var(--bp); border-color: var(--bp); }
.dx-act .dx-t.ok { color: #15803d; border-color: #86efac; } .dx-act .dx-t.ok:hover { background: #dcfce7; color: #15803d; }
.dx-act .dx-t.no { color: #dc2626; border-color: #fca5a5; } .dx-act .dx-t.no:hover { background: #fee2e2; color: #dc2626; }
.dx-box { margin-bottom: 12px; }
.dx-box > h6 { margin-bottom: 8px; }

/* breadcrumb row with an optional right side (dashboard greeting) */
.crumbs { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.crumbs .crumb-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--ink); font-size: 13px; }
.crumbs .crumb-r b { font-size: 14.5px; font-weight: 700; }
.crumbs .crumb-r .sub { color: var(--muted); font-size: 12.5px; }
.crumbs .crumb-r form { display: flex; align-items: center; gap: 8px; margin: 0; }
.crumbs .crumb-r .form-select { height: 30px; padding: .15rem 1.8rem .15rem .6rem; font-size: 13px; }

/* no sideways page scroll anywhere; wide tables scroll inside their own box */
html { overflow-x: hidden; } body { overflow-x: clip; } .main, .content { min-width: 0; } /* hidden on <body> too would turn it into a scroll box and break every position:sticky (e.g. the print live preview) */
body.sb-peek .sb { box-shadow: 8px 0 30px rgba(0,0,0,.35); }

/* ---------- Settings: grouped navigation (no sideways scrolling) + tidy pages ---------- */
.set-hub { margin-bottom: 12px; }
.set-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 7px); padding: 8px 12px; }
.set-grp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-gl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; min-width: 0; }
.set-gi { display: flex; flex-wrap: wrap; gap: 3px; }
.set-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 5px; color: var(--ink); font-size: 13px; font-weight: 550; white-space: nowrap; }
.set-nav a .bi { font-size: 15px; opacity: .7; }
.set-nav a:hover { background: var(--bg); }
.set-nav a.active { background: var(--bp-soft); color: var(--bp); } .set-nav a.active .bi { opacity: 1; }
.set-nav .set-grp + .set-grp { border-left: 1px solid var(--line); padding-left: 16px; }
.set-pg { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
.set-pg > .s4 { grid-column: span 4; } .set-pg > .s5 { grid-column: span 5; } .set-pg > .s6 { grid-column: span 6; } .set-pg > .s7 { grid-column: span 7; } .set-pg > .s8 { grid-column: span 8; } .set-pg > .s12 { grid-column: span 12; }
.set-pg .dx-box { margin-bottom: 0; } .set-pg .dx-box > h6 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.set-pg .dx-tbl { width: 100%; font-size: 13px; } .set-pg .dx-tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; } .set-pg .dx-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.set-pg .dx-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.set-save { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 7px); box-shadow: 0 -6px 18px rgba(20, 24, 60, .07); margin-top: 12px; }
.set-body > .card, .set-body form > .card { margin-bottom: 12px; } .set-body .card-body { padding: 12px 14px; } .set-body .card-header { padding: 8px 14px; }
@media (max-width: 1100px) { .set-pg > * { grid-column: span 12 !important; } .set-nav .set-grp + .set-grp { border-left: 0; padding-left: 0; } }
@media (min-width: 1200px) { .set-body .row > .col-xl-7 { flex: 0 0 auto; width: 62%; } .set-body .row > .col-xl-5 { flex: 0 0 auto; width: 38%; } .set-body .row > .col-xl-8 { width: 70%; } .set-body .row > .col-xl-4 { width: 30%; } }
.set-body .card { border-radius: var(--radius, 7px); } .set-body .card-body > h6:first-child, .set-body .card-header { font-size: 12.5px; }
.set-body .form-label { font-size: 12.5px; margin-bottom: 3px; }

/* Settings: grouped menu on the left of the page, content on the right */
.set-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.set-side { position: sticky; top: calc(var(--top-h, 56px) + 12px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 7px); padding: 8px; max-height: calc(100vh - var(--top-h, 56px) - 28px); overflow-y: auto; }
.set-side-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.set-side .set-gl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 10px 8px 3px; }
.set-side a { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 5px; color: var(--ink); font-size: 13px; font-weight: 550; }
.set-side a .bi { font-size: 15px; opacity: .65; width: 16px; text-align: center; }
.set-side a:hover { background: var(--bg); }
.set-side a.active { background: var(--bp-soft); color: var(--bp); } .set-side a.active .bi { opacity: 1; }
@media (max-width: 991px) { .set-layout { grid-template-columns: 1fr; } .set-side { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; } .set-side-h, .set-side .set-gl { width: 100%; } }
.cs-two > .dx-box { display: flex; flex-direction: column; } .cs-two .dx-box .cs-grow { flex: 1; display: flex; flex-direction: column; } .cs-two .dx-box .cs-grow textarea { flex: 1; min-height: 70px; }
