.btn-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 0.2rem;
}

:root {
    /* Default - Dark Theme (Premium Corporate Tech) */
    --primary-color: #6366f1;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary-color: #db2777;
    --accent-color: #0891b2;

    /* Elevation System - Surfaces (Dark) */
    --bg-surface-0: #0f172a;
    /* Main body background */
    --bg-surface-1: #1e293b;
    /* Sidebar / Navigation */
    --bg-surface-2: #334155;
    /* Cards / Modals surface */
    --bg-surface-3: #475569;
    /* Hover / Highlighted surfaces */

    --bg-dark: var(--bg-surface-0);
    --bg-card: var(--bg-surface-1);
    --bg-lighter: var(--bg-surface-2);
    --bg-sidebar: var(--bg-surface-1);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));

    /* Premium Shadow System */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-premium: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Common */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Global Border Color - Dynamic */
    --border-color: rgba(255, 255, 255, 0.1);
}

.cursor-pointer {
    cursor: pointer !important;
}

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

.text-orange {
    color: #f97316 !important;
}

.text-yellow {
    color: #eab308 !important;
}

.shadow-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important;
    border-color: var(--primary-color) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Blue Theme (Premium Tinted Dark Blue) */
[data-theme="blue"] {
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --secondary-color: #06b6d4;
    --accent-color: #8b5cf6;

    /* Surfaces - Blue Tinted Dark */
    --bg-surface-0: #0f172a;
    /* Slate 900 */
    --bg-surface-1: #1e293b;
    /* Slate 800 */
    --bg-surface-2: #1d4ed81a;
    /* Tinted Blue Surface */
    --bg-surface-3: #1d4ed833;
    /* Stronger Tint */

    --bg-dark: var(--bg-surface-0);
    --bg-card: var(--bg-surface-1);
    --bg-lighter: var(--bg-surface-2);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-card: linear-gradient(145deg, rgba(30, 58, 138, 0.4), rgba(15, 23, 42, 0.95));
}

/* Fuchsia Theme (Vibrant Tinted Dark) */
[data-theme="fuchsia"] {
    --primary-color: #d946ef;
    --primary-dark: #a21caf;
    --primary-light: #f0abfc;
    --secondary-color: #f43f5e;
    --accent-color: #8b5cf6;

    /* Surfaces - Fuchsia Tinted Dark */
    --bg-surface-0: #1a0614;
    --bg-surface-1: #2e0a1f;
    --bg-surface-2: #4a0d2c;
    --bg-surface-3: #701a43;

    --bg-dark: var(--bg-surface-0);
    --bg-card: var(--bg-surface-1);
    --bg-lighter: var(--bg-surface-2);
    --bg-sidebar: var(--bg-surface-0);

    --text-primary: #fef2f2;
    --text-secondary: #fbcfe8;
    --text-muted: #be185d;

    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-card: linear-gradient(145deg, rgba(74, 13, 44, 0.4), rgba(46, 10, 31, 0.95));
}

/* White Theme (Premium Soft Light) */
[data-theme="white"] {
    --primary-color: #4f46e5;
    /* Professional Indigo */
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;

    /* Elevation System - White Surfaces */
    --bg-surface-0: #f0f9ff;
    /* Pure Light Blue (Sky 50) */
    --bg-surface-1: #ffffff;
    --bg-surface-2: #ffffff;
    --bg-surface-3: #e0f2fe;
    /* Light Blue (Sky 100) */

    --bg-dark: var(--bg-surface-0);
    --bg-card: var(--bg-surface-2);
    --bg-lighter: var(--bg-surface-3);
    --bg-sidebar: var(--bg-surface-1);

    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --border-color: rgba(15, 23, 42, 0.08);
    /* Darker borders for light theme */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    --gradient-card: linear-gradient(145deg, #ffffff, #f8fafc);

    /* Light Theme Shadows (Softer) */
    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.1), 0 2px 4px -2px rgb(15 23 42 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.1), 0 4px 6px -4px rgb(15 23 42 / 0.1);
}

[data-theme="white"] .glass-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: var(--shadow-md) !important;
}

[data-theme="white"] #sidebar-wrapper {
    background-color: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="white"] #sidebar-wrapper .list-group-item {
    color: #64748b;
}

[data-theme="white"] #sidebar-wrapper .list-group-item:hover {
    background-color: #f8fafc !important;
    color: var(--primary-color) !important;
    padding-left: 1.75rem;
}

[data-theme="white"] #sidebar-wrapper .list-group-item.active {
    background: #f0f9ff !important;
    /* Sky 50 */
    color: #0284c7 !important;
    /* Sky 600 */
    border-left: 4px solid #0284c7;
    font-weight: 600;
}

[data-theme="white"] .card-header {
    background-color: #f8fafc !important;
    /* Slate 50 */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: var(--text-primary) !important;
}

[data-theme="white"] .modal-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text-primary) !important;
}

[data-theme="white"] .modal-header .btn-close {
    filter: none !important;
    /* Ensure it's not white-filtered */
}

[data-theme="white"] .btn-primary {
    color: #fff !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.2) !important;
}

[data-theme="white"] .card,
[data-theme="white"] .glass-card {
    background: #ffffff !important;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid #e0e7ff !important;
}

[data-theme="white"] .widget-card {
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Page Layout & Component Separation Overrides */
[data-theme="white"] .navbar {
    background-color: #ffffff !important;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

[data-theme="white"] .sidebar-logo {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* --- Dashboard & Kanban Design System --- */
.kanban-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.kanban-column {
    background-color: var(--bg-lighter) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    transition: var(--transition-medium);
}

.kanban-column .card-header {
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.75rem 1rem !important;
}

[data-theme="white"] .kanban-column {
    background: #e0f2fe !important;
    /* Force Clean Blue background */
    border: 1px solid #bae6fd !important;
}

[data-theme="white"] .kanban-column .card-header {
    background: #bae6fd !important;
    /* Darker clean blue */
    color: #0369a1 !important;
    border-bottom: 1px solid #7dd3fc !important;
}

[data-theme="white"] .kanban-card {
    background: #ffffff !important;
    border: 1px solid #bae6fd !important;
    color: #1e293b !important;
}

[data-theme="white"] .kanban-card:hover {
    border-color: #0ea5e9 !important;
    /* Sky 500 */
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1) !important;
}

/* Fix for dark dropdowns and legacy colors */
[data-theme="white"] select,
[data-theme="white"] select option,
[data-theme="white"] .form-select,
[data-theme="white"] .form-select option {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

.kanban-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition-fast);
    color: var(--text-primary) !important;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md) !important;
    border-color: var(--primary-light) !important;
}

.kanban-card .badge.bg-dark {
    background-color: var(--bg-lighter) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="fuchsia"] .btn-primary,
[data-theme="fuchsia"] .btn-warning,
[data-theme="blue"] .btn-primary,
[data-theme="blue"] .btn-warning {
    color: #fff !important;
}

/* Green Theme (Premium Tinted Dark Green) */
[data-theme="green"] {
    --primary-color: #10b981;
    --primary-dark: #047857;
    --primary-light: #34d399;
    --secondary-color: #84cc16;
    --accent-color: #06b6d4;

    /* Surfaces - Green Tinted Dark */
    --bg-surface-0: #020617;
    --bg-surface-1: #0f172a;
    --bg-surface-2: #064e3b33;
    --bg-surface-3: #064e3b66;

    --bg-dark: var(--bg-surface-0);
    --bg-card: var(--bg-surface-1);
    --bg-lighter: var(--bg-surface-2);
    --bg-sidebar: var(--bg-surface-0);

    --text-primary: #f0fdf4;
    --text-secondary: #bbf7d0;
    --text-muted: #15803d;

    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-card: linear-gradient(145deg, rgba(6, 78, 59, 0.3), rgba(2, 6, 23, 0.95));
}

/* Purple Theme (Premium Tinted Dark Purple) */
[data-theme="purple"] {
    --primary-color: #8b5cf6;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --secondary-color: #ec4899;
    --accent-color: #6366f1;

    /* Surfaces - Purple Tinted Dark */
    --bg-surface-0: #0f0720;
    --bg-surface-1: #1e0b3b;
    --bg-surface-2: #4c1d9533;
    --bg-surface-3: #4c1d9566;

    --bg-dark: var(--bg-surface-0);
    --bg-card: var(--bg-surface-1);
    --bg-lighter: var(--bg-surface-2);
    --bg-sidebar: var(--bg-surface-0);

    --text-primary: #faf5ff;
    --text-secondary: #e9d5ff;
    --text-muted: #7e22ce;

    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-card: linear-gradient(145deg, rgba(76, 29, 149, 0.3), rgba(15, 7, 32, 0.95));
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

/* Layout Specifics */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 250px;
    max-width: 250px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    white-space: nowrap;
}

#page-content-wrapper {
    flex: 1;
    width: 100%;
    background: var(--bg-dark);
    min-width: 0;
    /* Prevents flex items from overflowing */
}

/* Scrollable menu area */
.sidebar-menu-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Sidebar */
.sidebar-menu-container::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu-container::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-menu-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-version {
    padding: 10px;
    opacity: 0.6;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

#wrapper.toggled .sidebar-version {
    font-size: 0.65rem;
    padding: 5px;
}


/* Sidebar Transitions for Labels */
#sidebar-wrapper .sidebar-logo span,
#sidebar-wrapper .list-group-item span,
#sidebar-wrapper .list-group-item .fa-chevron-down {
    transition: opacity 0.3s ease, transform 0.3s ease, max-width 0.3s ease;
    display: inline-block;
    vertical-align: middle;
    opacity: 1;
    max-width: 200px;
}

/* Mini Sidebar State */
#wrapper.toggled #sidebar-wrapper {
    min-width: 70px;
    max-width: 70px;
    margin-left: 0;
}

#wrapper.toggled #sidebar-wrapper .sidebar-logo a,
#wrapper.toggled #sidebar-wrapper .sidebar-logo span,
#wrapper.toggled #sidebar-wrapper .list-group-item span,
#wrapper.toggled #sidebar-wrapper .list-group-item .fa-chevron-down {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transform: translateX(-10px);
    pointer-events: none;
    display: none;
    /* Hide logo completely in mini-mode to focus on toggle */
}

#wrapper.toggled #sidebar-wrapper .list-group-item:hover span {
    opacity: 1;
    max-width: 200px;
    position: absolute;
    left: 70px;
    /* Aligned with sidebar edge */
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    pointer-events: none;
    transform: translateX(8px);
    /* Subtle detachment */
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}



#wrapper.toggled #sidebar-wrapper .sidebar-logo {
    justify-content: center;
    padding: 1rem 0;
}

#wrapper.toggled #sidebar-wrapper .list-group-item {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
}

#wrapper.toggled #sidebar-wrapper .list-group-item i {
    margin-right: 0 !important;
    font-size: 1.1rem;
    /* Same as expanded state */
    transition: all 0.3s ease;
}

#wrapper.toggled #sidebar-wrapper .list-group-item.ps-5 {
    padding-left: 0 !important;
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        position: fixed;
        height: 100vh;
        z-index: 1050;
        /* Highest priority */
    }

    /* Expanded state (Drawer overlay) */
    #sidebar-wrapper {
        min-width: 250px;
        max-width: 250px;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    /* Collapsed state (Small icon bar) */
    #wrapper.toggled #sidebar-wrapper {
        min-width: 70px;
        max-width: 70px;
        box-shadow: none;
    }

    #page-content-wrapper {
        margin-left: 70px;
        width: calc(100% - 70px);
    }
}

/* Glassmorphism & Cards */
.card,
.glass-card {
    background: var(--bg-card);
    /* Fallback */
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    /* Higher blur */
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Stronger border */
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    transition: var(--transition-medium);
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.4);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
    color: var(--text-primary);
    padding: 1rem 1.25rem;
}

/* Improved Inputs */
.form-control,
.form-select {
    background-color: var(--bg-lighter);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(51, 65, 85, 0.8);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

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

/* Tables - High Contrast */
.table {
    color: var(--text-secondary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
}

.table th {
    color: var(--text-primary);
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom-width: 2px;
}

.table-hover tbody tr:hover {
    color: var(--text-primary);
    background-color: rgba(99, 102, 241, 0.1);
    /* Highlight color */
}

/* Navbar & Header */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    min-height: 60px;
    z-index: 1001;
    /* Above sidebar tooltips if needed */
}

.navbar .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
}

.navbar .nav-link:hover {
    color: var(--primary-light) !important;
}

.bg-light {
    background-color: var(--bg-card) !important;
}

.bg-card {
    background-color: var(--bg-card) !important;
}

.btn-toolbar .btn {
    margin-left: 0.5rem;
}

/* Standardized Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Search Bar */
.search-bar {
    position: relative;
    min-width: 250px;
}

.search-bar input {
    width: 100%;
    padding-right: 2.5rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-menu {
    border-radius: var(--radius-md) !important;
    padding: 0.5rem !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

#tenantList {
    min-width: 320px;
    max-width: 450px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: var(--border-color);
    color: #fff;
}

.search-bar i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Sidebar Branding */
.sidebar-logo {
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.sidebar-logo a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    transition: opacity 0.2s;
}

.sidebar-logo a:hover {
    opacity: 0.85;
}

.sidebar-logo i {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

/* Sidebar Menu Items - High Contrast Fix */
#sidebar-wrapper .list-group-item {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: none;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    min-height: 54px;
    /* Fixed height for consistency */
    padding: 0.5rem 1.5rem;
}

/* Chevron Menu Animation */
.sidebar-menu-container .list-group-item .fa-chevron-down {
    transition: transform 0.3s ease;
    font-size: 0.75em;
}

.sidebar-menu-container .list-group-item[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Favorite Remove Icon */
.fav-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7em;
    opacity: 0.4;
    transition: all 0.2s;
}

.fav-remove-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

#sidebar-wrapper .list-group-item:hover {
    background-color: var(--border-color) !important;
    color: #fff !important;
    padding-left: 1.5rem;
}

#wrapper.toggled #sidebar-wrapper .list-group-item:hover {
    padding-left: 0.75rem;
    /* Reset slide in mini mode */
}

#sidebar-wrapper .list-group-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-left: 4px solid var(--accent-color);
}

/* Dashboard Design System Sync */
.dashboard-quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background-color: var(--bg-lighter);
    color: var(--text-primary) !important;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    min-width: 180px;
}

.dashboard-quick-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* --- Premium Filter Sections --- */
.filter-section-container {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.filter-accordion-header {
    background: var(--bg-surface-3) !important;
    color: var(--text-primary) !important;
    border: none !important;
    box-shadow: none !important;
}

.filter-accordion-header:not(.collapsed) {
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--bg-surface-2) !important;
}

.filter-accordion-header i {
    color: var(--primary-color) !important;
}

.filter-accordion-body {
    background: var(--bg-surface-1) !important;
    padding: 1.25rem !important;
    border: none !important;
}

[data-theme="white"] .filter-accordion-header {
    background: #f0f9ff !important;
    /* Sky 50 */
    color: #0369a1 !important;
    /* Sky 700 */
}

[data-theme="white"] .filter-accordion-header:not(.collapsed) {
    background: #e0f2fe !important;
    /* Sky 100 */
}

/* Precise Drag and Drop indicators */
.drop-before {
    box-shadow: inset 0 2px 0 0 var(--bs-primary) !important;
}

.drop-after {
    box-shadow: inset 0 -2px 0 0 var(--bs-primary) !important;
}

.drop-zone-active #favorites-list::after {
    content: '';
    display: block;
    height: 2px;
    background-color: var(--bs-primary);
    margin: 4px 1.5rem;
    border-radius: 2px;
    opacity: 0.8;
}

#sidebar-wrapper .list-group {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Custom Scrollbar for Sidebar */
#sidebar-wrapper .list-group::-webkit-scrollbar {
    width: 4px;
}

#sidebar-wrapper .list-group::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-wrapper .list-group::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#sidebar-wrapper .list-group::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

#sidebar-wrapper .list-group i {
    width: 24px;
    /* Slightly wider for better centering */
    text-align: center;
    font-size: 1.1rem;
    /* Rock solid size */
    transition: all 0.3s ease;
}

.dashboard-quick-link:hover i {
    color: #fff;
}

.chart-filter-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.2s;
}

.chart-filter-btn:hover,
.chart-filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff !important;
}

/* Modal & Input overrides for deep theming */
.modal-content {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    pointer-events: auto;
}

.form-control,
.form-select {
    background-color: var(--bg-lighter) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-lighter) !important;
    color: var(--text-primary) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color), 0.25);
}

.sidebar-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sidebar-logo span {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* User Profile Widget */
.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-profile-widget:hover {
    background: var(--border-color);
}

.user-profile-widget img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
}

.user-profile-widget .info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-profile-widget .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Senior UI/UX Polish --- */

/* 1. Global Contrast & Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.025em;
    /* Modern tight spacing */
}

/* Force light text on cards/tables to prevent dark-on-dark issues */
.card,
.table,
.modal-content,
.table th,
.table td,
.form-label,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary) !important;
}

.text-muted {
    color: var(--text-secondary) !important;
    /* Lighter muted text */
}

/* Fix specific issue where some browser defaults override inheritance */
.table {
    color: var(--text-primary) !important;
}

/* 2. Enhanced Glassmorphism & Cards */
.glass-card,
.card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    /* Softer, deeper shadow */
}

/* 3. Modern Status Badges (Pills) */
.badge {
    padding: 0.35em 0.8em;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border-radius: 50rem;
    /* Pill shape */
    backdrop-filter: blur(4px);
}

/* Status Colors with High Contrast for Dark Mode */
.bg-success {
    background-color: rgba(16, 185, 129, 0.25) !important;
    color: #d1fae5 !important;
    /* Emerald 100 - High Contrast */
    border: 1px solid rgba(16, 185, 129, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.bg-warning {
    background-color: rgba(245, 158, 11, 0.25) !important;
    color: #fef3c7 !important;
    /* Amber 100 - High Contrast */
    border: 1px solid rgba(245, 158, 11, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.bg-danger {
    background-color: rgba(239, 68, 68, 0.25) !important;
    color: #fee2e2 !important;
    /* Red 100 - High Contrast */
    border: 1px solid rgba(239, 68, 68, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.bg-info {
    background-color: rgba(59, 130, 246, 0.25) !important;
    color: #dbeafe !important;
    /* Blue 100 - High Contrast */
    border: 1px solid rgba(59, 130, 246, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.bg-secondary {
    background-color: rgba(148, 163, 184, 0.25) !important;
    color: #f1f5f9 !important;
    /* Slate 100 - High Contrast */
    border: 1px solid rgba(148, 163, 184, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

/* 4. Table Interactions */
.table-hover tbody tr {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
    /* Subtle light highlight */
    transform: translateY(-1px);
    /* Micro-interaction */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

/* 5. Button Refinements */
.btn {
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
    /* Avoid uppercase shouting */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

/* 6. Empty States */
td.text-center.text-secondary {
    padding: 3rem !important;
    font-style: italic;
    opacity: 0.7;
}

/* 7. Dropdown Menus (Theme Aware) */
.dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.dropdown-item,
.dropdown-header {
    color: var(--text-primary);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-lighter);
    color: var(--text-primary);
}

.dropdown-divider {
    border-top-color: var(--border-color);
}

/* --- Timeline Component (Refined) --- */
.timeline {
    position: relative;
    padding: 10px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 24px;
    /* Move line slightly right */
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 60px;
    /* More space for marker */
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 15px;
    /* Center on the 24px line (24 + 1 - 10 = 15) */
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 1;
    box-shadow: 0 0 0 4px var(--bg-card);
    /* Spacing match card bg */
}

/* Ensure marker colors are visible */
.bg-success {
    background-color: #10b981 !important;
}

.bg-info {
    background-color: #3b82f6 !important;
}

.bg-warning {
    background-color: #f59e0b !important;
}

.bg-danger {
    background-color: #ef4444 !important;
}

.bg-secondary {
    background-color: #64748b !important;
}

.timeline-marker i {
    font-size: 10px;
}

.timeline-content {
    background-color: #334155 !important;
    /* Force Slate 700 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    position: relative;
    color: #f8fafc !important;
    /* Force light text */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.timeline-content::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 10px;
    border: 6px solid transparent;
    border-right-color: rgba(255, 255, 255, 0.1);
}

.timeline-content::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 11px;
    border: 5px solid transparent;
    border-right-color: #334155 !important;
    /* Match content bg */
}

.timeline-content strong {
    color: #60a5fa !important;
    /* Blue 400 for titles */
    display: block;
    margin-bottom: 0.25rem;
}

.timeline-content .text-muted {
    color: #cbd5e1 !important;
    /* Slate 300 for readable muted text */
}

/* Fix for specific timestamp alignment */
.timeline-content .d-flex {
    align-items: center;
}

/* --- Sidebar Toggle Button (Premium UX) --- */
/* --- Sidebar Toggle Button (Clean & Modern UX) --- */
.sidebar-toggle-btn {
    position: absolute;
    right: -12px;
    /* Overlap with border */
    top: 30px;
    /* Positioned near the top/logo area instead of middle for a cleaner look */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Circular for a cleaner look */
    background: var(--bg-surface-1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    padding: 0;
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

#wrapper.toggled .sidebar-toggle-btn {
    right: auto;
    left: 12px;
    /* Positioned inside the mini-sidebar at the left */
    top: 30px;
}

@media (max-width: 768px) {
    .sidebar-toggle-btn {
        right: -12px;
    }

    #wrapper.toggled .sidebar-toggle-btn {
        right: -12px;
        /* Keep it on the right edge for mobile drawer */
        left: auto;
    }
}

.sidebar-toggle-btn i {
    font-size: 0.65rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--primary-color);
    color: #fff;
    opacity: 1;
    transform: scale(1.1);
}

.sidebar-toggle-btn:hover i {
    color: #fff;
}

.sidebar-toggle-btn:active {
    transform: scale(0.9);
}

/* --- Premium Toasts (Glassmorphism) --- */
.toast {
    background: var(--bg-card) !important;
    /* Fallback */
    background: rgba(30, 41, 59, 0.85) !important;
    /* Semi-transparent Slate */
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    max-width: 350px;
    font-weight: 500;
}

/* Toast Header/Body Alignment */
.toast-body {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    padding: 1rem;
}

.toast-body i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

/* Toast Variants (Override Bootstrap text-bg-*) */
.toast.text-bg-success {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.9), rgba(2, 44, 34, 0.95)) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #ecfdf5 !important;
    /* Emerald 50 */
}

.toast.text-bg-success i {
    color: #34d399 !important;
}

.toast.text-bg-danger {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.9), rgba(69, 10, 10, 0.95)) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fef2f2 !important;
    /* Red 50 */
}

.toast.text-bg-danger i {
    color: #f87171 !important;
}

.toast.text-bg-warning {
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.9), rgba(69, 26, 3, 0.95)) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fffbeb !important;
    /* Amber 50 */
}

.toast.text-bg-warning i {
    color: #fbbf24 !important;
}

.toast.text-bg-info {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9), rgba(23, 37, 84, 0.95)) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #eff6ff !important;
    /* Blue 50 */
}

.toast.text-bg-info i {
    color: #60a5fa !important;
}

/* Close Button Override */
.toast .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
}

.toast .btn-close:hover {
    opacity: 1;
}

/* --- Flatpickr Dark/Light Theme Overrides --- */

.flatpickr-calendar {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
    color: var(--text-primary) !important;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
    border-bottom-color: var(--bg-card) !important;
}

.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
    border-top-color: var(--bg-card) !important;
}

.flatpickr-months {
    background: transparent !important;
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: var(--bg-lighter) !important;
}

.flatpickr-current-month input.cur-year {
    color: var(--text-primary) !important;
}

.flatpickr-weekdays {
    background: transparent !important;
}

span.flatpickr-weekday {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

.flatpickr-day {
    color: var(--text-primary) !important;
}

.flatpickr-day.today {
    border-color: var(--text-secondary) !important;
}

.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus {
    background: var(--bg-lighter) !important;
    border-color: var(--bg-lighter) !important;
    color: var(--text-primary) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: bold;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.notAllowed,
.flatpickr-day.notAllowed.prevMonthDay,
.flatpickr-day.notAllowed.nextMonthDay {
    color: var(--text-muted) !important;
    background: transparent !important;
    border-color: transparent !important;
}

/* Time Picker */
.flatpickr-time {
    background: transparent !important;
    border-top: 1px solid var(--border-color) !important;
}

.flatpickr-time .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text-secondary) !important;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-top-color: var(--text-secondary) !important;
}

.flatpickr-time input {
    color: var(--text-primary) !important;
}

.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: var(--text-primary) !important;
}

.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
    background: var(--bg-lighter) !important;
}

/* Confirm Date Plugin Fixes */
.flatpickr-confirm {
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 10px !important;
    height: auto !important;
    max-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

.flatpickr-confirm svg,
.flatpickr-confirm i {
    fill: var(--primary-color) !important;
    color: var(--primary-color) !important;
    width: 20px;
    height: 20px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.flatpickr-confirm:hover {
    background: var(--bg-lighter) !important;
}

.flatpickr-confirm:hover svg,
.flatpickr-confirm:hover i {
    transform: scale(1.1);
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
}

/* Ensure text visibility */
.flatpickr-confirm span {
    display: none;
    /* Hide text if icon is enough, or style it */
}

/* If text is desired along with icon */
/* 
.flatpickr-confirm {
    color: var(--primary-color) !important;
    font-weight: 700;
} 
*/
/* --- Time Picker Enhancement --- */
.flatpickr-time input {
    color: var(--text-primary) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: var(--radius-sm) !important;
    transition: all 0.2s ease !important;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus {
    background: var(--bg-lighter) !important;
    border-color: var(--primary-color) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.25) !important;
    /* Fallback if var not avail */
}

/* Ensure arrows are visible and themed */
.flatpickr-time .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text-secondary) !important;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-top-color: var(--text-secondary) !important;
}

.flatpickr-time .numInputWrapper:hover span.arrowUp:after {
    border-bottom-color: var(--primary-color) !important;
}

.flatpickr-time .numInputWrapper:hover span.arrowDown:after {
    border-top-color: var(--primary-color) !important;
}

/* Make sure the AM/PM toggle is also interactive */
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
    background: var(--bg-lighter) !important;
    color: var(--primary-color) !important;
    border-radius: var(--radius-sm) !important;
}

/* --- Timeline V2 (Modern Unified Timeline) --- */
.timeline-v2 {
    position: relative;
    padding: 10px 0;
}

.timeline-v2-item {
    position: relative;
    padding-left: 45px;
    margin-bottom: 20px;
    border-left: 2px solid var(--border-color);
    margin-left: 15px;
}

.timeline-v2-item:last-child {
    border-left-color: transparent;
    margin-bottom: 10px;
}

.timeline-v2-marker {
    position: absolute;
    left: -17px;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 0 0 4px var(--bg-dark);
}

.timeline-v2-marker i {
    font-size: 0.85rem;
}

.timeline-v2-content {
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    transition: all 0.2s ease;
}

.timeline-v2-item:hover .timeline-v2-content {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(var(--primary-color-rgb), 0.3);
}

.timeline-v2-content h6 {
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* Tab Polishing in Modal */
#apptDetailTabs,
#apptEditTabs {
    border-bottom: 1px solid var(--border-color);
}

#apptDetailTabs .nav-link,
#apptEditTabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

#apptDetailTabs .nav-link:hover,
#apptEditTabs .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

#apptDetailTabs .nav-link.active,
#apptEditTabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-color);
}

.tab-content#apptDetailTabsContent {
    min-height: 350px;
}

/* Autocomplete Custom Styles */
.autocomplete-results {
    position: absolute;
    z-index: 2000;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
    margin-top: 2px;
}

.autocomplete-results .list-group-item {
    cursor: pointer;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    transition: background 0.2s;
}

.autocomplete-results .list-group-item:hover {
    background-color: var(--bg-lighter) !important;
    color: var(--primary-light) !important;
}

.autocomplete-results .list-group-item:last-child {
    border-bottom: none;
}

/* Sticky Header Fix for Permissons Table */
#userMatrixTable thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-card) !important;
    border-bottom: 2px solid var(--border-color);
}