/* ==========================================================================
   Ekam Cashbook design system (manager panel + staff app)
   Built on Bootstrap 5.3. Use the cb-* components; Bootstrap utilities are fine.
   ========================================================================== */

:root {
  --cb-primary: #1d3fc4;
  --cb-primary-600: #1733a6;
  --cb-primary-50: #eef2ff;
  --cb-primary-100: #dfe6ff;
  --cb-red: #d92d3a;
  --cb-red-50: #fdecee;
  --cb-green: #138a4b;
  --cb-green-50: #e8f6ee;
  --cb-amber: #b86e00;
  --cb-amber-50: #fff4e0;
  --cb-violet: #6b46c1;
  --cb-violet-50: #f2edfd;

  --cb-ink: #111a33;
  --cb-ink-2: #3d4766;
  --cb-muted: #6b7491;
  --cb-line: #e3e7f0;
  --cb-line-2: #eef1f6;
  --cb-bg: #f3f5fa;
  --cb-card: #ffffff;

  --cb-radius: 14px;
  --cb-radius-sm: 10px;
  --cb-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --cb-shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --cb-sidebar-w: 248px;
  --cb-topbar-h: 60px;
  --cb-bottomnav-h: 64px;

  --bs-primary: var(--cb-primary);
  --bs-primary-rgb: 29, 63, 196;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-color: var(--cb-ink);
  --bs-body-bg: var(--cb-bg);
  --bs-border-color: var(--cb-line);
  --bs-link-color: var(--cb-primary);
  --bs-link-color-rgb: 29, 63, 196;
  --bs-link-hover-color: var(--cb-primary-600);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--bs-body-font-family);
  background: var(--cb-bg);
  color: var(--cb-ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { color: var(--cb-ink); font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted, .cb-muted { color: var(--cb-muted) !important; }
.cb-num, .cb-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-credit { color: var(--cb-green) !important; }
.cb-debit { color: var(--cb-red) !important; }
.fw-600 { font-weight: 600 !important; }

/* ---------- Shell: sidebar + topbar + content ---------- */
.cb-shell { min-height: 100vh; }
.cb-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--cb-sidebar-w); z-index: 1040;
  background: #fff; border-right: 1px solid var(--cb-line);
  display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.cb-sidebar .cb-brand {
  height: var(--cb-topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid var(--cb-line-2);
}
.cb-brand img { height: 34px; width: auto; }
.cb-brand .cb-brand-sub { font-size: 11px; font-weight: 600; color: var(--cb-muted); text-transform: uppercase; letter-spacing: .08em; line-height: 1.1; }
.cb-nav { padding: 12px 10px 20px; overflow-y: auto; flex: 1; }
.cb-nav-label { font-size: 11px; font-weight: 600; color: var(--cb-muted); text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.cb-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 1px 0;
  border-radius: 10px; color: var(--cb-ink-2); font-weight: 500;
}
.cb-nav a i { width: 18px; text-align: center; color: var(--cb-muted); font-size: 15px; }
.cb-nav a:hover { background: var(--cb-line-2); color: var(--cb-ink); }
.cb-nav a.active { background: var(--cb-primary-50); color: var(--cb-primary); font-weight: 600; }
.cb-nav a.active i { color: var(--cb-primary); }
.cb-sidebar-foot { padding: 12px 14px; border-top: 1px solid var(--cb-line-2); font-size: 12px; color: var(--cb-muted); }

.cb-main { margin-left: var(--cb-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.cb-topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--cb-topbar-h);
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--cb-line);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.cb-topbar .cb-burger { display: none; }
.cb-topbar-title { font-weight: 700; font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cb-user { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid var(--cb-line); background: #fff; color: var(--cb-ink); }
.cb-user:hover { background: var(--cb-line-2); color: var(--cb-ink); }
.cb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--cb-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none; }
.cb-avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.cb-content { padding: 22px 24px 32px; flex: 1; width: 100%; max-width: 1480px; }
.cb-footer { padding: 14px 24px 22px; font-size: 12px; color: var(--cb-muted); }
.cb-footer a { color: var(--cb-muted); }
.cb-backdrop { display: none; }
.cb-bottomnav { display: none; }

@media (max-width: 991.98px) {
  .cb-sidebar { transform: translateX(-100%); box-shadow: var(--cb-shadow-lg); }
  body.cb-nav-open .cb-sidebar { transform: none; }
  body.cb-nav-open .cb-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
  .cb-main { margin-left: 0; }
  .cb-topbar { padding: 0 12px; }
  .cb-topbar .cb-burger { display: inline-flex; }
  .cb-content { padding: 14px 12px calc(var(--cb-bottomnav-h) + 22px); }
  .cb-footer { padding-bottom: calc(var(--cb-bottomnav-h) + 18px); }
  .cb-user .cb-user-name { display: none; }
  .cb-bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--cb-bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--cb-line);
  }
  .cb-bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--cb-muted); }
  .cb-bottomnav a i { font-size: 18px; }
  .cb-bottomnav a.active { color: var(--cb-primary); }
  .cb-bottomnav a.cb-fab i { width: 44px; height: 44px; border-radius: 50%; background: var(--cb-primary); color: #fff; display: flex; align-items: center; justify-content: center; margin-top: -18px; box-shadow: 0 6px 16px rgba(29, 63, 196, .35); }
}

/* ---------- Page header ---------- */
.cb-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 18px; }
.cb-page-head h1 { font-size: 22px; margin: 0; }
.cb-page-head .cb-sub { color: var(--cb-muted); font-size: 13.5px; margin-top: 2px; }
.cb-page-head .cb-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 575.98px) {
  .cb-page-head h1 { font-size: 19px; }
  .cb-page-head .cb-actions { margin-left: 0; width: 100%; }
  .cb-page-head .cb-actions > .btn { flex: 1 1 auto; }
}

/* ---------- Cards ---------- */
.cb-card { background: var(--cb-card); border: 1px solid var(--cb-line); border-radius: var(--cb-radius); box-shadow: var(--cb-shadow); margin-bottom: 18px; }
.cb-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 14px 18px; border-bottom: 1px solid var(--cb-line-2); }
.cb-card-head h2, .cb-card-head h3, .cb-card-title { font-size: 15px; font-weight: 700; margin: 0; }
.cb-card-head .cb-card-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.cb-card-body { padding: 18px; }
.cb-card-body.p-0 { padding: 0; }
.cb-card-foot { padding: 12px 18px; border-top: 1px solid var(--cb-line-2); }
@media (max-width: 575.98px) {
  .cb-card-head { padding: 12px 14px; }
  .cb-card-body { padding: 14px; }
}

/* ---------- Stat tiles ---------- */
.cb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cb-stat { background: #fff; border: 1px solid var(--cb-line); border-radius: var(--cb-radius); padding: 14px 16px; box-shadow: var(--cb-shadow); min-width: 0; }
.cb-stat .cb-stat-label { font-size: 12px; font-weight: 600; color: var(--cb-muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.cb-stat .cb-stat-value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cb-stat .cb-stat-note { font-size: 12px; color: var(--cb-muted); margin-top: 2px; }
.cb-stat.is-credit .cb-stat-value { color: var(--cb-green); }
.cb-stat.is-debit .cb-stat-value { color: var(--cb-red); }
.cb-stat.is-primary .cb-stat-value { color: var(--cb-primary); }
@media (max-width: 575.98px) {
  .cb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cb-stat { padding: 12px; }
  .cb-stat .cb-stat-value { font-size: 18px; }
}

/* ---------- Filters / toolbars ---------- */
.cb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cb-seg { display: inline-flex; background: var(--cb-line-2); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cb-seg::-webkit-scrollbar { display: none; }
.cb-seg a, .cb-seg button, .cb-seg label {
  border: 0; background: transparent; color: var(--cb-ink-2); font-weight: 600; font-size: 13px;
  padding: 6px 12px; border-radius: 8px; white-space: nowrap; cursor: pointer; margin: 0; line-height: 1.4;
}
.cb-seg a:hover, .cb-seg button:hover, .cb-seg label:hover { color: var(--cb-ink); background: rgba(255, 255, 255, .6); }
.cb-seg .active, .cb-seg input:checked + label { background: #fff; color: var(--cb-primary); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.cb-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cb-filter { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.cb-filter .cb-filter-actions { display: flex; gap: 8px; }
@media (max-width: 575.98px) { .cb-filter { grid-template-columns: 1fr 1fr; } .cb-filter .cb-filter-actions { grid-column: 1 / -1; } .cb-filter .cb-filter-actions .btn { flex: 1; } }

/* ---------- Tables ---------- */
.cb-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cb-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.cb-table th {
  background: #f7f8fc; color: var(--cb-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px; border-bottom: 1px solid var(--cb-line); white-space: nowrap; text-align: left; position: sticky; top: 0; z-index: 1;
}
.cb-table td { padding: 11px 14px; border-bottom: 1px solid var(--cb-line-2); vertical-align: middle; color: var(--cb-ink); }
.cb-table tbody tr:hover td { background: #fafbff; }
.cb-table tbody tr:last-child td { border-bottom: 0; }
.cb-table tfoot td { background: #f7f8fc; font-weight: 700; border-top: 1px solid var(--cb-line); padding: 11px 14px; }
.cb-table .text-end, .cb-table .cb-amount { text-align: right; }
.cb-table.cb-compact td, .cb-table.cb-compact th { padding: 7px 10px; }
.cb-table-sticky-first th:first-child, .cb-table-sticky-first td:first-child { position: sticky; left: 0; background: #fff; z-index: 2; box-shadow: 1px 0 0 var(--cb-line); }
.cb-table-sticky-first th:first-child { background: #f7f8fc; z-index: 3; }

/* Stack rows into cards on phones: add .cb-stack to the table and data-label="…" on each td */
@media (max-width: 767.98px) {
  .cb-table.cb-stack thead { display: none; }
  .cb-table.cb-stack, .cb-table.cb-stack tbody, .cb-table.cb-stack tr, .cb-table.cb-stack td { display: block; width: 100%; }
  .cb-table.cb-stack tr { border: 1px solid var(--cb-line); border-radius: 12px; margin: 0 0 10px; padding: 6px 0; background: #fff; }
  .cb-table.cb-stack td { border: 0; padding: 5px 14px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .cb-table.cb-stack td::before { content: attr(data-label); color: var(--cb-muted); font-size: 12px; font-weight: 600; text-align: left; flex: none; }
  .cb-table.cb-stack td[data-label=""]::before, .cb-table.cb-stack td:not([data-label])::before { content: none; }
  .cb-table.cb-stack tbody tr:hover td { background: transparent; }
  .cb-table.cb-stack tfoot { display: block; }
  .cb-table.cb-stack tfoot tr { display: flex; flex-wrap: wrap; border-radius: 12px; overflow: hidden; }
  .cb-table.cb-stack tfoot td { display: block; width: auto; flex: 1 1 auto; text-align: left; }
  .cb-stack-wrap { padding: 12px; }
}

/* ---------- Badges / chips ---------- */
.cb-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--cb-line-2); color: var(--cb-ink-2); }
.cb-badge.is-credit, .cb-badge.is-success { background: var(--cb-green-50); color: var(--cb-green); }
.cb-badge.is-debit, .cb-badge.is-danger { background: var(--cb-red-50); color: var(--cb-red); }
.cb-badge.is-primary, .cb-badge.is-app { background: var(--cb-primary-50); color: var(--cb-primary); }
.cb-badge.is-warning { background: var(--cb-amber-50); color: var(--cb-amber); }
.cb-badge.is-violet { background: var(--cb-violet-50); color: var(--cb-violet); }
.cb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.cb-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--cb-line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 500; color: var(--cb-ink-2); }
a.cb-chip:hover { border-color: var(--cb-primary); color: var(--cb-primary); }

/* ---------- Buttons (Bootstrap overrides) ---------- */
.btn { border-radius: 10px; font-weight: 600; font-size: 14px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; line-height: 1.35; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 18px; font-size: 16px; border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--cb-primary); --bs-btn-border-color: var(--cb-primary); --bs-btn-hover-bg: var(--cb-primary-600); --bs-btn-hover-border-color: var(--cb-primary-600); --bs-btn-active-bg: var(--cb-primary-600); --bs-btn-active-border-color: var(--cb-primary-600); --bs-btn-disabled-bg: var(--cb-primary); --bs-btn-disabled-border-color: var(--cb-primary); }
.btn-success { --bs-btn-bg: var(--cb-green); --bs-btn-border-color: var(--cb-green); --bs-btn-hover-bg: #0f7440; --bs-btn-hover-border-color: #0f7440; }
.btn-danger { --bs-btn-bg: var(--cb-red); --bs-btn-border-color: var(--cb-red); --bs-btn-hover-bg: #b9222e; --bs-btn-hover-border-color: #b9222e; }
.btn-light, .btn-soft { --bs-btn-bg: #fff; --bs-btn-color: var(--cb-ink-2); --bs-btn-border-color: var(--cb-line); --bs-btn-hover-bg: var(--cb-line-2); --bs-btn-hover-border-color: var(--cb-line); --bs-btn-hover-color: var(--cb-ink); --bs-btn-active-bg: var(--cb-line-2); background: #fff; border: 1px solid var(--cb-line); color: var(--cb-ink-2); }
.btn-soft-primary { background: var(--cb-primary-50); color: var(--cb-primary); border: 1px solid transparent; }
.btn-soft-primary:hover { background: var(--cb-primary-100); color: var(--cb-primary-600); }
.btn-soft-danger { background: var(--cb-red-50); color: var(--cb-red); border: 1px solid transparent; }
.btn-soft-danger:hover { background: #fbd9dc; color: #b9222e; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn:focus-visible, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 3px rgba(29, 63, 196, .18); }

/* ---------- Forms ---------- */
.form-label, .cb-label { font-size: 13px; font-weight: 600; color: var(--cb-ink-2); margin-bottom: 6px; display: block; }
.form-control, .form-select { border-radius: 10px; border-color: var(--cb-line); min-height: 40px; font-size: 14.5px; color: var(--cb-ink); background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--cb-primary); }
.form-control::placeholder { color: #9aa2ba; }
textarea.form-control { min-height: 80px; }
.form-text { color: var(--cb-muted); font-size: 12.5px; }
.form-check-input:checked { background-color: var(--cb-primary); border-color: var(--cb-primary); }
.invalid-feedback, .cb-error { color: var(--cb-red); font-size: 12.5px; margin-top: 4px; display: block; }
.cb-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.cb-form-grid .cb-span-2 { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .cb-form-grid { grid-template-columns: 1fr; } }
@media (max-width: 991.98px) { .form-control, .form-select { font-size: 16px; } } /* stops iOS zoom on focus */

/* Choice pills (radio groups like Store / Type / Category) */
.cb-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-choice { position: relative; margin: 0; }
.cb-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.cb-choice span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--cb-line); border-radius: 10px; background: #fff; font-weight: 600; font-size: 13.5px; color: var(--cb-ink-2); cursor: pointer; user-select: none; }
.cb-choice input:checked + span { border-color: var(--cb-primary); background: var(--cb-primary-50); color: var(--cb-primary); }
.cb-choice.is-credit input:checked + span { border-color: var(--cb-green); background: var(--cb-green-50); color: var(--cb-green); }
.cb-choice.is-debit input:checked + span { border-color: var(--cb-red); background: var(--cb-red-50); color: var(--cb-red); }
.cb-choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(29, 63, 196, .18); }

/* Typeahead dropdown (employee / vendor pickers) */
.cb-typeahead { position: relative; }
.cb-typeahead-menu, #employeeOptions, #vendorOptions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1060; max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid var(--cb-line); border-radius: 12px; box-shadow: var(--cb-shadow-lg); padding: 4px; display: none;
}
.cb-typeahead-menu > *, .employeeOptions, .vendorOptions { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cb-typeahead-menu > *:hover, .employeeOptions:hover, .vendorOptions:hover { background: var(--cb-primary-50); }
.role-type-employee, .role-type-vendor { font-size: 11.5px; font-weight: 600; margin-left: 4px; }
.role-type-employee { color: var(--cb-primary); }
.role-type-vendor { color: var(--cb-amber); }

/* ---------- Alerts / flash ---------- */
.cb-flash { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2000; width: min(520px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; }
.cb-flash .alert { margin: 0; box-shadow: var(--cb-shadow-lg); }
.alert { border-radius: 12px; border: 1px solid transparent; font-size: 14px; padding: 12px 14px; }
.alert-success { background: var(--cb-green-50); color: #0c5c32; border-color: #bfe6cf; }
.alert-danger { background: var(--cb-red-50); color: #9b1c26; border-color: #f6c5ca; }
.alert-warning { background: var(--cb-amber-50); color: #7a4800; border-color: #fbdca4; }
.alert-info { background: var(--cb-primary-50); color: var(--cb-primary-600); border-color: var(--cb-primary-100); }

/* ---------- Modals ---------- */
.modal-content { border: 0; border-radius: 16px; box-shadow: var(--cb-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--cb-line-2); padding: 14px 18px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 18px; }
.modal-footer { border-top: 1px solid var(--cb-line-2); padding: 12px 18px; }
@media (max-width: 575.98px) {
  .modal-dialog:not(.modal-fullscreen) { margin: 0; position: fixed; left: 0; right: 0; bottom: 0; max-width: none; }
  .modal.fade .modal-dialog:not(.modal-fullscreen) { transform: translateY(30px); }
  .modal.show .modal-dialog:not(.modal-fullscreen) { transform: none; }
  .modal-dialog:not(.modal-fullscreen) .modal-content { border-radius: 18px 18px 0 0; max-height: 92vh; overflow-y: auto; }
}

/* ---------- Misc ---------- */
.cb-empty { text-align: center; padding: 34px 16px; color: var(--cb-muted); }
.cb-empty i { font-size: 28px; color: #c1c7d8; display: block; margin-bottom: 8px; }
.cb-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-thumbs img, .cb-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--cb-line); background: var(--cb-line-2); cursor: zoom-in; }
.cb-list { list-style: none; margin: 0; padding: 0; }
.cb-list > li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--cb-line-2); }
.cb-list > li:last-child { border-bottom: 0; }
.cb-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.cb-kv dt { color: var(--cb-muted); font-weight: 500; }
.cb-kv dd { margin: 0; font-weight: 600; }
.cb-divider { height: 1px; background: var(--cb-line-2); margin: 14px 0; }
.cb-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pagination { gap: 4px; flex-wrap: wrap; }
.page-link { border-radius: 8px !important; border-color: var(--cb-line); color: var(--cb-ink-2); }
.page-item.active .page-link { background: var(--cb-primary); border-color: var(--cb-primary); }

/* ---------- Auth pages ---------- */
.cb-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #dfe6ff 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #fde4e6 0, transparent 55%), var(--cb-bg); }
.cb-auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--cb-line); border-radius: 20px; box-shadow: var(--cb-shadow-lg); padding: 30px 26px; }
.cb-auth-card .cb-auth-logo { height: 54px; display: block; margin: 0 auto 6px; }
.cb-auth-card h1 { font-size: 20px; text-align: center; margin: 14px 0 4px; }
.cb-auth-card .cb-sub { text-align: center; color: var(--cb-muted); font-size: 13.5px; margin-bottom: 22px; }
.cb-input-icon { position: relative; }
.cb-input-icon > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--cb-muted); pointer-events: none; }
.cb-input-icon > .form-control { padding-left: 38px; min-height: 46px; }
.cb-input-icon > .cb-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--cb-muted); width: 36px; height: 36px; border-radius: 8px; }
.cb-input-icon > .cb-eye:hover { background: var(--cb-line-2); }
@media (max-width: 575.98px) { .modal-dialog-centered:not(.modal-fullscreen) { min-height: 0; } }

/* ==========================================================================
   Visual refresh (2026-10-23): dark sidebar, softer surfaces, richer tiles
   ========================================================================== */
:root {
  --cb-bg: #f4f6fb;
  --cb-line: #e6e9f2;
  --cb-line-2: #f0f2f7;
  --cb-radius: 16px;
  --cb-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px -12px rgba(16, 24, 40, .12);
  --cb-shadow-hover: 0 2px 4px rgba(16, 24, 40, .05), 0 14px 30px -14px rgba(16, 24, 40, .22);
  --cb-nav-bg: #0e1a44;
  --cb-nav-bg-2: #142563;
  --cb-brand-red: #ef3b4a;
}
body { background: var(--cb-bg); letter-spacing: -.003em; }

/* Sidebar */
.cb-sidebar { background: linear-gradient(180deg, var(--cb-nav-bg) 0%, var(--cb-nav-bg-2) 100%); border-right: 0; }
.cb-sidebar .cb-brand { border-bottom: 1px solid rgba(255, 255, 255, .08); height: 68px; padding: 0 16px; }
.cb-brand-logo { background: #fff; border-radius: 12px; padding: 6px 10px; display: inline-flex; align-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.cb-brand-logo img { height: 30px; width: auto; }
.cb-sidebar .cb-brand-sub { color: rgba(255, 255, 255, .55); }
.cb-nav { padding: 10px 12px 18px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.cb-nav-label { color: rgba(255, 255, 255, .38); font-size: 10.5px; padding: 16px 12px 6px; }
.cb-nav a { color: rgba(255, 255, 255, .74); padding: 8px 12px; font-size: 14px; position: relative; transition: background .15s, color .15s; }
.cb-nav a i { color: rgba(255, 255, 255, .45); transition: color .15s; }
.cb-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.cb-nav a:hover i { color: rgba(255, 255, 255, .8); }
.cb-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.cb-nav a.active i { color: #fff; }
.cb-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cb-brand-red); }
.cb-sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .45); }
.cb-sidebar-foot a { color: rgba(255, 255, 255, .8); }

/* Topbar */
.cb-topbar { height: 64px; background: rgba(244, 246, 251, .85); border-bottom: 1px solid transparent; padding: 0 28px; }
.cb-topbar-date { color: var(--cb-muted); font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
@media (min-width: 992px) { .cb-topbar-title { display: none; } }
@media (max-width: 991.98px) { .cb-topbar { background: rgba(255, 255, 255, .92); border-bottom-color: var(--cb-line); } .cb-topbar-date { display: none; } }
.cb-user { border-color: var(--cb-line); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.cb-avatar { background: linear-gradient(135deg, #2a52e6, #1733a6); }
.cb-content { padding: 8px 28px 36px; }
@media (max-width: 991.98px) { .cb-content { padding: 14px 12px calc(var(--cb-bottomnav-h) + 22px); } }

/* Page head */
.cb-page-head { margin-bottom: 20px; }
.cb-page-head h1 { font-size: 26px; letter-spacing: -.02em; }
.cb-page-head .cb-sub { font-size: 14px; margin-top: 4px; }
@media (max-width: 575.98px) { .cb-page-head h1 { font-size: 21px; } }

/* Cards */
.cb-card { border-color: var(--cb-line); border-radius: var(--cb-radius); box-shadow: var(--cb-shadow); }
.cb-card-head { padding: 16px 20px; }
.cb-card-head h2, .cb-card-head h3, .cb-card-title { font-size: 15.5px; letter-spacing: -.01em; }
.cb-card-body { padding: 20px; }
.cb-card-foot { background: #fbfcfe; border-radius: 0 0 var(--cb-radius) var(--cb-radius); }
@media (max-width: 575.98px) { .cb-card-head { padding: 13px 14px; } .cb-card-body { padding: 14px; } }

/* Stat tiles: icon bubble + soft accent circle */
.cb-stats { gap: 14px; }
.cb-stat { border-radius: var(--cb-radius); padding: 16px 18px; box-shadow: var(--cb-shadow); position: relative; overflow: hidden; transition: box-shadow .2s, transform .2s; }
a.cb-stat:hover { box-shadow: var(--cb-shadow-hover); transform: translateY(-1px); }
.cb-stat::after { content: ""; position: absolute; right: -22px; top: -22px; width: 72px; height: 72px; border-radius: 50%; background: var(--cb-line-2); opacity: .55; pointer-events: none; }
.cb-stat.is-credit::after { background: var(--cb-green-50); }
.cb-stat.is-debit::after { background: var(--cb-red-50); }
.cb-stat.is-primary::after { background: var(--cb-primary-50); }
.cb-stat > * { position: relative; z-index: 1; }
.cb-stat .cb-stat-label { font-size: 11.5px; letter-spacing: .06em; }
.cb-stat .cb-stat-label i { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: var(--cb-line-2); color: var(--cb-ink-2); }
.cb-stat.is-credit .cb-stat-label i { background: var(--cb-green-50); color: var(--cb-green); }
.cb-stat.is-debit .cb-stat-label i { background: var(--cb-red-50); color: var(--cb-red); }
.cb-stat.is-primary .cb-stat-label i { background: var(--cb-primary-50); color: var(--cb-primary); }
.cb-stat .cb-stat-value { font-size: 26px; letter-spacing: -.02em; margin-top: 8px; }
@media (max-width: 575.98px) { .cb-stat .cb-stat-value { font-size: 19px; } .cb-stat { padding: 13px; } }

/* Segmented control */
.cb-seg { background: #e9ecf4; border-radius: 12px; padding: 4px; }
.cb-seg a, .cb-seg button, .cb-seg label { border-radius: 9px; padding: 7px 13px; }
.cb-seg .active, .cb-seg input:checked + label { box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* Buttons */
.btn { border-radius: 11px; padding: 9px 16px; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 9px; padding: 6px 11px; }
.btn-lg { border-radius: 13px; }
.btn-icon { padding: 0; }
.btn-icon.btn-sm { padding: 0; }
.btn-primary { background: linear-gradient(180deg, #2a4fe0 0%, #1d3fc4 100%); border-color: #1d3fc4; box-shadow: 0 4px 12px -4px rgba(29, 63, 196, .5); }
.btn-primary:hover { background: linear-gradient(180deg, #2447d2 0%, #1733a6 100%); }
.btn-light, .btn-soft { box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }

/* Forms */
.form-control, .form-select { min-height: 42px; border-radius: 11px; background-color: #fcfdff; border-color: #dfe3ee; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.form-control:hover, .form-select:hover { border-color: #c9cfe0; }
.form-control:focus, .form-select:focus { background-color: #fff; box-shadow: 0 0 0 4px rgba(29, 63, 196, .12); }
.form-label, .cb-label { font-size: 12.5px; letter-spacing: .01em; }
.cb-choice span { border-radius: 11px; border-color: #dfe3ee; transition: border-color .15s, background .15s, box-shadow .15s; }
.cb-choice span:hover { border-color: #c2c9dc; }
.cb-choice input:checked + span { box-shadow: 0 0 0 3px rgba(29, 63, 196, .1); }
.cb-choice.is-credit input:checked + span { box-shadow: 0 0 0 3px rgba(19, 138, 75, .1); }
.cb-choice.is-debit input:checked + span { box-shadow: 0 0 0 3px rgba(217, 45, 58, .1); }

/* Tables */
.cb-table th { background: #f8f9fc; color: #7a839e; font-size: 11px; padding: 11px 16px; }
.cb-table td { padding: 12px 16px; border-bottom-color: #f1f3f8; }
.cb-table tbody tr td { transition: background .12s; }
.cb-table tbody tr:hover td { background: #f8faff; }
.cb-table tfoot td { background: #f8f9fc; }

/* Badges / chips / misc */
.cb-badge { padding: 3px 10px; }
.cb-chip { border-color: #dfe3ee; }
.cb-bottomnav { box-shadow: 0 -6px 20px -12px rgba(16, 24, 40, .25); }
.modal-content { border-radius: 18px; }
.alert { border-radius: 13px; }

/* Auth pages */
.cb-auth { background: radial-gradient(900px 520px at 0% 0%, #dbe3ff 0, transparent 60%), radial-gradient(800px 480px at 100% 100%, #ffe1e4 0, transparent 55%), #f4f6fb; }
.cb-auth-card { border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(16, 24, 40, .35); }
