/* Панель офисного сервера — одна нейтральная шкала. Цвет появляется только там, где беда (красный),
   и там, где вы находитесь (бирюзовый: текущий раздел, ссылки, фокус). */
/* Тёмная тема (решение владельца 22.10.2026): та же нейтральная шкала, перевёрнутая; контраст текста ≥4,5:1 на --surface */
:root {
  --bg: #0E0E0F;
  --surface: #171718;
  --soft: #202022;
  --rule: #232325;
  --line: #2E2E31;
  --line-strong: #3E3E42;
  --row-hover: #1C1C1E;
  --dim: #8F8F95;
  --mute: #A9A9AF;
  --body: #D4D4D8;
  --ink: #F2F2F3;
  --on-ink: #0E0E0F;
  --bar: #D9D9DD;
  --wash: rgba(255, 255, 255, .07);
  --accent: #3BB2CF;
  --accent-soft: rgba(59, 178, 207, .14);
  --red: #F26D6D;
  --red-strong: #FF8A8A;
  --trouble-line: #5A2A2A;
  --radius: 8px;
  --sans: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; caret-color: var(--accent); }
::selection { background: rgba(59, 178, 207, .32); }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button, input { font: inherit; color: inherit; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.sr-only, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 20; padding: 8px 12px; background: var(--ink); color: var(--on-ink); border-radius: 6px; }
.skip:focus { top: 12px; }

.mono { font-family: var(--mono); font-size: max(.9em, 12px); }
.dim { color: var(--dim); }
.is-down, .is-down * { color: var(--red); }
.link { color: var(--accent); }
.tag { margin-left: 8px; font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.num { text-align: right; }
.ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* оболочка */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px 16px; border-right: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand:hover { text-decoration: none; }
.mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--ink); color: var(--on-ink); }
.brand-text b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.brand-text small { display: block; font-size: 12px; color: var(--mute); }
.nav { display: grid; gap: 2px; margin-top: 28px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 6px; color: var(--body); }
.nav a:hover { background: var(--rule); text-decoration: none; color: var(--ink); }
.nav a .i { color: var(--dim); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a[aria-current="page"] .i { color: var(--accent); }
.nav .n { margin-left: auto; font-size: 12px; font-weight: 600; }
.nav .n em { font-style: normal; color: var(--red-strong); } /* ярче: ≥4,5:1 и на подсветке текущего раздела */
.rail-foot { display: grid; gap: 12px; margin-top: auto; padding: 16px 0 0; border-top: 1px solid var(--line); }
.readonly { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 12.5px; color: var(--mute); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; transition: background-color .15s ease-out, border-color .15s ease-out; }
.btn .i { width: 14px; height: 14px; color: var(--mute); }
.btn:hover { background: var(--soft); border-color: var(--line-strong); text-decoration: none; }
.btn:active { background: var(--rule); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: #FFFFFF; border-color: #FFFFFF; }
.rail-foot form .btn { width: 100%; }

/* страница */
.main { padding: 26px 32px 56px; min-width: 0; }
.main:focus { outline: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 34px; }
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.page-aside { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--mute); }
.crumbs { margin-bottom: 8px; font-size: 12.5px; color: var(--mute); overflow-wrap: anywhere; }
.crumbs a:hover { color: var(--accent); }
.lead { margin-top: 6px; color: var(--mute); }
.foot-note { margin-top: 16px; font-size: 12.5px; color: var(--mute); }

/* показатели */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.m { padding: 14px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.m-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--mute); }
.m-label span { font-size: 12px; color: var(--dim); }
.m-value { margin-top: 10px; font-size: 34px; font-weight: 400; letter-spacing: -.035em; line-height: 1; white-space: nowrap; }
.m-value small { margin: 0 6px 0 3px; font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--mute); }
.m-sub { margin-top: 8px; font-size: 12.5px; color: var(--mute); }
.spark { display: block; width: 100%; height: 32px; margin-top: 12px; overflow: visible; }
.spark-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--wash); }
.spark-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-dot { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.bar { display: block; width: 100%; height: 6px; margin-top: 22px; }
.bar-track { fill: var(--rule); }
.bar-fill { fill: var(--bar); }
.bar.is-down .bar-fill { fill: var(--red); }

/* утверждение → доказательство */
.claims { display: grid; gap: 8px; margin-top: 16px; }
.claim { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 11px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.claim > .i { color: var(--red); }
.claim.is-calm > .i { color: var(--mute); }
.claim p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.claim b { font-weight: 600; }
.claim span { font-size: 12.5px; color: var(--mute); overflow-wrap: anywhere; }
.claim .link { margin-left: auto; font-size: 13px; white-space: nowrap; }

/* карточки и таблицы */
.card { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card.has-trouble { border-color: var(--trouble-line); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 48px; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.card-head h2 { font-size: 14px; font-weight: 600; }
.card-head h2 span { margin-left: 6px; font-weight: 400; color: var(--mute); }
.card-head h2 span.is-down { color: var(--red); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { height: 36px; padding: 0 12px; text-align: left; font-size: 12px; font-weight: 400; color: var(--mute); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 42px; padding: 6px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.table tbody tr:hover td { background: var(--row-hover); }
.code { font-weight: 600; white-space: nowrap; }
.host { color: var(--ink); }
.status { font-size: 13px; }
.show-sm { display: none; }
.row-off td { color: var(--mute); }
.ctr { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ctr .mono { overflow-wrap: anywhere; }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ink); }
.dot.is-off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--dim); }
.dot.is-down { background: var(--red); }
.fname { display: inline-flex; align-items: center; gap: 8px; }
.fname .i { color: var(--dim); }
.empty { padding: 18px 20px; color: var(--mute); }
.page-head + .empty { padding-left: 0; }

/* сведения о контейнере и файле */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 24px; padding: 18px 20px; }
.facts dt { font-size: 12px; color: var(--mute); }
.facts dd { margin-top: 2px; overflow-wrap: anywhere; }
.mounts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 10px 20px; border-top: 1px solid var(--rule); }
.mounts li:first-child { border-top: 0; }
.notice + .viewer { margin-top: 8px; }
.notice { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--mute); }
.viewer { margin: 16px 0 0; padding: 16px 20px; max-height: 72vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font: 12.5px/1.6 var(--mono); tab-size: 4; white-space: pre; }

/* логи и журнал */
.log { padding: 6px 0; font: 12.5px/1.55 var(--mono); }
.log li { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 12px; padding: 3px 20px; }
.log li:hover { background: var(--row-hover); }
.log time { color: var(--dim); white-space: nowrap; }
.log span { white-space: pre-wrap; overflow-wrap: anywhere; }
.log li.is-err span, .log li.is-err b { color: var(--red); }
.log li.is-warn span { font-weight: 600; }
.journal li { grid-template-columns: 136px 150px minmax(0, 1fr); }
.journal b { font-weight: 400; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 24px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 0; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--mute); }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.seg a { display: flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 4px; color: var(--mute); font-size: 13px; }
.seg a:hover { color: var(--ink); text-decoration: none; background: var(--rule); }
.seg a[aria-current="true"] { background: var(--soft); color: var(--ink); font-weight: 600; }
.search { display: flex; gap: 8px; }
.search input { width: 260px; height: 32px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input::placeholder { color: var(--dim); }
.changes { display: grid; gap: 0; }
.change { padding: 16px 20px; }
.change h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.prose { max-width: 78ch; color: var(--body); font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
.prose p, .prose ul, .prose h3 { margin-top: 8px; }
.prose ul { padding-left: 18px; list-style: disc; }
.prose h3 { font-size: 13.5px; }
.prose code { padding: 1px 4px; background: var(--soft); border-radius: 4px; font: 12px var(--mono); }

/* карточки обзора — ссылки на «Ресурсы» */
a.m { display: block; color: inherit; transition: border-color .15s ease-out, background-color .15s ease-out; }
a.m:hover { text-decoration: none; border-color: var(--line-strong); background: var(--row-hover); }
.m-top { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-top b { font-weight: 600; color: var(--ink); }

/* «На что уходят ресурсы»: шкала «занято из всего» и рейтинг проектов */
.res-grid { display: grid; gap: 16px; margin-top: 6px; }
.res-grid > .card:first-child { margin-top: 10px; }
.res { scroll-margin-top: 16px; }
.res-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 320px); align-items: end; gap: 12px 24px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.res-head h2 { font-size: 16px; font-weight: 600; }
.res-sum { margin-top: 4px; font-size: 13px; color: var(--mute); }
.res-head .bar { margin: 0 0 4px; height: 8px; }
.res-cols, .res-line, .res-row > summary { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(120px, 2fr) 120px minmax(110px, auto); align-items: center; gap: 16px; }
.res-cols { padding: 10px 20px 6px; font-size: 12px; color: var(--dim); }
.res-row { border-top: 1px solid var(--rule); }
.res-rows .res-row:first-child { border-top: 0; }
.res-line, .res-row > summary { min-height: 44px; padding: 6px 20px; }
.res-row > summary { cursor: pointer; list-style: none; }
.res-row > summary::-webkit-details-marker { display: none; }
.res-row > summary:hover, .res-line:hover { background: var(--row-hover); }
.res-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.res-row > summary .res-name::before { content: ""; flex: none; width: 6px; height: 6px; border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim); transform: rotate(-45deg); transition: transform .15s ease-out; }
.res-row[open] > summary .res-name::before { transform: rotate(45deg); }
.res-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.res-val .dim { margin-left: 6px; }
.rank-bar { display: block; width: 100%; height: 8px; }
.rank-track { fill: var(--rule); }
.rank-fill { fill: var(--bar); }
.rank-bar.is-muted .rank-fill { fill: var(--dim); }
.res-row .spark { margin: 0; height: 24px; }
.res-items { padding: 2px 20px 10px 36px; }
.res-items li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 12.5px; color: var(--mute); border-top: 1px dashed transparent; }
.res-items .mono { overflow-wrap: anywhere; }
.res-note { margin: -6px 20px 0; padding: 0 0 10px; font-size: 12px; color: var(--dim); }
.res-row.is-other .res-name { color: var(--mute); }
.res-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }

/* файловый менеджер: загрузка внутри страницы */
.fm { transition: opacity .15s ease-out; }
.fm[aria-busy="true"] { opacity: .55; pointer-events: none; }
.fm h1:focus { outline: none; }
.row-up .fname span + span { margin-left: 8px; font-size: 12.5px; }
.fm-back { margin-top: 14px; }

/* вход */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.login { width: min(380px, 100%); }
.login .brand { padding: 0; }
.login-form { display: grid; gap: 8px; margin-top: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.login-form label { font-size: 13px; font-weight: 600; }
.login-form input[type="password"] { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.login-form input[type="password"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-form input[aria-invalid="true"] { border-color: var(--red); }
.login-form .btn { height: 40px; margin-top: 8px; font-size: 14px; }
.form-error { color: var(--red); font-size: 13px; }
.login-note { display: flex; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--mute); }
.login-note .i { margin-top: 1px; }

/* узкие экраны */
@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .rail { position: sticky; z-index: 10; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px; padding: 12px 16px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 4px; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
  .nav a { flex: none; height: 34px; padding: 0 9px; }
  .nav a .i { display: none; }
  .ctr .mono { font-size: 12px; }
  .rail-foot { grid-row: 1; grid-column: 2; margin: 0; padding: 0; border: 0; }
  .readonly { display: none; }
  .main { padding: 20px 16px 48px; }
  .hide-sm { display: none; }
  .show-sm { display: inline; white-space: nowrap; }
  .metrics { gap: 12px; margin-top: 16px; }
  .m { padding: 12px 14px; }
  .m-value { font-size: 28px; }
  .m-value small { font-size: 13px; }
  .claim { align-items: flex-start; flex-wrap: wrap; }
  .claim > .i { margin-top: 2px; }
  .claim p { flex: 1; }
  .claim .link { margin-left: 28px; }
  .card-head { padding: 10px 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .log li, .journal li { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 6px 16px; border-bottom: 1px solid var(--rule); }
  .journal b { white-space: normal; }
  .search, .search input { width: 100%; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .res-head { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .res-cols, .res-line, .res-row > summary { grid-template-columns: minmax(0, 1fr) 72px auto; gap: 10px; }
  .res-cols, .res-line, .res-row > summary, .res-foot { padding-left: 16px; padding-right: 16px; }
  .res-items { padding: 2px 16px 10px 30px; }
  .res-note { margin: -6px 16px 0; }
  .res-val .dim { display: none; }
}
@media (max-width: 380px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
