/* Import Font */
/* Now using link tag in _Layout for performance, but keeping this as backup or local override if needed */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables for theming */
/* Root and Global Variable Overrides */
html, body, :root {
    /* --- Modernize Theme System (THM-1) --- */
    --primary-color: #5D87FF;
    --primary-hover: #4F73D9;
    --primary-light: #F4F7FF;
    --secondary-color: #13DEB9;
    --secondary-hover: #11C7A6;
    --secondary-light: #E6FFFA;
    
    --success-color: #13DEB9;
    --danger-color: #FA896B;
    --warning-color: #FFAE1F;
    --info-color: #539BFF;

    --primary-text-color: #FFFFFF;
    --text-color: #2A3547;
    --text-muted: #7C8FAC;
    --bg-color: #F8FAFC;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-color: rgba(226, 232, 240, 0.8);
    
    --sidebar-bg: #FFFFFF;
    --sidebar-text: #2A3547;
    --sidebar-active-text: #5D87FF;
    --sidebar-active-bg: #F4F7FF;
    
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --card-radius: 12px;
    --input-radius: 8px;
    --glass-blur: blur(10px);
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);

    /* --- Override Bootstrap Variables Global (Final Fix) --- */
    --bs-light-rgb: 244, 247, 255;
    --bs-light: #F4F7FF;
    --bs-body-bg: #F8FAFC;

    /* --- Modernize Elevations (DSB-2) --- */
    --elevation-1: 0 2px 6px rgba(0, 0, 0, 0.04);
    --elevation-2: 0 4px 12px rgba(0, 0, 0, 0.06);
    --elevation-3: 0 10px 30px rgba(0, 0, 0, 0.08);
}

body.dark-theme {
    /* ... existing ... */
    --card-bg: rgba(32, 38, 50, 0.95);
    --border-color: rgba(255, 255, 255, 0.05);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    
    --elevation-1: 0 2px 6px rgba(0, 0, 0, 0.2);
    --elevation-2: 0 4px 12px rgba(0, 0, 0, 0.3);
    --elevation-3: 0 10px 30px rgba(0, 0, 0, 0.4);
    
    --sidebar-bg: #202632;
    --sidebar-text: #EAEFF4;
    --sidebar-active-text: #5D87FF;
    --sidebar-active-bg: #253662;
    
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

    /* Dark Theme Surface Colors */
    --bs-light-rgb: 42, 48, 60; 
    --bs-light: #2A303C;
    --bg-color: #1A1F26;
    --bs-body-bg: #1A1F26;
}

/* --- Theme Variations (THM-3) --- */
body.theme-aqua {
    --primary-color: #00CED1;
    --primary-hover: #00B2B2;
    --primary-light: #E0FFFF;
    --sidebar-active-text: #00CED1;
    --sidebar-active-bg: #E0FFFF;
    --bs-light-rgb: 240, 255, 255;
    --bs-light: #F0FFFF;
    --bg-color: #F8FFFF;
}

body.theme-purple {
    --primary-color: #763EBD;
    --primary-hover: #6535A3;
    --primary-light: #F2ECF9;
    --sidebar-active-text: #763EBD;
    --sidebar-active-bg: #F2ECF9;
    --bs-light-rgb: 249, 245, 254;
    --bs-light: #F9F5FE;
    --bg-color: #FBFAFF;
}

body.theme-orange {
    --primary-color: #FFAE1F;
    --primary-hover: #E69B1C;
    --primary-light: #FFF8EC;
    --sidebar-active-text: #FFAE1F;
    --sidebar-active-bg: #FFF8EC;
    --bs-light-rgb: 255, 250, 242;
    --bs-light: #FFFAF2;
    --bg-color: #FFFCF8;
}

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    display: flex;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Global Form Control Simplification */
.form-control, .form-select {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color);
    border-radius: var(--input-radius);
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff !important;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 135, 255, 0.1);
    outline: none;
}

.form-control-sm, .form-select-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.form-label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
}

/* /* --- Premium Sidebar Modernization (THM-2) --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1002;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border-color);
}

/* Sidebar Logo / Header */
.sidebar-header {
    height: 80px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

.logo .logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* --- Theme-Aware Logo Filter --- */
/* For light themes, we want original colored logo. 
   Filter is only applied on dark backgrounds to ensure visibility. */
body.dark-theme .sidebar .logo img {
    filter: brightness(0) invert(1);
}

.close-sidebar {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    color: var(--sidebar-active-text);
    font-size: 1.5rem;
    cursor: pointer;
}
.sidebar-nav {
    padding: 10px 14px;
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 0.885rem;
    font-weight: 400;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 12px;
    position: relative;
}

/* Parent Category Highlighting */
.sidebar-nav li a.active, 
.sidebar-nav li.open > a {
    background-color: var(--primary-color) !important;
    color: #FFFFFF !important;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(93, 135, 255, 0.25);
    transform: none !important;
}

.sidebar-nav li a.active i,
.sidebar-nav li.open > a i {
    color: #FFFFFF !important;
}

/* Hover effect with Micro-interaction */
.sidebar-nav li a:hover:not(.active) {
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(6px);
}

/* Clean Submenu (Modernize Style) */
.submenu {
    list-style: none;
    padding: 2px 0 2px 5px;
    margin-left: 20px;
    background: transparent !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav li.open > .submenu {
    max-height: 800px;
}

.submenu li a {
    padding: 8px 16px;
    background: transparent !important;
    color: var(--text-muted);
    font-weight: 400;
}

/* Submenu Bullet Transition (UX-5) */
.submenu li a::before {
    content: '';
    width: 6px;
    height: 6px;
    border: 1.5px solid var(--text-muted);
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.25s ease;
}

.submenu li a:hover::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.2);
}

.submenu li a.active {
    background: transparent !important;
    color: var(--primary-color) !important;
    font-weight: 600;
    box-shadow: none !important;
}

.submenu li a.active i {
    color: var(--primary-color) !important;
}

.submenu li a.active::before {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

/* Indicators (UX-5) */
.sidebar .has-submenu > a .arrow {
    margin-left: auto;
    font-size: 1.1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar li.open > a .arrow {
    transform: rotate(180deg);
}


/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: 250px;
    padding: 24px;
    transition: margin-left 0.3s ease-in-out;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    padding: 15px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

.header-title h1 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.header-title p {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

    .header-actions i {
        font-size: 1.4rem;
        cursor: pointer;
    }

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* Dashboard Grid & Cards */
/*.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.dashboard-grid a {
    text-decoration:none;
    cursor:context-menu;   
}
/* --- Global Card Modernization (DSB-2) --- */
.card {
    background-color: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--card-radius);
    transition: all 0.3s ease;
    border: none;
    margin-bottom: 24px;
    height: 100%;
}

/* Shadowed Style (Default/Toggle) */
.theme-card-shadowed .card {
    box-shadow: var(--elevation-1);
    border: 1px solid transparent; /* Clean look */
}

.theme-card-shadowed .card:hover {
    box-shadow: var(--elevation-2);
}

/* Bordered Style (Toggle) */
.theme-card-bordered .card {
    border: var(--glass-border);
    box-shadow: none;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 20px 24px !important;
}

.card-body {
    padding: 24px !important;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0;
}

    .card h3 {
        font-size: 0.8rem;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-bottom: 8px;
    }

    .card h2 {
        font-size: 2rem;
        color: var(--text-color);
    }

    .card p {
        margin-top: 16px;
    }*/

.positive-change {
    color: var(--secondary-color);
}

.negative-change {
    color: #f06548;
}

/* Data Table Styles (Modernized) */
.table-container {
    overflow-x: auto;
    background: #ffffff;
    border-radius: var(--card-radius);
    margin-top: 10px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background-color: #ffffff;
    padding: 16px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 16px 20px;
    font-size: 0.9rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: rgba(var(--bs-light-rgb), 0.5);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Semi-bold text in tables (instead of heavy strong tags) */
.table-primary-text {
    font-weight: 600;
    color: var(--text-color);
}

.table-secondary-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Compact Data Table for Financial Reports */
.data-table.compact th,
.data-table.compact td {
    padding: 10px 14px;
    font-size: 0.8125rem;
}
.data-table.compact th {
    font-size: 0.725rem;
    letter-spacing: 0.04em;
    background-color: var(--card-bg, #ffffff);
}
.data-table.compact td.num,
.data-table.compact th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.data-table.compact tr.total-row td {
    font-weight: 700;
    background-color: var(--primary-light, #F4F7FF);
    color: var(--text-color, #2A3547);
    border-top: 1px solid var(--border-color);
}

/* Financial Report Navigation Pills */
.report-nav-pill {
    color: var(--text-muted, #7C8FAC);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
}
.report-nav-pill:hover {
    color: var(--primary-color, #5D87FF);
    background-color: var(--primary-light, #F4F7FF);
}
.report-nav-pill.active {
    color: #ffffff !important;
    background-color: var(--primary-color, #5D87FF) !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(93, 135, 255, 0.3);
}

/* Theme Customizer */
.theme-toggler {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--primary-text-color); /* Use dynamic text color */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s, color 0.3s;
}

    .theme-toggler i {
        font-size: 1.8rem;
        animation: spin 3s linear infinite;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.theme-customizer {
    position: fixed;
    top: 0;
    right: -320px; /* Initially hidden */
    width: 320px;
    height: 100vh;
    background-color: var(--card-bg);
    border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.4s ease-in-out, background-color 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

    .theme-customizer.open {
        right: 0;
    }

.theme-customizer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .theme-customizer-header h3 {
        margin: 0;
        font-size: 1.1rem;
        color: var(--text-color);
    }

.close-customizer {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.theme-customizer-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.customizer-section {
    margin-bottom: 24px;
}

    .customizer-section h4 {
        font-size: 0.9rem;
        margin-bottom: 12px;
        color: var(--text-color);
        font-weight: 500;
    }

.layout-options, .color-scheme-options {
    display: flex;
    gap: 10px;
}

    .layout-options button, .color-scheme-options button {
        flex: 1;
        padding: 8px 15px;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        background-color: transparent;
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .layout-options button:hover, .color-scheme-options button:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .layout-options button.active, .color-scheme-options button.active {
            background-color: var(--primary-color);
            color: var(--primary-text-color);
            border-color: var(--primary-color);
        }

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0;
    background-color: transparent;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}


.theme-customizer-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.reset-theme {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .reset-theme:hover {
        background-color: var(--primary-color);
        color: var(--primary-text-color); /* Use dynamic text color */
    }


/* --- Modern Auth Page Layout --- */

/* --- FIX: Ensure html and body take full height --- */
html, body.auth-page {
    height: 100%;
}

.auth-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-wrapper {
    display: flex;
    flex-grow: 1;
}

.auth-content-left {
    width: 45%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    text-align: center;
    transition: background-color 0.3s;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

    .auth-brand i {
        font-size: 3rem;
    }

    .auth-brand h1 {
        font-size: 2.5rem;
        font-weight: 700;
    }

.auth-content-left p {
    font-size: 1.1rem;
    max-width: 450px;
    opacity: 0.8;
}

.auth-content-right {
    width: 55%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: var(--card-bg);
}

.auth-form-container {
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: left;
    margin-bottom: 2rem;
}

    .auth-header h2 {
        font-size: 2rem;
        font-weight: 600;
        color: var(--text-color);
    }

    .auth-header p {
        color: var(--text-muted);
        margin-top: 0.5rem;
    }

/* Ensure body doesn't use flex for auth pages */
body.auth-page {
    display: block;
}

/* Responsive styles for the auth page */
@media (max-width: 992px) {
    .auth-content-left {
        display: none;
    }

    .auth-content-right {
        width: 100%;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .sidebar {
        left: -250px;
    }

        .sidebar.open {
            left: 0;
        }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .close-sidebar {
        display: block;
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.4);
        z-index: 1001;
        display: none;
    }

        .overlay.show {
            display: block;
        }
}


.auth-page-simple {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .login-header h2 {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--primary-color);
    }

    .login-header p {
        color: var(--text-muted);
        font-size: 0.9rem;
    }



/* --- Modern Dashboard Card Styles --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 2fr));
    gap: 24px;
}

    .dashboard-grid .card {
        border: var(--glass-border);
        border-radius: 16px;
        color: white;
        position: relative;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        padding: 24px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-start;
        box-shadow: var(--shadow);
    }

        .dashboard-grid .card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
        }

        .dashboard-grid .card h3 {
            font-size: 0.85rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            opacity: 0.9;
            margin-bottom: 4px;
            color: rgba(255,255,255,0.9) !important;
        }

        .dashboard-grid .card h2 {
            font-size: 2.5rem;
            font-weight: 800;
            margin: 0;
            line-height: 1.2;
            color: white !important;
        }

        .dashboard-grid .card p {
            font-size: 0.9rem;
            opacity: 0.9;
            margin: 0;
        }

.card-icon {
    position: absolute;
    top: -20px;
    left: -20px; /* Changed from right to left */
    font-size: 100px;
    opacity: 0.15;
    transform: rotate(20deg); /* Adjusted rotation for left side */
}

/* Professional Color Palette */
.card-blue {
    background: linear-gradient(45deg, #405189, #556ee6);
}

.card-green {
    background: linear-gradient(45deg, #0ab39c, #34c38f);
}

.card-orange {
    background: linear-gradient(45deg, #f7b84b, #f9c26a);
}

.card-red {
    background: linear-gradient(45deg, #f06548, #f2836e);
}


/*New Color Palette*/

.card-purple {
    background: linear-gradient(45deg, #6f42c1, #a074e9);
}

.card-teal {
    background: linear-gradient(45deg, #20c997, #5be6c1);
}

.card-gray {
    background: linear-gradient(45deg, #6c757d, #adb5bd);
}

.card-pink {
    background: linear-gradient(45deg, #e83e8c, #f28db7);
}
.card-cyan {
    background: linear-gradient(45deg, #17a2b8, #63cdda);
}

.card-indigo {
    background: linear-gradient(45deg, #6610f2, #8e54e9);
}

.card-yellow {
    background: linear-gradient(45deg, #ffc107, #ffe082);
}

.card-navy {
    background: linear-gradient(45deg, #001f3f, #3c4b64);
}

.card-brown {
    background: linear-gradient(45deg, #795548, #a1887f);
}

.card-lime {
    background: linear-gradient(45deg, #cddc39, #d4e157);
}

.card-silver {
    background: linear-gradient(45deg, #bdc3c7, #ececec);
}


.card-black {
    background: linear-gradient(45deg, #2c2c2c, #4f4f4f);
}
/*End New Color Palette*/

/* --- Toast Notification Styles --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    background-color: #dc3545; /* Red for warnings */
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

    .toast-notification.show {
        opacity: 1;
        transform: translateX(0);
    }

    .toast-notification i {
        font-size: 1.5rem;
    }


/* --- Responsive Table System --- */
@media screen and (max-width: 768px) {
    .responsive-table thead:not(.filter-thead) {
        display: none; /* Hide headers on mobile */
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 1.5rem;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: var(--shadow);
        padding: 5px;
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
        white-space: normal;
    }

    .responsive-table td:last-child {
        border-bottom: none;
        justify-content: center;
        background: rgba(0,0,0,0.02);
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-align: left;
        flex: 1;
    }

    /* Override for Empty State Row in responsive view */
    .responsive-table tr.empty-state-row {
        display: block !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
    }
    .responsive-table tr.empty-state-row td {
        display: block !important;
        text-align: center !important;
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
    }
    .responsive-table tr.empty-state-row td::before {
        display: none !important;
    }
}

/* --- Improved Action Bar & Filters --- */
.action-bar {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

@media screen and (max-width: 768px) {
    .action-bar {
        flex-direction: column;
    }
    .action-bar .btn {
        width: 100%;
    }
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

@media screen and (max-width: 576px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Timeline Styles for Candidate History --- */
.timeline {
    list-style: none;
    padding: 5px 0 5px;
    position: relative;
}

    .timeline:before {
        top: 0;
        bottom: 0;
        position: absolute;
        content: " ";
        width: 3px;
        background-color: var(--border-color);
        left: 25px;
        margin-right: -1.5px;
    }

    .timeline > li {
        margin-bottom: 10px;
        position: relative;
    }

        .timeline > li:before,
        .timeline > li:after {
            content: " ";
            display: table;
        }

        .timeline > li:after {
            clear: both;
        }

        .timeline > li > .timeline-panel {
            width: calc(100% - 75px);
            float: right;
            border: 1px solid #d4d4d4;
            border-radius: 6px;
            padding: 10px;
            position: relative;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
        }

        .timeline > li > .timeline-badge {
            color: #fff;
            width: 50px;
            height: 50px;
            line-height: 50px;
            font-size: 1.4em;
            text-align: center;
            position: absolute;
            top: 16px;
            left: 0px;
            margin-right: -25px;
            background-color: var(--bs-light);
            z-index: 100;
            border-radius: 50%;
        }
/* Timeline Badge Colors */
.timeline-badge.submitted, .timeline-badge.searching {
    background-color: #556ee6 !important;
}

.timeline-badge.shortlisted, .timeline-badge.waitlisted {
    background-color: #f7b84b !important;
}

.timeline-badge.interview {
    background-color: #34c38f !important;
}

.timeline-badge.rejected, .timeline-badge.absconding {
    background-color: #f06548 !important;
}

.timeline-badge.offered, .timeline-badge.joined {
    background-color: #0ab39c !important;
}

.timeline-title {
    margin-top: 0;
    color: inherit;
}

.timeline-body > p,
.timeline-body > ul {
    margin-bottom: 0;
}

    .timeline-body > p + p {
        margin-top: 5px;
    }


/*Dashboard Notifications*/

.notif-wrapper {
    position: relative;
    display: inline-block;
}

    .notif-wrapper:hover .notif-panel,
    .notif-wrapper:focus-within .notif-panel {
        display: block;
    }

.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: #f06548;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    line-height: 16px;
    padding: 0 6px;
    min-width: 18px;
    text-align: center;
}
.notif-panel {
    position: absolute;
    right: 0;
    top: 100%; /* instead of a hard pixel like 36px */
    margin-top: 6px; /* small spacing but no dead zone */
    width: 360px;
    max-height: 420px;
    background: #fff;
    border: 1px solid var(--border-color,#e9ebec);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
    display: none;
    overflow: hidden;
    z-index: 1000;
}
    .notif-panel:hover {
        display: block;
    }

.notif-header {
    padding: 10px 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.notif-body {
    max-height: 350px;
    overflow: auto;
}

.notif-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f3f3;
}

    .notif-item:hover {
        background: var(--bs-light);
    }

.notif-title {
    font-weight: 600;
}

.notif-sub {
    font-size: 12px;
    color: #6c757d;
}

.notif-footer {
    padding: 8px 12px;
    text-align: right;
    border-top: 1px solid #f3f3f3;
    background: var(--bg-color);
}

.notif-wrapper:hover .notif-panel {
    display: block;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: #f06548;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    line-height: 16px;
    padding: 0 6px;
    min-width: 18px;
    text-align: center;
}
/* pure CSS hover open */


/* ===== Fullscreen Loader ===== */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 20000; /* above everything including search and modals */
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease-in-out, visibility .2s;
}

    .app-loader.is-active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

.app-loader__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4); /* slightly darker for better intimacy */
    backdrop-filter: blur(2px);
}

.app-loader__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,.2);
    min-width: 180px;
}

/* Spinner (no external assets) */
.app-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(93, 135, 255, 0.1);
    border-top-color: var(--primary-color, #5D87FF); 
    border-radius: 50%;
    animation: appspin .8s linear infinite;
}

@keyframes appspin {
    to { transform: rotate(360deg); }
}

.app-loader__text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color, #2A3547);
}

/* --- Unified Premium Button System --- */
.btn {
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 8px; /* Slightly more rounded for premium look */
    padding: 0.5rem 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
}

.btn:active {
    transform: scale(0.96);
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(64, 81, 137, 0.15);
}

.btn-primary:hover {
    background-color: #364574 !important;
    border-color: #364574 !important;
    box-shadow: 0 6px 15px rgba(64, 81, 137, 0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.btn-secondary:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.btn-soft-primary {
    background-color: rgba(64, 81, 137, 0.1);
    color: var(--primary-color);
    border: 1px solid transparent;
}

.btn-soft-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-soft-success {
    background-color: rgba(10, 179, 156, 0.1);
    color: #0ab39c;
    border: 1px solid transparent;
}

.btn-soft-success:hover {
    background-color: #0ab39c;
    color: white;
}

.btn-soft-danger {
    background-color: rgba(240, 101, 72, 0.1);
    color: #f06548;
    border: 1px solid transparent;
}

.btn-soft-danger:hover {
    background-color: #f06548;
    color: white;
}

.btn-soft-info {
    background-color: rgba(41, 156, 219, 0.1);
    color: #299cdb;
    border: 1px solid transparent;
}

.btn-soft-info:hover {
    background-color: #299cdb;
    color: white;
}

.btn-soft-secondary {
    background-color: rgba(53, 59, 72, 0.1);
    color: #353b48;
    border: 1px solid transparent;
}

.btn-soft-secondary:hover {
    background-color: #353b48;
    color: white;
}

/* Action Icons Container */
.action-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.action-icons .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-icons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-icons .btn i {
    font-size: 1.1rem;
}

.btn-outline-secondary {
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
    background-color: transparent !important;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-color) !important;
    border-color: var(--border-color) !important;
    color: var(--primary-color) !important;
}

/* Component-Level Force Fix for bg-light and Surfaces Overriding */
body .bg-light, 
body [class*="bg-light"],
body div.bg-light,
body section.bg-light,
body .card-header,
body .data-table th,
body .table thead th {
    --bs-bg-opacity: 1 !important;
    background-color: var(--bs-light) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.card-header {
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.bg-white {
    background-color: #ffffff !important;
}

/* --- Global Search Overlay --- */
#searchOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
}

#searchOverlay.active {
    display: flex;
}

.search-modal {
    width: 90%;
    max-width: 650px;
    margin-top: 100px;
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: searchSlideIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-field-container {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-field-container i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

#globalSearchInput {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.35rem;
    width: 100%;
    outline: none;
    font-weight: 500;
}

.search-results-container {
    max-height: 500px;
    overflow-y: auto;
    background: var(--card-bg);
}

.search-result-item {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: var(--bs-light);
}

.search-result-item i.res-icon {
    font-size: 1.6rem;
    color: var(--primary-color);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-light);
    border-radius: 12px;
}

.search-category-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--primary-color);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 12px;
}

.search-res-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.search-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.search-no-results {
    padding: 60px 40px;
    text-align: center;
}

.search-no-results i {
    font-size: 3.5rem;
    color: var(--text-muted);
    opacity: 0.3;
}

/* --- Search Box Trigger in Header --- */
.search-box-trigger {
    background: var(--bs-light);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 16px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    cursor: pointer;
    min-width: 200px;
    height: 38px;
    transition: all 0.2s;
    user-select: none;
}

.search-box-trigger:hover {
    background: rgba(0,0,0,0.05);
    border-color: var(--primary-color);
    border-width: 1.5px;
    color: var(--text-color);
}

.search-box-trigger i {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.search-box-trigger kbd {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.7rem;
    padding: 1px 5px;
    margin-left: auto;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .search-box-trigger span, .search-box-trigger kbd {
        display: none;
    }
    .search-box-trigger {
        min-width: 40px;
        padding: 0;
        justify-content: center;
        margin-right: 8px;
    }
}

/* --- Theme Customizer Styles (THM-2) --- */
.theme-customizer-btn {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(93, 135, 255, 0.4);
    z-index: 1005;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-customizer-btn:hover {
    transform: scale(1.1) rotate(45deg);
}

.customizer-drawer {
    position: fixed;
    right: -320px;
    top: 0;
    width: 320px;
    height: 100vh;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border-left: var(--glass-border);
    z-index: 1006;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

.customizer-drawer.open {
    right: 0;
}

.customizer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customizer-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--text-color);
}

.customizer-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.customizer-body {
    padding: 24px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.customizer-body::-webkit-scrollbar {
    width: 6px;
}

.customizer-body::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
}

.customizer-section {
    margin-bottom: 32px;
}

.customizer-section-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
    letter-spacing: -0.2px;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.toggle-btn {
    background: var(--bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.toggle-btn i {
    font-size: 1.25rem;
}

.toggle-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

.toggle-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-color);
}

.color-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-dot.active {
    border-color: rgba(0,0,0,0.1);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.color-dot.active::after {
    content: '\ebcc'; /* bx-check */
    font-family: 'boxicons';
    color: #fff;
    font-size: 1.2rem;
}

.custom-range {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* --- Dashboard Summary Cards (DSB-1) --- */
.stat-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: var(--card-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--elevation-1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--elevation-2);
}

.stat-card-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.stat-card-info p {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 4px 0 0;
    color: var(--text-muted);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.primary .stat-card-icon { background: rgba(93, 135, 255, 0.1); color: #5D87FF; }
.stat-card.success .stat-card-icon { background: rgba(19, 222, 185, 0.1); color: #13DEB9; }
.stat-card.info .stat-card-icon { background: rgba(0, 206, 209, 0.1); color: #00CED1; }
.stat-card.warning .stat-card-icon { background: rgba(255, 174, 31, 0.1); color: #FFAE1F; }
.stat-card.danger .stat-card-icon { background: rgba(240, 101, 72, 0.1); color: #f06548; }

/* --- Modernize Invoice Styles (INV-1) --- */
/* (Removed legacy invoice-edit-header) */

.bill-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.bill-info-box {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    height: 100%;
    position: relative;
}

.bill-info-box .edit-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--primary-color);
    cursor: pointer;
}

.invoice-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 30px;
}

.invoice-meta-item {
    flex: 1;
    min-width: 200px;
}

.invoice-total-section {
    max-width: 400px;
    margin-left: auto;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.invoice-total-row:last-child {
    border-bottom: none;
}

.invoice-total-row.grand-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .invoice-edit-header {
        flex-direction: column;
        text-align: center;
    }
    .invoice-header-img {
        display: none;
    }
}

/* --- Skeleton Screens (UX-4) --- */
@keyframes skeleton-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.skeleton {
    background-color: var(--border-color);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
    pointer-events: none;
    display: inline-block;
}

[data-bs-theme='dark'] .skeleton {
    background-color: rgba(255, 255, 255, 0.05);
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }

.skeleton-circle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.skeleton-rect {
    width: 100%;
    height: 100px;
    border-radius: 8px;
}

.skeleton-table-row {
    display: table-row;
}

.skeleton-table-row td {
    padding: 15px;
}

.skeleton-btn {
    width: 80px;
    height: 32px;
}

/* Container for grouping skeletons */
.skeleton-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Specific usage for table loading */
.table-loading-placeholder {
    display: none; /* Controlled via JS */
}

.is-loading .table-loading-placeholder {
    display: table-row-group;
}

.is-loading .table-actual-content {
    display: none;
}
