/* --- THEME VARIABLES --- */
:root {
    --bg-main: #0b0f19;
    /* Deep Space Blue */
    --bg-card: #161b2c;
    /* Slate Navy */
    --accent-blue: #38bdf8;
    /* Neon Cyan */
    --accent-purple: #818cf8;
    /* Cyber Purple */
    --text-primary: #f8fafc;
    /* Bright White */
    --text-muted: #94a3b8;
    /* Blue Grey */
    --danger: #ef4444;
    /* Alert Red */
    --success: #10b981;
    /* Matrix Green */
    --border: #334155;
    /* Subtle Stroke */
}

/* --- BASE STYLES --- */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.super-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- HEADER --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent-blue);
    margin: 0;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.auth-badge {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* --- UPTIME WIDGET --- */
.uptime-widget {
    background: linear-gradient(145deg, var(--bg-card), #111522);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.uptime-left h3 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-display {
    margin-top: 8px;
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.status-indicator {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 12px;
}

.status-up {
    background-color: var(--success);
    box-shadow: 0 0 12px var(--success);
}

.status-down {
    background-color: var(--danger);
    box-shadow: 0 0 12px var(--danger);
}

.status-paused {
    background-color: #f59e0b;
    box-shadow: 0 0 12px #f59e0b;
}

.uptime-right {
    text-align: right;
}

.uptime-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.uptime-value {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent-blue);
    margin-top: 4px;
}

/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--accent-purple);
}

/* --- TABS --- */
/* --- TABS --- */
.dashboard-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    position: relative;
    /* ADD THIS LINE */
    z-index: 50;
    /* ADD THIS LINE */
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: 0.2s;
    border-radius: 0;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom: 3px solid var(--accent-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

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

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

/* --- TABLES & SECTIONS --- */
.user-management {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: white;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    vertical-align: middle;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

tr:last-child td {
    border-bottom: none;
}

/* --- BADGES --- */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.super_admin {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-purple);
    border: 1px solid var(--accent-purple);
}

.badge.admin {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.badge.user {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}

.badge.supervisor {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

/* --- BUTTONS --- */
button {
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-blue);
    color: var(--bg-main);
    border: none;
    padding: 8px 16px;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    padding: 8px 16px;
}

.btn-secondary:hover {
    background: rgba(56, 189, 248, 0.1);
}

.btn-exit {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 8px 16px;
}

.btn-exit:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Table Action Buttons */
.action-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-promote,
.btn-demote {
    background: transparent;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-promote {
    border: 1px solid var(--success);
    color: var(--success);
}

.btn-promote:hover {
    background: var(--success);
    color: white;
}

.btn-demote {
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-demote:hover {
    background: var(--danger);
    color: white;
}

/* --- CUSTOM MODALS --- */
.super-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.super-modal-backdrop.show {
    opacity: 1;
}

.super-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 12px;
    width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.super-modal-backdrop.show .super-modal-box {
    transform: translateY(0);
}

.super-modal-title {
    color: var(--accent-blue);
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.super-modal-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.super-modal-input,
.super-modal-select {
    width: 100%;
    padding: 0.85rem;
    margin-bottom: 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: white;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
}

.super-modal-input:focus,
.super-modal-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.super-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 16px;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.btn-confirm {
    background: var(--accent-blue);
    color: var(--bg-main);
    border: none;
    padding: 8px 16px;
}

.btn-danger-solid {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .uptime-widget {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .uptime-right {
        text-align: center;
    }
}

/* ==========================================
   SUPER ADMIN MODAL SYSTEM
========================================== */
.super-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.super-modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.super-modal-box {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    transition: transform 0.2s;
}

.super-modal-backdrop.show .super-modal-box {
    transform: translateY(0);
}

.super-modal-title {
    color: #38bdf8;
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
}

.super-modal-text {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.super-modal-input,
.super-modal-select {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.super-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.super-modal-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    border: none;
    transition: 0.2s;
}

.btn-cancel {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #475569;
}

.btn-cancel:hover {
    background: #334155;
    color: white;
}

.btn-confirm {
    background: #38bdf8;
    color: #0f172a;
}

.btn-confirm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#modalContainer {
    pointer-events: none;
}

.super-modal-backdrop {
    pointer-events: auto;
}