:root {
    --bg: #08090d;
    --bg-sidebar: #0b0c12;
    --panel: #101219;
    --panel-2: #12151d;
    --input-bg: #0a0b10;
    --border: rgba(255,255,255,.07);
    --border-soft: rgba(255,255,255,.045);
    --text: #e7e9ef;
    --text-2: #c5c8d2;
    --muted: #8b8f9e;
    --muted-2: #6c7180;
    --faint: #5c6070;
    --accent: #3b82f6;
    --accent-dim: rgba(59,130,246,.15);
    --green: #2fd4a7;
    --red: #ff5f6d;
    --amber: #f5b544;
}

* { box-sizing: border-box; }
[hidden], .is-hidden { display: none !important; }
html { color-scheme: dark; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
::selection { background: var(--accent-dim); }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 238px;
    flex: none;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
}
.brand {
    height: 69px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-family: "Space Grotesk", Inter, sans-serif;
    font-weight: 700;
}
.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #04140f;
    background: linear-gradient(140deg, var(--accent), #1a9c7a);
    box-shadow: 0 6px 20px var(--accent-dim);
    font-weight: 800;
}
.side-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-section {
    padding: 12px 10px 8px;
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.nav-item {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
}
.nav-item:hover { background: rgba(255,255,255,.035); color: var(--text); }
.nav-primary { color: var(--text); background: var(--accent-dim); }
.user-card {
    margin: 12px;
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #1f2431;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 700;
}
.user-meta { min-width: 0; flex: 1; }
.user-meta strong, .user-meta span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-meta strong { font-size: 12px; }
.user-meta span { color: var(--muted-2); font-size: 11.5px; }
.icon-button {
    border: 0;
    color: var(--muted-2);
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    padding: 6px;
}
.icon-button:hover { color: var(--red); background: rgba(255,95,109,.1); }

.container {
    width: min(1240px, calc(100% - 72px));
    flex: 0 1 1240px;
    min-width: 0;
    margin: 0 auto;
    padding: 30px 0 60px;
}
.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 26px;
}
.hero h1, .form-panel h1, .detail-header h1, .status-page > h1, .auth-card h1 {
    margin: 0 0 8px;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(28px, 4vw, 34px);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -.02em;
}
.hero p, .form-panel > p, .auth-card p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow {
    display: inline-block;
    margin-bottom: 9px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.button {
    border: 0;
    border-radius: 10px;
    padding: 11px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}
.button-primary { background: var(--accent); color: #04140f; box-shadow: 0 8px 22px var(--accent-dim); }
.button-primary:hover { filter: brightness(1.06); color: #04140f; }
.button-ghost { color: var(--text); background: #171a24; border: 1px solid rgba(255,255,255,.09); }
.button-small { padding: 8px 12px; font-size: 12.5px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stats-three { grid-template-columns: repeat(3, 1fr); }
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 15px 16px;
}
.stat-card span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 11px; }
.stat-card strong {
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -.02em;
}
.stat-up strong, .text-up { color: var(--green); }
.stat-down strong, .text-down { color: var(--red); }
.stat-degraded strong, .text-degraded, .text-pending { color: var(--amber); }

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
}
.panel-heading { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; align-items: center; }
.panel-heading h2 { margin: 0; font-family: "Space Grotesk"; font-size: 16.5px; font-weight: 600; }
.muted-link { color: var(--muted); font-size: 13px; }
.monitor-row {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
}
.monitor-row:hover { background: rgba(255,255,255,.02); }
.monitor-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.monitor-main strong { font-size: 14px; }
.monitor-main small, .target-url { color: var(--muted-2); font-family: "JetBrains Mono", monospace; overflow-wrap: anywhere; }
.muted-meta { color: var(--muted-2); font: 12px "JetBrains Mono", monospace; white-space: nowrap; }
.row-arrow { color: var(--muted-2); }

.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); flex: none; }
.status-up { background-color: var(--green); }
.status-down { background-color: var(--red); }
.status-degraded, .status-pending { background-color: var(--amber); }
.status-pill {
    border-radius: 999px;
    padding: 5px 8px;
    color: #04140f;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.status-pill.status-up { background: var(--green); }
.status-pill.status-down { background: var(--red); }
.status-pill.status-degraded, .status-pill.status-pending { background: var(--amber); }

.empty-state, .empty-compact { text-align: center; color: var(--muted); padding: 46px 24px; }
.pulse-icon { font-size: 42px; color: var(--accent); }
.back-link { display: inline-block; color: var(--muted); margin-bottom: 20px; }
.narrow { width: min(650px, 100%); margin: 0 auto; }
.wide-form { width: min(820px, 100%); }
.form-panel { padding: 28px; }
.stack-form { display: grid; gap: 18px; margin-top: 24px; }
.stack-form label { display: grid; gap: 7px; color: var(--text-2); font-weight: 700; font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
input, select {
    width: 100%;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 10px;
    padding: 11px 13px;
    font: inherit;
    color: var(--text);
    background: var(--input-bg);
    outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
label small { color: var(--muted-2); font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.alert { background: rgba(255,95,109,.12); color: #ffb1bd; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,95,109,.2); }

.detail-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.detail-title { display: flex; align-items: center; gap: 18px; min-width: 0; }
.detail-title .status-dot { width: 15px; height: 15px; }
.button-row { display: flex; gap: 9px; }
.date-value { font-size: 16px !important; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 18px; margin-bottom: 18px; }
.chart-wrap { padding: 18px; min-height: 260px; }
#latencyChart { width: 100%; height: 240px; }
.info-panel { padding: 23px; }
.info-panel dl { margin: 12px 0 26px; }
.info-panel dl div { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.06); padding: 12px 0; gap: 16px; }
.info-panel dt { color: var(--muted); }
.info-panel dd { margin: 0; text-align: right; }
.info-panel a { color: #6ba4ff; }
.danger-link { background: none; border: 0; color: var(--red); padding: 0; cursor: pointer; }
.history-panel { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
th { color: var(--muted); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.error-cell { color: var(--muted); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.details-cell {
    color: var(--muted);
    max-width: 620px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}
.status-page { width: min(920px, 100%); }
.big-status { display: flex; align-items: center; gap: 18px; border-radius: 15px; padding: 22px; margin: 24px 0 18px; border: 1px solid var(--border); background: var(--panel); }
.big-status-up { border-color: rgba(47,212,167,.35); background: linear-gradient(120deg, rgba(18, 61, 49, .9), var(--panel)); }
.big-status-down { border-color: rgba(255,95,109,.35); background: linear-gradient(120deg, rgba(70, 23, 31, .9), var(--panel)); }
.big-status-degraded { border-color: rgba(245,181,68,.35); background: linear-gradient(120deg, rgba(80,57,18,.9), var(--panel)); }
.big-status strong, .big-status small { display: block; }
.big-status strong { font: 600 18px "Space Grotesk"; margin-bottom: 5px; }
.big-status small { color: var(--muted); }
.status-timeline > div { display: grid; grid-template-columns: 12px 88px 1fr auto; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.status-timeline span, .status-timeline time { color: var(--muted); }

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(900px 500px at 50% -10%, rgba(47,212,167,.08), transparent 60%), var(--bg);
}
.auth-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(600px 400px at 50% 30%, #000, transparent 80%);
}
.auth-wrap { position: relative; width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 26px; font: 700 19px "Space Grotesk"; }
.auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.auth-card h1 { font-size: 23px; }
.auth-tabs { display: flex; padding: 4px; background: var(--input-bg); border: 1px solid rgba(255,255,255,.06); border-radius: 11px; margin: 22px 0; }
.auth-tabs a { flex: 1; text-align: center; border-radius: 8px; padding: 9px; color: var(--muted); font-size: 13px; font-weight: 700; }
.auth-tabs a.active { background: var(--accent); color: #04140f; }
.auth-note { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 18px; }

@media (max-width: 860px) {
    .app-shell { display: block; }
    .sidebar { width: 100%; height: auto; position: static; }
    .side-nav { flex-direction: row; flex-wrap: wrap; }
    .nav-section, .user-card { display: none; }
    .container { width: 100%; padding: 24px; }
    .stats-grid, .stats-three { grid-template-columns: repeat(2, 1fr); }
    .content-grid, .form-grid { grid-template-columns: 1fr; }
    .hero, .detail-header { flex-direction: column; align-items: stretch; }
    .muted-meta { display: none; }
}
