:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #16243a;
    background: #f2f5f9;
    --ink: #16243a;
    --muted: #51627b;
    --line: #dce4ee;
    --blue: #124db0;
    --nav: #101e34;
    --green: #0b694d;
    --red: #a52537;
    --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); }
a:hover { color: #0a377e; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid #5285dc;
    outline-offset: 3px;
}
.top { background: var(--nav); color: #fff; border-bottom: 3px solid #4680df; }
.top-inner {
    max-width: 1510px;
    margin: auto;
    min-height: 74px;
    padding: 10px clamp(16px, 3vw, 44px);
    display: flex;
    align-items: center;
    gap: clamp(14px, 3vw, 40px);
}
.brand { display: flex; align-items: center; gap: 11px; white-space: nowrap; line-height: 1.2; }
.brand small { margin-top: 4px; color: #bdcce2; font-size: .74rem; }
.mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: #346ed5;
    border-radius: 10px;
    font-weight: 850;
    font-size: 1.3rem;
}
nav { display: flex; gap: 5px; flex-wrap: wrap; }
nav a { color: #dce8f8; font-size: .89rem; text-decoration: none; border-radius: 7px; padding: 9px 11px; }
nav a:hover, nav [aria-current] { color: white; background: #293e60; }
.profile { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.profile button { border-color: #607696; background: transparent; color: white; }
.profile button:hover { background: #293e60; }
.wrap { width: 100%; max-width: 1510px; margin: auto; padding: 30px clamp(16px, 3vw, 44px) 60px; }
.heading { margin-bottom: 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.045em; line-height: 1.12; }
h2 { font-size: 1.04rem; letter-spacing: -.015em; }
.heading p { color: var(--muted); margin-top: 8px; font-size: .92rem; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.metric { display: grid; gap: 4px; padding: 13px 17px; text-decoration: none; color: var(--ink); border-top: 3px solid #799bc9; }
.metric:hover { border-color: #5580ba; }
.metric.green { border-top-color: #278869; }
.metric.red { border-top-color: #d15262; background: #fff6f7; color: var(--red); }
.metric span { color: var(--muted); font-size: .83rem; font-weight: 650; }
.metric strong { font-size: 1.8rem; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.filter { display: grid; grid-template-columns: minmax(145px, 1.6fr) repeat(3, minmax(118px, 1fr)) auto; align-items: end; gap: 12px; padding: 16px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .8rem; font-weight: 650; }
input, select, button, .button { font: inherit; }
input, select { width: 100%; min-width: 0; min-height: 38px; background: #fff; color: var(--ink); border: 1px solid #c1cddd; border-radius: 7px; padding: 7px 9px; font-size: .88rem; }
button, .button { display: inline-block; min-height: 36px; padding: 8px 13px; border-radius: 7px; border: 1px solid transparent; font-size: .83rem; font-weight: 650; cursor: pointer; text-decoration: none; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: #0c397f; }
.filter button { min-height: 38px; }
.quiet { background: #f5f8fd; border-color: #ccd8e9; color: var(--blue); }
.quiet:hover { background: #e9f1fc; }
.danger { color: var(--red); background: #fff1f2; border-color: #f0c2c8; }
.danger:hover { background: #fbe0e3; }
.section-title { display: flex; align-items: baseline; gap: 9px 14px; flex-wrap: wrap; padding: 13px 16px; }
.section-title span, .section-title a, .node-counts { color: var(--muted); font-size: .83rem; }
.section-title a { margin-left: auto; color: var(--blue); }
.table-scroll { overflow-x: auto; border-radius: 0 0 12px 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
thead { background: #edf2f9; color: #435774; }
th { font-size: .78rem; white-space: nowrap; }
th, td { padding: 10px 13px; vertical-align: top; }
th:first-child, td:first-child { padding-left: 16px; }
td { border-bottom: 1px solid #e6edf5; }
tbody tr:last-child td { border-bottom: 0; }
td strong { overflow-wrap: anywhere; }
td small { display: block; color: var(--muted); margin-top: 4px; white-space: nowrap; }
tbody tr.suspended { background: #fff2f3; color: #831f30; }
tbody tr.suspended td { border-color: #f6dadd; }
tbody tr.suspended td:first-child { box-shadow: inset 3px 0 #d15262; }
.pill { display: inline-flex; border-radius: 20px; padding: 3px 8px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.green { color: var(--green); }
.red, .red-text { color: var(--red); }
.pill.green { background: #dff5ec; }
.pill.red { background: #fbdde1; }
details summary { width: max-content; color: var(--blue); cursor: pointer; font-weight: 650; }
.action-form { margin-top: 8px; min-width: min(260px, 68vw); }
.action-form form, .login form, .box form { display: grid; gap: 10px; }
.action-form button, .box button { justify-self: start; }
.empty { padding-block: 28px; color: var(--muted); text-align: center; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 16px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.servers { margin-top: 20px; }
.servers .section-title { padding-left: 0; }
.node-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.node { display: grid; gap: 8px; padding: 14px; text-decoration: none; color: var(--ink); min-width: 0; }
.node:hover, .node[aria-current] { border-color: #5580ba; }
.node strong { overflow-wrap: anywhere; }
.node-counts { display: flex; flex-wrap: wrap; gap: 3px 12px; }
meter { width: 100%; height: 9px; appearance: none; }
meter::-webkit-meter-bar { background: #e0e9f4; border: 0; }
meter::-webkit-meter-optimum-value { background: #d15262; }
meter::-moz-meter-bar { background: #d15262; }
.login { width: min(100%, 410px); margin: clamp(20px, 9vh, 90px) auto 0; padding: clamp(19px, 4vw, 34px); box-shadow: 0 12px 30px #1c355510; }
.login h1 { margin-bottom: 20px; }
.login form { gap: 16px; }
.notice { background: #e9f2ff; color: #204a87; padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; }
.page-login .notice, .page-error .notice { background: #fff0f1; color: var(--red); }
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.box { padding: 16px; }
.box h2 { margin-bottom: 12px; }
.list { margin-top: 14px; }
.manage-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px 20px; }
.manage-actions form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.manage-actions details form { margin-top: 8px; }
@media (max-width: 900px) {
    .filter { grid-template-columns: repeat(3,minmax(0, 1fr)); }
    .filter .search { grid-column: span 2; }
    .filter button { grid-column: 3; grid-row: 1; }
    .node-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
    .top-inner { flex-wrap: wrap; gap: 8px 15px; }
    nav { order: 3; width: 100%; }
    nav a { font-size: .8rem; padding: 7px 8px; }
    .wrap { padding-top: 22px; }
    .metrics { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .filter { grid-template-columns: 1fr 1fr; }
    .filter .search { grid-column: span 2; }
    .filter button { grid-row: auto; grid-column: auto; }
    .manage-grid, .node-grid { grid-template-columns: 1fr; }
}
