/*
  Облако LOADEQ — вариант «Б»: интерфейс с нуля.
  Основа: тёмно-синяя боковая панель в цвете марки, светлое рабочее поле, цвет — только у состояния (норма, предупреждение,
  авария, сведения). Светлая и тёмная тема — по настройке системы. Шрифты и значки — свои (без внешних адресов).
  Имена переменных --font, --border, --text, --text-muted, --text-faint, --sunken, --accent, --info, --warn, --danger, --ok
  читают сценарии графиков — их не переименовывать.
*/

:root {
    color-scheme: light;
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Mono", Consolas, "Noto Sans Mono", "DejaVu Sans Mono", monospace;

    --bg: #F3F5F8;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --sunken: #EDF1F5;
    --hover: #F2F5F9;
    --border: #E2E7EE;
    --border-strong: #C8D1DC;
    --text: #13213A;
    --text-muted: #56657C;
    --text-faint: #8995A8;

    --accent: #0B63B6;
    --accent-hover: #09528F;
    --accent-text: #FFFFFF;
    --accent-soft: #E7F0FA;
    --accent-line: #B8D2EC;

    --ok: #17824A;
    --ok-soft: #E3F3E9;
    --info: #0A7889;
    --info-soft: #DFF1F3;
    --warn: #A95F00;
    --warn-soft: #FCEFD9;
    --danger: #C2342C;
    --danger-soft: #FBE6E4;
    --neutral-soft: #EDF0F4;
    --track: #E3E8EF;

    --side-bg: #0F2746;
    --side-line: rgba(255, 255, 255, 0.08);
    --side-text: rgba(225, 234, 246, 0.76);
    --side-strong: #FFFFFF;
    --side-faint: rgba(225, 234, 246, 0.44);
    --side-hover: rgba(255, 255, 255, 0.06);
    --side-active: rgba(255, 255, 255, 0.12);
    --side-mark: #6BB1FF;

    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(15, 32, 58, 0.05), 0 1px 1px rgba(15, 32, 58, 0.03);
    --shadow-pop: 0 10px 28px rgba(15, 32, 58, 0.18);
    --focus: 0 0 0 3px rgba(11, 99, 182, 0.22);
    --side-width: 236px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0C1320;
        --surface: #121B29;
        --surface-2: #162132;
        --sunken: #0F1724;
        --hover: #1A2638;
        --border: #233148;
        --border-strong: #34445C;
        --text: #E3E9F2;
        --text-muted: #9CAABE;
        --text-faint: #6B7A91;

        --accent: #5EA6F2;
        --accent-hover: #80BAF6;
        --accent-text: #07111E;
        --accent-soft: #15283F;
        --accent-line: #264A72;

        --ok: #4CC07E;
        --ok-soft: #13301F;
        --info: #45BFCE;
        --info-soft: #0F2D33;
        --warn: #E5A740;
        --warn-soft: #33260E;
        --danger: #F06B61;
        --danger-soft: #3A1816;
        --neutral-soft: #1A2433;
        --track: #26344B;

        --side-bg: #08101B;
        --side-line: rgba(255, 255, 255, 0.07);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-pop: 0 12px 30px rgba(0, 0, 0, 0.5);
        --focus: 0 0 0 3px rgba(94, 166, 242, 0.28);
    }
}

/* ---------- Основа ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* Скрытое атрибутом hidden скрыто всегда — и у элементов со своим display (сценарии меняют hidden). */
[hidden] { display: none !important; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.45;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, label:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: 1.72rem; line-height: 1.2; }
h2 { font-size: 1.08rem; line-height: 1.3; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.6rem; }
p:last-child { margin-bottom: 0; }
code { font-family: var(--mono); font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
ul { margin: 0; }
small { font-size: 0.86em; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.sub { color: var(--text-muted); font-size: 0.9rem; }
.notes { white-space: pre-line; }
.hash { word-break: break-all; }
.inline { display: inline; }
.spacer { flex: 1; }
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin-bottom: 0.25rem; }

/* ---------- Значки ---------- */

.icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.22em;
}
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }
.icon .fill { fill: currentColor; stroke: none; }

/* ---------- Каркас: боковая панель и рабочее поле ---------- */

.nav-open { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.app { min-height: 100vh; }

.side {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side-width);
    display: flex;
    flex-direction: column;
    background: var(--side-bg);
    color: var(--side-text);
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.15rem 1.15rem 1rem;
    color: var(--side-strong);
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 1.05rem;
    line-height: 1.15;
}
.brand:hover { color: var(--side-strong); text-decoration: none; }
/* Знак и надпись LOADEQ (по фирменной шапке документов) и «cloud» в строку через черту (BrandLockup): высота букв — половина
   знака, «cloud» — того же белого и на одной линии с надписью. */
.lockup { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark { width: 24px; height: 24px; flex: none; fill: #FFFFFF; }
.lockup-text { display: flex; align-items: baseline; gap: 0.55rem; }
.lockup-word { display: block; width: 109px; height: 12px; fill: #FFFFFF; }
.lockup-sep { align-self: center; width: 1px; height: 14px; background: rgba(255, 255, 255, 0.35); }
.lockup-sub { font-weight: 400; font-size: 14px; letter-spacing: 0.02em; line-height: 1; color: rgba(255, 255, 255, 0.85); }

.side-nav { flex: 1; overflow-y: auto; padding: 0.35rem 0.7rem 1rem; }
.side-group {
    margin: 1.05rem 0.55rem 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--side-faint);
    font-weight: 600;
}
.side-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    color: var(--side-text);
    font-weight: 500;
    position: relative;
}
.side-link:hover { background: var(--side-hover); color: var(--side-strong); text-decoration: none; }
.side-link.active { background: var(--side-active); color: var(--side-strong); }
.side-link.active::before {
    content: "";
    position: absolute;
    left: -0.7rem;
    top: 0.45rem;
    bottom: 0.45rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--side-mark);
}
.side-link .icon { opacity: 0.9; }

.side-foot { border-top: 1px solid var(--side-line); padding: 0.8rem 0.9rem 1rem; }
.side-user { display: flex; align-items: center; gap: 0.65rem; }
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: var(--side-strong);
    font-weight: 600;
    font-size: 0.85rem;
}
.side-who { min-width: 0; flex: 1; line-height: 1.25; }
.side-who .top-name { display: block; color: var(--side-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-who .top-name:hover { text-decoration: underline; }
.side-who .top-role { color: var(--side-faint); font-size: 0.82rem; }
.side-logout { margin: 0; }
.side-logout button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--side-text);
    cursor: pointer;
}
.side-logout button:hover { background: var(--side-hover); color: var(--side-strong); }
.side-zone { margin-top: 0.7rem; font-size: 0.78rem; color: var(--side-faint); display: flex; align-items: center; gap: 0.4rem; }

.topbar { display: none; }
.side-backdrop { display: none; }

.main { margin-left: var(--side-width); min-width: 0; overflow-x: clip; }
.page { max-width: 1380px; margin: 0 auto; padding: 1.6rem 2rem 3.5rem; }

/* Без входа (ошибка, страница не найдена): только марка сверху. */
.bare-top { display: flex; align-items: center; padding: 0.9rem 1.4rem; background: var(--side-bg); }
.bare-top .brand { padding: 0; }
.app.bare .main { margin-left: 0; }

/* ---------- Заголовок страницы ---------- */

.ph { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.9rem 1.5rem; margin-bottom: 1.25rem; }
.ph-main { flex: 1 1 420px; min-width: 0; }
.ph-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.ph-crumbs a { color: var(--text-muted); }
.ph-crumbs a:hover { color: var(--accent); }
.ph-crumbs .sep { color: var(--text-faint); }
.ph-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.ph-title .badge { white-space: normal; border-radius: 8px; }
.ph-sub { margin-top: 0.3rem; color: var(--text-muted); font-size: 1rem; }
.ph-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.6rem; }
.ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* Факты под заголовком: подпись над значением, в ряд. */
.facts { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; margin: 0.9rem 0 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 0.1rem; }
.facts dd { margin: 0; font-weight: 500; }
.facts dd .sub { font-weight: 400; }

/* ---------- Панели и сетки ---------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.1rem;
    min-width: 0;
}
.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}
.panel-head h2 { display: flex; align-items: center; gap: 0.5rem; }
.panel-head .count { font-weight: 500; color: var(--text-faint); font-size: 0.95rem; }
.panel-tools { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.panel-body { padding: 1rem 1.1rem; }
.panel-foot { padding: 0.65rem 1.1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.88rem; }
.panel.danger-zone .panel-head h2 { color: var(--danger); }
.panel.confirm { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.panel.confirm .panel-head { background: var(--danger-soft); border-radius: var(--radius) var(--radius) 0 0; }
.panel.confirm .panel-head h2 { color: var(--danger); }

.grid { display: grid; gap: 1.1rem; margin-bottom: 1.1rem; }
.grid > .panel { margin-bottom: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.stack-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.stack-col > .panel { margin-bottom: 0; }
.narrow { max-width: 640px; }

/* ---------- Показатели ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.kpi {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.95rem 1.1rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    position: relative;
    min-width: 0;
    overflow: hidden;
}
a.kpi:hover { text-decoration: none; border-color: var(--accent-line); color: var(--text); }
.kpi-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.86rem; color: var(--text-muted); font-weight: 500; }
.kpi-value { font-size: 1.9rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-value small { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); margin-left: 0.4rem; letter-spacing: 0; }
.kpi-note { font-size: 0.86rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.tone-danger, .kpi.tone-warn, .kpi.tone-ok { background: var(--surface); }
.kpi.tone-danger .kpi-value, .kpi.tone-danger .kpi-label .icon { color: var(--danger); }
.kpi.tone-warn .kpi-value, .kpi.tone-warn .kpi-label .icon { color: var(--warn); }
.kpi.tone-ok .kpi-label .icon { color: var(--ok); }
.kpi.tone-danger::after, .kpi.tone-warn::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--danger);
}
.kpi.tone-warn::after { background: var(--warn); }

/* ---------- Кнопки ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font: inherit;
    font-weight: 500;
    min-height: 34px;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}
.btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
.btn-danger:hover { background: var(--danger); filter: brightness(0.93); color: #FFFFFF; }
.btn-danger-quiet { color: var(--danger); border-color: var(--border-strong); }
.btn-danger-quiet:hover { background: var(--danger-soft); color: var(--danger); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-quiet:hover { background: var(--hover); color: var(--text); }
.btn-wide { width: 100%; min-height: 40px; }
.btn-sm { min-height: 28px; padding: 0.2rem 0.6rem; font-size: 0.9rem; border-radius: 7px; }
.btn-icon { padding: 0; width: 34px; }
.btn-icon.btn-sm { width: 28px; }
.btn:disabled, .btn:disabled:hover, .btn[aria-disabled=true], .btn[aria-disabled=true]:hover {
    opacity: 0.45;
    cursor: default;
    background: var(--surface);
    filter: none;
}
.btn-primary:disabled, .btn-primary:disabled:hover { background: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; margin-top: 0.4rem; }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; }

/* ---------- Формы ---------- */

.form { display: flex; flex-direction: column; gap: 0.85rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field > span { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }
.field > span.hint, .hint { font-size: 0.84rem; color: var(--text-faint); font-weight: 400; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.85rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=date],
input[type=number], input:not([type]), select, textarea {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0.42rem 0.65rem;
    min-height: 36px;
    width: 100%;
    min-width: 0;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[readonly] { background: var(--sunken); color: var(--text-muted); }
input:disabled, select:disabled, textarea:disabled { background: var(--sunken); color: var(--text-muted); cursor: default; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input[type=file] { font: inherit; color: var(--text-muted); padding: 0.2rem 0; max-width: 100%; }
input[type=file]::file-selector-button {
    font: inherit;
    font-weight: 500;
    margin-right: 0.8rem;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.check { display: flex; align-items: flex-start; gap: 0.55rem; margin: 0; cursor: pointer; line-height: 1.35; }
.check input { width: 16px; height: 16px; margin: 0.1rem 0 0; flex: none; accent-color: var(--accent); }
.field-error, .validation-message { color: var(--danger); font-size: 0.88rem; }
.checklist { display: flex; flex-direction: column; gap: 0.4rem; }
.checklist.indent { padding-left: 1.6rem; }
.checklist.columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.5rem 1.2rem; }
.scope { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.scope legend { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; padding: 0; margin-bottom: 0.4rem; }
.row-form { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 0; }
.row-form input[type=text], .row-form input[type=date], .row-form select { width: auto; flex: 1 1 140px; }
.row-form.compact input[type=date] { flex: 0 1 150px; min-height: 32px; padding: 0.25rem 0.45rem; }
.row-form.compact .btn { min-height: 32px; }
.code-input { font-family: var(--mono); font-size: 1.35rem; letter-spacing: 0.24em; text-align: center; }

/* Отбор над списками. */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem; margin-bottom: 1rem; }
.filters .field { flex: 0 1 200px; }
.filters .grow { flex: 1 1 280px; }
.filters .check { align-self: center; }
.search-box { position: relative; display: block; }
.search-box .icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search-box input { padding-left: 2.15rem; }

/* «Чипы» отбора: ссылки с числом. */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.chip-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.92rem;
    white-space: nowrap;
}
.chip-link:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.chip-link.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip-link .count { font-variant-numeric: tabular-nums; color: var(--text-faint); }
.chip-link.active .count { color: var(--surface); opacity: 0.7; }

/* Раскрывающиеся блоки. */
details.disclosure > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--accent);
    font-weight: 500;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(-45deg);
    margin: 0 0.15rem 0 0.1rem;
}
details.disclosure[open] > summary::before { transform: rotate(45deg); margin-top: -0.25rem; }
details.disclosure[open] > summary { margin-bottom: 0.8rem; }
details.more { margin-top: 0.45rem; }
details.more > summary { cursor: pointer; color: var(--accent); width: fit-content; font-size: 0.92rem; }
details.more[open] > summary { margin-bottom: 0.55rem; color: var(--text-muted); }

/* «Дать название» рабочему месту — свёрнутая форма в ячейке. */
details.rename { margin-top: 0.25rem; font-size: 0.88rem; }
details.rename > summary { cursor: pointer; color: var(--accent); width: fit-content; list-style: none; }
details.rename > summary::-webkit-details-marker { display: none; }
details.rename[open] > summary { color: var(--text-muted); }
.rename-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.35rem; }
.rename-form input[type=text] { width: 13rem; max-width: 100%; min-height: 32px; }
.rename-form .btn { min-height: 32px; }

/* ---------- Отметки состояния (шкала Tone ядра) и сообщения ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.12rem 0.6rem;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    background: var(--neutral-soft);
    color: var(--text-muted);
    border: 0;
    vertical-align: middle;
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-accent { background: var(--accent-soft); color: var(--accent); }
.tone-neutral, .tone-none { background: var(--neutral-soft); color: var(--text-muted); }
.badge.wrap { white-space: normal; border-radius: 8px; }

.alert {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    border-radius: var(--radius);
    padding: 0.7rem 0.95rem;
    margin-bottom: 1rem;
    color: var(--text);
    border: 1px solid transparent;
    line-height: 1.45;
}
.alert > .icon { margin-top: 0.1rem; }
.alert-body { flex: 1; min-width: 0; }
.alert.tone-ok { background: var(--ok-soft); color: var(--text); border-color: var(--ok-soft); }
.alert.tone-info { background: var(--info-soft); color: var(--text); }
.alert.tone-warn { background: var(--warn-soft); color: var(--text); }
.alert.tone-danger { background: var(--danger-soft); color: var(--text); }
.alert.tone-neutral, .alert.tone-none { background: var(--neutral-soft); color: var(--text); }
.alert.tone-ok > .icon { color: var(--ok); }
.alert.tone-info > .icon { color: var(--info); }
.alert.tone-warn > .icon { color: var(--warn); }
.alert.tone-danger > .icon { color: var(--danger); }
.alert p { margin: 0 0 0.35rem; }
.alert p:last-child { margin: 0; }

/* Точка состояния: в списке модулей, в «Сейчас». */
.now-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; vertical-align: 0.05em; }
.now-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.now-dot.danger { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.now-dot.none { background: var(--text-faint); box-shadow: 0 0 0 3px var(--neutral-soft); }
.now-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

/* ---------- Таблицы ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.84rem;
    background: var(--surface-2);
    white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.table.dense th, .table.dense td { padding: 0.45rem 0.9rem; }
.table.middle td { vertical-align: middle; }
.table td.right, .table th.right { text-align: right; }
.table .group-row th { background: var(--sunken); color: var(--text); font-size: 0.88rem; padding-top: 0.55rem; }
.table tr.attention td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.table a.row-title { font-weight: 600; color: var(--text); }
.table a.row-title:hover { color: var(--accent); }
.panel > .table-wrap:last-child, .panel > .scroll-box:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.panel > .table-wrap:last-child tbody tr:last-child td { border-bottom: 0; }
.scroll-box { max-height: 520px; overflow: auto; }
.scroll-box .table th { position: sticky; top: 0; z-index: 1; }
.journal td { font-size: 0.93rem; }
.pager { display: flex; gap: 0.5rem; padding: 0.7rem 1.1rem; border-top: 1px solid var(--border); }

/* Номера модулей ссылками через пробел. */
.module-link { margin-right: 0.5rem; white-space: nowrap; font-weight: 500; }
.module-link:last-child { margin-right: 0; }

/* Пары «подпись — значение» в карточках. */
.props { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 0.55rem 1.2rem; margin: 0; }
.props dt { color: var(--text-muted); }
.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.props .badge { white-space: normal; }

/* ---------- Вкладки и переключатели ---------- */

.tabs {
    display: flex;
    gap: 0.15rem;
    border-bottom: 1px solid var(--border);
    margin: 1.3rem 0 1.1rem;
    overflow-x: auto;
    scrollbar-width: thin;
}
.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count {
    font-size: 0.78rem;
    font-weight: 600;
    min-width: 1.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--neutral-soft);
    color: var(--text-muted);
    text-align: center;
}
.tabs a.active .count { background: var(--accent-soft); color: var(--accent); }
.tabs .tab-sep { flex: none; width: 1px; background: var(--border); margin: 0.65rem 0.4rem; }

.seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border-radius: 9px;
    background: var(--sunken);
    border: 1px solid var(--border);
}
.seg a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.26rem 0.7rem;
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.92rem;
    white-space: nowrap;
}
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 32, 58, 0.12); }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; margin-bottom: 0.9rem; }
.toolbar .btn { min-height: 32px; padding: 0.25rem 0.7rem; }
.toolbar .btn-icon { width: 32px; padding: 0; }
.toolbar .range { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 0.92rem; }
.goto { display: inline-flex; gap: 0.35rem; align-items: center; margin: 0; }
.goto input { width: 10.5rem; min-height: 32px; padding: 0.25rem 0.55rem; }
.source-line { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center; margin-bottom: 0.9rem; font-size: 0.9rem; }
.source-pick { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; }
.source-pick label { color: var(--text-muted); }
.source-pick select { width: auto; max-width: 20rem; min-height: 32px; padding: 0.2rem 0.5rem; }
.source-pick .btn { min-height: 32px; }
.source-line #source-segments { color: var(--text-faint); }

/* ---------- Графики (js/charts.js) ---------- */

/* Вид данных у интервала (вариант «А»): подробно — зелёным, среднее за шаг — серым; пояснение — подсказкой. */
.data-kind { font-size: 0.8rem; padding: 0.05rem 0.55rem; border-radius: 999px; white-space: nowrap; cursor: help; }
.data-kind.fine { background: var(--ok-soft); color: var(--ok); }
.data-kind.coarse { background: var(--neutral-soft); color: var(--text-muted); }
.charts-panel { padding: 0.8rem 0.9rem 0.65rem; }
.chart-panel { margin-bottom: 0.45rem; position: relative; }
.chart-head { display: flex; align-items: baseline; gap: 0.8rem; padding-left: 76px; font-size: 0.86rem; min-height: 1.35rem; }
.chart-remove { margin-left: 0.15rem; padding: 0 0.2rem; color: var(--text-faint); text-decoration: none; font-size: 1rem; line-height: 1; }
.chart-remove:hover { color: var(--danger); }
/* «+ Величина» окна — список под заголовком, по правому краю окна. */
.chart-add { position: static; align-self: center; }
.chart-add > summary { list-style: none; min-height: 26px; padding: 0.1rem 0.55rem; font-size: 0.84rem; }
.chart-add > summary::-webkit-details-marker { display: none; }
.chart-add[open] > summary { background: var(--accent-soft); border-color: var(--accent-line); }
.chart-add-form {
    position: absolute;
    right: 0;
    top: 1.75rem;
    z-index: 40;
    width: min(760px, 100%);
    max-height: 60vh;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    padding: 0.75rem 0.9rem;
}
.chart-add-note { margin: 0 0 0.7rem; color: var(--text-muted); }
.chart-add-note b { color: var(--text); font-weight: 600; }
.chart-add .check.taken { color: var(--text-faint); cursor: default; }
.chart-add .actions { position: sticky; bottom: -0.75rem; margin: 0 -0.9rem -0.75rem; padding: 0.55rem 0.9rem; background: var(--surface); border-top: 1px solid var(--border); }
.chart-title { font-weight: 600; color: var(--text); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.2rem 0.85rem; color: var(--text-muted); flex: 1; }
.chart-key { display: inline-flex; align-items: center; gap: 0.35rem; }
.chart-key i { display: inline-block; width: 16px; border-top: 2px solid; border-radius: 1px; }
.chart-key.dash i { border-top-style: dashed; }
.chart-unit { color: var(--text-faint); padding-right: 12px; }
.chart-canvas { position: relative; }
.chart-canvas canvas { display: block; position: absolute; left: 0; top: 0; }
.chart-over { cursor: crosshair; touch-action: pan-y; }
.chart-over.dragging { cursor: grabbing; }
.chart-over.selecting { cursor: crosshair; }
.timeline { margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px dashed var(--border); }
.timeline .chart-over { cursor: default; }
.chart-notes:empty { display: none; }
.chart-notes { margin: 0.45rem 0 0; font-size: 0.86rem; color: var(--warn); }
.chart-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; margin-top: 0.4rem; padding-top: 0.45rem; border-top: 1px solid var(--border); font-size: 0.84rem; color: var(--text-faint); }
.chart-foot #chart-status { color: var(--warn); }
.help-tip { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--text-faint); cursor: help; }
.help-tip:hover { color: var(--text-muted); }
.chart-tip {
    position: absolute;
    z-index: 60;
    pointer-events: none;
    max-width: 420px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.86rem;
    box-shadow: var(--shadow-pop);
    font-variant-numeric: tabular-nums;
}
.chart-tip-time { color: var(--text-muted); }
.channel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem 1.2rem; margin-bottom: 0.9rem; }

/* ---------- «Сейчас» от модема ---------- */

.now { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 1.1rem; overflow: hidden; }
.now-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.7rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.now-title { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.now-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
.now-cell { padding: 0.6rem 1rem 0.7rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; min-width: 0; }
.now-label { display: block; font-size: 0.8rem; color: var(--text-faint); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-value { display: block; font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-value small { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }
.now-cell.lead .now-value { color: var(--accent); }
.now-cell.text .now-value { font-size: 1rem; padding-top: 0.3rem; white-space: normal; }
.now-grid.dim .now-value, .now-grid.dim .now-cell.lead .now-value { color: var(--text-faint); }
.now-alarms { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.6rem 1rem; border-top: 1px solid var(--border); }
.now-note { padding: 0.55rem 1rem; font-size: 0.9rem; color: var(--warn); border-top: 1px solid var(--border); }
.now-modem { padding: 0.5rem 1rem; font-size: 0.86rem; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------- Нагрузка: полоска и линия за сутки ---------- */

.spark { display: block; overflow: visible; }
.spark-base { stroke: var(--border); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; }
.loadbar-wrap { display: inline-flex; align-items: center; gap: 0.55rem; font-variant-numeric: tabular-nums; }
.loadbar { display: block; flex: none; }
.loadbar-track { fill: var(--track); }
.loadbar-fill { fill: var(--accent); }
.loadbar.dim .loadbar-fill { fill: var(--text-faint); }
.bar { display: block; width: 100%; height: 6px; }
.bar-track { fill: var(--track); }
.bar-fill { fill: var(--accent); }
.bar-fill.warn { fill: var(--warn); }
.bar-fill.none { fill: var(--text-faint); }

/* ---------- Ленты: «требует внимания», журнал модема ---------- */

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed-icon { width: 30px; height: 30px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.feed-main { flex: 1; min-width: 0; }
.feed-title { font-weight: 600; color: var(--text); }
a.feed-title:hover { color: var(--accent); }
.feed-text { color: var(--text-muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.feed-side { color: var(--text-faint); font-size: 0.86rem; white-space: nowrap; text-align: right; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; padding: 2rem 1.2rem; color: var(--text-muted); }
.empty > .icon { width: 28px; height: 28px; color: var(--text-faint); stroke-width: 1.5; margin-bottom: 0.2rem; }
.empty.ok > .icon { color: var(--ok); }
.empty-title { font-weight: 600; color: var(--text); }
.empty.compact { padding: 1.2rem 1rem; }
.empty .btn { margin-top: 0.5rem; }

/* «Работают сейчас» на сводке. */
.live-rows { list-style: none; margin: 0; padding: 0; }
.live-rows li {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.2fr) 150px minmax(0, 0.8fr);
    gap: 0.4rem 1.1rem;
    align-items: center;
    padding: 0.65rem 1.1rem;
    border-bottom: 1px solid var(--border);
}
.live-rows li:last-child { border-bottom: 0; }
.live-rows .who { min-width: 0; }
.live-rows .who a { font-weight: 600; color: var(--text); }
.live-rows .who a:hover { color: var(--accent); }
.live-rows .live-when { text-align: right; color: var(--text-faint); font-size: 0.86rem; }

/* Аренды на сводке: срок полоской. */
.term-rows { list-style: none; margin: 0; padding: 0; }
.term-rows li { padding: 0.7rem 1.1rem 0.75rem; border-bottom: 1px solid var(--border); }
.term-rows li:last-child { border-bottom: 0; }
.term-top { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; align-items: baseline; justify-content: space-between; }
.term-top a { font-weight: 600; }
.term-bar { margin: 0.5rem 0 0.3rem; }
.term-meta { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.84rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* ---------- Испытания: карточка на испытание ---------- */

.trials { list-style: none; margin: 0; padding: 0; }
.trial { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.9rem 1.5rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.trial:last-child { border-bottom: 0; }
.trial-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.trial-number { font-weight: 600; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.trial-what { margin-top: 0.3rem; font-weight: 500; }
.trial-meta { margin-top: 0.15rem; color: var(--text-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.trial-outcome { margin-top: 0.55rem; display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; }
.trial-files { display: flex; flex-direction: column; align-items: flex-end; gap: 0.45rem; }
.trial-files form { display: flex; flex-direction: column; align-items: flex-end; gap: 0.45rem; margin: 0; }
.trial-files .label { color: var(--text-faint); font-size: 0.82rem; }
.download-row { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.download-row .btn { min-width: 4.2rem; min-height: 32px; }
.trial-files .check { font-size: 0.88rem; color: var(--text-muted); }
.trial-files .note { color: var(--text-muted); font-size: 0.84rem; max-width: 22rem; text-align: right; }
.trial-files .note.warn { color: var(--warn); }

/* ---------- Логин и пароль клиента, коды ---------- */

.credentials code { font-size: 1.05rem; user-select: all; background: var(--surface); padding: 0.1rem 0.45rem; border-radius: 6px; border: 1px solid var(--border); }
.big-code { display: inline-block; font-family: var(--mono); font-size: 1.6rem; letter-spacing: 0.18em; padding: 0.5rem 1rem; border-radius: 10px; background: var(--sunken); border: 1px dashed var(--border-strong); user-select: all; }
.steps { padding-left: 1.3rem; margin: 0; }
.steps li { margin-bottom: 1.1rem; padding-left: 0.25rem; }
.steps li:last-child { margin-bottom: 0; }
.qr { margin: 0.7rem 0; }
.qr img { background: #FFFFFF; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.key { font-size: 1.05rem; letter-spacing: 0.06em; }
.codes { columns: 2; list-style: none; padding: 0; margin: 0.6rem 0; }
.codes li { margin-bottom: 0.35rem; }
.codes code { background: var(--surface); padding: 0.1rem 0.45rem; border-radius: 6px; border: 1px solid var(--border); }
.cmd { display: block; padding: 0.6rem 0.8rem; border-radius: 8px; background: var(--sunken); border: 1px solid var(--border); overflow-x: auto; white-space: nowrap; }

/* ---------- Ход загрузки выпуска (js/upload.js) ---------- */

.upload-progress { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.7rem; }
.upload-progress[hidden] { display: none; }
.upload-progress-track { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease-out; }
.upload-progress-text { font-size: 0.9rem; color: var(--text-muted); }
.upload-progress.failed .upload-progress-fill { background: var(--danger); }
.upload-progress.failed .upload-progress-text { color: var(--danger); }

/* ---------- Карта (js/map.js) ---------- */

.map-box { height: 440px; border-radius: var(--radius); background: var(--sunken); overflow: hidden; border: 1px solid var(--border); }
.map-box.tall { height: calc(100vh - 290px); min-height: 460px; }
.map-box.full { height: calc(100vh - 205px); min-height: 460px; }
.panel .map-box { border-radius: var(--radius) var(--radius) 0 0; border: 0; border-bottom: 1px solid var(--border); }
.panel .map-box:last-child { border-radius: var(--radius); border-bottom: 0; }
.map-box.map-failed { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.map-missing { margin: 0; padding: 1rem 1.1rem; color: var(--text-muted); }
.map-popup { font: 0.9rem var(--font); color: #13213A; line-height: 1.4; }
.map-popup a { font-weight: 600; }

/* ---------- Программа ---------- */

.release-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: center; padding: 1.4rem 1.5rem; }
.release-label { font-size: 0.86rem; color: var(--text-muted); font-weight: 500; }
.release-version { font-size: 2.3rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin-top: 0.15rem; }
.release-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; color: var(--text-muted); margin-top: 0.45rem; font-variant-numeric: tabular-nums; }
.release-notes { margin-top: 0.9rem; white-space: pre-line; }
.release-hero .btn-primary { min-height: 44px; padding: 0.5rem 1.2rem; font-size: 1.02rem; }

/* ---------- Вход (страницы без меню) ---------- */

/* Картинка — 40 % ширины, вход — 60 % (просьба пользователя 27.10.2026). */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 2fr) minmax(400px, 3fr); }
.auth-brand {
    position: relative;
    background: var(--side-bg);
    color: var(--side-text);
    padding: 2.4rem 2.6rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.4rem;
    overflow: hidden;
}
.auth-brand .brand { padding: 0; font-size: 1.2rem; position: relative; z-index: 1; }
.auth-brand .brand-mark { width: 34px; height: 34px; }
.auth-brand .lockup { gap: 0.8rem; }
.auth-brand .lockup-text { gap: 0.75rem; }
.auth-brand .lockup-word { width: 155px; height: 17px; }
.auth-brand .lockup-sep { height: 20px; }
.auth-brand .lockup-sub { font-size: 20px; }
/* Картинка входа (AuthArts) — на всю панель, лишнее обрезается по краям; по дугам медленно бегут импульсы, при «меньше движения» — без них. */
.auth-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-art .art-bg { fill: var(--side-bg); }
.auth-art .art-run { animation: art-run 5s linear infinite; }
.auth-art .d1 { animation-delay: -0.5s; }
.auth-art .d2 { animation-delay: -1.1s; }
.auth-art .d3 { animation-delay: -1.7s; }
.auth-art .d4 { animation-delay: -2.3s; }
.auth-art .d5 { animation-delay: -2.9s; }
@keyframes art-run { to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) { .auth-art * { animation: none !important; } }
.auth-tag { position: relative; z-index: 1; font-size: 0.95rem; color: rgba(255, 255, 255, 0.85); max-width: 22rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 0.45rem; }
.auth-card .lead { color: var(--text-muted); margin-bottom: 1.2rem; }
.auth-card .form { margin-top: 1.3rem; }
.auth-card .alert { margin-top: 1rem; }
.auth-links { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
/* «Программа и профиль модуля» (без входа): блоки программы и профиля — через черту. */
.auth-card .get-block { margin-top: 1.6rem; }
.auth-card .get-block + .get-block { padding-top: 1.6rem; border-top: 1px solid var(--border); }
.auth-card .get-block h2 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.auth-card .get-block .lead { margin-bottom: 0.9rem; }
.auth-card .get-block .form { margin-top: 0.8rem; }
.auth-card .get-block .hint { margin: 0.2rem 0 0.9rem; }
/* Демо-версия: страница без входа (вариант «А») и кнопка на странице входа — под ссылками, через черту. */
.auth-card .demo-text { margin-bottom: 1.4rem; }
.auth-card .demo-meta { margin-top: 0.6rem; }
.auth-demo { margin-top: 1.6rem; padding-top: 1.6rem; border-top: 1px solid var(--border); }

/* ---------- Страницы: модуль, модули клиента, отбор ---------- */

.h1-sub { font-weight: 400; color: var(--text-muted); }
.grid.side-main { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.7fr); align-items: start; }
.load-now { display: inline-flex; align-items: center; gap: 0.55rem; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.2rem; }
.map-legend > span { display: inline-flex; align-items: center; gap: 0.45rem; }
.spark.stretch { width: 100%; }
.spark.stretch .spark-line, .spark.stretch .spark-base { vector-effect: non-scaling-stroke; }

/* Раскрывающаяся панель («Другие величины»). */
details.picker > summary { list-style: none; cursor: pointer; border-bottom: 0; }
details.picker > summary::-webkit-details-marker { display: none; }
details.picker > summary h2::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 1.8px solid var(--text-muted);
    border-bottom: 1.8px solid var(--text-muted);
    transform: rotate(-45deg);
    margin: 0 0.35rem 0 0.1rem;
}
details.picker[open] > summary { border-bottom: 1px solid var(--border); }
details.picker[open] > summary h2::before { transform: rotate(45deg); margin-top: -0.2rem; }
details.picker > summary:hover h2 { color: var(--accent); }

/* Модули клиента — карточкой. */
.module-card { display: flex; flex-direction: column; gap: 0.9rem; padding: 1rem 1.1rem 1.05rem; color: var(--text); }
a.module-card:hover { text-decoration: none; border-color: var(--accent-line); color: var(--text); }
.module-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; }
.module-card-title { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.module-card-spark { min-height: 46px; display: flex; align-items: center; }
.module-card-spark .spark { width: 100%; height: 44px; }
.module-card-facts { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0.6rem 1.4rem; margin: 0; }
.module-card-facts dt { font-size: 0.8rem; color: var(--text-faint); }
.module-card-facts dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Доля полоской (статистика парка). */
.share { display: inline-flex; align-items: center; gap: 0.55rem; }
.share-bar { width: 70px; flex: none; }
.field > label { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }
.stack-forms hr { margin: 0.9rem 0; }
.add-module { margin: 0; }
.client-actions { justify-content: flex-end; flex-wrap: nowrap; }
.open-access > summary { margin-bottom: 0; }
.open-access[open] > summary { margin-bottom: 0.9rem; }
.rental-edit { margin-top: 1rem; }
.module-check .badge { margin-left: auto; }

/* Разделы раздела (модемы, данные) — вкладками под заголовком. */
.tabs.section-tabs { margin-top: -0.4rem; }

/* Программа: скачивание справа от версии. */
.release-get { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; text-align: right; max-width: 26rem; }
.release-get details.more > summary { margin-left: auto; }
.release-get code.hash { display: block; text-align: left; font-size: 0.8rem; color: var(--text-muted); }
.release-actions { align-items: flex-end; }
.notes.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Люди: кружок с инициалами в списках. */
.person { display: flex; align-items: center; gap: 0.7rem; }
.avatar.light { background: var(--accent-soft); color: var(--accent); }
.role-option { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.role-option:hover { border-color: var(--border-strong); }
.role-option input { margin-top: 0.2rem; accent-color: var(--accent); }
.role-option > span { display: flex; flex-direction: column; gap: 0.1rem; }
.security { display: flex; flex-direction: column; gap: 0.6rem; }
.security hr { margin: 0.3rem 0; }
.security-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.security .alert { margin: 0.4rem 0 0; }

/* Ошибка, нет доступа, страница не найдена. */
.status-page { margin: 8vh auto 0; }
.status-page .empty { padding: 2.6rem 1.5rem; }
.status-page .empty > .icon { width: 36px; height: 36px; }

.health-kpis { grid-template-columns: repeat(auto-fill, minmax(180px, 230px)); }
.chips-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0.2rem 0.3rem; }
.wifi-form { margin-top: 0.9rem; }
.module-check { flex-wrap: wrap; }

/* Таблица настроек модема. */
.settings-table .setting-input { width: 9rem; min-height: 30px; padding: 0.2rem 0.45rem; }
.settings-table select.setting-input { width: 10rem; }
.settings-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }


/* ---------- Узкий экран ---------- */

@media (max-width: 1180px) {
    .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .live-rows li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 130px; }
    .live-rows li .live-when { display: none; }
}

@media (max-width: 980px) {
    .side {
        display: none;
        top: 56px;
        width: min(320px, 86vw);
        box-shadow: var(--shadow-pop);
    }
    .nav-open:checked ~ .app .side { display: flex; }
    .nav-open:checked ~ .app .side-backdrop {
        display: block;
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(7, 14, 26, 0.45);
        z-index: 35;
    }
    .side > .brand { display: none; }
    .side-nav { padding-top: 0.5rem; }
    .topbar {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        position: sticky;
        top: 0;
        z-index: 45;
        height: 56px;
        padding: 0 0.5rem 0 1rem;
        background: var(--side-bg);
    }
    .topbar .brand { padding: 0; font-size: 1rem; }
    .topbar .brand-mark { width: 28px; height: 28px; }
    .topbar .section { color: var(--side-text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
    .menu-btn {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.45rem 0.7rem;
        border-radius: 8px;
        color: var(--side-strong);
        cursor: pointer;
        font-weight: 500;
    }
    .menu-btn:hover { background: var(--side-hover); }
    .main { margin-left: 0; }
    .page { padding: 1.2rem 1.25rem 3rem; }
    .grid.two, .grid.main-side, .grid.side-main { grid-template-columns: minmax(0, 1fr); }
    .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .auth-brand { padding: 1.3rem 1.4rem; min-height: 132px; }
    .auth-tag { display: none; }
    .auth-art { height: 100%; }
    .auth-art .art-main { display: none; }
    .auth-main { align-items: flex-start; padding-top: 2rem; }
}

@media (max-width: 720px) {
    html { font-size: 15px; }
    input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=date], input:not([type]), select, textarea { font-size: 16px; }
    .page { padding: 1rem 1rem 2.5rem; }
    h1 { font-size: 1.45rem; }
    .grid.three { grid-template-columns: minmax(0, 1fr); }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
    .kpi { padding: 0.75rem 0.85rem; }
    .kpi-value { font-size: 1.5rem; }
    .panel-head { padding: 0.75rem 0.9rem; }
    .panel-body { padding: 0.9rem; }
    .ph { margin-bottom: 1rem; }
    .ph-main { flex-basis: 100%; }
    .facts { gap: 0.55rem 1.4rem; }
    .filters .field, .filters .grow { flex: 1 1 100%; }
    .codes { columns: 1; }
    .props { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
    .props dt { margin-top: 0.5rem; font-size: 0.86rem; }
    .props dt:first-child { margin-top: 0; }
    .goto input { width: 9.5rem; }
    .chart-head { padding-left: 0; flex-wrap: wrap; }
    .trial { grid-template-columns: minmax(0, 1fr); }
    .trial-files, .trial-files form { align-items: flex-start; }
    .download-row { justify-content: flex-start; }
    .trial-files .note { text-align: left; }
    .live-rows li { grid-template-columns: minmax(0, 1fr) 110px; }
    .live-rows li .live-load { grid-column: 1 / -1; }
    .release-hero { grid-template-columns: minmax(0, 1fr); padding: 1.1rem; }
    .map-box, .map-box.tall { height: 380px; min-height: 0; }
    .map-box.full { height: calc(100vh - 230px); min-height: 360px; }
    .now-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .now-cell { padding: 0.55rem 0.7rem 0.6rem; }
    .now-value { font-size: 1.1rem; }
    .scroll-box { max-height: 70vh; }
    .badge { max-width: 100%; }
    #event-table thead { display: none; }
    #event-table table, #event-rows { display: block; }
    #event-rows tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.1rem 0.7rem; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--border); }
    #event-rows td { border: 0; padding: 0; }
    #event-rows td:nth-child(2) { color: var(--text-muted); font-size: 0.86rem; text-align: right; }
    #event-rows td:nth-child(3) { grid-column: 1 / -1; }
    .release-get { align-items: flex-start; text-align: left; }
    .release-actions { align-items: flex-start; }
    .client-actions { justify-content: flex-start; flex-wrap: wrap; }
    .tabs { margin-top: 1rem; }
    .tabs.section-tabs { margin-top: -0.3rem; }

    /* Таблицы-списки — карточками: строка — блок, ячейка — «подпись: значение». */
    .table.cards thead { display: none; }
    .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
    .table.cards tr { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); }
    .table.cards tbody tr:last-child { border-bottom: 0; }
    .table.cards td { border: 0; padding: 0.18rem 0; }
    .table.cards td[data-label] { display: flex; gap: 0.9rem; justify-content: space-between; align-items: flex-start; }
    .table.cards td[data-label]::before {
        content: attr(data-label);
        color: var(--text-faint);
        font-size: 0.86rem;
        flex: none;
        padding-top: 0.1rem;
    }
    .table.cards td[data-label] > * { text-align: right; }
    .table.cards td.card-title { padding-bottom: 0.4rem; }
    .table.cards td.hide-narrow { display: none; }
    .table.cards td.wide[data-label] { display: block; }
    .table.cards td.wide[data-label]::before { display: block; margin-bottom: 0.15rem; }
    .table.cards td.wide[data-label] > * { text-align: left; }
    .table.cards tr.attention td:first-child, .table.cards tr.warn td:first-child { box-shadow: none; }
    .table.cards tr.attention { box-shadow: inset 3px 0 0 var(--danger); }
    .table.cards tr.warn { box-shadow: inset 3px 0 0 var(--warn); }
}

/* ---------- Оповещения (мини-ТЗ «Оповещения облака», вариант «Б») ---------- */

.side-count {
    margin-left: auto;
    min-width: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.14);
    color: var(--side-strong);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.alert-feed li.closed .feed-title { color: var(--text-muted); }
.alert-when { color: var(--text-faint); font-size: 0.86rem; margin-top: 0.15rem; }
.alert-letters { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; margin-top: 0.25rem; font-size: 0.86rem; color: var(--text-muted); }
.alert-letter { display: inline-flex; align-items: center; }
.alert-letter .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 0.35rem; flex: none; }
.subscriptions td.right { white-space: nowrap; }
.mode-pick { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--sunken); border: 1px solid var(--border); }
.mode-pick label { position: relative; margin: 0; }
.mode-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mode-pick span {
    display: inline-flex;
    padding: 0.22rem 0.65rem;
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
}
.mode-pick span:hover { color: var(--text); }
.mode-pick input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 32, 58, 0.12); }
.mode-pick input:focus-visible + span { box-shadow: var(--focus); }
@media (max-width: 640px) {
    .subscriptions td.right { white-space: normal; }
    .mode-pick { flex-wrap: wrap; }
}
