@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #020617;
    --primary-neon: #06b6d4;
    --primary-blue: #3b82f6;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --border-glow: rgba(6, 182, 212, 0.2);
    --border-glow-focus: rgba(56, 189, 248, 0.65);
    
    --bg-glass: rgba(8, 14, 27, 0.55);
    --bg-glass-heavy: rgba(5, 9, 20, 0.85);
    
    --safe-green: #10b981;
    --safe-green-glow: rgba(16, 185, 129, 0.25);
    --danger-red: #ef4444;
    --danger-red-glow: rgba(239, 68, 68, 0.35);
    --warning-yellow: #f59e0b;
    --warning-yellow-glow: rgba(245, 158, 11, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Outfit', sans-serif;
}

body {
    min-height: 100vh;
    background-color: var(--bg-dark);
    /* Sleek, professional dark SaaS ambient gradients matching contact.html & dashboard.html */
    background: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        linear-gradient(180deg, #020617 0%, #070a13 100%);
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
}

/* ===== CANVAS BACKDROP & SCAN SWEEPS ===== */
#particle-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.laser-scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-neon), transparent);
    box-shadow: 0 0 15px 2px var(--primary-neon);
    animation: screenScan 8s infinite linear;
    z-index: 2;
    pointer-events: none;
}

@keyframes screenScan {
    0% { top: 0%; opacity: 0.1; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { top: 100%; opacity: 0.1; }
}

/* ===== CYBER HUD OVERLAYS ===== */
.cyber-hud-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    font-family: 'Space Grotesk', sans-serif;
}

.hud-tag {
    position: absolute;
    font-size: 11px;
    font-weight: 700;
    color: rgba(6, 182, 212, 0.35);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hud-top-left { top: 90px; left: 40px; display: flex; flex-direction: column; gap: 4px; }
.hud-top-right { top: 90px; right: 40px; text-align: right; }
.hud-bottom-left { bottom: 40px; left: 40px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-neon);
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary-neon);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-neon);
    animation: activePulse 1.6s infinite ease-in-out;
}

@keyframes activePulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.5; }
}

/* ===== NAVBAR STYLES HANDLED BY CENTRAL NAVBAR_RESPONSIVE.CSS ===== */


/* ===== MAIN WORKSPACE ===== */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 5;
    position: relative;
}

.admin-container {
    flex: 1;
    padding: 170px 60px 40px 60px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.admin-header {
    text-align: center;
    margin-bottom: 50px;
}

.admin-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary-neon) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== STATS GRID SYSTEM ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-top: 3px solid var(--primary-neon);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.04), transparent);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(6, 182, 212, 0.45);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.15);
}

.stat-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: var(--primary-neon);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon-wrapper {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--primary-neon);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
    transform: scale(1.05);
}

.stat-icon {
    width: 24px;
    height: 24px;
}

.stat-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 5px 0;
    letter-spacing: -1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.stat-card p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* ===== TABLE CONTAINER & GRID LAYOUTS ===== */
.admin-table-container {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: 40px;
}

.table-header-bar {
    margin-bottom: 25px;
    border-left: 3px solid var(--primary-neon);
    padding-left: 15px;
}

.table-header-bar h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.table-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
}

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
}

/* Custom Table Scrollbar */
.table-responsive-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-responsive-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.table-responsive-wrapper::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.25);
    border-radius: 10px;
    transition: background 0.3s;
}

.table-responsive-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-neon);
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    font-size: 14px;
}

.admin-table th {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--primary-neon);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 12px 20px;
    border-bottom: 2px solid rgba(6, 182, 212, 0.2);
    text-align: left;
}

.admin-table td {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.25s ease;
}

.admin-table td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px 0 0 10px;
    font-weight: 500;
}

.admin-table td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 0 10px 10px 0;
}

.admin-table tbody tr:hover td {
    background: rgba(6, 182, 212, 0.06);
    border-color: rgba(6, 182, 212, 0.15);
}

/* ===== ROLE SELECT CAPSULES ===== */
.role-select {
    font-family: 'Space Grotesk', sans-serif;
    background: #091326;
    color: var(--text-main);
    border: 1px solid rgba(6, 182, 212, 0.35);
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.role-select:focus {
    border-color: var(--primary-neon);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.role-select option {
    background: #0d1930;
    color: var(--text-main);
    padding: 8px;
}

/* ===== CYBER RELAY BUTTONS ===== */
.action-btn {
    font-family: 'Space Grotesk', sans-serif;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 8px;
    text-transform: uppercase;
}

.btn-update {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: var(--primary-neon);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.1);
}

.btn-update:hover {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-neon));
    color: #ffffff;
    border-color: var(--primary-neon);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
    transform: translateY(-1.5px);
}

.btn-delete {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(185, 28, 28, 0.15));
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-1.5px);
}

/* ===== TABLE LOADERS ===== */
.table-loader-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.table-loader {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(6, 182, 212, 0.1);
    border-top-color: var(--primary-neon);
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MENU-TOGGLE STYLES HANDLED BY NAVBAR_RESPONSIVE.CSS ===== */

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(5, 9, 20, 0.4);
    margin-top: 50px;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.5px;
}

/* =========================================
   MEDIA RESPONSIVENESS OVERRIDES
   ========================================= */

/* Desktop / Tablet Breakpoint (Under 1200px) */
@media (max-width: 1200px) {
    .cyber-hud-layer {
        display: none;
    }
    
    .admin-container {
        padding: 120px 40px 40px 40px;
    }
}

/* Tablet & Mobile Layout Shifts (Under 992px) */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .admin-table th, .admin-table td {
        padding: 12px 14px;
    }
}

/* Mobile Navigation Shifts (Under 768px) */
@media (max-width: 768px) {
    .admin-container {
        padding: 95px 20px 30px 20px;
    }

    .admin-header h1 {
        font-size: 26px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 25px;
    }
}

/* Micro Mobile Polish (Under 480px) */
@media (max-width: 480px) {
    .admin-table-container {
        padding: 15px;
    }
    
    .table-header-bar h2 {
        font-size: 16px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 11px;
        margin-bottom: 5px;
        width: 100%;
    }
    
    .role-select {
        width: 100%;
        margin-bottom: 8px;
    }
}