/* 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: 256px;
    --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: 22px 24px 30px; max-width: 1480px; width: 100%; flex: 1; }
.app-foot { padding: 14px 24px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
body.sb-mini .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 .sb .sb-brand .logo-full { display: none; } body.sb-mini .sb .sb-brand .logo-mini { display: block; }
body.sb-mini .sb .sb-label, body.sb-mini .sb .sb-title span, body.sb-mini .sb .sb-foot, body.sb-mini .sb .sb-badge { display: none; }

body.sb-mini .sb .sb-top { justify-content: center; padding: 0; } body.sb-mini .sb .sb-link { justify-content: center; padding: 10px 0; } body.sb-mini .sb .sb-title { justify-content: center; padding: 8px 0 2px; }
body.sb-mini .sb .sb-title .bi-chevron-down { display: none; } body.sb-mini .sb .sb-sub, body.sb-mini .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: 5px; font-weight: 550; padding: .5rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-sm { padding: .3rem .7rem; border-radius: 4px; font-size: 13px; }
.btn-lg { padding: .7rem 1.4rem; border-radius: 6px; }
.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; } }
