/* ========================================================================
   VINP Billing — Powered by AIMatric
   Dashboard Design System
   ======================================================================== */

/* ─── CSS Variables (ArchitectUI tokens) ────────────────────────────── */
:root {
    /* Primary palette */
    --primary: #3f6ad8;
    --primary-light: #6d92e5;
    --primary-dark: #2952b8;
    --primary-bg: #e0f3ff;

    /* Semantic colors */
    --success: #3ac47d;
    --success-bg: #d4edda;
    --warning: #f7b924;
    --warning-bg: #fff3cd;
    --danger: #d92550;
    --danger-bg: #f8d7da;
    --info: #16aaff;
    --info-bg: #d1ecf1;
    --focus: #444054;
    --alternate: #794c8a;

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 60px;

    /* Surfaces */
    --body-bg: #f1f4f6;
    --card-bg: #fff;
    --sidebar-bg: #fff;
    --header-bg: #3f6ad8;

    /* Typography */
    --body-color: #495057;
    --heading-color: #343a40;
    --muted-color: #6c757d;
    --font-size-base: 0.88rem;

    /* Shadows (subtle, refined) */
    --card-shadow: 0 1px 15px rgba(0,0,0,.04),
                   0 1px 6px rgba(0,0,0,.04);
    --card-shadow-hover: 0 2px 20px rgba(0,0,0,.08),
                         0 1px 8px rgba(0,0,0,.06);
    --sidebar-shadow: 0 0 15px rgba(0,0,0,.05);

    /* Misc */
    --border-color: #dee2e6;
    --border-radius: 0.375rem;
    --transition: all .2s ease;
}

/* ─── Animations ──────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Global ──────────────────────────────────────────────────────── */
body {
    background: var(--body-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-size-base);
    color: var(--body-color);
    overflow-x: hidden;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ─── App Container: sidebar + header + content ───────────────────── */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ─── Fixed Sidebar (ArchitectUI — white sidebar with subtle shadow) ── */
.sidebar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: transform .3s ease, width .3s ease;
    box-shadow: var(--sidebar-shadow);
    border-right: 1px solid rgba(0,0,0,.05);
}

/* Custom scrollbar */
.sidebar-fixed::-webkit-scrollbar { width: 5px; }
.sidebar-fixed::-webkit-scrollbar-track { background: transparent; }
.sidebar-fixed::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 4px; }
.sidebar-fixed::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.18); }

/* Sidebar brand/logo area */
.sidebar-brand {
    padding: 0 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,.05);
    background: linear-gradient(135deg, var(--primary), #6d92e5);
}

.sidebar-brand h5 {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.sidebar-brand h5 i {
    font-size: 1.25rem;
    opacity: .9;
}

.sidebar-brand small {
    display: none;
}

/* User info block below brand */
.sidebar-user-info {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,.05);
    background: #fafbfc;
}

.sidebar-user-info .user-name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--heading-color);
}

.sidebar-user-info .user-role {
    font-size: .72rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Sidebar nav sections */
.sidebar-fixed .nav-header {
    color: var(--primary);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 1.2rem 1.5rem 0.4rem;
    opacity: .6;
}

.sidebar-fixed .nav-header[data-bs-toggle="collapse"] {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.sidebar-fixed .nav-header[data-bs-toggle="collapse"]:hover {
    opacity: .9;
}

.sidebar-fixed .nav-header[data-bs-toggle="collapse"]::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    font-size: .55rem;
    transition: transform .2s ease;
}

.sidebar-fixed .nav-header[data-bs-toggle="collapse"][aria-expanded="true"]::after,
.sidebar-fixed .nav-header[data-bs-toggle="collapse"]:not(.collapsed)::after {
    transform: rotate(180deg);
}

.sidebar-fixed .collapse .nav-link,
.sidebar-fixed .collapsing .nav-link {
    padding-left: 2.2rem;
    font-size: .82rem;
}

/* Nav link items — ArchitectUI style */
.sidebar-fixed .nav-link {
    color: var(--body-color);
    padding: 0.5rem 1.5rem;
    font-size: .85rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    transition: var(--transition);
    min-height: 2.4rem;
}

.sidebar-fixed .nav-link i {
    font-size: .92rem;
    width: 22px;
    text-align: center;
    opacity: .4;
    transition: var(--transition);
}

.sidebar-fixed .nav-link:hover {
    color: var(--primary);
    background: var(--primary-bg);
    border-left-color: transparent;
}

.sidebar-fixed .nav-link:hover i {
    opacity: .7;
}

.sidebar-fixed .nav-link.active {
    color: var(--primary);
    background: var(--primary-bg);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-fixed .nav-link.active i {
    opacity: .9;
    color: var(--primary);
}

.sidebar-fixed .nav-link .badge {
    font-size: .62rem;
    padding: 3px 6px;
}

.sidebar-fixed hr {
    border-color: rgba(0,0,0,.06);
    margin: 0.6rem 1.2rem;
    opacity: 1;
}

/* ─── Top Header Bar (ArchitectUI blue gradient) ──────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    background: linear-gradient(135deg, var(--primary) 0%, #6d92e5 100%);
    z-index: 1035;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    transition: left .3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.app-header .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-header .hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 1.3rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.app-header .hamburger-btn:hover {
    color: #fff;
}

.app-header .page-title {
    color: rgba(255,255,255,.85);
    font-size: .92rem;
    font-weight: 400;
}

.app-header .header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-header .header-right .btn-header {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .88rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.app-header .header-right .btn-header:hover {
    background: rgba(255,255,255,.25);
}

.app-header .header-right .btn-header .notification-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--primary);
}

.app-header .user-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    cursor: pointer;
    padding: 4px 12px 4px 4px;
    border-radius: 30px;
    transition: var(--transition);
    text-decoration: none;
}

.app-header .user-widget:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}

.app-header .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .82rem;
    border: 2px solid rgba(255,255,255,.3);
}

.app-header .user-text {
    font-size: .82rem;
    line-height: 1.2;
}

.app-header .user-text .name {
    font-weight: 600;
    color: #fff;
}

.app-header .user-text .role {
    font-size: .7rem;
    opacity: .75;
}

/* Dropdown within header */
.app-header .dropdown-menu {
    border: 1px solid rgba(0,0,0,.05);
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    border-radius: var(--border-radius);
    padding: .5rem 0;
    min-width: 180px;
    margin-top: 8px;
}

.app-header .dropdown-menu .dropdown-item {
    padding: .45rem 1rem;
    font-size: .84rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.app-header .dropdown-menu .dropdown-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.app-header .dropdown-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    opacity: .5;
}

.app-header .dropdown-divider {
    margin: .3rem 0;
}

/* ─── Mobile Header (hidden on desktop) ──────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary) 0%, #6d92e5 100%);
    z-index: 1035;
    align-items: center;
    padding: 0 1rem;
}

.mobile-header .brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1039;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .25s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ─── Content Area ────────────────────────────────────────────────── */
.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    background: var(--body-bg);
    padding: 1.5rem 2rem;
    animation: fadeIn 0.25s ease-out;
    transition: margin-left .3s ease;
}

/* ─── Cards (ArchitectUI — borderless, layered shadow) ────────────── */
.card {
    border: 0;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    background: var(--card-bg);
    transition: box-shadow .25s ease, transform .25s ease;
    animation: fadeInUp 0.3s ease-out both;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: .88rem;
    padding: .75rem 1.25rem;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
}

.card-header h6 {
    font-size: .88rem;
    color: var(--heading-color);
}

.card-header h6 i {
    color: var(--primary);
    opacity: .7;
}

.card-footer {
    background: var(--card-bg);
    border-top: 1px solid #e9ecef;
}

/* Staggered card animation */
.card-stagger:nth-child(1) { animation-delay: 0s; }
.card-stagger:nth-child(2) { animation-delay: 0.06s; }
.card-stagger:nth-child(3) { animation-delay: 0.12s; }
.card-stagger:nth-child(4) { animation-delay: 0.18s; }

/* ─── KPI Cards (ArchitectUI widget style) ────────────────────────── */
.kpi-card {
    border-radius: var(--border-radius);
    padding: 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: var(--card-shadow);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.kpi-card.green  { background: linear-gradient(135deg, #3ac47d, #2ea06a); }
.kpi-card.blue   { background: linear-gradient(135deg, #3f6ad8, #2952b8); }
.kpi-card.orange { background: linear-gradient(135deg, #f7b924, #d9a21e); }
.kpi-card.purple { background: linear-gradient(135deg, #794c8a, #5c3a6b); }

.kpi-card .kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius);
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.kpi-card .kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card .kpi-label {
    font-size: .76rem;
    opacity: .85;
    margin-top: 2px;
}

/* Decorative circle */
.kpi-card::after {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    top: -15px;
    right: -15px;
}

/* ─── Tables (ArchitectUI — #e0f3ff hover, light head) ────────────── */
.table {
    margin-bottom: 0;
    font-size: var(--font-size-base);
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted-color);
    padding: 0.65rem 0.85rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr {
    transition: background-color .15s ease;
}

.table tbody tr:hover {
    background-color: var(--primary-bg) !important;
}

.table td {
    padding: 0.55rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
    color: var(--body-color);
}

.table tfoot td, .table tfoot th {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}

/* ─── Buttons (ArchitectUI style) ─────────────────────────────────── */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: var(--font-size-base);
    transition: var(--transition);
    padding: 0.4rem 0.85rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 0.125rem 0.625rem rgba(63,106,216,.4);
}

.btn-sm {
    padding: 0.28rem 0.65rem;
    font-size: .82rem;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #2ea06a; border-color: #2ea06a; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b91e44; border-color: #b91e44; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #212529; }
.btn-info { background: var(--info); border-color: var(--info); }

/* ─── Forms (ArchitectUI style) ───────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: var(--font-size-base);
    color: var(--body-color);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(63,106,216,.25);
}

.form-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted-color);
    margin-bottom: 0.3rem;
}

.input-group-text {
    background: #f8f9fa;
    border-color: var(--border-color);
    color: var(--muted-color);
    font-size: var(--font-size-base);
}

/* ─── Alerts (ArchitectUI — subtle left border) ───────────────────── */
.alert {
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    animation: slideInRight 0.3s ease-out both;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.alert-success {
    background: var(--success-bg);
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-danger, .alert-error {
    background: var(--danger-bg);
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: var(--warning-bg);
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: var(--info-bg);
    color: #0c5460;
    border-left: 4px solid var(--info);
}

/* ─── Page Header ─────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.25s ease-out both;
}

.page-header h4 {
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--heading-color);
    margin: 0;
}

.page-header h4 i {
    color: var(--primary);
    opacity: .6;
}

.page-header .badge {
    font-size: .68rem;
    font-weight: 500;
    vertical-align: middle;
    margin-left: 8px;
}

/* ─── Filter Bar ──────────────────────────────────────────────────── */
.filter-bar {
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    animation: fadeInUp 0.3s ease-out both;
}

.filter-bar .card-body {
    padding: 0.6rem 1rem;
}

/* ─── Quick Actions ───────────────────────────────────────────────── */
.quick-actions .btn {
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-weight: 500;
    font-size: .82rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ─── Badges ──────────────────────────────────────────────────────── */
.badge-payment { background: #d4edda; color: #155724; }
.badge-receipt { background: #cce5ff; color: #004085; }
.badge-journal { background: var(--warning-bg); color: #856404; }

/* ─── Charts ──────────────────────────────────────────────────────── */
.chart-container {
    position: relative;
    padding: 1rem;
}

/* ─── Empty State ─────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted-color);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: .25;
}

.empty-state p {
    font-size: .88rem;
    margin: 0;
}

/* ─── Pagination ──────────────────────────────────────────────────── */
.pagination .page-link {
    border-radius: var(--border-radius);
    margin: 0 2px;
    font-size: .8rem;
    border: none;
    color: var(--muted-color);
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0.125rem 0.625rem rgba(63,106,216,.4);
}

.pagination .page-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

/* ─── Select2 Refinements ─────────────────────────────────────────── */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: var(--border-radius);
    border-color: var(--border-color);
    min-height: 36px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(63,106,216,.25);
}

/* ─── Loading Spinner ─────────────────────────────────────────────── */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: 10px;
    top: 50%;
    margin-top: -8px;
}

/* ─── Tooltips ────────────────────────────────────────────────────── */
.tooltip-inner {
    font-size: .75rem;
    border-radius: 4px;
    background: #343a40;
}

/* ─── Login Page (ArchitectUI style) ──────────────────────────────── */
.login-bg {
    background: linear-gradient(135deg, var(--primary) 0%, #6d92e5 50%, #794c8a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-card {
    max-width: 420px;
    width: 100%;
    animation: fadeInUp 0.5s ease-out both;
}

.login-card .card {
    border-radius: var(--border-radius);
    box-shadow: 0 0.46875rem 2.1875rem rgba(4,9,20,.07),
                0 0.9375rem 1.40625rem rgba(4,9,20,.06),
                0 0.25rem 0.53125rem rgba(4,9,20,.1),
                0 0.125rem 0.1875rem rgba(4,9,20,.06);
    border: none;
}

.login-card .brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #794c8a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin: 0 auto 1rem;
}

/* ─── Summary Cards (Reports) ─────────────────────────────────────── */
.summary-card {
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius);
}

.summary-card .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading-color);
}

.summary-card .label {
    font-size: .72rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ─── Footer ──────────────────────────────────────────────────────── */
.app-footer {
    margin-left: var(--sidebar-width);
    padding: .75rem 2rem;
    background: var(--card-bg);
    border-top: 1px solid #e9ecef;
    font-size: .78rem;
    color: var(--muted-color);
    transition: margin-left .3s ease;
}

/* ─── Print Styles ────────────────────────────────────────────────── */
@media print {
    .sidebar-fixed,
    .mobile-header,
    .sidebar-overlay,
    .app-header,
    .app-footer,
    .filter-bar,
    .page-header .btn,
    .pagination,
    .btn-print {
        display: none !important;
    }

    .content-wrapper {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background: #fff;
    }
}

/* ─── Responsive: Mobile ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar-fixed {
        transform: translateX(-100%);
    }

    .sidebar-fixed.show {
        transform: translateX(0);
    }

    .mobile-header {
        display: flex;
    }

    .app-header {
        display: none;
    }

    .content-wrapper {
        margin-left: 0;
        margin-top: var(--header-height);
        padding: 1rem;
    }

    .app-footer {
        margin-left: 0;
    }

    .kpi-card .kpi-value {
        font-size: 1.25rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ─── Responsive: Tablet ──────────────────────────────────────────── */
@media (min-width: 992px) and (max-width: 1199.98px) {
    :root {
        --sidebar-width: 240px;
    }

    .content-wrapper {
        padding: 1.25rem 1.5rem;
    }
}

/* ─── Utility Animations ──────────────────────────────────────────── */
.animate-fadeInUp { animation: fadeInUp 0.35s ease-out both; }
.animate-delay-1 { animation-delay: 0.06s; }
.animate-delay-2 { animation-delay: 0.12s; }
.animate-delay-3 { animation-delay: 0.18s; }
.animate-delay-4 { animation-delay: 0.24s; }

/* ─── Misc helpers ────────────────────────────────────────────────── */
.fw-medium { font-weight: 500; }
.text-primary { color: var(--primary) !important; }
.bg-primary-subtle { background: var(--primary-bg) !important; }
