/* =========================================================
   FTPL Finance — shadcn-inspired design system on Bootstrap 5
   Light theme (default) + Dark theme via [data-theme="dark"]
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
    /* Neutrals (zinc scale, HSL) */
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;

    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 240 10% 3.9%;

    --primary: 240 5.9% 10%;
    --primary-foreground: 0 0% 98%;

    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;

    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;

    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;

    --destructive: 0 72.2% 50.6%;
    --destructive-foreground: 0 0% 98%;

    --success: 142 71% 38%;
    --success-foreground: 0 0% 100%;

    --warning: 38 92% 50%;
    --warning-foreground: 0 0% 100%;

    --info: 217 91% 60%;
    --info-foreground: 0 0% 100%;

    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --ring: 240 5% 64.9%;

    /* Sidebar */
    --sidebar: 240 4.8% 97.5%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-muted: 240 3.8% 46.1%;
    --sidebar-border: 240 5.9% 90%;
    --sidebar-hover: 240 4.8% 94%;
    --sidebar-active: 240 5.9% 90%;

    /* Brand accent (kept subtle) */
    --brand: 221 83% 53%;
    --brand-foreground: 0 0% 100%;

    --radius: 0.625rem;
    --radius-sm: 0.375rem;
    --radius-lg: 0.875rem;

    --shadow-xs: 0 1px 2px 0 hsl(240 4% 10% / 0.04);
    --shadow-sm: 0 1px 3px 0 hsl(240 4% 10% / 0.06), 0 1px 2px -1px hsl(240 4% 10% / 0.06);
    --shadow-md: 0 4px 10px -2px hsl(240 4% 10% / 0.08), 0 2px 4px -2px hsl(240 4% 10% / 0.04);
    --shadow-lg: 0 12px 24px -6px hsl(240 4% 10% / 0.10), 0 4px 8px -4px hsl(240 4% 10% / 0.06);
}

[data-theme="dark"] {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;

    --card: 240 6% 7%;
    --card-foreground: 0 0% 98%;

    --popover: 240 6% 7%;
    --popover-foreground: 0 0% 98%;

    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;

    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;

    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;

    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;

    --destructive: 0 62.8% 45%;
    --destructive-foreground: 0 0% 98%;

    --success: 142 71% 42%;
    --warning: 38 92% 55%;
    --info: 217 91% 65%;

    --border: 240 3.7% 18%;
    --input: 240 3.7% 18%;
    --ring: 240 4.9% 45%;

    --sidebar: 240 6% 6%;
    --sidebar-foreground: 240 5% 85%;
    --sidebar-muted: 240 5% 55%;
    --sidebar-border: 240 3.7% 14%;
    --sidebar-hover: 240 3.7% 12%;
    --sidebar-active: 240 3.7% 16%;

    --brand: 217 91% 65%;

    --shadow-xs: 0 1px 2px 0 hsl(0 0% 0% / 0.3);
    --shadow-sm: 0 1px 3px 0 hsl(0 0% 0% / 0.4), 0 1px 2px -1px hsl(0 0% 0% / 0.4);
    --shadow-md: 0 4px 10px -2px hsl(0 0% 0% / 0.45), 0 2px 4px -2px hsl(0 0% 0% / 0.3);
    --shadow-lg: 0 12px 24px -6px hsl(0 0% 0% / 0.55), 0 4px 8px -4px hsl(0 0% 0% / 0.4);
}

/* ---------- Base ---------- */
* { border-color: hsl(var(--border)); }

html, body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: "cv11", "ss01", "ss03";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

body {
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: hsl(var(--foreground));
}
h4 { font-size: 1.375rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 0.95rem; }

code, pre, .font-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Bootstrap overrides — backgrounds/text */
.bg-white { background-color: hsl(var(--card)) !important; }
.bg-light { background-color: hsl(var(--muted)) !important; }
.bg-dark  { background-color: hsl(var(--sidebar)) !important; color: hsl(var(--sidebar-foreground)) !important; }
.text-dark { color: hsl(var(--foreground)) !important; }
.text-white { color: hsl(var(--sidebar-foreground)) !important; }
.text-muted { color: hsl(var(--muted-foreground)) !important; }
.text-primary { color: hsl(var(--brand)) !important; }
.text-danger { color: hsl(var(--destructive)) !important; }
.text-success { color: hsl(var(--success)) !important; }

/* ---------- Layout: wrapper, sidebar, main ---------- */
#wrapper {
    min-height: 100vh;
    background-color: hsl(var(--background));
}

.sidebar {
    min-width: 260px;
    max-width: 260px;
    min-height: 100vh;
    background-color: hsl(var(--sidebar)) !important;
    color: hsl(var(--sidebar-foreground)) !important;
    border-right: 1px solid hsl(var(--sidebar-border));
    transition: margin 0.25s ease-out;
    padding: 0.5rem 0;
}

.sidebar-heading {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid hsl(var(--sidebar-border)) !important;
    font-size: 0.95rem !important;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: hsl(var(--foreground)) !important;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.sidebar-heading i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, hsl(var(--brand)), hsl(var(--brand) / 0.7));
    color: white;
    font-size: 0.95rem;
}

.sidebar .list-group,
.sidebar nav.list-group {
    padding: 0.5rem;
    gap: 2px;
    display: flex;
    flex-direction: column;
}

.sidebar .list-group-item {
    background-color: transparent !important;
    color: hsl(var(--sidebar-foreground)) !important;
    border: 0 !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: background-color 0.15s ease, color 0.15s ease;
    position: relative;
}

.sidebar .list-group-item i { color: hsl(var(--sidebar-muted)); transition: color 0.15s ease; }

.sidebar .list-group-item:hover {
    background-color: hsl(var(--sidebar-hover)) !important;
    color: hsl(var(--foreground)) !important;
}
.sidebar .list-group-item:hover i { color: hsl(var(--foreground)); }

.sidebar .list-group-item.active {
    background-color: hsl(var(--sidebar-active)) !important;
    color: hsl(var(--foreground)) !important;
    border-left: none !important;
    font-weight: 600;
}
.sidebar .list-group-item.active i { color: hsl(var(--brand)); }

/* Submenu items */
.sidebar .list-group-item.ps-5 {
    padding-left: 2.25rem !important;
    font-size: 0.8125rem;
    font-weight: 400;
    color: hsl(var(--sidebar-muted)) !important;
}
.sidebar .list-group-item.ps-5:hover { color: hsl(var(--foreground)) !important; }

.sidebar-section {
    border-top: 1px solid hsl(var(--sidebar-border)) !important;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.sidebar.toggled { margin-left: -260px; }

/* Topbar */
.navbar {
    background-color: hsl(var(--card)) !important;
    border-bottom: 1px solid hsl(var(--border)) !important;
    box-shadow: none !important;
    padding: 0.625rem 1.25rem !important;
    min-height: 56px;
}

/* Main content area */
main.container-fluid {
    padding: 1.75rem 2rem !important;
    max-width: 1600px;
}

/* ---------- Cards ---------- */
.card {
    background-color: hsl(var(--card)) !important;
    color: hsl(var(--card-foreground)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-xs) !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid hsl(var(--border)) !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}
.card-body { padding: 1.25rem; }

/* Report cards */
.report-card {
    cursor: pointer;
    overflow: hidden;
    position: relative;
}
.report-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, hsl(var(--brand) / 0.06), transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.report-card:hover {
    transform: translateY(-2px);
    border-color: hsl(var(--brand) / 0.4) !important;
    box-shadow: var(--shadow-md) !important;
}
.report-card:hover::before { opacity: 1; }
.report-card .bi {
    color: hsl(var(--brand));
    transition: transform 0.25s ease;
}
.report-card:hover .bi { transform: scale(1.1); }
.report-card h6 {
    font-weight: 600;
    color: hsl(var(--foreground)) !important;
    font-size: 0.9rem;
}

/* ---------- Buttons ---------- */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.95rem;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    letter-spacing: -0.005em;
}
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}
.btn:focus, .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.35);
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}
.btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
    border-color: hsl(var(--primary) / 0.9);
    color: hsl(var(--primary-foreground));
}

.btn-success {
    background-color: hsl(var(--success));
    border-color: hsl(var(--success));
    color: hsl(var(--success-foreground));
}
.btn-success:hover {
    background-color: hsl(var(--success) / 0.9);
    border-color: hsl(var(--success) / 0.9);
    color: hsl(var(--success-foreground));
}

.btn-outline-primary {
    background-color: transparent;
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}
.btn-outline-primary:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    border-color: hsl(var(--border));
}

.btn-outline-secondary {
    background-color: transparent;
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}
.btn-outline-secondary:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    border-color: hsl(var(--border));
}

.btn-outline-danger {
    background-color: transparent;
    color: hsl(var(--destructive));
    border-color: hsl(var(--border));
}
.btn-outline-danger:hover {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border-color: hsl(var(--destructive));
}

/* Icon-only square buttons (row actions) */
.btn-sm .bi {
    font-size: 0.9rem;
    line-height: 1;
}

/* ---------- Forms ---------- */
.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.4rem;
    letter-spacing: -0.005em;
}

.form-control,
.form-select,
input.form-control,
textarea.form-control,
select.form-select {
    background-color: hsl(var(--background)) !important;
    color: hsl(var(--foreground)) !important;
    border: 1px solid hsl(var(--input)) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.875rem !important;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control-sm, .form-select-sm {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.8125rem !important;
}
.form-control:focus,
.form-select:focus {
    border-color: hsl(var(--ring)) !important;
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25) !important;
    outline: none;
}
.form-control::placeholder { color: hsl(var(--muted-foreground)); }

.form-check-input {
    background-color: hsl(var(--background));
    border-color: hsl(var(--border));
}
.form-check-input:checked {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25);
    border-color: hsl(var(--ring));
}
.form-check-label {
    font-size: 0.875rem;
    color: hsl(var(--foreground));
}
.form-text {
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
}

/* Multi-select (rights) */
select[multiple].form-control,
select[multiple].form-select {
    min-height: 180px;
    padding: 0.25rem !important;
}
select[multiple] option {
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

/* ---------- Tables ---------- */
.table {
    color: hsl(var(--foreground));
    margin-bottom: 0;
    font-size: 0.875rem;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: hsl(var(--muted) / 0.4);
    --bs-table-hover-bg: hsl(var(--muted) / 0.6);
    --bs-table-striped-color: hsl(var(--foreground));
    --bs-table-hover-color: hsl(var(--foreground));
    --bs-table-color: hsl(var(--foreground));
    --bs-table-border-color: hsl(var(--border));
    border-color: hsl(var(--border));
}
.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
    border-bottom-color: hsl(var(--border));
    background-color: transparent;
    color: hsl(var(--foreground));
}
.table:not(.report-table-l1):not(.report-table):not(.report-table-l3):not(.flash-table):not(.tb-table) thead th,
.table-light,
.table-light > th,
.table-light > td {
    background-color: hsl(var(--muted) / 0.5) !important;
    color: hsl(var(--muted-foreground)) !important;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid hsl(var(--border)) !important;
}
.table:not(.report-table-l1):not(.report-table):not(.report-table-l3):not(.flash-table):not(.tb-table) thead th { padding: 0.7rem 1rem; }
.table tbody tr { transition: background-color 0.12s ease; }
.table-hover > tbody > tr:hover > * {
    background-color: hsl(var(--muted) / 0.45) !important;
}

/* Sticky header for non-report tables */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 2;
}
.table:not(.report-table-l1):not(.report-table):not(.report-table-l3):not(.flash-table):not(.tb-table) thead.sticky-top th {
    background-color: hsl(var(--card)) !important;
    backdrop-filter: blur(6px);
}

.table-responsive {
    /* border-radius: var(--radius); */
    scrollbar-width: thin;
    /* scrollbar-color: hsl(var(--border)) transparent; */
}
.table-responsive::-webkit-scrollbar { width: 10px; height: 10px; }
.table-responsive::-webkit-scrollbar-track { background: transparent; }
.table-responsive::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 10px;
    border: 2px solid hsl(var(--card));
}
.table-responsive::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.5); }

/* ---------- Badges ---------- */
.badge {
    font-weight: 500;
    font-size: 0.7rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}
.badge.bg-primary {
    background-color: hsl(var(--brand) / 0.12) !important;
    color: hsl(var(--brand)) !important;
    border-color: hsl(var(--brand) / 0.25);
}
.badge.bg-success {
    background-color: hsl(var(--success) / 0.14) !important;
    color: hsl(var(--success)) !important;
    border-color: hsl(var(--success) / 0.3);
}
.badge.bg-secondary {
    background-color: hsl(var(--muted)) !important;
    color: hsl(var(--muted-foreground)) !important;
    border-color: hsl(var(--border));
}
.badge.bg-info {
    background-color: hsl(var(--info) / 0.14) !important;
    color: hsl(var(--info)) !important;
    border-color: hsl(var(--info) / 0.3);
}
.badge.bg-danger {
    background-color: hsl(var(--destructive) / 0.14) !important;
    color: hsl(var(--destructive)) !important;
    border-color: hsl(var(--destructive) / 0.3);
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.alert-success {
    background-color: hsl(var(--success) / 0.08);
    color: hsl(var(--success));
    border-color: hsl(var(--success) / 0.3);
}
.alert-danger, .alert-error {
    background-color: hsl(var(--destructive) / 0.08);
    color: hsl(var(--destructive));
    border-color: hsl(var(--destructive) / 0.3);
}
.alert-warning {
    background-color: hsl(var(--warning) / 0.1);
    color: hsl(var(--warning));
    border-color: hsl(var(--warning) / 0.3);
}
.alert-info {
    background-color: hsl(var(--info) / 0.08);
    color: hsl(var(--info));
    border-color: hsl(var(--info) / 0.3);
}
.alert .btn-close {
    margin-left: auto;
    filter: var(--btn-close-filter, none);
}
[data-theme="dark"] .alert .btn-close { filter: invert(1) brightness(1.8); }

/* ---------- Auth pages ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, hsl(var(--brand) / 0.08), transparent 70%),
        radial-gradient(ellipse 50% 40% at 100% 100%, hsl(var(--brand) / 0.05), transparent 70%),
        hsl(var(--background));
    position: relative;
}
.auth-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(hsl(var(--border) / 0.5) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--border) / 0.5) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    pointer-events: none;
    opacity: 0.5;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg) !important;
}
.auth-brand {
    width: 48px; height: 48px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, hsl(var(--brand)), hsl(var(--brand) / 0.7));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 24px -6px hsl(var(--brand) / 0.4);
}
.auth-title { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.25rem; }
.auth-sub { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }

/* OTP input */
.letter-spacing-2 { letter-spacing: 0.75rem; }
#otp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem !important;
    letter-spacing: 0.6rem;
    font-weight: 600;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
    background: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.theme-toggle:hover {
    background: hsl(var(--accent));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}
.theme-toggle .bi-sun-fill { display: none; }
.theme-toggle .bi-moon-stars { display: inline-block; }
[data-theme="dark"] .theme-toggle .bi-sun-fill { display: inline-block; }
[data-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }

/* ---------- User chip in topbar ---------- */
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem 0.3rem 0.4rem;
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    font-size: 0.8125rem;
    color: hsl(var(--foreground));
    background: hsl(var(--card));
}
.user-chip .avatar {
    width: 24px; height: 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, hsl(var(--brand)), hsl(var(--brand) / 0.7));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ---------- Page header utility ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.page-header h4 { margin: 0; }
.page-header .subtitle {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: hsl(var(--muted-foreground));
}
.empty-state .bi {
    font-size: 2.5rem;
    color: hsl(var(--muted-foreground) / 0.6);
    margin-bottom: 0.75rem;
    display: inline-block;
}

/* ---------- Misc ---------- */
hr { border-color: hsl(var(--border)); opacity: 1; }
a { color: hsl(var(--brand)); text-decoration: none; }
a:hover { color: hsl(var(--brand) / 0.8); }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.border { border-color: hsl(var(--border)) !important; }
.border-bottom { border-bottom-color: hsl(var(--border)) !important; }
.border-secondary { border-color: hsl(var(--border)) !important; }

/* Collapse chevron animation */
[data-bs-toggle="collapse"] .bi-chevron-down {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    opacity: 0.6;
}
[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .sidebar { margin-left: -260px; position: fixed; z-index: 1040; }
    .sidebar.toggled { margin-left: 0; }
    main.container-fluid { padding: 1rem !important; }
}

/* ---------- Keyframes ---------- */
@keyframes ftpl-fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
main > *, .auth-card { animation: ftpl-fade-up 0.35s ease both; }

/* Report scrollbar styling - consistent across all levels */
.l1-table-wrapper::-webkit-scrollbar,
.report-table-wrapper::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.l1-table-wrapper::-webkit-scrollbar-track,
.report-table-wrapper::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}
.l1-table-wrapper::-webkit-scrollbar-thumb,
.report-table-wrapper::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}
.l1-table-wrapper::-webkit-scrollbar-thumb:hover,
.report-table-wrapper::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}
