/* ═══════════ WHITE-ID — админка ═══════════ */
:root {
    --ink: #15233b; --ink-2: #22355a; --paper: #f3f6fa; --white: #fff; --line: #e2e8f0; --line-2: #eef2f7;
    --text: #1b2a42; --muted: #66758c; --blue: #2f5bff; --blue-soft: #e9eeff;
    --green: #12a26b; --amber: #d98a06; --red: #d93a3a; --violet: #7a4cf0;
    --r: 14px; --shadow: 0 1px 2px rgba(21,35,59,.06), 0 8px 24px -16px rgba(21,35,59,.25);
    --display: "Unbounded", "Manrope", system-ui, sans-serif;
    --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.5 var(--body); color: var(--text); background: var(--paper); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px; background: var(--ink); color: #c9d4e6; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; color: #fff; text-decoration: none !important; }
.side-brand img { max-height: 34px; max-width: 170px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .3px; line-height: 1.1; color: #fff; }
.wordmark small { display: block; font-family: var(--body); font-weight: 600; font-size: 11px; color: #8ea0bd; letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: #c9d4e6; font-weight: 600; text-decoration: none; }
.nav a svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: #fff; color: var(--ink); }
.nav a.on svg { opacity: 1; color: var(--blue); }
.nav .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--blue); color: #fff; font-size: 11.5px; text-align: center; }
.nav a.on .count { background: var(--blue); }
.nav-sep { height: 1px; margin: 12px 8px; background: rgba(255,255,255,.08); }
.side-foot { margin-top: auto; padding: 14px 8px 0; font-size: 12.5px; color: #8ea0bd; }
.side-foot .who { color: #fff; font-weight: 700; }
.side-foot form { margin: 0; }
.side-foot button { all: unset; cursor: pointer; color: #8ea0bd; }
.side-foot button:hover { color: #fff; }
.lang-sw { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(255,255,255,.07); margin: 8px 0; }
.lang-sw a { padding: 3px 9px; border-radius: 7px; color: #c9d4e6; font-size: 12px; font-weight: 700; text-decoration: none; }
.lang-sw a.on { background: #fff; color: var(--ink); }

.main { min-width: 0; padding: 26px 32px 60px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.top h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 23px; letter-spacing: -.2px; color: var(--ink); }
.top .sub { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); }
.card-b { padding: 18px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }

.kpi { padding: 16px 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.kpi-l { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kpi-n { margin-top: 6px; font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-s { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.kpi.alert { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.kpi.alert .kpi-n { color: var(--red); }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { padding: 9px 14px; text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafbfe; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .strong { font-weight: 700; color: var(--ink); }
.tbl small, .muted { color: var(--muted); }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 12%, #fff); }
.badge.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-green { --c: var(--green); } .b-amber { --c: var(--amber); } .b-red { --c: var(--red); } .b-blue { --c: var(--blue); }
.b-violet { --c: var(--violet); } .b-gray { --c: #7b8799; } .b-ink { --c: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #224ae8; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: #c5cfdd; }
.btn-danger { background: #fff; color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, #fff); }
.btn-green { background: var(--green); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form .wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 700; color: #3a4a61; }
.field label small { font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea, .ctrl {
    width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; color: var(--text);
}
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .ctrl:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,91,255,.14); }
.field .hint { margin-top: 4px; font-size: 12px; color: var(--muted); }
.field.err input, .field.err select { border-color: var(--red); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.filters .field { min-width: 150px; }
.filters .field label { font-size: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 14px 0; border-bottom: 1px solid var(--line-2); }
.tabs a { padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--blue); }
.tabs a .n { margin-left: 4px; font-size: 12px; color: var(--muted); }

.flash { padding: 12px 15px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: #e7f6ef; color: #0d5c3d; border: 1px solid #bfe5d2; }
.flash.error { background: #fdecec; color: #8a1c1c; border: 1px solid #f5c7c7; }
.flash.info { background: var(--blue-soft); color: #1d3aa8; border: 1px solid #cdd8ff; }

.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; color: var(--ink); font-weight: 600; word-break: break-word; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .meta { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }

.code { display: flex; gap: 8px; align-items: stretch; }
.code code { flex: 1; padding: 10px 12px; border-radius: 10px; background: #f4f7fb; border: 1px solid var(--line); font-size: 12.5px; word-break: break-all; }

.health { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.health i { width: 10px; height: 10px; border-radius: 50%; background: #b8c2d1; }
.health.ok i { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
.health.warn i { background: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 18%, transparent); }
.health.down i { background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sys { display: block; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: inherit; text-decoration: none !important; border-top: 3px solid #b8c2d1; }
.sys.ok { border-top-color: var(--green); } .sys.warn { border-top-color: var(--amber); } .sys.down { border-top-color: var(--red); }
.sys:hover { border-color: #c5cfdd; }
.sys h3 { margin: 0 0 2px; font-size: 15px; color: var(--ink); }
.sys .url { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.sys .row { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; }
.sys .row span:first-child { color: var(--muted); }
.sys .row b { font-variant-numeric: tabular-nums; }

.pager { display: flex; gap: 4px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.pager a, .pager span { padding: 5px 10px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.pager span { background: var(--ink); color: #fff; }

.issues { list-style: none; margin: 0; padding: 0; }
.issues li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.issues li:last-child { border-bottom: 0; }

@media (max-width: 1000px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; }
    .side-brand { padding: 0 8px 0 0; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .nav a { padding: 7px 9px; font-size: 13px; }
    .nav-sep, .side-foot .who-line { display: none; }
    .side-foot { margin: 0 0 0 auto; padding: 0; }
    .main { padding: 18px 16px 40px; }
    .grid2, .form { grid-template-columns: 1fr; }
    .dl { grid-template-columns: 1fr; }
}
@media print {
    .side, .top-actions, .no-print { display: none !important; }
    .shell { display: block; } .main { padding: 0; } body { background: #fff; }
    .card { box-shadow: none; border: 0; }
}
