:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #111827;
    --muted: #64748b;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --danger: #b91c1c;
    --line: #e2e8f0;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--brand-dark); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.brand { color: var(--text); font-weight: 800; text-decoration: none; }
.nav { display: flex; gap: 10px; overflow-x: auto; }
.nav a { color: var(--text); text-decoration: none; font-size: 14px; white-space: nowrap; }
.page { width: min(1120px, 100%); margin: 0 auto; padding: 24px 16px 48px; }
h1, h2 { margin: 0 0 12px; }
.muted { color: var(--muted); margin-top: 0; }
.hero, .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat, .panel, .auth-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.stat { padding: 18px; }
.stat strong { display: block; font-size: 30px; }
.stat span { color: var(--muted); }
.panel { padding: 18px; margin-bottom: 18px; }
.auth-panel { width: min(420px, 100%); margin: 42px auto; padding: 22px; }
.auth-panel.wide { width: min(620px, 100%); }
.form { display: grid; gap: 14px; }
.form.inline { grid-template-columns: 1fr auto; align-items: end; }
label { display: grid; gap: 6px; font-weight: 650; }
input, select, textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}
textarea { resize: vertical; min-height: 140px; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}
.button.secondary { background: #e0f2f1; color: var(--brand-dark); }
button.danger { background: var(--danger); }
.alert { padding: 12px; border-radius: 8px; background: #fee2e2; color: #991b1b; }
.notice { padding: 12px; border-radius: 8px; background: #dcfce7; color: #166534; margin-bottom: 14px; }
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    color: #fff;
    font-weight: 750;
    text-transform: capitalize;
}
.badge.online { background: #15803d; }
.badge.offline { background: #b91c1c; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.truncate { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.api-list { display: grid; gap: 14px; }
.api-item {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
code {
    padding: 2px 5px;
    border-radius: 6px;
    background: #eef2f7;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}
pre {
    overflow-x: auto;
    margin: 8px 0 0;
    padding: 14px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.55;
}
pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

@media (max-width: 720px) {
    .topbar, .hero, .section-title { align-items: flex-start; flex-direction: column; }
    .grid { grid-template-columns: 1fr; }
    .form.inline { grid-template-columns: 1fr; }
    .nav { width: 100%; }
}
