:root {
    --bg-color: #0f172a;
    --bg-sidebar: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 8px;
}

.nav-menu { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 1rem; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.nav-item.active { background: rgba(59, 130, 246, 0.15); color: var(--primary); }

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

.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }

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

@keyframes pulseAlert {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 currentColor; }
    50% { opacity: 0.6; transform: scale(1.3); box-shadow: 0 0 0 4px transparent; }
}


.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}

.page-header h1 { font-size: 2rem; font-weight: 600; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Cards & Elements */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }

.card-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.card-header h3 { font-size: 1.25rem; }
.badge { padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.bg-active { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.bg-inactive { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.card-body { flex: 1; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.card-footer { display: flex; justify-content: flex-end; border-top: 1px solid var(--glass-border); padding-top: 1rem; gap: 0.5rem; }

/* Content Stats Grid */
.stats-row { display: flex; justify-content: space-between; background: rgba(0,0,0,0.2); padding: 0.75rem; border-radius: 8px; margin-bottom: 0.5rem; }
.stats-row span:first-child { color: var(--text-muted); }
.stats-row span:last-child { font-weight: 600; color: var(--text-main); }

/* Buttons */
.btn-primary { background: var(--primary); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 500; cursor: pointer; transition: 0.3s; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: transparent; color: white; border: 1px solid var(--glass-border); padding: 0.75rem 1.5rem; border-radius: 8px; cursor: pointer; }
.btn-icon { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.5rem; border-radius: 6px; transition: 0.2s; }
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }
.btn-icon.delete:hover { background: rgba(239,68,68,0.2); color: var(--danger); }

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s; z-index: 1000;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { width: 100%; max-width: 450px; transform: scale(0.95); transition: 0.3s; }
.modal-overlay.active .modal { transform: scale(1); }

.modal-header { display: flex; justify-content: space-between; margin-bottom: 1.5rem; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.875rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); color: white; padding: 0.75rem; border-radius: 8px; }
.form-group input:focus { outline: none; border-color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; }

/* Submenu Navigation */
.nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-left: 2.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-subitem:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-subitem.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

