:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #eab308;
    --border: #334155;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Auth Layout */
#auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    width: 350px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

input {
    width: 90%;
    padding: 10px;
    margin-bottom: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: white;
    border-radius: 6px;
}

button {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background: var(--accent-hover);
}

/* Dashboard Layout */
#dashboard-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}

.sidebar nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Navigation Styles */
.nav-item,
.nav-header {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
    margin-bottom: 4px;
}

.nav-item:hover,
.nav-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-header span i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Accordion */
.nav-group {
    margin-bottom: 4px;
}

.nav-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 20px;
    /* Indent sub items */
}

.nav-group.open .nav-sub {
    max-height: 300px;
    /* Arbitrary large height */
}

.nav-group.open .arrow {
    transform: rotate(90deg);
}

.nav-sub a {
    display: block;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 1px solid var(--border);
    margin-left: 12px;
}

.nav-sub a:hover,
.nav-sub a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.arrow {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.separator {
    flex: 1;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
}

/* User Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 500;
    color: var(--text-secondary);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.low {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: var(--warning);
}

.badge.high,
.badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge.admin {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
}

.action-btn {
    padding: 4px 8px;
    margin-right: 4px;
    border-radius: 4px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
}

.action-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Modal */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.close-modal {
    cursor: pointer;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--success);
}

input:checked+.slider:before {
    transform: translateX(20px);
}


/* Stats Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    color: white;
}

.stat-card.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-card.green {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.stat-card.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-card.yellow {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
}

.stat-card.purple {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}