:root {
    --bg: #020617;
    --surface: rgba(15, 23, 42, 0.9);
    --surface-hover: rgba(30, 41, 59, 0.9);
    --border: rgba(71, 85, 105, 0.5);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-w: 260px;
    --sidebar-bg: rgba(2, 6, 23, 0.95);
    --transition: 0.25s ease;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
}

/* ============ SIDEBAR ============ */

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    padding: 24px 0;
    z-index: 100;
    backdrop-filter: blur(16px);
}

.sidebar-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.sidebar-brand h2 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand .online-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

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

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

.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--surface-hover);
    color: var(--text);
}

.sidebar-nav a.active {
    color: var(--accent);
    font-weight: 600;
}

.sidebar-nav a .nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-divider {
    height: 1px; background: var(--border);
    margin: 12px 16px;
}

.sidebar-footer {
    padding: 16px 24px 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ============ MAIN CONTENT ============ */

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    padding: 24px 32px;
}

/* ============ HEADER BAR ============ */

.topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 28px;
}

.topbar h1 { font-size: 26px; font-weight: 700; }

.topbar-right {
    display: flex; align-items: center; gap: 12px;
}

.status-badge {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ============ STAT CARDS ============ */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.stat-card .stat-value {
    font-size: 38px;
    font-weight: 800;
    margin: 8px 0;
    transition: color 0.5s;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.players { border-top: 3px solid #a78bfa; }
.stat-card.players .stat-value { color: #a78bfa; }
.stat-card.cpu { border-top: 3px solid var(--accent); }
.stat-card.cpu .stat-value { color: var(--accent); }
.stat-card.ram { border-top: 3px solid var(--success); }
.stat-card.ram .stat-value { color: var(--success); }
.stat-card.backup { border-top: 3px solid var(--warning); }
.stat-card.backup .stat-value { color: var(--warning); font-size: 16px; }

/* ============ PANEL CARDS ============ */

.panel-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
}

.panel-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}

.panel-card pre {
    white-space: pre-wrap;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============ BUTTONS ============ */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 14px;
}

.btn:hover { transform: translateY(-1px); opacity: 0.9; }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #020617; }
.btn-success { background: var(--success); color: #020617; }
.btn-warning { background: var(--warning); color: #020617; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--surface-hover); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ QUICK ACTIONS BAR ============ */

.quick-actions {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    display: flex;
    gap: 10px;
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.quick-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
}

/* ============ PLAYER CARDS ============ */

.player-list {
    display: flex; flex-direction: column; gap: 12px;
}

.player-card {
    background: rgba(0,0,0,0.25);
    border-radius: 15px;
    padding: 16px;
    display: flex; align-items: center; gap: 16px;
    transition: var(--transition);
}

.player-card:hover {
    background: rgba(255,255,255,0.05);
}

.player-avatar {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--surface-hover);
    flex-shrink: 0;
}

.player-info { flex: 1; }

.player-name {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 2px;
}

.player-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.player-actions {
    display: flex; gap: 6px;
    flex-shrink: 0;
}

/* ============ TABLE ============ */

.table-wrap {
    overflow-x: auto;
    border-radius: 15px;
    background: rgba(0,0,0,0.3);
}

.table-wrap table {
    width: 100%; border-collapse: collapse;
}

.table-wrap th {
    color: var(--accent);
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.3);
}

.table-wrap td {
    padding: 14px 16px;
    color: var(--text);
    border-top: 1px solid var(--border);
    font-size: 14px;
}

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

/* ============ TOASTS ============ */

.toasts {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    animation: slideIn 0.35s ease, fadeOut 0.35s ease 3.5s forwards;
    max-width: 380px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.toast-success { background: rgba(34,197,94,0.9); }
.toast-warning { background: rgba(245,158,11,0.9); }
.toast-danger { background: rgba(239,68,68,0.9); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-12px); }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar .sidebar-brand h2,
    .sidebar .sidebar-nav a span,
    .sidebar .sidebar-footer {
        display: none;
    }
    .sidebar-nav a { justify-content: center; padding: 14px 0; }
    .main { margin-left: 60px; padding: 16px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { flex-wrap: wrap; }
}

/* ============ FORM ============ */

.form-control {
    background: rgba(0,0,0,0.3) !important;
    color: white !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 14px;
}

.form-control:focus {
    border-color: var(--accent) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}

input::placeholder { color: var(--text-muted); }

/* ============ LOGIN PAGE ============ */

.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #020617);
}

.login-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card h2 { text-align: center; margin-bottom: 24px; }

.login-card input {
    width: 100%;
    margin-bottom: 14px;
}

.login-card button {
    width: 100%;
    margin-top: 8px;
}
