:root {
    --bs-body-bg: #f8fafc;
    --bs-body-color: #334155;
    --bs-primary: #4f46e5; /* Modern Indigo */
    --bs-primary-rgb: 79, 70, 229;
    --bs-success: #10b981;
    --bs-danger: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 4px 20px -1px rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
    --navbar-height: 72px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bs-body-bg);
    /* Subtle mesh gradient background */
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(239, 68, 68, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--bs-body-color);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* --- Modern Navbar --- */
.modern-navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    height: var(--navbar-height);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    z-index: 1030;
    transition: all 0.3s ease;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.text-gradient {
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.25rem;
}

.user-badge {
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 6px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

/* --- Sidebar (Desktop) --- */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    bottom: 0;
    left: 0;
    z-index: 100;
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(226, 232, 240, 0.6);
    padding-top: 1rem;
}

.sidebar .nav-link {
    color: #64748b;
    font-weight: 500;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover {
    color: var(--bs-primary);
    background: rgba(79, 70, 229, 0.05);
}

.sidebar .nav-link.active {
    background: #fff;
    color: var(--bs-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
    font-weight: 600;
}

.icon-box {
    width: 24px;
    text-align: center;
}

/* --- Content Wrapper --- */
.main-content-wrapper {
    margin-top: var(--navbar-height);
    padding-top: 2rem;
    padding-bottom: 3rem;
    transition: margin-left 0.3s;
}

@media (min-width: 992px) {
    .main-content-wrapper {
        margin-left: var(--sidebar-width);
    }
}

/* --- Modern Card --- */
.modern-card {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.08);
}

.card-header-clean {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    background: transparent;
}

.card-body-clean {
    padding: 1.5rem;
    flex-grow: 1;
}

/* --- Utils & Soft Colors --- */
.bg-primary-soft { background-color: rgba(79, 70, 229, 0.1); }
.bg-success-soft { background-color: rgba(16, 185, 129, 0.1); }
.bg-danger-soft { background-color: rgba(239, 68, 68, 0.1); }
.bg-warning-soft { background-color: rgba(245, 158, 11, 0.1); }

.btn-danger-soft {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    transition: all 0.2s;
}
.btn-danger-soft:hover {
    background-color: #ef4444;
    color: white;
    transform: translateY(-1px);
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.ls-tight { letter-spacing: -0.025em; }
.ls-1 { letter-spacing: 0.05em; }
.fw-medium { font-weight: 500; }

/* Table Styles */
.table-clean th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 1px solid #e2e8f0;
}
.table-clean td {
    border-bottom: 1px solid #f1f5f9;
}
.table-clean tr:last-child td { border-bottom: none; }

/* Nav Pills Custom */
.nav-pills .nav-link {
    color: #64748b;
    border-radius: 10px;
    font-weight: 500;
}
.nav-pills .nav-link.active {
    background-color: transparent !important;
    border: 1px solid rgba(0,0,0,0.05);
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.nav-pills .nav-link.active .text-success { color: #10b981 !important; }
.nav-pills .nav-link.active .text-danger { color: #ef4444 !important; }

/* -----------------------------------------------------------
   MODERN AUTH PAGES (Login/Register) - Full Screen Glass
   ----------------------------------------------------------- */

/* Layout Wrapper for Auth */
.auth-layout {
    width: 100%;
    min-height: 100vh;
    padding-top: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Full Screen Gradient */
    background: radial-gradient(circle at 10% 20%, rgb(242, 246, 252) 0%, rgb(235, 238, 255) 90%);
    background-attachment: fixed;
}

.auth-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.auth-card:hover .auth-icon-wrapper {
    transform: rotate(0deg) scale(1.05);
}

/* Floating Input Overrides */
.form-floating > .form-control {
    border: 2px solid transparent;
    background-color: rgba(241, 245, 249, 0.8);
    border-radius: 12px;
    padding-left: 1rem;
    height: 58px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.form-floating > .form-control:focus {
    background-color: #fff;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    outline: none;
}

.form-floating > label {
    padding-left: 1rem;
    color: #64748b;
}

/* Auth Buttons */
.btn-auth {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    width: 100%;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.auth-link {
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #3730a3;
    text-decoration: underline;
}

/* -----------------------------------------------------------
   MOBILE OPTIMIZATIONS
   ----------------------------------------------------------- */
@media (max-width: 991.98px) {
    /* Navbar Collapse as Glass Card */
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 20px;
        padding: 1.5rem;
        margin-top: 1rem;
        box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.1);
    }
    
    /* Navigation Links on Mobile */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 12px;
        margin-bottom: 0.25rem;
        transition: background-color 0.2s;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background-color: rgba(241, 245, 249, 0.8);
    }

    /* Active State for Mobile Links */
    .navbar-nav .nav-link.active {
        background-color: rgba(79, 70, 229, 0.1) !important;
        color: var(--bs-primary) !important;
        font-weight: 600;
    }

    /* User Badge Centering */
    .user-badge {
        justify-content: center;
        width: 100%;
        margin-bottom: 0.75rem;
        background: #f8fafc;
    }
}