:root {
    --primary-red: #d32f2f; /* Fire Engine Red */
    --hover-red: #b71c1c;
    --bg-white: #ffffff; /* FINAL PRODUCTION PURE WHITE */
    --text-dark: #212121;
    --text-dim: #616161;
    --border-color: #eeeeee; /* Minimal Border */
    --silver: #bdbdbd;
    --success: #2e7d32;
    --error: #d32f2f;
    --header-height: 80px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    background-color: #ffffff !important; /* FORCED PURE WHITE */
    color: var(--text-dark);
    font-family: var(--font-family);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff !important; /* FORCED PURE WHITE */
}

/* GLOBAL HEADER */
.global-header {
    width: 100%;
    height: var(--header-height) !important;
    background-color: #ffffff;
    border-bottom: 2px solid var(--primary-red);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dashboard-active .global-header { display: flex; }

.header-left, .header-right { display: flex; align-items: center; gap: 1.5rem; flex: 1; }
.header-right { justify-content: flex-end; }
.header-center { display: flex; justify-content: center; align-items: center; flex: 1; }

.nav-link {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-link.active {
    color: var(--primary-red);
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 4px;
}

/* BRANDING & LOGO */
.logo-container {
    text-align: center;
    padding-top: 20px;
    background-color: #ffffff !important; /* FORCED PURE WHITE */
}

.logo-container.hero { margin-top: 5vh; margin-bottom: 3rem; }
.logo-container img { max-width: 320px; height: auto; }
body.dashboard-active .header-center img { max-width: 200px; }

/* MAINTENANCE BANNER */
.maintenance-banner {
    width: 100%;
    max-width: 480px;
    background-color: var(--primary-red);
    color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CARD & LAYOUT - REMOVED SHADOWS FOR SEAMLESS BLEND */
.card, .login-container {
    background-color: #ffffff !important; /* FORCED PURE WHITE */
    padding: 3rem;
    border-radius: 0;
    box-shadow: none !important; /* No shadow for perfect blend */
    border: none;
    width: 100%;
    max-width: 480px;
    text-align: center;
    margin-bottom: 2.5rem;
}

.card h2 { margin-bottom: 1.2rem; font-weight: 800; color: var(--text-dark); }

/* FORM ELEMENTS */
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-dark); font-weight: 700; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 1rem; border-radius: 8px; border: 2px solid var(--border-color);
    background-color: #fff; color: var(--text-dark); font-size: 1rem;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary-red); box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1);
}

/* BUTTONS */
button {
    padding: 1rem 2rem; border-radius: 8px; border: none; background-color: var(--primary-red);
    color: white; font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all 0.3s ease;
    text-transform: uppercase;
}
button:hover { background-color: var(--hover-red); }
button:disabled { background-color: #e0e0e0 !important; color: #999 !important; cursor: not-allowed; }

button.btn-silver { background-color: #f1f1f1; color: #444; border: 1px solid var(--silver); text-transform: none; }
.btn-full { width: 100%; }

/* ACTION BUTTONS (TABLE) */
.action-btn-sm { padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.75rem; font-weight: 800; min-width: 80px; }

/* TABLE FIX */
.table-card { background: #fff; width: 100%; border-radius: 0; border: 1px solid var(--border-color); margin-top: 2rem; }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th { background-color: var(--primary-red); color: white; padding: 1.2rem; text-align: left; }
.user-table td { padding: 1.2rem; border-bottom: 1px solid var(--border-color); }
.user-table td:last-child { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* BLACKOUT CONTROL */
.floating-gear {
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
    background: rgba(255, 255, 255, 0.95); border: 2px solid var(--primary-red); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
    cursor: pointer; z-index: 2000; transition: transform 0.3s ease;
}
.floating-gear:hover { transform: rotate(90deg) scale(1.1); }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(5px);
    z-index: 3000; display: flex; align-items: center; justify-content: center;
}

#status-hud, #success-msg, #error-message { 
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 800;
    width: auto;
    min-width: 320px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

#status-hud { background: #fee2e2; color: var(--primary-red); border: 2px solid var(--primary-red); }
#success-msg { background: #dcfce7; color: var(--success); border: 2px solid var(--success); }
#error-message { background: #fee2e2; color: var(--error); border: 2px solid var(--error); }

.logout-link { color: var(--text-dim); text-decoration: none; font-weight: 600; background: #f1f1f1; padding: 0.6rem 1.2rem; border-radius: 30px; font-size: 0.85rem; cursor: pointer; }
.logout-link:hover { background: var(--primary-red); color: white; }