/* Base */
:root {
    --bg: #f5f7fb;
    --sidebar: #0f172a;
    --sidebar-hover: #111c33;
    --text: #0f172a;
    --muted: #6b7280;
    --primary: #059669;
    --primary-dark: #047857;
    --card: #ffffff;
    --border: #e5e7eb;
    --badge-green: #d1fae5;
    --badge-green-text: #065f46;
    --badge-red: #ffe4e6;
    --badge-red-text: #b91c1c;
    --badge-amber: #fef3c7;
    --badge-amber-text: #92400e;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: var(--sidebar);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-link {
    display: block;
    padding: 12px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    color: #e5e7eb;
    font-weight: 600;
}
.nav-link:hover { background: rgba(255,255,255,0.07); }
.nav-link.is-active { background: #111c33; color: #6ee7b7; }
.nav-section {
    margin: 16px 12px 8px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    color: #cbd5e1;
}

.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-title { font-weight: 700; font-size: 18px; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-meta { text-align: right; line-height: 1.2; }
.user-name { font-weight: 700; font-size: 14px; display: block; }
.user-email { color: var(--muted); font-size: 12px; display: block; }
.content { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-dark { background: #0f172a; color: #fff; }
.btn-dark:hover { background: #111c33; }
.full-width { width: 100%; }

/* Cards and grids */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.charts { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.04);
}
.card-plain { background: #fff; }
.card-green { background: #ecfdf3; border-color: #bbf7d0; }
.card-red { background: #fff1f2; border-color: #fecdd3; }
.card-amber { background: #fffbeb; border-color: #fde68a; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.card-header.between { align-items: flex-start; }

.label { font-size: 13px; color: var(--muted); }
.value { font-size: 32px; font-weight: 700; margin-top: 4px; }
.title-sm { font-size: 16px; font-weight: 700; }

.chart { width: 100%; max-width: 100%; height: 280px; }

/* Tables */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: none; }
.text-strong { font-weight: 700; color: #111827; }
.text-right { text-align: right; }
.links a { margin-left: 10px; }
.link { font-weight: 700; color: var(--primary); text-decoration: none; }
.link.muted { color: #475569; font-weight: 600; }
.link.danger { color: #e11d48; }
.empty { text-align: center; color: var(--muted); padding: 16px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.badge-online { background: var(--badge-green); color: var(--badge-green-text); }
.badge-offline { background: var(--badge-red); color: var(--badge-red-text); }
.badge-warning { background: var(--badge-amber); color: var(--badge-amber-text); }
.badge-unknown { background: #e5e7eb; color: #374151; }
.badge-green { background: var(--badge-green); color: var(--badge-green-text); }
.badge-red { background: var(--badge-red); color: var(--badge-red-text); }
.badge-amber { background: var(--badge-amber); color: var(--badge-amber-text); }

/* Forms */
.filter-grid {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: center;
}
.filter-grid input,
.filter-grid select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
}
.filter-grid button { width: 100%; }

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.page-header h1 { margin: 0; font-size: 24px; }
.muted { color: var(--muted); margin: 4px 0 0; }

/* Login */
.login-body {
    background: radial-gradient(circle at 20% 20%, rgba(16,185,129,0.15), transparent 30%), #0b1225;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-wrapper { max-width: 1040px; width: 100%; }
.login-card {
    background: linear-gradient(145deg, #0f172a, #0b1225);
    border-radius: 26px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    color: #e5e7eb;
}
.login-panel { padding: 32px 32px 40px; }
.login-panel--info {
    background: radial-gradient(circle at 20% 20%, rgba(16,185,129,0.25), transparent 30%), #0b1225;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: rgba(16,185,129,0.2);
    display: grid; place-items: center;
    font-weight: 800;
}
.brand-name { font-size: 18px; font-weight: 700; }
.login-panel-title { letter-spacing: 0.14em; text-transform: uppercase; color: #34d399; margin-top: 32px; font-size: 12px; }
.login-heading { margin: 12px 0 16px; font-size: 28px; color: #fff; }
.login-bullets { padding-left: 18px; color: #cbd5e1; line-height: 1.8; }
.login-footer { margin-top: 42px; color: #94a3b8; font-size: 13px; }

.login-panel--form { background: rgba(255,255,255,0.02); }
.login-form-header .label { letter-spacing: 0.12em; color: #34d399; text-transform: uppercase; font-size: 12px; }
.login-form-header h2 { margin: 6px 0 4px; color: #fff; }
.login-form-header p { margin: 0; color: #cbd5e1; }
.login-form { margin-top: 18px; }
.form-label { display: block; margin: 14px 0 6px; font-weight: 600; }
.input-group {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 10px 12px;
}
.input-icon { width: 28px; text-align: center; color: #94a3b8; }
.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
}
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0;
    color: #cbd5e1;
}
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: 16px; height: 16px; }
.alert { padding: 12px; border-radius: 12px; font-weight: 600; margin: 8px 0; }
.alert-error { background: rgba(248,113,113,0.12); color: #fca5a5; border: 1px solid rgba(248,113,113,0.3); }
.login-alt { text-align: center; margin-top: 12px; color: #cbd5e1; }
.login-alt .link { color: #22d3ee; }

@media (max-width: 960px) {
    .sidebar { display: none; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
}
