*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #0f0f17;
    --bg-secondary: #161625;
    --bg-card: #1c1c30;
    --bg-card-hover: #242442;
    --bg-input: #12121f;
    --border: #2a2a45;
    --border-light: #35355a;
    --text-primary: #e4e4ef;
    --text-secondary: #8888a8;
    --text-muted: #5e5e7e;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --green: #22c55e;
    --green-dim: #166534;
    --red: #ef4444;
    --red-dim: #7f1d1d;
    --yellow: #f59e0b;
    --yellow-dim: #78350f;
    --blue: #3b82f6;
    --purple: #a855f7;
    --orange: #f97316;
    --cyan: #06b6d4;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
    --sidebar-width: 240px;
    --header-height: 56px;
}

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.sidebar-header h1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-header .subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 4px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-item .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Sidebar status indicator */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}

.server-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    flex-shrink: 0;
}

.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.starting { background: var(--yellow); animation: pulse 1.5s infinite; }
.status-dot.offline { background: var(--red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Main content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    min-width: 0;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 90;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s;
}

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 100;
        left: -260px;
        top: 0;
        height: 100vh;
        height: 100dvh;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { left: 0; }
    .main-content {
        padding: 16px;
        padding-top: 60px;
    }
    .mobile-menu-btn { display: flex; }
    .page-header h2 { font-size: 18px; }
    .page-header { margin-bottom: 16px; }
}
