:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-blue: #1a56db;
    --accent-blue-hover: #1e429f;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --nav-height: 64px;
}

body {
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

/* SLEEK COMPONENTS */

.auth-card {
    max-width: 440px;
    margin: 60px auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 32px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.auth-header h1 {
    margin: 0;
    color: var(--accent-blue);
    font-size: 24px;
    font-weight: 800;
}

.auth-header p {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-body {
    padding: 40px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
    height: auto !important;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.1);
}

.btn-auth {
    width: 100%;
    padding: 14px;
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-auth:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.2);
}

.error-box {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    color: #c53030;
    font-size: 14px;
    border-left: 4px solid #f56565;
}

.auth-links {
    text-align: center;
    padding: 0 40px 32px;
}

.auth-links a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* DASHBOARD WRAPPERS */

.block {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 24px !important;
}

.block-header {
    background: #f8fafc !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 12px 20px !important;
    color: var(--text-primary) !important;
    font-weight: 700;
}

.navbar-inner {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
}

.brand {
    color: var(--accent-blue) !important;
    font-weight: 800 !important;
}

.nav > li > a {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
}

.nav > li.active > a {
    color: var(--accent-blue) !important;
    background: #eff6ff !important;
}

/* GRADIENT TEXT */
.text-gradient {
    background: linear-gradient(135deg, #1a56db 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* SIDEBAR LAYOUT STYLING */
@media (min-width: 768px) {
    body.has-sidebar {
        margin: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-bottom: 0 !important;
        overflow-x: hidden;
    }
    
    /* Hide top navbar on desktop */
    body.has-sidebar .navbar.navbar-fixed-top {
        display: none !important;
    }
    
    /* Force box-sizing border-box for the app layouts */
    .app-sidebar, .app-sidebar *, .app-main-wrapper, .app-main-wrapper * {
        box-sizing: border-box !important;
    }
    
    body.has-sidebar .app-main-wrapper {
        margin-left: 260px !important;
        width: calc(100% - 260px) !important;
        min-height: 100vh;
        background-color: var(--bg-main);
    }
    
    body.has-sidebar .app-main-wrapper .container-fluid {
        padding: 30px 40px !important;
        width: auto !important;
        margin: 0 !important;
        background-color: transparent !important;
    }
    
    /* Hide page-level sub-sidebar on desktop */
    body.has-sidebar .app-main-wrapper #sidebar {
        display: none !important;
    }
    
    /* Expand content area to take full width */
    body.has-sidebar .app-main-wrapper .span9 {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    /* Sidebar container */
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        background: #0f172a; /* Slate 900 */
        color: #f1f5f9;
        display: flex;
        flex-direction: column;
        z-index: 1050;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
        border-right: 1px solid #1e293b;
    }
    
    /* Sidebar Logo */
    .sidebar-logo {
        padding: 24px;
        display: flex;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid #1e293b;
    }
    
    .sidebar-logo i {
        font-size: 22px;
        color: #3b82f6; /* Modern Blue */
        text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    }
    
    .sidebar-logo span {
        font-size: 18px;
        font-weight: 800;
        letter-spacing: 0.5px;
        background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    /* Navigation Grouping */
    .sidebar-nav {
        flex: 1;
        overflow-y: auto;
        padding: 20px 14px;
    }
    
    /* Custom Scrollbar for Sidebar */
    .sidebar-nav::-webkit-scrollbar {
        width: 4px;
    }
    .sidebar-nav::-webkit-scrollbar-thumb {
        background: #1e293b;
        border-radius: 4px;
    }
    
    .nav-group {
        margin-bottom: 24px;
    }
    
    .nav-group-title {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        color: #475569; /* Slate 600 */
        letter-spacing: 1.5px;
        padding-left: 12px;
        margin-bottom: 8px;
    }
    
    .app-nav-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .app-nav-list > li {
        margin-bottom: 4px;
    }
    
    .app-nav-list a, .submenu-toggle {
        display: flex;
        align-items: center;
        padding: 10px 14px;
        color: #94a3b8; /* Slate 400 */
        text-decoration: none !important;
        font-size: 14px;
        font-weight: 600;
        border-radius: 8px;
        transition: all 0.2s ease;
        cursor: pointer;
    }
    
    .app-nav-list a i, .submenu-toggle i:first-child {
        width: 20px;
        margin-right: 12px;
        font-size: 16px;
        transition: transform 0.2s ease;
    }
    
    .app-nav-list a:hover, .submenu-toggle:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .app-nav-list li.active > a, .app-nav-list li.active > .submenu-toggle {
        color: #ffffff;
        background: #1e293b;
        box-shadow: inset 3px 0 0 #3b82f6; /* Left blue accent border */
    }
    
    /* Cascading Submenu Styling */
    .has-submenu {
        position: relative;
    }
    
    .submenu-toggle {
        justify-content: space-between;
    }
    
    .caret-icon {
        font-size: 10px !important;
        margin-left: auto;
        color: #475569;
        transition: transform 0.2s ease !important;
    }
    
    .has-submenu.open .caret-icon {
        transform: rotate(180deg);
        color: #3b82f6;
    }
    
    .app-submenu-list {
        list-style: none;
        margin: 4px 0 0 0;
        padding: 0 0 0 16px;
        display: none; /* Controlled by jQuery slideToggle */
        border-left: 1px dashed #1e293b;
    }
    
    .has-submenu.open .app-submenu-list {
        display: block;
    }
    
    .app-submenu-list li {
        margin-bottom: 2px;
    }
    
    .app-submenu-list a {
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 500;
        color: #64748b;
    }
    
    .app-submenu-list a:hover {
        color: #ffffff;
        background: transparent;
    }
    
    .app-submenu-list li.active a {
        color: #3b82f6;
        font-weight: 600;
        background: transparent;
    }
    
    /* Sidebar Footer / User section */
    .sidebar-footer {
        padding: 16px 20px;
        background: #090d16;
        border-top: 1px solid #1e293b;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .user-info {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .user-avatar i {
        font-size: 24px;
        color: #94a3b8;
    }
    
    .user-details {
        display: flex;
        flex-direction: column;
    }
    
    .username {
        font-size: 13px;
        font-weight: 700;
        color: #f1f5f9;
    }
    
    .btn-signout {
        color: #94a3b8;
        font-size: 16px;
        transition: color 0.2s;
        text-decoration: none !important;
    }
    
    .btn-signout:hover {
        color: #ef4444;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
    .app-sidebar {
        display: none !important;
    }
    .container-fluid {
        padding-top: 80px !important;
    }
}

