* { box-sizing: border-box; }
:root {
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #1e293b;
    --border: #263248;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --green: #10b981;
    --green-hover: #059669;
    --amber: #f59e0b;
    --amber-hover: #d97706;
    --red: #ef4444;
    --red-hover: #dc2626;
    --purple: #8b5cf6;
    --purple-hover: #7c3aed;
    --radius: 12px;
}
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1260px; margin: 0 auto; padding: 1.5rem; }

.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.navbar-inner {
    max-width: 1260px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-weight: 700;
    font-size: 1.08rem;
    color: #fff;
    text-decoration: none;
}
.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    box-shadow: 0 0 12px rgba(59,130,246,.6);
}
.nav-links { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.nav-link {
    padding: .45rem .78rem;
    border-radius: 8px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.nav-link:hover, .nav-link.active { background: var(--surface-2); color: #fff; text-decoration: none; }
.nav-link.active { border: 1px solid #3b82f6; color: #93c5fd; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
}
.stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: #fff; margin-top: .25rem; }
.stat-sub { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    margin-bottom: 1.25rem;
}
.card-title { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 600; color: #fff; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .85rem;
}
@media (min-width: 760px) {
    .span-2 { grid-column: span 2; }
}
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .35rem; font-weight: 500; }
input[type="text"], input[type="url"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select {
    width: 100%;
    padding: .62rem .8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0b1120;
    color: #f8fafc;
    font-size: .9rem;
    outline: none;
    color-scheme: dark;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59,130,246,.2); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .52rem .92rem;
    border-radius: 8px;
    border: none;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--primary);
    text-decoration: none;
    transition: background .15s ease;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn-green { background: var(--green); } .btn-green:hover { background: var(--green-hover); }
.btn-amber { background: var(--amber); color: #111827; } .btn-amber:hover { background: var(--amber-hover); }
.btn-red { background: var(--red); } .btn-red:hover { background: var(--red-hover); }
.btn-purple { background: var(--purple); } .btn-purple:hover { background: var(--purple-hover); }
.btn-slate { background: #334155; } .btn-slate:hover { background: #475569; }
.btn-sm { padding: .35rem .65rem; font-size: .79rem; border-radius: 6px; }

.badge {
    display: inline-block;
    padding: .18rem .58rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.badge-active { background: rgba(16,185,129,.18); color: #34d399; border: 1px solid rgba(16,185,129,.35); }
.badge-paused { background: rgba(245,158,11,.18); color: #fbbf24; border: 1px solid rgba(245,158,11,.35); }
.badge-info { background: rgba(59,130,246,.18); color: #93c5fd; border: 1px solid rgba(59,130,246,.35); }
.badge-error { background: rgba(239,68,68,.18); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }
.badge-purple { background: rgba(139,92,246,.18); color: #c4b5fd; border: 1px solid rgba(139,92,246,.35); }

.alert {
    padding: .9rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
}
.alert-success { background: rgba(16,185,129,.14); border: 1px solid rgba(16,185,129,.35); color: #a7f3d0; }
.alert-error { background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.35); color: #fecaca; }
.alert-info { background: rgba(59,130,246,.14); border: 1px solid rgba(59,130,246,.35); color: #bfdbfe; }

.monitor-meta { font-size: .83rem; color: var(--muted); margin-top: .35rem; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.actions form { margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
a.monitor-name-link { color: #fff; font-weight: 700; font-size: 1rem; }
a.monitor-name-link:hover { color: #60a5fa; text-decoration: underline; }

code {
    background: #0b1120;
    border: 1px solid var(--border);
    padding: .15rem .45rem;
    border-radius: 6px;
    font-size: .82rem;
    color: #93c5fd;
    word-break: break-all;
}
pre.cmd-box {
    background: #060a14;
    border: 1px solid var(--border);
    padding: .85rem 1rem;
    border-radius: 8px;
    overflow-x: auto;
    color: #a7f3d0;
    font-size: .83rem;
    margin: .4rem 0 1rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.auth-card h1 { margin: 0 0 .4rem; font-size: 1.35rem; color: #fff; }
.auth-card p.sub { margin: 0 0 1.4rem; color: var(--muted); font-size: .88rem; }
.field { margin-bottom: .95rem; }
.req-list { list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .84rem; }
.req-list li { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid var(--border); }
details.edit-box {
    margin-top: .85rem;
    padding: .95rem;
    background: #0d1526;
    border: 1px solid var(--border);
    border-radius: 10px;
}
details.edit-box summary {
    cursor: pointer;
    font-size: .84rem;
    color: #93c5fd;
    font-weight: 600;
}
