@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Fintech Stripe-inspired Luxury Palette */
    --bs-primary: #6366f1;
    --bs-primary-rgb: 99, 102, 241;
    --bs-secondary: #64748b;
    --bs-success: #10b981;
    --bs-info: #0ea5e9;
    --bs-warning: #f59e0b;
    --bs-danger: #f43f5e;
    --bs-light: #f8fafc;
    --bs-dark: #0f172a;

    /* Body & Text */
    --bs-body-bg: #f8fafc;
    --bs-body-color: #0f172a;
    --bs-border-color: #e2e8f0;
    --bs-link-color: #4f46e5;
    --bs-link-hover-color: #3730a3;
    --bs-secondary-color: #64748b;

    /* Layout Sizes */
    --exp-sidebar-width: 280px;
    --exp-header-height: 70px;
    --exp-footer-height: 48px;

    /* UI tokens */
    --primary-light: rgba(99, 102, 241, 0.08);
    --primary: var(--bs-primary);
    --bg-primary: var(--bs-body-bg);
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #090d16 0%, #111827 100%);
    --bg-hover: rgba(99, 102, 241, 0.05);

    --text-primary: var(--bs-body-color);
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;

    --border-light: #f8fafc;
    --border-medium: #e2e8f0;
    --border-strong: #cbd5e1;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.05), 0 10px 15px -5px rgba(0, 0, 0, 0.03);
    --shadow-premium: 0 24px 50px -12px rgba(99, 102, 241, 0.06), 0 8px 24px -8px rgba(0, 0, 0, 0.04);

    --scrollbar-size: 8px;
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
    --scrollbar-thumb-hover: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-premium: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    overflow-x: hidden;
    transition: var(--transition-premium);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.sidebar,
.sidebar-nav,
.content-area,
.table-responsive,
.modal-body,
.offcanvas-body {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 var(--scrollbar-track);
}

.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.content-area::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.offcanvas-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.offcanvas-body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid var(--scrollbar-track);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.content-area::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.offcanvas-body::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.app-container {
    overflow-x: hidden;
}

body[data-theme="dark"],
[data-theme="dark"] body,
html[data-theme="dark"] body {
    --bs-primary: #818cf8;
    --bs-primary-rgb: 129, 140, 248;
    --bs-secondary: #94a3b8;
    --bs-success: #34d399;
    --bs-info: #38bdf8;
    --bs-warning: #fbbf24;
    --bs-danger: #fb7185;
    --bs-body-bg: #030712;
    --bs-body-color: #f3f4f6;
    --bs-border-color: #1f2937;
    --bs-secondary-color: #9ca3af;
    --bs-tertiary-bg: #0b0f19;
    --bs-secondary-bg: #090d16;
    --bs-light: #1f2937;
    --bs-dark: #f9fafb;
    --bs-link-color: #a5b4fc;
    --bs-link-hover-color: #c7d2fe;

    --primary-light: rgba(129, 140, 248, 0.12);
    --bg-primary: var(--bs-body-bg);
    --bg-secondary: #090d16;
    --bg-tertiary: #0b0f19;
    --bg-card: rgba(9, 13, 22, 0.85);
    --bg-sidebar: linear-gradient(180deg, #010204 0%, #080c14 100%);
    --bg-hover: rgba(129, 140, 248, 0.08);

    --text-primary: var(--bs-body-color);
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;

    --border-light: #0d1321;
    --border-medium: #1f2937;
    --border-strong: #374151;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
    --shadow-premium: 0 24px 60px rgba(129, 140, 248, 0.05), 0 10px 20px rgba(0, 0, 0, 0.45);

    --scrollbar-track: #090d16;
    --scrollbar-thumb: linear-gradient(180deg, #374151 0%, #1f2937 100%);
    --scrollbar-thumb-hover: linear-gradient(180deg, #4b5563 0%, #374151 100%);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--exp-sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    overflow-y: auto;
    z-index: 1030;
    transition: var(--transition-premium);
    box-shadow: 0 10px 30px rgba(3, 7, 18, 0.28);
}

.sidebar-header {
    height: var(--exp-header-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    color: #f8fafc;
    text-decoration: none;
    font-weight: 600;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1rem;
}

.nav-section-title {
    font-size: .75rem;
    font-weight: 700;
    color: rgba(148, 163, 184, 0.72);
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 0 .875rem .25rem;
}

.nav-item {
    padding: 0 .5rem;
}

.sidebar .nav-link {
    border-radius: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .25rem 0.75rem;
    padding: .65rem .85rem;
    font-weight: 500;
    transition: var(--transition-premium);
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.12) 0%, rgba(var(--bs-primary-rgb), 0.02) 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 4px 0 0 var(--bs-primary);
}

.main-content {
    margin-left: var(--exp-sidebar-width);
    width: calc(100% - var(--exp-sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body.sidebar-collapsed .sidebar {
    width: 86px;
}

body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-section-title {
    display: none;
}

body.sidebar-collapsed .main-content {
    margin-left: 86px;
    width: calc(100% - 86px);
}

.app-header {
    height: var(--exp-header-height);
    border-bottom: 1px solid var(--border-medium);
    background: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-premium);
}

/* Premium page header title styling */
.header-title-group {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.9rem 0.35rem 0.45rem;
    border-radius: 14px;
    background: rgba(var(--bs-primary-rgb), 0.03);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.12);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-premium);
}

.header-title-group:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
    border-color: rgba(var(--bs-primary-rgb), 0.28);
    box-shadow: 0 8px 25px -6px rgba(var(--bs-primary-rgb), 0.16);
    transform: translateY(-1px);
}

.page-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, color-mix(in srgb, var(--bs-primary) 75%, #4f46e5) 100%);
    color: #ffffff !important;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.28);
    transition: var(--transition-premium);
    flex-shrink: 0;
}

.page-title-icon i {
    color: #ffffff !important;
    font-size: 1.1rem;
    line-height: 1;
}

.header-title-group:hover .page-title-icon {
    transform: scale(1.08) rotate(-4deg);
    box-shadow: 0 6px 16px rgba(var(--bs-primary-rgb), 0.45);
}

.header-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 65%, var(--bs-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition-premium);
}

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

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-x: hidden;
    animation: none;
}

.app-footer {
    min-height: var(--exp-footer-height);
    border-top: 1px solid var(--border-medium);
    padding: 1rem 2rem;
    font-size: 0.825rem;
    background: var(--bg-sidebar);
    color: var(--text-secondary);
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.footer-link {
    text-decoration: none;
    color: var(--bs-primary);
    font-weight: 500;
    transition: var(--transition-premium);
}

.footer-link:hover {
    color: var(--bs-link-hover-color);
    text-decoration: underline;
}

.scroll-top-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 5rem;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1080;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition: var(--transition-premium);
    background: var(--bs-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb), 0.3);
}

.scroll-top-btn:hover {
    background: var(--bs-link-hover-color);
    transform: translateY(0) scale(1.05);
    box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.4);
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.mobile-menu-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1080;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition: var(--transition-premium);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}

.mobile-menu-btn.show {
    display: inline-flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    transform: scale(1.05);
}

.quick-calendar-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1080;
    transition: var(--transition-premium);
    background: var(--bs-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb), 0.3);
}

.quick-calendar-btn:hover {
    background: var(--bs-link-hover-color);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.45);
}

@media (min-width: 993px) {
    .mobile-menu-btn,
    .mobile-menu-btn.show {
        display: none !important;
    }
}

.user-button {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    padding: .35rem .75rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition-premium);
    box-shadow: var(--shadow-sm);
}

.user-button:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
    color: var(--bs-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), #1e40af);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(var(--bs-primary-rgb), 0.2);
}

.avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid var(--bs-primary);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-preview span {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: .25rem .75rem;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-premium);
}

.theme-switch:hover {
    border-color: var(--border-strong);
}

.ts-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.ts-track {
    width: 2.6rem;
    height: 1.4rem;
    background: var(--border-medium);
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    padding: .125rem;
    transition: var(--transition-premium);
    position: relative;
}

.ts-thumb {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform var(--transition-premium), background-color var(--transition-premium);
}

.ts-toggle[data-state="dark"] .ts-track {
    background: var(--bs-primary);
}

.ts-toggle[data-state="dark"] .ts-thumb {
    transform: translateX(1.2rem);
    background: #0f172a;
}

.ts-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-premium);
}

.ts-label.active {
    color: var(--bs-primary);
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0;
}

.fade-in {
    animation: expFadeIn .4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes expFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    padding: 1.5rem;
    height: 100%;
    min-height: 128px;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-premium);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-premium);
    border-color: rgba(var(--bs-primary-rgb), 0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--bs-primary);
    border-radius: 4px 0 0 4px;
    opacity: 0.8;
}

.stat-card.success::before { background: var(--bs-success); }
.stat-card.warning::before { background: var(--bs-warning); }
.stat-card.info::before { background: var(--bs-info); }
.stat-card.primary::before { background: var(--bs-danger); }

.stat-card.success {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(14, 165, 168, 0.02) 100%);
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(244, 63, 94, 0.02) 100%);
}

[data-theme="dark"] .stat-card.success {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(52, 211, 153, 0.04) 100%);
}

[data-theme="dark"] .stat-card.warning {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(251, 191, 36, 0.04) 100%);
}

[data-theme="dark"] .stat-card.info {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(56, 189, 248, 0.04) 100%);
}

[data-theme="dark"] .stat-card.primary {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(251, 113, 133, 0.04) 100%);
}

.stat-card.small {
    min-height: 110px;
    padding: 1rem 1.25rem;
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--bs-primary);
    font-size: 1.6rem;
    transition: var(--transition-premium);
    flex-shrink: 0;
    box-shadow: 0 8px 20px -6px rgba(var(--bs-primary-rgb), 0.15);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(6deg);
}

.stat-card.success .stat-icon {
    color: var(--bs-success);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.2);
}

.stat-card.warning .stat-icon {
    color: var(--bs-warning);
    background: rgba(245, 158, 11, 0.08);
    box-shadow: 0 8px 20px -6px rgba(245, 158, 11, 0.2);
}

.stat-card.info .stat-icon {
    color: var(--bs-info);
    background: rgba(14, 165, 168, 0.08);
    box-shadow: 0 8px 20px -6px rgba(14, 165, 168, 0.2);
}

.stat-card.primary .stat-icon {
    color: var(--bs-danger);
    background: rgba(244, 63, 94, 0.08);
    box-shadow: 0 8px 20px -6px rgba(244, 63, 94, 0.2);
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-info h3,
.stat-info p,
.stat-info span {
    margin: 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 600;
    text-transform: none;
    margin-bottom: 0.15rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0;
    color: var(--text-primary);
    word-break: break-word;
}

.stat-meta {
    color: var(--text-tertiary);
    font-size: .78rem;
    font-weight: 500;
    margin-top: 0.15rem;
}

.stat-sub {
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card.small .stat-value {
    font-size: 1.35rem;
}

.stat-group {
    border: 1px solid var(--border-medium);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.stat-group .card-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-medium);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    font-size: .75rem;
    padding: .85rem 1.25rem;
}

.stat-group .card-body {
    padding: 1.25rem;
}

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: var(--radius-md);
    --bs-btn-padding-y: .55rem;
    --bs-btn-padding-x: 1.15rem;
    --bs-btn-focus-box-shadow: 0 0 0 .2rem var(--primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    line-height: 1.2;
    transition: var(--transition-premium);
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
}

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

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

.btn-sm {
    --bs-btn-padding-y: .35rem;
    --bs-btn-padding-x: .85rem;
    --bs-btn-font-size: .825rem;
    --bs-btn-border-radius: var(--radius-sm);
}

.btn-lg {
    --bs-btn-padding-y: .7rem;
    --bs-btn-padding-x: 1.5rem;
    --bs-btn-border-radius: var(--radius-lg);
}

.btn-primary {
    background: var(--bs-primary);
    border: 1px solid var(--bs-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--bs-link-hover-color);
    border-color: var(--bs-link-hover-color);
    color: #ffffff;
}

.btn-success {
    background: #1f8a4c;
    border: 1px solid #1f8a4c;
    color: #ffffff;
}

.btn-success:hover {
    background: #17663a;
    border-color: #17663a;
    color: #ffffff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--bs-danger), #be123c);
    border: none;
    color: #ffffff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #be123c, #9f1239);
    color: #ffffff;
}

.btn i {
    padding: 0;
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn:hover i {
    transform: scale(1.12);
}
.btn:active i {
    transform: scale(0.95);
}

.chart-card .card-body {
    padding: 1rem;
}

.chart-canvas {
    position: relative;
    height: 280px;
    border: 1px solid var(--nexus-line);
    border-radius: 12px;
    background:
        radial-gradient(circle at 12% 8%, rgba(var(--bs-primary-rgb), 0.08), transparent 220px),
        color-mix(in srgb, var(--nexus-panel-soft) 72%, transparent);
    padding: .85rem;
    overflow: hidden;
}

.chart-canvas-sm {
    height: 220px;
}

.chart-canvas canvas {
    position: relative;
    z-index: 1;
}

.chart-card .card-header {
    min-height: 56px;
}

.chart-card .card-title {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .94rem;
    font-weight: 850;
    line-height: 1.25;
}

.chart-card .card-title i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nexus-accent-soft);
    color: var(--bs-primary);
}

@media (max-width: 992px) {
    .chart-canvas {
        height: 240px;
    }

    .chart-canvas-sm {
        height: 200px;
    }
}

.alert {
    border-width: 1px;
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.profile-card .card-body {
    padding: 1.5rem;
}

.profile-page .card {
    border-radius: var(--radius-lg);
}

.profile-image-container {
    display: flex;
    justify-content: center;
    position: relative;
}

.profile-image,
.profile-avatar {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-premium);
}

.profile-image {
    object-fit: cover;
    border: 3px solid var(--bs-primary);
    background: var(--bg-tertiary);
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2.25rem;
    color: #fff;
    background: linear-gradient(135deg, var(--bs-primary), #1e40af);
    border: 3px solid rgba(var(--bs-primary-rgb), 0.25);
}

.profile-image-container:hover .profile-image,
.profile-image-container:hover .profile-avatar {
    transform: scale(1.05);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.profile-stats .stat-item {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: .85rem 1rem;
    background: var(--bg-tertiary);
    transition: var(--transition-premium);
}

.profile-stats .stat-item:hover {
    border-color: var(--bs-primary);
    background: var(--bg-hover);
}

.profile-stats .stat-value {
    display: block;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.profile-stats .stat-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

#profileTabNav {
    gap: .5rem;
    flex-wrap: wrap;
    border-bottom: none;
}

#profileTabNav .nav-link {
    border: 1px solid var(--border-medium);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: .55rem 1.15rem;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition-premium);
}

#profileTabNav .nav-link:hover {
    background: var(--bg-hover);
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

#profileTabNav .nav-link.active {
    background: var(--bs-primary);
    color: #ffffff !important;
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.25);
}

.profile-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-section .form-group {
    margin-bottom: 1.15rem;
}

.text-tertiary {
    color: var(--text-tertiary) !important;
}

.alert-success {
    --bs-alert-bg: rgba(16, 185, 129, 0.08);
    --bs-alert-border-color: rgba(16, 185, 129, 0.2);
    --bs-alert-color: #065f46;
}

.alert-info {
    --bs-alert-bg: rgba(14, 165, 168, 0.08);
    --bs-alert-border-color: rgba(14, 165, 168, 0.2);
    --bs-alert-color: #0369a1;
}

.alert-warning {
    --bs-alert-bg: rgba(245, 158, 11, 0.08);
    --bs-alert-border-color: rgba(245, 158, 11, 0.2);
    --bs-alert-color: #92400e;
}

.alert-danger {
    --bs-alert-bg: rgba(244, 63, 94, 0.08);
    --bs-alert-border-color: rgba(244, 63, 94, 0.2);
    --bs-alert-color: #9f1239;
}

[data-theme="dark"] .alert-success {
    --bs-alert-bg: rgba(52, 211, 153, 0.12);
    --bs-alert-border-color: rgba(52, 211, 153, 0.25);
    --bs-alert-color: #a7f3d0;
}

[data-theme="dark"] .alert-info {
    --bs-alert-bg: rgba(56, 189, 248, 0.12);
    --bs-alert-border-color: rgba(56, 189, 248, 0.25);
    --bs-alert-color: #bae6fd;
}

[data-theme="dark"] .alert-warning {
    --bs-alert-bg: rgba(251, 191, 36, 0.12);
    --bs-alert-border-color: rgba(251, 191, 36, 0.25);
    --bs-alert-color: #fef3c7;
}

[data-theme="dark"] .alert-danger {
    --bs-alert-bg: rgba(251, 113, 133, 0.12);
    --bs-alert-border-color: rgba(251, 113, 133, 0.25);
    --bs-alert-color: #ffe4e6;
}

.bi {
    vertical-align: -.125em;
}

.fa-3x,
.bi-3x {
    font-size: 3em;
}

.calendar-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-medium);
    background: var(--bg-tertiary);
}

.calendar-controls h5 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-medium);
}

.calendar-day-header {
    padding: .75rem .5rem;
    text-align: center;
    font-weight: 700;
    font-size: .8rem;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-light);
}

.calendar-day-header:last-child {
    border-right: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--border-medium);
}

.calendar-day {
    background: var(--bg-card);
    min-height: 118px;
    padding: .5rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition-premium);
}

.calendar-day:hover {
    background: var(--bg-hover);
    z-index: 2;
}

.calendar-day.other-month {
    background: var(--bg-tertiary);
    opacity: .45;
}

.calendar-day.today {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
    background: var(--primary-light);
}

.calendar-day.selected {
    background: var(--bs-primary);
    color: #fff;
}

.day-number {
    font-weight: 700;
    font-size: .9rem;
    color: var(--text-primary);
    line-height: 1.1;
}

.calendar-day.selected .day-number {
    color: #fff;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1;
    min-width: 0;
}

.event-dot {
    background: var(--bs-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-premium);
}

.event-dot:hover {
    transform: scale(1.02);
}

.event-dot a,
.event-dot button,
.event-dot i,
.event-dot span {
    color: inherit;
}

.event-dot span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-dot button {
    text-decoration: none;
    background: none;
    border: none;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    transition: var(--transition-premium);
}

.event-dot button:hover {
    opacity: 1;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 82px;
        padding: .35rem;
    }

    .day-number {
        font-size: .75rem;
    }

    .event-dot {
        font-size: .6rem;
        padding: .1rem .3rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        padding-bottom: 80px !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
    }

    .header-title-group {
        padding: 0.25rem 0.75rem 0.25rem 0.35rem;
        gap: 0.55rem;
        border-radius: 10px;
    }

    .page-title-icon {
        width: 28px;
        height: 28px;
        border-radius: 7px;
    }

    .page-title-icon i {
        font-size: 0.95rem;
    }

    .header-title {
        font-size: 1.05rem;
        max-width: 45vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-actions {
        gap: .5rem;
    }

    .content-area {
        padding: 1.25rem;
    }

    .sidebar {
        width: 82vw;
        max-width: 320px;
    }

    body.sidebar-collapsed .main-content,
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .table-responsive {
        border-radius: var(--radius-md);
    }
}

@media (max-width: 576px) {
    .app-header {
        padding: 0 .75rem;
        gap: .5rem;
    }

    .header-actions .btn,
    .header-actions .btn-sm {
        padding-left: .6rem;
        padding-right: .6rem;
    }

    .header-actions .btn span {
        display: none;
    }

    .theme-switch {
        padding: .2rem .5rem;
        gap: .35rem;
    }

    .user-button {
        padding: .2rem .5rem;
        gap: .35rem;
    }

    .user-button div {
        display: none;
    }

    .header-actions .dropdown-menu {
        min-width: 220px;
    }

    .scroll-top-btn {
        right: 1rem;
        bottom: 5.5rem;
        width: 2.6rem;
        height: 2.6rem;
    }

    .quick-calendar-btn {
        right: 1rem;
        bottom: 1rem;
        width: 2.6rem;
        height: 2.6rem;
    }

    .profile-card .card-body {
        padding: 1.25rem;
    }

    .profile-image,
    .profile-avatar {
        width: 108px;
        height: 108px;
    }

    #profileTabNav .nav-link {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .profile-upload-btn,
    .profile-actions .btn {
        width: 100%;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .profile-section h5 {
        font-size: 1rem;
        margin-bottom: .9rem !important;
    }
}

@media (max-width: 992px) {
    .mobile-menu-btn {
        right: 1rem;
        bottom: 5.5rem;
        width: 2.6rem;
        height: 2.6rem;
    }

    .scroll-top-btn {
        right: 1rem;
        bottom: 9rem;
    }

    .quick-calendar-btn {
        right: 1rem;
        bottom: 1rem;
        width: 2.6rem;
        height: 2.6rem;
        display: inline-flex;
    }
}

/* Page styles */
.login-w11 {
    font-family: 'Outfit', 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    background: var(--bs-body-bg);
    padding: 1.5rem;
}

.login-w11-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(129, 140, 248, 0.06), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(148, 163, 184, 0.05), transparent 50%),
        var(--bs-body-bg);
    z-index: -1;
}

[data-theme="dark"] .login-w11-bg {
    background:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.06), transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(129, 140, 248, 0.04), transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.15), transparent 50%),
        var(--bs-body-bg);
}

.login-split-wrapper {
    position: relative;
    width: 100%;
    max-width: 920px;
    padding: 1.5rem;
    animation: expFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Contenedor principal que divide el panel */
.login-split-card {
    display: flex;
    width: 100%;
    max-width: 920px;
    min-height: 560px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg), var(--shadow-premium);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition-premium);
}

.login-split-card:hover {
    border-color: var(--border-strong);
}

/* Panel Izquierdo: Branding & Gradients */
.login-split-left {
    flex: 1.1;
    position: relative;
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(67, 56, 202, 0.95) 50%, rgba(30, 27, 75, 0.98) 100%);
    overflow: hidden;
    border-right: 1px solid var(--border-medium);
}

[data-theme="dark"] .login-split-left {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.9) 0%, rgba(49, 46, 129, 0.92) 50%, rgba(3, 7, 18, 0.98) 100%);
    border-right-color: var(--border-medium);
}

/* Glow circles en el panel izquierdo (aurora effect) */
.login-split-left-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.65;
    mix-blend-mode: screen;
}

.gc-1 {
    top: -20%;
    left: -20%;
    width: 300px;
    height: 300px;
    background: rgba(129, 140, 248, 0.5);
}

.gc-2 {
    bottom: -20%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: rgba(99, 102, 241, 0.35);
}

.login-split-left-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
}

.login-split-brand-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: var(--transition-premium);
    overflow: hidden;
}

.login-split-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-split-brand-logo:hover {
    transform: scale(1.05) rotate(-5deg);
    background: rgba(255, 255, 255, 0.22);
}

.login-split-project-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-top: 0;
    margin-bottom: 0.15rem;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.login-split-project-desc {
    color: rgba(243, 244, 246, 0.85);
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 0;
}

/* Lista de características */
.login-split-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-split-features li {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    transition: var(--transition-premium);
}

.login-split-features li:hover {
    transform: translateX(4px);
    color: #ffffff;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Panel Derecho: Formulario */
.login-split-right {
    flex: 1;
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-card);
}

.login-split-right-content {
    width: 100%;
    margin: 0 auto;
}

.login-w11-header {
    margin-bottom: 2.25rem;
}

.login-w11-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.login-w11-subtitle {
    color: var(--text-secondary);
    font-size: .95rem;
    font-weight: 500;
}

.login-w11-footer {
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Adaptación responsiva */
@media (max-width: 991px) {
    .login-split-card {
        max-width: 460px;
        flex-direction: column;
        min-height: auto;
    }
    .login-split-left {
        display: none;
    }
    .login-split-right {
        padding: 3rem 2.25rem;
    }
}

@media (max-width: 576px) {
    .login-split-wrapper {
        padding: 0.75rem;
    }
    .login-split-card {
        border-radius: var(--radius-lg);
    }
    .login-split-right {
        padding: 2.5rem 1.25rem;
    }
}

.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: .875rem;
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.input-icon-right {
    position: absolute;
    right: .5rem;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    padding: .45rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-premium);
}

.input-icon-right:hover {
    background: var(--primary-light);
    color: var(--bs-primary);
}

.input-icon-group .form-control {
    padding-left: 2.6rem;
    padding-right: 2.6rem;
    height: 46px;
}

.input-icon-group .form-control:focus ~ .input-icon-left {
    color: var(--bs-primary);
}

/* Custom Checkbox */
.form-check-input {
    border-color: var(--border-strong);
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition-premium);
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px var(--primary-light);
    border-color: var(--bs-primary);
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
}

/* Custom Link */
a.text-secondary {
    transition: var(--transition-premium);
}

a.text-secondary:hover {
    color: var(--bs-primary) !important;
    text-decoration: underline !important;
}

/* Nexus green surface and component overrides */
.card,
.modal-content,
.offcanvas,
.dropdown-menu {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-premium);
}

.card:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.15);
    box-shadow: var(--shadow-lg);
}

.card-header,
.modal-header,
.dropdown-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-medium);
    color: var(--text-primary);
    font-weight: 700;
}

.card-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.015em;
}

/* Card titles with icons premium design and micro-interaction */
.card-title {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    color: var(--bs-primary);
    transition: var(--transition-premium);
}

.card:hover .card-title i {
    transform: scale(1.18) rotate(-6deg);
    color: var(--bs-link-hover-color);
}

.table {
    --bs-table-bg: var(--bg-card);
    --bs-table-border-color: var(--border-medium);
    --bs-table-hover-bg: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
    border-collapse: separate;
    border-spacing: 0;
}

.table tbody tr {
    transition: var(--transition-premium);
}

.table tbody tr:hover {
    transform: scale(1.002);
}

.table td {
    padding: 0.95rem 1rem;
    vertical-align: middle;
}

.table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-medium);
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.85rem 1rem;
}

.form-control,
.form-select,
.input-group-text {
    border-color: var(--border-medium);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.22rem var(--primary-light);
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
}

.badge.text-bg-success,
.badge.bg-success {
    background-color: color-mix(in srgb, var(--bs-success) 88%, #ffffff) !important;
}

/* Button cleanup: less saturated and more consistent */
.btn {
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

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

.btn-secondary {
    background: color-mix(in srgb, var(--bg-tertiary) 86%, #ffffff);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: color-mix(in srgb, var(--bg-tertiary) 70%, #ffffff);
    border-color: var(--bs-secondary-color);
    color: var(--text-primary);
}

.btn-outline-secondary {
    --bs-btn-color: var(--text-secondary);
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-color: var(--text-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--bg-tertiary) 75%, #ffffff);
    --bs-btn-hover-border-color: var(--bs-secondary-color);
}

.btn-danger {
    background: #c73b50;
    border: 1px solid #c73b50;
}

.btn-danger:hover {
    background: #ad3044;
    border-color: #ad3044;
}

/* ─── Nexis Premium Overrides (Homologation Phase) ─── */

/* Premium Badge definitions */
.badge-premium {
    background: rgba(99, 102, 241, 0.08) !important;
    color: #6366f1 !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    padding: 0.3em 0.85em !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.03em !important;
    display: inline-flex !important;
    align-items: center;
}
[data-theme="dark"] .badge-premium {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #818cf8 !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.badge-premium-success {
    background: rgba(16, 185, 129, 0.08) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    padding: 0.3em 0.85em !important;
    font-size: 0.72rem !important;
    display: inline-flex !important;
    align-items: center;
}
[data-theme="dark"] .badge-premium-success {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

/* Premium Primary Button overrides */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25) !important;
    color: #ffffff !important;
    transition: var(--transition-premium) !important;
}
.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4) !important;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    color: #ffffff !important;
}
.btn-primary:active {
    transform: translateY(0) !important;
}

/* Base Card overrides - ensuring perfect borders and glows */
.card {
    border: 1px solid var(--border-medium) !important;
    background: var(--bg-card) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition-premium) !important;
}
.card:hover {
    border-color: rgba(99, 102, 241, 0.2) !important;
    box-shadow: var(--shadow-premium) !important;
    transform: translateY(-2px);
}

/* Premium Outline Buttons (Translucent & Well-defined) */
.btn-outline-primary {
    background: rgba(99, 102, 241, 0.04) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    color: #818cf8 !important;
    transition: var(--transition-premium) !important;
}
[data-theme="light"] .btn-outline-primary {
    color: #4f46e5 !important;
    background: rgba(99, 102, 241, 0.02) !important;
}
.btn-outline-primary:hover {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.btn-outline-secondary {
    background: rgba(100, 116, 139, 0.04) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    color: #94a3b8 !important;
    transition: var(--transition-premium) !important;
}
[data-theme="light"] .btn-outline-secondary {
    color: #475569 !important;
    background: rgba(100, 116, 139, 0.02) !important;
}
.btn-outline-secondary:hover {
    background: #64748b !important;
    border-color: #64748b !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.btn-outline-info {
    background: rgba(14, 165, 233, 0.04) !important;
    border: 1px solid rgba(14, 165, 233, 0.25) !important;
    color: #38bdf8 !important;
    transition: var(--transition-premium) !important;
}
[data-theme="light"] .btn-outline-info {
    color: #0284c7 !important;
    background: rgba(14, 165, 233, 0.02) !important;
}
.btn-outline-info:hover {
    background: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.btn-outline-success {
    background: rgba(16, 185, 129, 0.04) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    color: #34d399 !important;
    transition: var(--transition-premium) !important;
}
[data-theme="light"] .btn-outline-success {
    color: #059669 !important;
    background: rgba(16, 185, 129, 0.02) !important;
}
.btn-outline-success:hover {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.btn-outline-danger {
    background: rgba(244, 63, 94, 0.04) !important;
    border: 1px solid rgba(244, 63, 94, 0.25) !important;
    color: #fb7185 !important;
    transition: var(--transition-premium) !important;
}
[data-theme="light"] .btn-outline-danger {
    color: #e11d48 !important;
    background: rgba(244, 63, 94, 0.02) !important;
}
.btn-outline-danger:hover {
    background: #f43f5e !important;
    border-color: #f43f5e !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.btn-outline-warning {
    background: rgba(245, 158, 11, 0.04) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
    transition: var(--transition-premium) !important;
}
[data-theme="light"] .btn-outline-warning {
    color: #d97706 !important;
    background: rgba(245, 158, 11, 0.02) !important;
}
.btn-outline-warning:hover {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #111827 !important;
    transform: translateY(-2px) !important;
}

/* Modal polish */
.modal-backdrop.show {
    opacity: 0.74;
    backdrop-filter: blur(4px);
}

.modal-dialog {
    padding: 0.75rem;
}

.modal-content {
    border-radius: 14px !important;
    border: 1px solid color-mix(in srgb, var(--border-medium) 78%, transparent) !important;
    background: color-mix(in srgb, var(--bg-card) 94%, transparent) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), var(--shadow-premium) !important;
    overflow: hidden;
}

.modal-header {
    min-height: 68px;
    padding: 1rem 1.25rem !important;
    background: color-mix(in srgb, var(--bg-tertiary) 88%, transparent) !important;
    border-bottom: 1px solid var(--border-medium) !important;
}

.modal-title {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--text-primary);
}

.modal-title-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--primary-light);
    color: var(--bs-primary);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.22);
}

.modal-title-icon.danger {
    color: var(--bs-danger);
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.24);
}

.modal-body {
    padding: 1.25rem !important;
}

.modal-footer {
    padding: 1rem 1.25rem !important;
    background: color-mix(in srgb, var(--bg-tertiary) 76%, transparent);
    border-top: 1px solid var(--border-medium) !important;
    gap: 0.625rem;
}

.modal .btn-close {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 10px;
    background-color: transparent;
    border: 1px solid transparent;
    opacity: 0.65;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal .btn-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: scale(1.05) rotate(90deg);
}

[data-theme="light"] .modal .btn-close:hover,
[data-bs-theme="light"] .modal .btn-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}


.category-editor-modal .modal-body {
    max-height: min(72vh, 760px);
}

.category-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr);
    gap: 1rem;
}

.category-icon-name[readonly] {
    background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent);
    color: var(--text-secondary);
    cursor: default;
}

.category-icon-preview {
    min-height: 42px;
    border-radius: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent) !important;
    border: 1px solid var(--border-medium) !important;
}

.category-icon-preview i {
    font-size: 1.55rem;
    color: var(--bs-primary);
}

.icon-grid {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.9rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg-secondary) 82%, transparent);
    border: 1px solid var(--border-medium) !important;
}

.icon-grid .col-12 small {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.icon-btn {
    min-height: 2.45rem;
    border-radius: 10px;
    padding-inline: 0.35rem;
}

.icon-btn i {
    margin: 0;
    font-size: 1rem;
}

.icon-btn.btn-primary {
    box-shadow: 0 0 0 3px var(--primary-light) !important;
}

.category-modal-footer .btn {
    min-width: 112px;
}

.category-delete-modal {
    max-width: 460px;
    margin-inline: auto;
}

.category-delete-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.delete-warning-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.delete-warning-panel > i {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--bs-danger);
    background: rgba(244, 63, 94, 0.13);
}

.delete-warning-panel p {
    color: var(--text-primary);
    font-weight: 700;
}

.delete-warning-panel span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

@media (max-width: 576px) {
    .modal-dialog {
        padding: 0.25rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-inline: 1rem !important;
    }

    .category-field-grid {
        grid-template-columns: 1fr;
    }

    .category-modal-footer .btn {
        width: 100%;
    }
}

/* Expensia Nexus UI layer */
:root {
    --nexus-ink: #0f172a;
    --nexus-panel: #ffffff;
    --nexus-panel-soft: #f8fafc;
    --nexus-panel-muted: #f1f5f9;
    --nexus-accent: #6366f1;
    --nexus-accent-strong: #4f46e5;
    --nexus-accent-soft: rgba(99, 102, 241, 0.09);
    --nexus-line: rgba(148, 163, 184, 0.28);
    --nexus-line-strong: rgba(100, 116, 139, 0.32);
    --nexus-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 30px rgba(15, 23, 42, 0.06);
    --nexus-shadow-hover: 0 18px 45px rgba(15, 23, 42, 0.1), 0 8px 22px rgba(99, 102, 241, 0.08);
    --nexus-radius: 12px;
    --nexus-radius-sm: 8px;
}

[data-theme="dark"] {
    --nexus-ink: #f8fafc;
    --nexus-panel: #0b101b;
    --nexus-panel-soft: #070b14;
    --nexus-panel-muted: #111827;
    --nexus-accent: #818cf8;
    --nexus-accent-strong: #6366f1;
    --nexus-accent-soft: rgba(129, 140, 248, 0.13);
    --nexus-line: rgba(148, 163, 184, 0.15);
    --nexus-line-strong: rgba(148, 163, 184, 0.22);
    --nexus-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 38px rgba(0, 0, 0, 0.28);
    --nexus-shadow-hover: 0 22px 55px rgba(0, 0, 0, 0.42), 0 8px 26px rgba(99, 102, 241, 0.12);
}

body {
    background:
        radial-gradient(circle at top right, rgba(var(--bs-primary-rgb), 0.08), transparent 330px),
        var(--bs-body-bg);
}

.content-area {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--nexus-panel-soft) 84%, transparent), var(--bs-body-bg));
}

.page-header {
    margin-bottom: 1.15rem;
}

.page-subtitle {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0;
    padding: .48rem .82rem;
    border: 1px solid var(--nexus-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--nexus-panel) 72%, transparent);
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 650;
    box-shadow: var(--shadow-sm);
}

.app-header {
    background: color-mix(in srgb, var(--nexus-panel) 88%, transparent);
    border-bottom-color: var(--nexus-line);
}

.header-title {
    letter-spacing: 0;
}

.sidebar {
    background: linear-gradient(180deg, #050812 0%, #0b1020 100%);
}

.sidebar .nav-link {
    border: 1px solid transparent;
}

.sidebar .nav-link.active {
    background: rgba(99, 102, 241, 0.13);
    border-color: rgba(129, 140, 248, 0.13);
    box-shadow: inset 3px 0 0 #818cf8;
}

.sidebar .nav-link:hover {
    border-color: rgba(255, 255, 255, 0.06);
}

.card,
.stat-card,
.stat-group,
.modal-content,
.offcanvas,
.dropdown-menu,
.list-group,
.table-responsive,
.calendar-container {
    border: 1px solid var(--nexus-line) !important;
    border-radius: var(--nexus-radius) !important;
    background: color-mix(in srgb, var(--nexus-panel) 94%, transparent) !important;
    box-shadow: var(--nexus-shadow) !important;
}

.card,
.stat-card,
.stat-group,
.table-responsive,
.calendar-container {
    overflow: hidden;
}

.card:hover,
.stat-card:hover,
.stat-group:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.24) !important;
    box-shadow: var(--nexus-shadow-hover) !important;
    transform: translateY(-1px);
}

.card-header,
.stat-group .card-header,
.modal-header,
.offcanvas-header,
.dropdown-header,
.calendar-controls {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--nexus-panel-muted) 82%, transparent), color-mix(in srgb, var(--nexus-panel) 88%, transparent)) !important;
    border-bottom: 1px solid var(--nexus-line) !important;
    color: var(--text-primary) !important;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .01em;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.modal-title {
    letter-spacing: 0;
}

.card-body {
    color: var(--text-primary);
}

.stat-card {
    gap: 1rem;
}

.stat-icon,
.modal-title-icon,
.conv-icon,
.feature-icon,
.quick-icon {
    border-radius: 10px !important;
    background: var(--nexus-accent-soft) !important;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.18);
    color: var(--bs-primary) !important;
}

.stat-value {
    letter-spacing: 0;
}

.table-responsive {
    background: var(--nexus-panel) !important;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: color-mix(in srgb, var(--nexus-panel-muted) 42%, transparent);
    --bs-table-hover-bg: var(--nexus-accent-soft);
    --bs-table-border-color: var(--nexus-line);
    margin-bottom: 0;
}

.table thead th {
    background: color-mix(in srgb, var(--nexus-panel-muted) 86%, transparent) !important;
    border-bottom: 1px solid var(--nexus-line-strong) !important;
    color: var(--text-tertiary) !important;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .075em;
    padding: .88rem 1rem;
}

.table tbody td,
.table tbody th {
    border-color: var(--nexus-line) !important;
    color: var(--text-primary);
}

.table tbody tr {
    transition: background-color .18s ease, box-shadow .18s ease;
}

.table tbody tr:hover {
    transform: none;
    box-shadow: inset 3px 0 0 var(--nexus-accent);
}

.form-label {
    color: var(--text-secondary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .01em;
    margin-bottom: .45rem;
}

.form-control,
.form-select,
.input-group-text,
.form-check-input {
    border: 1px solid var(--nexus-line-strong) !important;
    background-color: color-mix(in srgb, var(--nexus-panel) 90%, transparent) !important;
    color: var(--text-primary) !important;
    border-radius: var(--nexus-radius-sm) !important;
    box-shadow: none !important;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.form-control,
.form-select {
    min-height: 42px;
    padding: .6rem .82rem;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(var(--bs-primary-rgb), 0.62) !important;
    box-shadow: 0 0 0 3px var(--nexus-accent-soft) !important;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child),
.input-group > .input-group-text:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child),
.input-group > .input-group-text:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.btn {
    border-radius: var(--nexus-radius-sm) !important;
    font-weight: 750;
    letter-spacing: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07) !important;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1) !important;
}

.btn:active {
    transform: translateY(1px) !important;
    box-shadow: var(--shadow-sm) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.26) !important;
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.18) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
    border-color: transparent !important;
    color: #111827 !important;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-info,
.btn-outline-warning {
    background: color-mix(in srgb, var(--nexus-panel) 76%, transparent) !important;
    border-width: 1px !important;
}

.btn-group .btn,
.input-group .btn {
    border-radius: var(--nexus-radius-sm) !important;
}

.badge {
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: .01em;
    padding: .35em .72em;
}

.badge.bg-primary,
.badge.text-bg-primary {
    background: var(--nexus-accent-soft) !important;
    border: 1px solid rgba(var(--bs-primary-rgb), .2);
    color: var(--bs-primary) !important;
}

.badge.bg-success,
.badge.text-bg-success {
    background: rgba(16, 185, 129, .12) !important;
    border: 1px solid rgba(16, 185, 129, .24);
    color: var(--bs-success) !important;
}

.badge.bg-danger,
.badge.text-bg-danger {
    background: rgba(244, 63, 94, .12) !important;
    border: 1px solid rgba(244, 63, 94, .24);
    color: var(--bs-danger) !important;
}

.badge.bg-warning,
.badge.text-bg-warning {
    background: rgba(245, 158, 11, .14) !important;
    border: 1px solid rgba(245, 158, 11, .26);
    color: var(--bs-warning) !important;
}

.dropdown-menu {
    padding: .45rem;
}

.dropdown-item {
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 650;
    padding: .55rem .68rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--nexus-accent-soft);
    color: var(--text-primary);
}

.modal-backdrop.show {
    opacity: .68;
}

.modal-content {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--nexus-panel) 96%, transparent), color-mix(in srgb, var(--nexus-panel-muted) 42%, var(--nexus-panel))) !important;
    border-color: var(--nexus-line-strong) !important;
}

.modal-header {
    min-height: 62px;
}

.modal-footer {
    background: color-mix(in srgb, var(--nexus-panel-muted) 76%, transparent) !important;
    border-top-color: var(--nexus-line) !important;
}

.nav-tabs {
    border-bottom-color: var(--nexus-line);
    gap: .25rem;
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 750;
}

.nav-tabs .nav-link:hover,
.nav-pills .nav-link:hover {
    background: var(--nexus-accent-soft);
    border-color: transparent;
    color: var(--text-primary);
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
    background: var(--nexus-accent-soft);
    border-color: rgba(var(--bs-primary-rgb), .24);
    color: var(--bs-primary);
}

.alert {
    border-radius: var(--nexus-radius) !important;
    border-color: var(--nexus-line) !important;
    box-shadow: var(--shadow-sm) !important;
}

.pagination {
    gap: .25rem;
}

.page-link {
    border-color: var(--nexus-line);
    border-radius: 8px !important;
    color: var(--text-secondary);
    font-weight: 750;
}

.active > .page-link,
.page-link.active {
    background: var(--nexus-accent);
    border-color: var(--nexus-accent);
}

.progress {
    background: color-mix(in srgb, var(--nexus-panel-muted) 88%, transparent);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 999px;
}

.user-button,
.theme-switch {
    background: color-mix(in srgb, var(--nexus-panel) 82%, transparent) !important;
    border: 1px solid var(--nexus-line) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-sm);
}

.user-button:hover,
.theme-switch:hover {
    border-color: rgba(var(--bs-primary-rgb), .28) !important;
    box-shadow: var(--nexus-shadow);
}

.user-avatar {
    border: 1px solid rgba(var(--bs-primary-rgb), .24);
    box-shadow: 0 0 0 3px var(--nexus-accent-soft);
}

.scroll-top-btn,
.mobile-menu-btn,
.quick-calendar-btn {
    width: 46px !important;
    height: 46px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(var(--bs-primary-rgb), .22) !important;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 28px rgba(99, 102, 241, .24) !important;
}

.scroll-top-btn:hover,
.mobile-menu-btn:hover,
.quick-calendar-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 16px 34px rgba(99, 102, 241, .32) !important;
}

.quick-calendar-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: rgba(16, 185, 129, .32) !important;
    box-shadow: 0 12px 28px rgba(16, 185, 129, .22) !important;
}

.quick-calendar-btn:hover {
    box-shadow: 0 16px 34px rgba(16, 185, 129, .3) !important;
}

.modal-open .scroll-top-btn,
.modal-open .mobile-menu-btn,
.modal-open .quick-calendar-btn {
    display: none !important;
}

/* Performance guardrails: keep the Nexus look without expensive global effects. */
.app-header,
.card,
.modal-content,
.offcanvas,
.dropdown-menu,
.table-responsive,
.calendar-container,
.user-button,
.theme-switch {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal-backdrop.show,
.chat-mobile-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.fade-in {
    animation-duration: .18s;
}

@media (max-width: 768px) {
    .content-area {
        padding: 1rem;
    }

    .card-header,
    .modal-header {
        min-height: 56px;
    }

    .table thead th,
    .table tbody td,
    .table tbody th {
        padding: .78rem .82rem;
    }
}

/* ==========================================
   MOBILE BOTTOM NAVIGATION & RESPONSIVE TABLES
   ========================================== */

/* Bottom nav container */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-medium);
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 1040;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area */
}

body[data-theme="dark"] .mobile-bottom-nav {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    background: var(--bg-secondary);
}

/* Bottom nav items */
.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--text-secondary);
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 4px 0;
    transition: var(--transition-premium);
    font-size: 0.72rem;
    font-weight: 600;
}

.mobile-bottom-nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item:focus {
    color: var(--bs-primary);
}

.mobile-bottom-nav-item:active i {
    transform: scale(0.9);
}

.mobile-bottom-nav-item.active {
    color: var(--bs-primary);
}

.mobile-bottom-nav-item.active i {
    color: var(--bs-primary);
}

/* Adjust layout on mobile to prevent bottom content overlapping */
@media (max-width: 992px) {
    body {
        padding-bottom: 70px !important; /* Safe padding for bottom nav */
    }

    .mobile-bottom-nav {
        display: flex !important;
    }

    .quick-calendar-btn {
        bottom: 5.25rem !important;
    }

    .scroll-top-btn {
        bottom: 8.75rem !important;
    }
}

/* Responsive card table styles */
@media (max-width: 768px) {
    .table-responsive-mobile {
        display: block;
        width: 100%;
        border: none !important;
    }
    .table-responsive-mobile thead {
        display: none !important;
    }
    .table-responsive-mobile tbody {
        display: block;
        width: 100%;
    }
    .table-responsive-mobile tr {
        display: block;
        width: 100%;
        background: var(--bg-card);
        border: 1px solid var(--border-medium);
        border-radius: var(--radius-md);
        padding: 0.85rem 1rem;
        margin-bottom: 0.85rem;
        box-shadow: var(--shadow-sm);
        transition: var(--transition-premium);
    }
    .table-responsive-mobile tr:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        border-color: rgba(var(--bs-primary-rgb), 0.2);
    }
    .table-responsive-mobile td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.55rem 0 !important;
        border-bottom: 1px dashed var(--border-medium) !important;
        text-align: right;
        min-height: 38px;
        width: 100% !important;
    }
    .table-responsive-mobile td:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        margin-top: 0.35rem;
        justify-content: flex-end;
    }
    .table-responsive-mobile td:first-child {
        padding-top: 0 !important;
    }
    .table-responsive-mobile td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        font-size: 0.78rem;
        text-align: left;
        margin-right: 1rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    .table-responsive-mobile td .btn-group {
        display: inline-flex;
    }
    
    /* Custom spacing in lists */
    .table-responsive-mobile td .badge {
        font-size: 0.75rem;
    }
}

/* General Premium Visual Improvements */
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px var(--primary-light) !important;
    border-color: var(--bs-primary) !important;
}

.card {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glassmorphic Toast Notifications System */
.cg-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.cg-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.75); /* Tailwind Slate-800 with opacity */
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: #f8fafc;
    pointer-events: auto;
    transform: translateX(100%) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cg-toast.cg-toast-show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.cg-toast.cg-toast-hide {
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
}

.cg-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}

.cg-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Color styles matching the toast types */
.cg-toast-success {
    border-left: 4px solid #10b981;
}
.cg-toast-success .cg-toast-icon {
    color: #10b981;
}

.cg-toast-danger {
    border-left: 4px solid #f43f5e;
}
.cg-toast-danger .cg-toast-icon {
    color: #f43f5e;
}

.cg-toast-warning {
    border-left: 4px solid #f59e0b;
}
.cg-toast-warning .cg-toast-icon {
    color: #f59e0b;
}

.cg-toast-info {
    border-left: 4px solid #3b82f6;
}
.cg-toast-info .cg-toast-icon {
    color: #3b82f6;
}

.cg-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    opacity: 0.6;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0;
    margin-left: 16px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-toast-close:hover {
    opacity: 1;
    color: #f8fafc;
    transform: scale(1.15);
}

/* Light theme styles */
[data-bs-theme="light"] .cg-toast,
[data-theme="light"] .cg-toast {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
[data-bs-theme="light"] .cg-toast-close,
[data-theme="light"] .cg-toast-close {
    color: #64748b;
}
[data-bs-theme="light"] .cg-toast-close:hover,
[data-theme="light"] .cg-toast-close:hover {
    color: #0f172a;
}

.user-avatar-container {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
}
.ia-status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary, #1e293b);
    z-index: 10;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.ia-status-indicator.active {
    background-color: #10b981; /* Green */
    box-shadow: 0 0 8px #10b981;
}
.ia-status-indicator.inactive {
    background-color: #ef4444; /* Red */
    box-shadow: 0 0 8px #ef4444;
}

.mobile-header-indicator {
    display: none !important;
}

@media (max-width: 576px) {
    .mobile-header-indicator {
        display: inline-block !important;
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin-right: 4px;
    }
}
.scan-ticket-container {
    background: rgba(99, 102, 241, 0.03) !important;
    border: 1.5px dashed rgba(99, 102, 241, 0.25) !important;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.scan-ticket-container:hover {
    background: rgba(99, 102, 241, 0.06) !important;
    border-color: rgba(99, 102, 241, 0.45) !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}
