:root {
    color-scheme: dark;
    --bg: #08111f;
    --panel: #0f1c2e;
    --panel-2: #13243a;
    --line: #263b55;
    --text: #e8f0fa;
    --muted: #9fb1c7;
    --brand: #37b6ff;
    --brand-2: #2de1a7;
    --danger: #ff6b7a;
    --warning: #f3bd55;
    --ok: #42d392;
    --shadow: 0 20px 55px rgba(0, 0, 0, .28);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 0%, rgba(55, 182, 255, .14), transparent 32rem),
        radial-gradient(circle at 90% 10%, rgba(45, 225, 167, .10), transparent 28rem),
        var(--bg);
    color: var(--text);
}
a { color: var(--brand); }
button, input, select { font: inherit; }
.shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
    width: 46px; height: 46px; display: grid; place-items: center;
    border-radius: 14px; color: #04111c; font-weight: 900; letter-spacing: -.05em;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 10px 30px rgba(55, 182, 255, .22);
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.03em; }
h2 { font-size: 1.12rem; margin-bottom: 16px; }
.subtitle, .muted { color: var(--muted); }
.subtitle { margin: 0; font-size: .94rem; }
.userbar { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.card {
    background: linear-gradient(180deg, rgba(19, 36, 58, .96), rgba(15, 28, 46, .96));
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
    padding: 22px;
}
.login-wrap { width: min(460px, calc(100% - 32px)); margin: 8vh auto 0; }
.login-wrap .brand { margin-bottom: 24px; }
.login-wrap .card { padding: 30px; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #cbd8e7; font-size: .88rem; font-weight: 650; }
input, select {
    width: 100%; color: var(--text); background: #091625; border: 1px solid #304761;
    border-radius: 10px; padding: 11px 12px; outline: none;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(55, 182, 255, .14); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; color: #cbd8e7; }
.check span { line-height: 1.35; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { width: 100%; font-weight: 760; margin-bottom: 15px; }
details { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
summary { color: var(--brand); cursor: pointer; font-weight: 700; margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
    width: auto; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px;
    cursor: pointer; font-weight: 760; color: #06111d; background: var(--brand);
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { color: var(--text); background: #1c3048; border-color: #334d69; }
.btn.success { background: var(--brand-2); }
.btn.danger { color: #fff; background: #b53648; }
.btn.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.notice { border-radius: 12px; padding: 13px 15px; border: 1px solid; margin-bottom: 18px; line-height: 1.45; }
.notice.error { color: #ffd9dd; background: rgba(181, 54, 72, .15); border-color: rgba(255, 107, 122, .45); }
.notice.warning { color: #ffe7ba; background: rgba(243, 189, 85, .11); border-color: rgba(243, 189, 85, .4); }
.notice.success { color: #caffea; background: rgba(66, 211, 146, .11); border-color: rgba(66, 211, 146, .4); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #0a1727; }
.kpi strong { display: block; font-size: 1.25rem; margin-top: 4px; }
.kpi span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 620px; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: .88rem; }
th { color: var(--muted); background: #0a1727; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.status-ok { color: var(--ok); font-weight: 760; }
.status-bad { color: var(--danger); font-weight: 760; }
.log { background: #06101d; border: 1px solid var(--line); border-radius: 12px; padding: 13px; max-height: 360px; overflow: auto; }
.log-line { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; padding: 4px 0; white-space: pre-wrap; word-break: break-word; }
.log-title { color: var(--brand); font-weight: 800; margin-top: 8px; }
.log-success { color: var(--ok); }
.log-warning { color: var(--warning); }
.log-error { color: var(--danger); }
.footer { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 24px; }
.help { color: var(--muted); font-size: .78rem; line-height: 1.4; font-weight: 450; }

@media (max-width: 960px) {
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .shell { width: min(100% - 20px, 1440px); padding-top: 14px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .form-grid, .check-grid, .kpis { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .card { padding: 17px; border-radius: 14px; }
    .userbar { width: 100%; justify-content: space-between; }
}
