:root {
    --bg: #05050d;
    --panel: rgba(18, 18, 34, 0.7);
    --glass: rgba(255, 255, 255, 0.05);
    --text: #f7f2ff;
    --muted: #aaa3c4;
    --purple: #9d4dff;
    --pink: #ff4fd8;
    --blue: #37d5ff;
    --danger: #ff3366;
    --success: #00ff88;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 0 30px rgba(157, 77, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden; /* Dashboard feel */
}

/* Background Glows */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.3;
}
.glow-indigo { top: -10%; left: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, var(--purple) 0%, transparent 70%); }
.glow-violet { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background: radial-gradient(circle, var(--blue) 0%, transparent 70%); }

/* Layout Structure */
.dashboard-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(10, 10, 18, 0.8);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 3rem;
}

.system-label {
    color: var(--pink);
    font-size: 0.7rem;
    letter-spacing: 3px;
    font-weight: 700;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn:hover {
    background: var(--glass);
    color: var(--text);
}

.nav-btn.active {
    background: rgba(55, 213, 255, 0.1);
    border-color: rgba(55, 213, 255, 0.3);
    color: var(--blue);
    box-shadow: inset 0 0 15px rgba(55, 213, 255, 0.1);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--muted);
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 4rem;
    overflow-y: auto;
}

.view-section { display: none; animation: fadeIn 0.4s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.section-header h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--muted); }

/* Glass Panels & UI */
.glass-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    margin-bottom: 1.5rem;
}

/* Tables */
.vexora-table {
    width: 100%;
    border-collapse: collapse;
}

.vexora-table th, .vexora-table td {
    padding: 1.2rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

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

.vexora-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.user-identity { font-weight: 600; display: block; }
.user-email { font-size: 0.8rem; color: var(--muted); }

.badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.badge.admin { background: rgba(255, 79, 216, 0.15); color: var(--pink); border: 1px solid var(--pink); }
.badge.manager { background: rgba(157, 77, 255, 0.15); color: var(--purple); border: 1px solid var(--purple); }
.badge.agent { background: rgba(55, 213, 255, 0.15); color: var(--blue); border: 1px solid var(--blue); }

.status-active { color: var(--success); text-shadow: 0 0 8px rgba(0, 255, 136, 0.5); }
.status-suspended { color: var(--danger); text-shadow: 0 0 8px rgba(255, 51, 102, 0.5); }

.edit-btn {
    background: transparent; border: 1px solid var(--muted); color: var(--text);
    padding: 5px 15px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; transition: 0.3s;
}
.edit-btn:hover { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 10px rgba(55, 213, 255, 0.3); }

/* Security Controls */
.security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.full-width { grid-column: 1 / -1; }

.policy-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.policy-info h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.policy-info p { font-size: 0.85rem; color: var(--muted); line-height: 1.4; }

/* Custom Neon Toggles */
.vexora-toggle {
    position: relative; width: 50px; height: 26px; display: inline-block; flex-shrink: 0;
}
.vexora-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1); border-radius: 34px; transition: .4s;
    border: 1px solid var(--border);
}
.toggle-slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: var(--muted); border-radius: 50%; transition: .4s;
}
.vexora-toggle input:checked + .toggle-slider {
    background-color: rgba(55, 213, 255, 0.2); border-color: var(--blue);
}
.vexora-toggle input:checked + .toggle-slider:before {
    transform: translateX(24px); background-color: var(--blue); box-shadow: 0 0 10px var(--blue);
}

/* Permission Matrix */
.matrix-grid { margin-top: 1.5rem; }
.matrix-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; padding: 1rem 0; border-bottom: 1px solid var(--border); align-items: center; }
.matrix-row.header { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; border-bottom-width: 2px; }
.matrix-row span:not(:first-child) { text-align: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin: 0 auto; }
.dot.active { background: var(--success); box-shadow: 0 0 10px var(--success); }
.dot.inactive { background: rgba(255, 255, 255, 0.1); }

/* Activity Timeline */
.timeline { padding: 1rem 0; }
.activity-item { display: flex; gap: 1.5rem; margin-bottom: 2rem; position: relative; }
.activity-item::before {
    content: ''; position: absolute; left: 5px; top: 20px; bottom: -30px;
    width: 2px; background: var(--border);
}
.activity-item:last-child::before { display: none; }

.activity-node {
    width: 12px; height: 12px; border-radius: 50%; background: var(--blue);
    box-shadow: 0 0 10px var(--blue); position: relative; z-index: 2; margin-top: 5px; flex-shrink: 0;
}
.node-alert { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.node-auth { background: var(--purple); box-shadow: 0 0 10px var(--purple); }

.activity-content { flex: 1; }
.activity-time { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; }
.activity-text { font-size: 0.95rem; line-height: 1.4; }
.activity-text strong { color: var(--text); }

/* Modal Styles */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(3, 2, 6, 0.8); backdrop-filter: blur(10px);
    z-index: 100; display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-glass {
    width: 100%; max-width: 500px; background: var(--panel); border: 1px solid var(--purple);
    border-radius: 16px; padding: 2rem; box-shadow: 0 0 50px rgba(157, 77, 255, 0.15);
    transform: translateY(20px); transition: 0.3s;
}
.modal-overlay.active .modal-glass { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; }
.modal-tag { color: var(--pink); font-size: 0.75rem; letter-spacing: 2px; }
.close-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; text-transform: uppercase; }
.luxury-input {
    width: 100%; background: rgba(0,0,0,0.5); border: 1px solid var(--border); padding: 1rem;
    border-radius: 8px; color: var(--text); outline: none; transition: 0.3s;
}
.luxury-input:focus { border-color: var(--purple); box-shadow: inset 0 0 10px rgba(157, 77, 255, 0.2); }
.modal-footer { margin-top: 2rem; }
.launch-btn {
    background: linear-gradient(135deg, var(--blue), var(--purple)); color: white;
    border: none; padding: 1rem 2rem; border-radius: 50px; font-weight: 700; width: 100%;
    cursor: pointer; transition: 0.3s;
}
.launch-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(157, 77, 255, 0.3); }
.small-btn { width: auto; padding: 0.8rem 1.5rem; font-size: 0.85rem; }
