:root {
    --primary-color: #4f46e5;
    --secondary-color: #4338ca;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), #06b6d4);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.nav-category {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    padding: 20px 20px 8px;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0 0 20px 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover, .sidebar-menu li a.active {
    color: var(--primary-color);
    background: #f1f5f9;
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu li a i {
    margin-right: 12px;
    font-size: 18px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.topbar {
    background: #ffffff;
    height: 70px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-wrapper {
    padding: 30px;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    margin-bottom: 24px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    font-weight: 600;
}

.stat-card {
    padding: 24px;
    border-radius: 16px;
    background: white;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Tables */
.table th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-primary);
}

/* Login Page */
.login-bg {
    background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
                #f1f5f9;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
}

.login-image {
    background-color: var(--primary-color);
    background-image: linear-gradient(135deg, rgba(79, 70, 229, 0.85), rgba(6, 182, 212, 0.85)), url('https://images.unsplash.com/photo-1586528116311-ad8ed3c84a0d?q=80&w=800&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
    min-height: 100%;
    position: relative;
}

.login-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(79, 70, 229, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
    z-index: 1;
}

.login-form-wrapper {
    padding: 60px;
}

/* Unified Premium Input Groups for Login */
.login-form-wrapper .input-group {
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.login-form-wrapper .input-group:focus-within {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.login-form-wrapper .input-group-text {
    background-color: transparent !important;
    border: none !important;
    padding-left: 16px;
    padding-right: 10px;
}

.login-form-wrapper .form-control {
    background-color: transparent !important;
    border: none !important;
    padding-left: 10px;
    padding-right: 16px;
    box-shadow: none !important;
}

.login-form-wrapper .form-control:focus {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Override body padding-bottom for login pages */
body.login-bg {
    padding-bottom: 0 !important;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .login-form-wrapper {
        padding: 40px 30px;
    }
    
    /* Center the cover text on mobile/tablet viewports if visible */
    .login-image {
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 40px 24px !important;
    }
    
    .login-image .text-white {
        text-align: center !important;
        width: 100%;
    }
}

@media (max-width: 576px) {
    /* Soft premium gradient glow at the top on mobile */
    body.login-bg {
        background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12) 0%, rgba(248, 250, 252, 0) 70%), #f8fafc !important;
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        min-height: 100vh;
    }
    
    body.login-bg .container {
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        min-height: 100vh;
        display: flex !important;
        align-items: stretch !important;
    }

    body.login-bg .login-card {
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        border: none !important;
        min-height: 100vh;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important; /* transparent card to show background glow */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Right column wrapper on mobile */
    body.login-bg .login-card > div:last-child {
        display: flex !important;
        flex-direction: column !important;
        flex-grow: 1;
        min-height: 100vh;
    }

    /* Stretch the form wrapper to exactly 100vh and organize elements as a native layout */
    .login-form-wrapper {
        padding: 50px 24px 30px 24px !important;
        min-height: 100vh;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        flex-grow: 1;
    }

    .login-form-body {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        flex-grow: 1;
    }

    .login-form-footer {
        margin-top: auto !important;
        padding-top: 20px;
    }

    /* Styling inputs specifically for mobile to look like native text fields */
    .login-form-wrapper .input-group {
        border-radius: 14px !important;
        background-color: #ffffff !important; /* white inputs to contrast against the soft background */
        border: 1.5px solid #e2e8f0 !important; /* clean light-gray borders */
        padding: 4px 0;
    }

    .login-form-wrapper .input-group:focus-within {
        background-color: #ffffff !important;
        border-color: var(--primary-color) !important;
        box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08) !important;
    }

    .login-form-wrapper .input-group-text {
        font-size: 18px !important;
        color: #94a3b8 !important;
    }

    .login-form-wrapper .form-control {
        font-size: 15px !important;
        font-weight: 500 !important;
        color: #1e293b !important;
    }

    .login-form-wrapper .form-label {
        font-size: 13px !important;
        font-weight: 600 !important;
        color: #475569 !important;
        margin-bottom: 6px !important;
    }

    /* Brand Header adjustments on mobile */
    .login-form-wrapper .brand-icon {
        width: 52px !important;
        height: 52px !important;
        border-radius: 14px !important;
        font-size: 24px !important;
        box-shadow: 0 6px 16px rgba(79, 70, 229, 0.2) !important;
    }

    .login-form-wrapper .brand-icon i {
        font-size: 24px !important;
    }

    .login-form-wrapper .font-outfit.fs-5 {
        font-size: 1.45rem !important;
        font-weight: 800 !important;
        letter-spacing: -0.5px;
    }

    .login-form-wrapper h3 {
        font-size: 1.65rem !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        letter-spacing: -0.5px;
        margin-top: 15px;
    }

    .login-form-wrapper p.text-secondary {
        font-size: 14px !important;
        color: #64748b !important;
        margin-bottom: 25px !important;
    }

    /* Style button for mobile */
    .login-form-wrapper .btn-primary {
        border-radius: 14px !important;
        padding-top: 14px !important;
        padding-bottom: 14px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25) !important;
        margin-top: 15px !important;
    }
}

/* Mobile Sidebar Open State */
body.sidebar-open .sidebar {
    transform: translateX(0);
}

/* Utility */
.font-outfit {
    font-family: 'Outfit', sans-serif;
}

.font-monospace {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar open overlay for mobile */
body.sidebar-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

/* Badge pill utilities */
.badge-pill-sm {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Print styles */
@media print {
    .sidebar,
    .topbar,
    .modal-footer,
    button {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .modal-dialog {
        max-width: 100%;
        margin: 0;
    }
    .modal-content {
        border: none;
        box-shadow: none;
    }
    .modal {
        position: static;
        display: block;
    }
    .modal-backdrop {
        display: none;
    }
}

/* Mobile Bottom Navigation Styles */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    padding: 0 2px;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 9.5px;
    font-weight: 600;
    flex: 1;
    height: 100%;
    padding: 2px;
    text-align: center;
    line-height: 1.25;
    transition: color 0.2s ease, transform 0.2s ease;
}

.mobile-bottom-nav .nav-item i {
    font-size: 15px;
    margin-bottom: 3px;
}

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

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

@media (max-width: 991.98px) {
    body {
        padding-bottom: 75px !important;
    }
}
