:root {
    --primary-color: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --bg-dark: #0f172a;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-size: 14px; /* Industry standard data-dense baseline */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a 60%);
    position: relative;
    overflow: hidden;
}

body.auth-body {
    background: linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.75)), url('/assets/images/login_bg.webp') no-repeat center center fixed;
    background-size: cover;
}

/* Background Animated Blobs */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    animation: float 10s infinite alternate ease-in-out;
}

body::before {
    width: 400px;
    height: 400px;
    background: rgba(79, 70, 229, 0.4);
    top: -100px;
    left: -100px;
}

body::after {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.3);
    bottom: -100px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.1); }
}

.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    to { transform: translateY(0); opacity: 1; }
}

.brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.input-group input, .input-group select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

input[type="date"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.db-status {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Flash Messages (Toast Notifications) */
.flash-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    animation: slideInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards, fadeOut 0.5s ease-in 4s forwards;
    pointer-events: none;
    max-width: 400px;
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.95);
}

@keyframes slideInDown {
    from { transform: translateY(-150%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

.flash-success {
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-left: 4px solid #34d399;
}

.flash-error {
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-left: 4px solid #ef4444;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Layout styling */
    .dashboard-layout {
        position: relative;
        flex-direction: column;
        overflow-x: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px !important;
        height: 100vh;
        z-index: 10000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
        border-right: 1px solid var(--glass-border);
        border-bottom: none;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Sidebar Overlay Backdrop */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 9999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .main-content {
        padding: 1rem !important;
        width: 100%;
        overflow-x: hidden;
    }

    /* Topbar stacking and centering */
    .topbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
        padding-bottom: 1.5rem !important;
    }

    .topbar > div {
        display: flex;
        justify-content: space-between;
        width: 100%;
        align-items: center;
    }

    .topbar > div:first-child {
        justify-content: flex-start;
    }

    .topbar .user-info {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
        width: 100%;
        border-top: 1px solid var(--glass-border);
        padding-top: 0.75rem;
    }

    .topbar .user-info span {
        font-size: 0.9rem;
    }

    .topbar .user-info .logout-btn {
        width: 100%;
        text-align: center;
    }

    /* Standard responsive grid modifications */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .two-col-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Stack form input rows */
    .form-row {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .form-row > .input-group {
        flex: unset !important;
        width: 100% !important;
    }

    /* Action Headers styling on mobile */
    .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .page-header .header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 0.75rem !important;
    }

    .page-header .header-actions > * {
        width: 100% !important;
        text-align: center;
        margin: 0 !important;
    }


    
    /* Login & Register container responsiveness */
    .login-container {
        padding: 1.5rem !important;
        margin: 1rem;
        max-width: 95% !important;
    }

    /* Stepper workflow responsiveness */
    .stepper {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }

    .stepper div[style*="height: 2px"] {
        display: none !important; /* hide line separator on vertical flow */
    }

    .stepper .step {
        width: 100%;
    }

    /* Cards block layout on mobile */
    .card {
        padding: 1.25rem !important;
    }
}

/* Responsive table wrapper (Global) */
.responsive-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
}
