/* --- Reset & Variables --- */
:root {
    --bg-body: #1a1c23;       /* Dark background */
    --bg-card: #242731;       /* Slightly lighter card */
    --bg-nav: #16181d;        /* Darkest for nav */
    --text-primary: #edf2f7;  /* White-ish text */
    --text-secondary: #a0aec0; /* Gray text */
    --accent: #4c6ef5;        /* Modern Blue */
    --accent-hover: #3b5bdb;
    --border: #2d3748;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
    --container-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* --- Navigation (footer.php) --- */
.navbar {
    background-color: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-content {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

/* --- Main Layout --- */
.main-container {
    width: 100%;
    max-width: var(--container-width);
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
    animation: fadeIn 0.4s ease-out;
}

.page-header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 15px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: white;
    margin: 0;
}

/* --- Cards --- */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* --- Grid System --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }

/* --- Forms & Inputs --- */
.form-group { margin-bottom: 15px; position: relative; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"], select {
    width: 100%;
    background-color: #121418;
    border: 1px solid var(--border);
    color: white;
    padding: 12px 15px;
    border-radius: var(--radius);
    font-size: 15px;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--accent);
}

input[type="submit"], button.btn, .btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.2s;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

input[type="submit"]:hover, button.btn:hover, .btn:hover { 
    background-color: var(--accent-hover); 
    color: white;
}

/* --- Login Page Centering --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #242731, #1a1c23);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
}

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
td, th { padding: 15px; border-bottom: 1px solid var(--border); color: var(--text-secondary); text-align: left; }
td:first-child { color: white; font-weight: 500; }
tr:last-child td { border-bottom: none; }

/* --- Mobile --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px; left: 0; right: 0;
        background-color: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    
    table, tbody, tr, td { display: block; width: 100%; }
    td { padding-left: 0; border: none; padding-bottom: 5px; }
    tr { margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }