/* ============================================
   UCare Design System — Unified Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 68px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --topbar-height: 60px;
    --topbar-bg: #ffffff;
    --content-bg: #f1f5f9;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --card-shadow: 0 1px 3px rgba(0,0,0,.08);
    --card-radius: 10px;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
}

/* --- Base Reset --- */
body {
    background-color: var(--content-bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* --- Layout: Sidebar + Content --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width .3s ease;
    overflow-x: hidden;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
    gap: .625rem;
    white-space: nowrap;
    min-height: 60px;
}
.sidebar-brand:hover { color: #fff; text-decoration: none; }
.sidebar-brand i { font-size: 1.4rem; color: var(--accent); flex-shrink: 0; }

.sidebar-nav {
    list-style: none;
    padding: .75rem 0;
    margin: 0;
    flex: 1;
}
.sidebar-nav .nav-label {
    padding: .75rem 1.5rem .375rem;
    font-size: .675rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sidebar-text);
    opacity: .6;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-nav .nav-item a {
    display: flex;
    align-items: center;
    padding: .625rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    transition: all .15s ease;
    border-left: 3px solid transparent;
    gap: .75rem;
    white-space: nowrap;
}
.sidebar-nav .nav-item a i { width: 1.25rem; text-align: center; font-size: .95rem; flex-shrink: 0; }
.sidebar-nav .nav-item a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}
.sidebar-nav .nav-item.active > a {
    background: rgba(37,99,235,.15);
    color: var(--sidebar-text-active);
    border-left-color: var(--accent);
    font-weight: 500;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--sidebar-text);
    font-size: .8125rem;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-footer .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .8rem;
    flex-shrink: 0;
}
.sidebar-footer .dropdown-menu {
    background: var(--sidebar-bg);
    border: 1px solid rgba(255,255,255,.1);
}
.sidebar-footer .dropdown-item {
    color: var(--sidebar-text);
    font-size: .8125rem;
}
.sidebar-footer .dropdown-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

/* --- Sidebar Collapsed State (desktop) --- */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-nav .nav-label,
.sidebar.collapsed .sidebar-nav .nav-item a span,
.sidebar.collapsed .sidebar-footer .user-info > div,
.sidebar.collapsed .sidebar-footer .user-info > i {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity .2s ease;
}
.sidebar.collapsed .sidebar-brand {
    padding: 1.25rem 0;
    justify-content: center;
}
.sidebar.collapsed .sidebar-nav .nav-label {
    padding: .5rem 0;
    height: 0;
    margin: 0;
    opacity: 0;
}
.sidebar.collapsed .sidebar-nav .nav-item a {
    padding: .625rem 0;
    justify-content: center;
    border-left-width: 0;
}
.sidebar.collapsed .sidebar-footer {
    padding: 1rem .5rem;
}
.sidebar.collapsed .sidebar-footer .user-info {
    justify-content: center;
}
/* Tooltip on hover for collapsed items */
.sidebar.collapsed .nav-item {
    position: relative;
}
.sidebar.collapsed .nav-item a::after {
    content: attr(data-title);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) + 6px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-bg);
    color: #fff;
    padding: .375rem .75rem;
    border-radius: 6px;
    font-size: .8125rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    z-index: 1050;
}
.sidebar.collapsed .nav-item a:hover::after {
    opacity: 1;
}

/* Adjust topbar & content when collapsed */
.sidebar.collapsed ~ .topbar {
    left: var(--sidebar-collapsed-width);
}
.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* --- Topbar --- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1030;
    transition: left .3s ease;
}
.topbar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* --- Main Content Area --- */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    transition: margin-left .3s ease;
}
.main-content > .content-wrapper {
    padding: 1.5rem;
}

/* --- Sidebar Toggle --- */
.sidebar-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    padding: .25rem .5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s;
}
.sidebar-toggle:hover {
    background: #f1f5f9;
}

/* --- Cards --- */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background: #fff;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}
.card-header h5, .card-header h6 { margin: 0; font-weight: 600; }
.card-footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
}

/* Stat cards — white bg with left color border */
.stat-card {
    border-radius: var(--card-radius);
    border: none;
    border-left: 4px solid var(--accent);
    box-shadow: var(--card-shadow);
    background: #fff;
    transition: transform .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.stat-card.border-primary { border-left-color: var(--accent); }
.stat-card.border-success { border-left-color: #16a34a; }
.stat-card.border-info    { border-left-color: #0891b2; }
.stat-card.border-warning { border-left-color: #d97706; }
.stat-card.border-danger  { border-left-color: #dc2626; }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: .8125rem;
    color: var(--text-secondary);
    margin-top: .25rem;
}

/* --- Tables --- */
.table-pro {
    margin-bottom: 0;
}
.table-pro thead th {
    background: #f8fafc;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: .75rem 1rem;
    white-space: nowrap;
}
.table-pro tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: .875rem;
}
.table-pro tbody tr:hover {
    background: #f8fafc;
}
.table-pro tbody tr:last-child td { border-bottom: none; }

/* --- Badges — Status --- */
.badge-status {
    font-size: .75rem;
    font-weight: 500;
    padding: .3em .65em;
    border-radius: 6px;
}
.badge-status-inquiry        { background: #e0f2fe; color: #0369a1; }  /* 詢價中 */
.badge-status-quoting        { background: #e0f2fe; color: #0284c7; }  /* 報價中 */
.badge-status-quoted         { background: #dbeafe; color: #1d4ed8; }  /* 已報價 */
.badge-status-pending_payment{ background: #fef3c7; color: #92400e; }  /* 待繳費 */
.badge-status-declined       { background: #f1f5f9; color: #475569; }  /* 婉拒投保 */
.badge-status-submitted      { background: #f3e8ff; color: #7c3aed; }  /* 已送件 */
.badge-status-issued         { background: #ccfbf1; color: #0f766e; }  /* 已出單 */
.badge-status-active         { background: #dcfce7; color: #15803d; }  /* 效期中 */
.badge-status-expiring_soon  { background: #fef3c7; color: #b45309; }  /* 即將到期 */
.badge-status-expired        { background: #fee2e2; color: #b91c1c; }  /* 失效 */
/* legacy compat */
.badge-status-cancelled      { background: #f1f5f9; color: #475569; }
.badge-status-processing     { background: #fef3c7; color: #92400e; }

/* --- Tag Input --- */
.tag-input-wrap {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    cursor: text;
    min-height: 42px;
    transition: border-color .2s;
}
.tag-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.tag-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
}
.tag-pill .tag-remove {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: .75rem;
    line-height: 1;
    color: #1d4ed8;
    margin-left: 2px;
    transition: background .15s, color .15s;
}
.tag-pill .tag-remove:hover { background: #1d4ed8; color: #fff; }
.tag-text-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    font-size: .875rem;
    background: transparent;
    padding: 2px 0;
}
.tag-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    max-height: 180px;
    overflow-y: auto;
}
.tag-suggestions.show { display: block; }
.tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: .875rem;
    transition: background .1s;
}
.tag-suggestion-item:hover,
.tag-suggestion-item.active { background: #f1f5f9; }

/* --- Badges — Type --- */
.badge-type {
    font-size: .75rem;
    font-weight: 500;
    padding: .3em .65em;
    border-radius: 6px;
}
.badge-type-compulsory { background: #fce4ec; color: #c62828; }
.badge-type-voluntary  { background: #e3f2fd; color: #1565c0; }
.badge-type-both       { background: #f3e5f5; color: #6a1b9a; }

/* Expiry-days badge */
.badge-days {
    font-size: .75rem;
    font-weight: 600;
    padding: .3em .65em;
    border-radius: 6px;
    min-width: 52px;
    text-align: center;
    display: inline-block;
}
.badge-days-danger  { background: #fee2e2; color: #b91c1c; }
.badge-days-warning { background: #fef3c7; color: #92400e; }
.badge-days-info    { background: #e0f2fe; color: #0369a1; }

/* --- Progress bar (refined) --- */
.progress-refined {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: visible;
    position: relative;
}
.progress-refined .progress-bar {
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), #3b82f6);
    transition: width .4s ease;
}
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: .5rem;
}
.progress-step {
    text-align: center;
    font-size: .7rem;
    color: var(--text-muted);
}
.progress-step.completed { color: var(--accent); font-weight: 600; }
.progress-step .step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
    margin: 0 auto .25rem;
    border: 2px solid #e2e8f0;
}
.progress-step.completed .step-dot {
    background: var(--accent);
    border-color: var(--accent);
}

/* --- Pagination --- */
.pagination-pro .page-link {
    border: none;
    color: var(--text-secondary);
    font-size: .875rem;
    padding: .5rem .75rem;
    border-radius: 6px;
    margin: 0 2px;
}
.pagination-pro .page-link:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}
.pagination-pro .page-item.active .page-link {
    background: var(--accent);
    color: #fff;
}
.pagination-pro .page-item.disabled .page-link {
    color: var(--text-muted);
    background: transparent;
}

/* --- Alert (expiring notification) --- */
.alert-expiring {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: var(--card-radius);
    padding: 1rem 1.25rem;
    color: #92400e;
}
.alert-expiring .alert-heading {
    font-weight: 600;
    font-size: .9375rem;
    margin-bottom: .5rem;
}
.alert-expiring a { color: #b45309; font-weight: 500; }

/* --- Forms --- */
.form-section {
    margin-bottom: 1.5rem;
}
.form-section-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: .5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(37,99,235,.15);
}

/* --- Detail tables --- */
.detail-table th {
    width: 160px;
    background: #f8fafc;
    font-weight: 600;
    font-size: .8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.detail-table td {
    font-size: .875rem;
}

/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: .75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -1.625rem;
    top: .25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--border-color);
}
.timeline-item.completed .timeline-dot {
    background: #16a34a;
    box-shadow: 0 0 0 2px #bbf7d0;
}
.timeline-item.active .timeline-dot {
    background: var(--accent);
    box-shadow: 0 0 0 2px #bfdbfe;
}
.timeline-content {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: .75rem 1rem;
}
.timeline-content .timeline-date {
    font-size: .75rem;
    color: var(--text-muted);
}

/* --- Tabs (pro) --- */
.nav-tabs-pro {
    border-bottom: 2px solid var(--border-color);
}
.nav-tabs-pro .nav-link {
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: .75rem 1.25rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.nav-tabs-pro .nav-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.nav-tabs-pro .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

/* --- Filter bar (top) --- */
.filter-bar {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.filter-bar .form-control,
.filter-bar .form-select {
    font-size: .875rem;
}

/* --- Quick-filter pills --- */
.quick-filter {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.quick-filter .filter-pill {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .875rem;
    border-radius: 20px;
    font-size: .8125rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: #fff;
    transition: all .15s;
}
.quick-filter .filter-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.quick-filter .filter-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* --- Confirm-delete card --- */
.card-delete .card-header {
    background: #fef2f2;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
}

/* --- Charts container --- */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

/* --- Select2 overrides --- */
.select2-container--default .select2-selection--single {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    height: calc(2.5rem + 2px);
    padding: .375rem .75rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.7;
    padding-left: 0;
    color: var(--text-primary);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(2.5rem + 2px);
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(37,99,235,.15);
}
.select2-dropdown {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
}
.select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--accent) !important;
}

/* --- Alert container (toast-style) --- */
.alert-container {
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    right: 20px;
    z-index: 1060;
    max-width: 380px;
}
.alert-container .alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* --- Auth layout (split panel) --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
}
.auth-left {
    flex: 0 0 420px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.auth-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(37,99,235,.15) 0%, transparent 70%);
}
.auth-left .brand-icon { font-size: 3rem; color: var(--accent); margin-bottom: 1.5rem; position: relative; }
.auth-left h1 { font-size: 2rem; font-weight: 700; margin-bottom: .5rem; position: relative; }
.auth-left p { color: var(--sidebar-text); font-size: 1rem; position: relative; }

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
}
.auth-form-box {
    width: 100%;
    max-width: 400px;
}
.auth-form-box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .25rem;
}
.auth-form-box .auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}
.btn-auth {
    height: 2.75rem;
    font-weight: 500;
    border-radius: 8px;
}

/* --- Buttons (accent) --- */
.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
}
.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; display: block; }

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .sidebar {
        width: var(--sidebar-width) !important;
        transform: translateX(-100%);
        transition: transform .3s ease;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    /* Reset collapsed state on mobile — always full width overlay */
    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
    }
    .sidebar.collapsed .sidebar-brand span,
    .sidebar.collapsed .sidebar-nav .nav-label,
    .sidebar.collapsed .sidebar-nav .nav-item a span,
    .sidebar.collapsed .sidebar-footer .user-info > div,
    .sidebar.collapsed .sidebar-footer .user-info > i {
        opacity: 1;
        width: auto;
    }
    .sidebar.collapsed .sidebar-brand {
        padding: 1.25rem 1.5rem;
        justify-content: flex-start;
    }
    .sidebar.collapsed .sidebar-nav .nav-label {
        height: auto;
        padding: .75rem 1.5rem .375rem;
        opacity: .6;
    }
    .sidebar.collapsed .sidebar-nav .nav-item a {
        padding: .625rem 1.5rem;
        justify-content: flex-start;
        border-left-width: 3px;
    }
    .sidebar.collapsed .sidebar-nav .nav-item a::after {
        display: none;
    }
    .sidebar.collapsed .sidebar-footer {
        padding: 1rem 1.5rem;
    }
    .sidebar.collapsed .sidebar-footer .user-info {
        justify-content: flex-start;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1035;
    }
    .sidebar-overlay.show { display: block; }

    .topbar {
        left: 0 !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .auth-left { display: none; }
    .auth-right { padding: 1.5rem; }
}

@media (max-width: 575.98px) {
    .main-content > .content-wrapper {
        padding: 1rem;
    }
    .stat-card .stat-value { font-size: 1.5rem; }
}
