:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-hover: #22263a;
    --text: #e0e2e8;
    --text-muted: #8b92a8;
    --accent: #4f8cff;
    --accent-hover: #3a78f0;
    --success: #2dd36f;
    --danger: #eb445a;
    --warning: #ffc409;
    --border: #2a2e3f;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* LOGIN */
.login-body {
    justify-content: center;
    align-items: center;
}

.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-box .logo {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--accent);
}

.login-box h2 {
    text-align: center;
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 400;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.input-group input:focus {
    border-color: var(--accent);
}

.input-group.checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    cursor: pointer;
}

.input-group.checkbox input {
    width: auto;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
}

.error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

/* SIDEBAR */
.sidebar {
    width: 220px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
}

.sidebar .logo {
    font-size: 18px;
    font-weight: 700;
    padding: 0 20px 20px;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-links li a:hover, .nav-links li a.active {
    background: var(--bg-hover);
    color: var(--text);
    border-left-color: var(--accent);
}

.user-info {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

/* CONTENT */
.content {
    margin-left: 220px;
    flex: 1;
    padding: 32px;
    max-width: 1200px;
}

.content h1 {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 600;
}

.content h2 {
    font-size: 18px;
    margin: 32px 0 16px;
    color: var(--text-muted);
    font-weight: 500;
}

.hidden { display: none !important; }

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

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

/* SERVICES GRID */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, border-color 0.15s;
}

.service-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.service-icon {
    font-size: 32px;
}

.service-info {
    flex: 1;
}

.service-name {
    font-weight: 600;
    font-size: 14px;
}

.service-status {
    font-size: 12px;
    margin-top: 4px;
}

.status-online { color: var(--success); }
.status-offline { color: var(--danger); }
.status-error { color: var(--warning); }

/* TABLES */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table .tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tag-online { background: rgba(45,211,111,0.15); color: var(--success); }
.tag-offline { background: rgba(235,68,90,0.15); color: var(--danger); }
.tag-admin { background: rgba(79,140,255,0.15); color: var(--accent); }

.actions { margin-bottom: 16px; }

.actions .btn-primary { width: auto; }

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 400px;
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* UTILS */
.loading {
    color: var(--text-muted);
    padding: 20px;
    text-align: center;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .content { margin-left: 0; padding: 16px; }
    body { flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
