/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f4f7fc;
    color: #1e293b;
    line-height: 1.5;
}

/* Import Google Fonts (optional but modern) */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== NAVIGATION BAR ===== */
.navbar {
    background: white;
    backdrop-filter: blur(0px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 20px 20px;
    margin-bottom: 32px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    padding: 16px 0;
}

.logo a {
    text-decoration: none;
    background: linear-gradient(135deg, #0f2b3d, #1b4f72);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 40px;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-links a:hover {
    background: #eef2ff;
    color: #1e40af;
}

.nav-links a.active {
    background: #1e3a8a;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.nav-links a.logout {
    background: #fee2e2;
    color: #b91c1c;
}

.nav-links a.logout:hover {
    background: #fecaca;
    color: #7f1d1d;
}

/* ===== DASHBOARD CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 28px;
    padding: 24px 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.1);
}

.stat-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #5b6e8c;
    margin-bottom: 12px;
}

.stat-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: #0f2b3d;
    line-height: 1.2;
}

/* ===== TABLES & CARDS ===== */
.section-card {
    background: white;
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #edf2f7;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #0f2b3d;
    border-left: 4px solid #3b82f6;
    padding-left: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: left;
    padding: 12px 8px;
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

td {
    padding: 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

tr:hover td {
    background-color: #fafcff;
}

/* Badges / status */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e6f7e6;
    color: #15803d;
}

.status-badge.disabled {
    background: #ffe6e6;
    color: #b91c1c;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: none;
    padding: 8px 18px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #1e293b;
}

.btn-primary {
    background: #1e3a8a;
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-danger:hover {
    background: #fecaca;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 20px;
    }

    .nav-links {
        justify-content: center;
        margin-top: 8px;
    }

    .stats-grid {
        gap: 16px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .section-card {
        padding: 16px;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    th {
        display: none;
    }

    tr {
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 8px;
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 8px 4px;
    }

    td:before {
        content: attr(data-label);
        font-weight: 600;
        width: 40%;
        color: #475569;
    }
}

/* Forms (used in auth.ejs) */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1e293b;
}

input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.95rem;
    transition: 0.2s;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.auth-container {
    max-width: 480px;
    margin: 80px auto;
    background: white;
    border-radius: 32px;
    padding: 36px 28px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
    margin-bottom: 24px;
    text-align: center;
}

/* Pagination */
.pagination {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.footer {
    text-align: center;
    padding: 24px 0 32px;
    color: #5b6e8c;
    font-size: 0.85rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 24px;
}