:root {
    --bg: #0e1117;
    --bg2: #151b23;
    --panel: rgba(21, 27, 35, 0.92);
    --panel-solid: #151b23;
    --text: #edf2f7;
    --muted: #9aa8b7;
    --primary: #f0b323;
    --primary-dark: #c88708;
    --line: rgba(255,255,255,0.12);
    --online: #16c784;
    --offline: #ff4d5e;
    --timeout: #f59e0b;
    --shadow: 0 22px 60px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(240,179,35,.16), transparent 28rem),
        radial-gradient(circle at top right, rgba(74, 108, 140, .22), transparent 32rem),
        linear-gradient(180deg, #0b0f14 0%, #111821 44%, #0e1117 100%);
    color: var(--text);
}
a { color: #f8d36a; text-decoration: none; }
a:hover { text-decoration: none; color: #ffe39c; }
.site-header { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.utility-bar {
    height: 34px;
    display: flex;
    justify-content: center;
    gap: 42px;
    align-items: center;
    color: #c8d2dc;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(7,10,14,.72);
    border-bottom: 1px solid var(--line);
}
.topbar {
    min-height: 74px;
    background: rgba(13,18,24,.78);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px clamp(16px, 5vw, 72px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.brand-logo { width: 48px; height: 48px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.35)); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.topbar nav a { color: #edf2f7; padding: 9px 11px; border-radius: 999px; font-size: 14px; background: rgba(255,255,255,0.06); border: 1px solid transparent; }
.topbar nav a:hover { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,.15); }
.danger-link { background: rgba(239,68,68,0.18)!important; }
.container { max-width: 1360px; margin: 26px auto; padding: 0 18px; }
.footer { text-align: center; color: var(--muted); padding: 34px 16px; font-size: 13px; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 64px); line-height: 1.03; letter-spacing: -.04em; }
h2 { margin: 0; font-size: clamp(22px, 3vw, 34px); }
h3 { margin: 0; }
.eyebrow { color: var(--primary); font-weight: 900; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; }
.muted { color: var(--muted); }
.hero-board, .page-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 18px;
    border-radius: 28px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background:
        linear-gradient(90deg, rgba(6,9,13,.82), rgba(12,18,24,.65)),
        radial-gradient(circle at 72% 25%, rgba(240,179,35,.35), transparent 18rem),
        linear-gradient(135deg, #243746, #101720 55%, #271b0a);
}
.hero-board { grid-template-columns: 1.7fr .9fr; min-height: 360px; padding: clamp(24px, 5vw, 58px); align-items: end; }
.page-hero { padding: clamp(26px, 5vw, 52px); margin-bottom: 20px; }
.small-hero { min-height: 230px; }
.apiary-hero { min-height: 280px; }
.hero-main p, .page-hero p { max-width: 760px; color: #d7e2ec; font-size: clamp(16px, 2vw, 21px); line-height: 1.55; }
.hero-desc { color: #c2ccd8!important; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.btn-primary, .btn-ghost, button, .btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--primary);
    color: #111827;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-ghost { background: rgba(255,255,255,.09); color: #f8fafc; border: 1px solid var(--line); }
.btn-primary:hover, button:hover, .btn:hover { background: #ffd36a; color: #111; }
.btn-ghost:hover { background: rgba(255,255,255,.16); color: #fff; }
.hero-side { display: grid; gap: 12px; }
.hero-side article, .card, .panel, .auth-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,.22);
}
.hero-side article { padding: 22px; }
.hero-side span, .card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.hero-side strong, .card strong { display: block; font-size: clamp(22px, 3vw, 34px); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.metric-strip { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.card { padding: 20px; }
.card.online { border-color: rgba(22,199,132,.45); }
.card.offline { border-color: rgba(255,77,94,.45); }
.panel { padding: 22px; margin: 18px 0; }
.glass-panel { backdrop-filter: blur(10px); }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.text-link { color: #f8d36a; font-weight: 800; }
.status { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.status.ONLINE { background: rgba(22,199,132,.15); color: var(--online); }
.status.OFFLINE { background: rgba(255,77,94,.15); color: var(--offline); }
.status.TIMEOUT { background: rgba(245,158,11,.17); color: var(--timeout); }
.ok { color: var(--online); }
.bad { color: var(--offline); }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
tr:hover td { background: rgba(255,255,255,.03); }
form label { display: block; text-align: left; font-weight: 800; margin: 10px 0 6px; color: #e8eef5; }
input, select, textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px;
    font: inherit; background: rgba(255,255,255,.06); color: var(--text);
}
textarea { min-height: 90px; }
.grid-form { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.grid-form .full { grid-column: 1 / -1; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 4px; }
.auth-card { max-width: 430px; margin: 60px auto; padding: 30px; text-align: center; }
.login-logo { width: 76px; height: 76px; margin-bottom: 10px; }
.alert { padding: 12px; border-radius: 12px; margin: 12px 0; text-align: left; }
.alert.error { background: rgba(239,68,68,.16); color: #fecaca; }
.alert.success { background: rgba(22,199,132,.15); color: #bbf7d0; }
pre { overflow-x: auto; background: #06090d; color: #f9fafb; padding: 16px; border-radius: 16px; border: 1px solid var(--line); }
code, .token-box { color: #ffe08a; }
.token-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #06090d; padding: 14px; border-radius: 14px; overflow-wrap: anywhere; margin: 12px 0; border: 1px solid var(--line); }
.list { display: grid; gap: 10px; }
.list-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.05); }
.apiary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px; }
.apiary-tile, .hive-tile {
    position: relative; overflow: hidden; min-height: 255px; border-radius: 24px; border: 1px solid var(--line);
    background: linear-gradient(135deg, #243746, #111821 55%, #2b1c08); box-shadow: var(--shadow); color: #fff;
}
.apiary-tile:hover, .hive-tile:hover { transform: translateY(-2px); transition: transform .18s ease; color: #fff; }
.tile-overlay { position: absolute; inset: 0; background: radial-gradient(circle at 82% 20%, rgba(240,179,35,.34), transparent 12rem), linear-gradient(180deg, transparent, rgba(0,0,0,.42)); }
.tile-content { position: relative; min-height: 255px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; }
.tile-content h2 { font-size: clamp(28px, 4vw, 44px); margin: 8px 0; }
.tile-content p { color: #d9e2ec; }
.tile-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.tile-stats span, .tile-bottom { background: rgba(0,0,0,.26); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 8px 10px; color: #edf2f7; }
.tile-bottom { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; border-radius: 16px; }
.hive-cards, .hive-tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.hive-card, .hive-tile { padding: 18px; background: rgba(255,255,255,.055); border: 1px solid var(--line); border-radius: 20px; color: #fff; }
.hive-card p { margin: 6px 0; color: var(--muted); }
.hive-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.hive-weight { font-size: clamp(36px, 5vw, 58px); font-weight: 950; letter-spacing: -.06em; margin: 18px 0; }
.hive-weight small { font-size: 18px; color: var(--muted); letter-spacing: 0; }
.hive-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; color: #ccd6e0; font-size: 14px; }
.hive-tile.ONLINE { border-color: rgba(22,199,132,.5); }
.hive-tile.OFFLINE { border-color: rgba(255,77,94,.5); }
.hive-tile.TIMEOUT { border-color: rgba(245,158,11,.55); }
.setting-section { padding: 0; overflow: hidden; }
.setting-section summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 950; font-size: 18px; background: rgba(255,255,255,.05); }
.setting-section summary::-webkit-details-marker { display: none; }
.setting-section summary:before { content: "+"; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 10px; border-radius: 999px; background: var(--primary); color: #111; }
.setting-section[open] summary:before { content: "−"; }
.section-body { padding: 0 22px 22px; }
.empty-state { padding: 24px; color: var(--muted); }
@media (max-width: 1050px) { .hero-board { grid-template-columns: 1fr; } .cards { grid-template-columns: repeat(2, minmax(140px, 1fr)); } }
@media (max-width: 760px) {
    .topbar { align-items: flex-start; flex-direction: column; padding: 12px 16px; }
    .utility-bar { gap: 12px; padding: 0 10px; justify-content: flex-start; overflow: hidden; }
    .hide-small { display: none; }
    .grid-form, .metric-strip { grid-template-columns: 1fr; }
    .section-title { align-items: start; flex-direction: column; }
    .hive-meta { grid-template-columns: 1fr; }
    .page-hero, .hero-board { border-radius: 20px; }
}
