:root {
    --ink: #1c2830;
    --muted: #66717c;
    --line: #e4dfd4;
    --paper: #f6f4ef;
    --card: #fffdf9;
    --teal: #1f6f68;
    --teal-dark: #16332f;
    --ok: #0f6b3c;
    --ok-bg: #e5f6ee;
    --warn: #8a5a00;
    --warn-bg: #fff4df;
    --bad: #9f1d16;
    --bad-bg: #fdeceb;
    --side: #1c2830;
    color-scheme: light;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.45;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 28px; letter-spacing: -0.03em; margin-bottom: 0; }
h2 { font-size: 18px; letter-spacing: -0.02em; }
a { color: var(--teal); }
code {
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: #efeae2;
    padding: 1px 5px;
    border-radius: 4px;
}

.app {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    min-height: 100vh;
}

.side {
    background: var(--side);
    color: #d7e0dc;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.brand strong { display: block; color: white; }
.brand small { color: #9aada8; }

.mark {
    width: 28px;
    height: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    flex: none;
}
.mark i { display: block; border-radius: 2px; }
.mark i:nth-child(1) { background: #3dbe9a; }
.mark i:nth-child(2) { background: #e7b008; }
.mark i:nth-child(3) { background: #e15a4a; }
.mark i:nth-child(4) { background: #d5ddd8; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
    color: #d7e0dc;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); }
.nav a.active { background: #2a6d67; color: white; }
.nav-gap { height: 10px; }

.side-foot { margin-top: auto; font-size: 13px; color: #9aada8; }
.side-foot a { color: #d7efe9; }
.side-note { margin-bottom: 0; }

.main { padding: 22px 24px 48px; min-width: 0; }

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 14px;
}
.eyebrow {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--muted);
}
.top-actions, .identity-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 12px;
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.btn:hover { border-color: var(--teal); color: var(--teal); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: white; }
.btn-primary:hover { color: white; background: #185952; }
.btn.aktif { background: var(--ink); color: white; border-color: var(--ink); }

.chip, .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
}
.chip { border: 1px solid #cfe3e0; color: #0f5c56; background: #f3fbfa; }
.pill { background: var(--ok-bg); color: var(--ok); font-weight: 650; }
.pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.pill.info { background: var(--warn-bg); color: var(--warn); }

.banner, .callout, .alert {
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 0 14px;
}
.banner { background: var(--warn-bg); border: 1px solid #f0d7a2; color: #6b4a09; }
.callout { background: #e7f3f2; color: var(--teal-dark); }
.alert { background: var(--bad-bg); border: 1px solid #f3c7c3; color: #7d1b16; }
.refresh-note { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.identity {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 14px;
}
.identity h2 { font-size: 32px; margin-bottom: 4px; }
.muted { color: var(--muted); }
.block { display: block; }

.cek-grid, .stat-grid {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
}
.cek-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.cek, .stat, .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.cek { border-left-width: 4px; border-left-color: var(--ok); padding: 10px 12px; }
.cek.warn { border-left-color: #d0891c; }
.cek.bad { border-left-color: #c44536; }
.cek.info { border-left-color: #8aa0a8; }
.cek-judul { margin: 0; font-weight: 650; }
.cek-rinci { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.cek a { font-size: 13px; }

.stat { padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.stat strong { display: block; font-size: 28px; letter-spacing: -0.03em; margin-bottom: 8px; }
.stat.ok strong { color: var(--ok); }
.stat.warn strong { color: var(--warn); }
.stat.bad strong { color: var(--bad); }
.stat .muted { margin: 8px 0 0; font-size: 13px; }

.bar { height: 8px; background: #ece7de; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--ok); }
.bar.warn > span { background: #d0891c; }
.bar.bad > span { background: #c44536; }

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 14px;
}
.card { padding: 14px 16px; }
.main > .card + .card { margin-top: 14px; }
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-head h2 { margin-bottom: 8px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid #f0ebe3; vertical-align: top; }
tr.bad td { background: #fff6f5; }
tr.warn td { background: #fffaf0; }
.num { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.off, .badge.info { background: #eeeae3; color: #5c6570; }

.ringkas-angka { display: flex; gap: 8px; margin-top: 0; }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { padding: 8px 0; border-bottom: 1px solid #f0ebe3; }
.log-list li.bad { color: var(--bad); }
.log-list li.warn { color: #7a4e00; }
.meter { margin-top: 8px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.meter .bar { margin-top: 4px; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.filter-row input[type="search"] { width: min(320px, 100%); }

input[type="text"], input[type="password"], input[type="search"], input[type="number"] {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: white;
    color: inherit;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.form-aksi { display: flex; gap: 8px; align-items: center; }
.router-list { list-style: none; margin: 0; padding: 0; }
.router-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0ebe3;
}
.router-list form { margin: 0; }
.router-list .muted { margin: 4px 0 0; }

.kosong { color: var(--muted); }
details { margin-top: 16px; }
summary { cursor: pointer; font-weight: 650; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 28px; }
.prose h3 { margin-bottom: 8px; }
.prose li { margin: 6px 0; }
.prose pre {
    background: var(--side);
    color: #e7f3f1;
    padding: 12px 14px;
    border-radius: 12px;
    overflow: auto;
    font-size: 13px;
}
.langkah { padding-left: 18px; }
.langkah li { margin: 8px 0; }
.galat h2 { font-size: 26px; }

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(#1c2830 0 168px, var(--paper) 168px);
}
.login-card {
    width: min(440px, 100%);
    background: var(--card);
    border-radius: 18px;
    padding: 28px;
    border: 1px solid var(--line);
}
.login-card h1 { font-size: 30px; margin-bottom: 8px; }
.login-card label { display: block; margin: 14px 0; font-size: 14px; }
.login-card input { width: 100%; margin-top: 6px; }
.hint { font-size: 13px; color: var(--muted); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.side a:focus-visible { outline-color: #9ad7cf; }

:target { scroll-margin-top: 16px; background: #fff8e8; border-radius: 8px; }

@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .side { position: sticky; top: 0; z-index: 5; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .nav-gap, .side-note { display: none; }
    .side-foot { margin-top: 0; display: flex; gap: 10px; align-items: center; }
    .split, .identity, .router-list li { grid-template-columns: 1fr; display: block; }
    .router-list .top-actions { margin-top: 8px; }
    .identity-side { margin-top: 8px; }
    .topbar { display: block; }
    .top-actions { margin-top: 10px; }
    h1, .identity h2 { font-size: 24px; }
}
