/* ============================================================
   app-h.css — новый дизайн панели («гибрид H», 27.10.2026).
   Тёмный графит, акцент #D4FF00, шрифт Onest, меню с иконками и группами,
   поиск в шапке, спокойные карточки и таблицы, тонкие тёмные полосы прокрутки.
   Подключается последним и перекрывает старые слои. Откат — убрать строку в index.html.
   ============================================================ */

@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../vendor/fonts/onest/onest-cyrillic-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../vendor/fonts/onest/onest-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../vendor/fonts/onest/onest-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../vendor/fonts/onest/onest-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- цвета ---------- */
html.dark, .dark {
  --bg: #0E0F11;
  --card: #16181C;
  --card-2: #121417;
  --border: #22252B;
  --border-strong: #2E323A;
  --hover: #1D2025;
  --text-main: #ECEDEF;
  --text-muted: #9AA0AA;
  --text-faint: #8A909A;
  --acid: #D4FF00;
  --acid-text: #D4FF00;
  --acid-dim: rgba(212, 255, 0, 0.12);
  --on-acid: #0E0F11;
  --btn-primary-start: #D4FF00;
  --btn-primary-end: #D4FF00;
  --btn-primary-text: #0E0F11;
  --card-shine: transparent;
  --card-orb: transparent;
  --shadow: none;
  --h-ok: #7FD8A6; --h-ok-bg: #173126;
  --h-warn: #F2C14E; --h-warn-bg: #3A2E12;
  --h-bad: #FF9E8A; --h-bad-bg: #3A1E19;
  --h-info: #9DBDFF; --h-info-bg: #1F2A40;
  --h-ai: #B6A8FF; --h-ai-bg: #17162A;
  /* точные цвета холста: кнопки/переключатели, выбранный сегмент, линии, аватары, текст меню */
  --ctl: #15171B; --ctl-border: #262A31; --sel: #2A2E35; --sel-text: #F4F5F6;
  --line: #1F2227; --av: #23262C; --nav-text: #C9CDD3; --nav-bg: #15171B; --nav-border: #1F2227; --ck: #3A3F47;
}
html:not(.dark) {
  --bg: #F4F5F2;
  --card: #FFFFFF;
  --card-2: #FAFAF8;
  --border: #E3E5E1;
  --border-strong: #D3D6D1;
  --hover: #F1F2EF;
  --text-main: #15171A;
  --text-muted: #5D6470;
  --text-faint: #6B717C;
  --acid: #D4FF00;
  --acid-text: #3F6212;
  --acid-dim: rgba(132, 176, 0, 0.14);
  --on-acid: #15171A;
  --btn-primary-start: #D4FF00;
  --btn-primary-end: #D4FF00;
  --btn-primary-text: #15171A;
  --card-shine: transparent;
  --card-orb: transparent;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --h-ok: #1F7A4D; --h-ok-bg: #E3F4EA;
  --h-warn: #8A5A00; --h-warn-bg: #FBEFD2;
  --h-bad: #B4321D; --h-bad-bg: #FCE6E1;
  --h-info: #1F4E99; --h-info-bg: #E3EEFF;
  --h-ai: #4B3FB0; --h-ai-bg: #EEEBFF;
  --ctl: #FFFFFF; --ctl-border: #DADDD7; --sel: #E9EBE6; --sel-text: #15171A;
  --line: #ECEEEA; --av: #ECEEE9; --nav-text: #3A3F47; --nav-bg: #FFFFFF; --nav-border: #E3E5E1; --ck: #C5C9C2;
}

/* ---------- основа ---------- */
html, body { background-color: var(--bg); }
body {
  background-image: none !important;
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
  font-feature-settings: 'tnum' 0;
  letter-spacing: 0;
}
body, button, input, select, textarea, .input { font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif; }
.font-mono, code, kbd, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
table td, table th, .num, .text-2xl, .text-3xl, .text-xl, .text-4xl { font-variant-numeric: tabular-nums; }

/* полосы прокрутки: тонкие, в цвет темы */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- меню слева ---------- */
@media (min-width: 768px) {
  #sidebar {
    margin: 12px 0 12px 12px;
    height: calc(100% - 24px) !important;
    width: 252px;
    flex: 0 0 252px;
    border: 1px solid var(--border) !important;
    border-radius: 22px;
    box-shadow: none !important;
    overflow: hidden;
  }
}
#sidebar { background: var(--card) !important; }
#sidebar .sidebar-brand { height: 64px; padding: 0 18px; border-bottom: 0 !important; }
#sidebar .sidebar-brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
#sidebar .h-logo { width: 28px; height: 28px; margin-right: 10px; flex: none; }
#sidebar nav { padding: 0 10px 12px !important; display: flex; flex-direction: column; gap: 1px; }
#sidebar nav > * + * { margin-top: 0 !important; }

.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px 6px; border: 0; background: transparent; width: 100%;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); text-align: left;
}
button.nav-group-title { cursor: pointer; }
button.nav-group-title:hover { color: var(--text-main); }
.nav-group-title .chev { transition: transform .18s ease; font-size: 10px; }
.nav-group.is-open .nav-group-title .chev { transform: rotate(90deg); }
.nav-group.is-collapsible:not(.is-open) .nav-item:not(.active) { display: none; }
.nav-group.is-empty { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 38px; min-height: 38px; padding: 0 12px !important;
  border-radius: 12px !important;
  color: var(--text-main) !important; opacity: .82;
  font-size: 14px; font-weight: 500 !important;
  background: transparent;
}
.nav-item::before { display: none !important; }
.nav-item:hover { opacity: 1; background: var(--hover) !important; }
.nav-item .nav-ico { width: 19px; height: 19px; flex: none; stroke: var(--text-faint); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item i { width: 19px !important; font-size: 15px !important; color: var(--text-faint); }
.nav-item.active {
  opacity: 1;
  background: var(--acid) !important;
  color: var(--on-acid) !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}
.nav-item.active .nav-ico { stroke: var(--on-acid); stroke-width: 2; }
.nav-item.active i { color: var(--on-acid); }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--hover); color: var(--text-main); font-variant-numeric: tabular-nums;
}
.nav-badge.warn { background: var(--h-warn-bg); color: var(--h-warn); }
.nav-item.active .nav-badge { background: rgba(0,0,0,.14); color: var(--on-acid); }
.nav-badge:empty { display: none; }

/* низ меню: пользователь и короткие кнопки */
#sidebar .sidebar-bottom { padding: 12px 12px 14px !important; border-top: 1px solid var(--border) !important; }
#sidebar .sidebar-theme-row { display: none !important; }
#sidebar .sidebar-user-row { gap: 10px !important; margin-bottom: 10px !important; }
#sidebar #userAvatar { width: 36px; height: 36px; background: var(--hover) !important; border: 0 !important; font-size: 13px; }
#sidebar #userName { font-size: 13px; }
#sidebar #userRole { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-faint) !important; }
.h-side-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.h-side-actions button {
  height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-2);
  color: var(--text-main); display: grid; place-items: center; font-size: 13px; cursor: pointer;
}
.h-side-actions button:hover { border-color: var(--border-strong); background: var(--hover); }
.h-side-actions button.danger { color: var(--h-bad); }
#sidebar [data-app-install] { margin-top: 8px; height: 36px; padding: 0 !important; border-radius: 10px !important; font-size: 12px; }

/* свёрнутое меню */
@media (min-width: 768px) {
  #sidebar.is-collapsed { width: 78px; flex-basis: 78px; }
  #sidebar.is-collapsed .nav-group-title { display: none; }
  #sidebar.is-collapsed .nav-badge { display: none; }
  #sidebar.is-collapsed .nav-item { width: 46px; justify-content: center; padding: 0 !important; margin-inline: auto; }
  #sidebar.is-collapsed .nav-item .nav-ico { margin: 0; }
  #sidebar.is-collapsed .nav-group.is-collapsible .nav-item { display: flex; }
  #sidebar.is-collapsed .h-side-actions { grid-template-columns: 1fr; }
  #sidebar.is-collapsed .h-logo { margin-right: 0; }
}
.sidebar-collapse-btn { border-color: var(--border) !important; background: var(--card) !important; }

/* ---------- шапка ---------- */
#desktopHeader {
  height: auto !important; min-height: 64px; padding: 14px 32px 10px !important;
  border-bottom: 0 !important; background: var(--bg) !important; gap: 12px;
}
#desktopHeader .h-crumbs { display: flex; flex-direction: column; min-width: 0; }
#desktopHeader .h-crumb { font-size: 13px; color: var(--text-faint); line-height: 1.2; }
#desktopHeader #desktopTitle { font-size: 26px !important; font-weight: 800 !important; letter-spacing: -.02em; line-height: 1.15; }
.h-search {
  display: flex; align-items: center; gap: 8px; height: 38px; width: 300px; max-width: 34vw;
  padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text-faint); font-size: 14px; cursor: text; text-align: left;
}
.h-search:hover { border-color: var(--text-faint); }
.h-search span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.h-search kbd { font: 600 11px 'Onest', sans-serif; color: var(--text-faint); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px; }
.h-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px !important;
  border: 1px solid var(--border-strong) !important; background: var(--card) !important;
  color: var(--text-main) !important; display: grid; place-items: center;
}
.h-icon-btn:hover { border-color: var(--text-faint) !important; }
#dateDisplay { font-family: 'Onest', sans-serif !important; font-size: 13px; color: var(--text-faint) !important; }
#mobileHeader { background: color-mix(in srgb, var(--bg) 92%, transparent) !important; border-bottom-color: var(--border) !important; }

/* переключатель языка — сегменты */
.lang-switch { background: var(--ctl) !important; border: 1px solid var(--ctl-border) !important; border-radius: 10px !important; padding: 2px !important; gap: 2px; }
.lang-switch-btn { border-radius: 8px !important; height: 30px; padding: 0 9px !important; font-size: 12px !important; font-weight: 700 !important; }
.lang-switch-btn .lang-flag { display: none !important; }
.lang-switch-btn span:not(.lang-flag) { display: inline !important; }
.lang-switch-btn.is-active, .lang-switch-btn.active { background: var(--hover) !important; color: var(--text-main) !important; box-shadow: none !important; }

/* ---------- содержимое ---------- */
#content { padding: 8px 32px 40px !important; }
@media (max-width: 767px) { #content { padding: 12px 14px 96px !important; } }

/* карточки: ровные, без бликов и прыжков */
.void-card, .card, .k-hero, .k-card {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow) !important;
}
.void-card::before, .void-card::after, .k-hero::after { display: none !important; }
.void-card:hover { transform: none !important; border-color: var(--border-strong) !important; box-shadow: var(--shadow) !important; }

/* кнопки */
.btn-primary {
  background: var(--acid) !important; color: var(--on-acid) !important;
  border-radius: 10px !important; font-weight: 800 !important; letter-spacing: 0 !important;
  box-shadow: none !important; padding: 10px 16px;
}
.btn-primary:hover { transform: none !important; filter: brightness(1.04); box-shadow: none !important; }

/* поля ввода */
.input, select.input, textarea.input {
  background: var(--card-2) !important; border: 1px solid var(--border-strong) !important;
  border-radius: 10px !important; box-shadow: none !important; font-size: 14px; padding: 10px 12px;
}
.input:focus { border-color: var(--acid) !important; box-shadow: 0 0 0 3px var(--acid-dim) !important; background: var(--card-2) !important; }

/* таблицы */
#content table thead th {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-faint);
}

/* модальные окна */
.modal-box, #chatModalContent { border-radius: 18px !important; border-color: var(--border) !important; background: var(--card) !important; }
.modal-bg { background: rgba(5, 6, 8, .72) !important; backdrop-filter: blur(2px); }

/* окна SweetAlert */
.swal2-popup { background: var(--card) !important; color: var(--text-main) !important; border: 1px solid var(--border); border-radius: 18px !important; font-family: 'Onest', sans-serif !important; }
.swal2-title, .swal2-html-container { color: var(--text-main) !important; }
.swal2-styled.swal2-confirm { background: var(--acid) !important; color: var(--on-acid) !important; border-radius: 10px !important; font-weight: 800 !important; box-shadow: none !important; }
.swal2-styled.swal2-cancel { background: var(--hover) !important; color: var(--text-main) !important; border-radius: 10px !important; }

/* ---------- общие детали нового дизайна (для страниц) ---------- */
.h-page { display: flex; flex-direction: column; gap: 16px; }
.h-page h1, .h-page h2, .h-page h3 { color: var(--text-main); }
.h-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.h-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.h-pill.ok { background: var(--h-ok-bg); color: var(--h-ok); }
.h-pill.warn { background: var(--h-warn-bg); color: var(--h-warn); }
.h-pill.bad { background: var(--h-bad-bg); color: var(--h-bad); }
.h-pill.info { background: var(--h-info-bg); color: var(--h-info); }
.h-pill.muted { background: var(--hover); color: var(--text-muted); }
.h-seg { display: inline-flex; background: var(--ctl); border: 1px solid var(--ctl-border); border-radius: 11px; padding: 3px; gap: 0; }
.h-seg > button, .h-seg > a { border: 0; background: transparent; color: var(--text-muted); padding: 7px 12px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.h-seg > .on, .h-seg > [aria-pressed="true"], .h-seg > [aria-selected="true"] { background: var(--sel); color: var(--sel-text); font-weight: 700; }
.h-btn { height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--ctl-border); background: var(--ctl); color: var(--text-main); font: inherit; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.h-btn:hover { border-color: var(--text-faint); }
.h-btn.primary { background: var(--acid); color: var(--on-acid); border-color: transparent; font-weight: 800; }
.h-btn.primary:hover { filter: brightness(1.04); }
.h-btn.danger { color: var(--h-bad); border-color: color-mix(in srgb, var(--h-bad) 35%, var(--border)); }
.h-btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.h-title { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--text-main); }
.h-eyebrow { font-size: 13px; color: var(--text-faint); }
.h-muted { color: var(--text-muted); }
.h-faint { color: var(--text-faint); }
.h-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.h-kpi { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: var(--text-main); }
.h-kpi .lbl { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.h-kpi .val { font-size: clamp(19px, 1.55vw, 23px); font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.h-kpi .val small { font-size: 13px; font-weight: 600; color: var(--text-faint); }
.h-kpi .sub { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.h-kpi.hero { background: color-mix(in srgb, var(--acid) 7%, var(--card)); border-color: color-mix(in srgb, var(--acid) 22%, var(--border)); }
.h-kpi.hero .val { color: var(--acid-text); }
.h-bar { height: 8px; border-radius: 99px; background: var(--hover); overflow: hidden; position: relative; }
.h-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--acid); }
.h-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-radius: 14px; padding: 12px 16px; font-size: 14px; }
.h-alert.warn { background: var(--h-warn-bg); color: var(--text-main); border: 1px solid color-mix(in srgb, var(--h-warn) 30%, transparent); }
.h-alert.bad { background: var(--h-bad-bg); color: var(--text-main); border: 1px solid color-mix(in srgb, var(--h-bad) 30%, transparent); }
.h-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.h-table th { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); text-align: left; padding: 10px 12px; white-space: nowrap; }
.h-table td { padding: 12px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.h-table .r { text-align: right; }
.h-table tbody tr:hover td { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.h-av { width: 28px; height: 28px; border-radius: 99px; background: var(--av); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text-main); flex: none; }

/* ---------- Реализация ---------- */
.h-rz-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 5px; border-radius: 99px; border: 1px solid var(--ctl-border); background: var(--ctl); color: var(--text-main); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.h-rz-chip:not(:has(.h-av)) { padding-left: 14px; }
.h-rz-chip.on { background: var(--sel-text); color: var(--bg); border-color: var(--sel-text); font-weight: 700; }
.h-rz-chip.on .h-av { background: var(--bg); color: var(--text-main); }
.h-rz-kv { padding: 12px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.h-rz-kv > span { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.h-rz-kv > b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-rz-kv small { font-size: 12px; font-weight: 600; }
.h-rz-head, .h-rz-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) 120px 120px 22px; gap: 10px; align-items: center; padding: 10px 16px; }
.h-rz-head { padding-top: 7px; padding-bottom: 7px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); border-top: 1px solid var(--border); }
.h-rz-row { border-top: 1px solid var(--border); font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; }
.h-rz-row:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.h-rz-row.is-sel { background: color-mix(in srgb, var(--acid) 7%, var(--card)); box-shadow: inset 3px 0 0 var(--acid); }
.h-rz-org-name { min-width: 160px; flex: 0 1 300px; }
.h-rz-org-name .rz-in { background: transparent !important; border: 1px solid transparent !important; font-weight: 800; font-size: 15px; color: var(--text-main); padding: 4px 6px; border-radius: 8px; width: 100%; }
.h-rz-org-name .rz-in:hover, .h-rz-org-name .rz-in:focus { border-color: var(--border-strong) !important; background: var(--bg) !important; }
.h-rz .rz-in-wrap { position: relative; display: flex; align-items: center; }
.h-rz .rz-pick-trigger { position: absolute; right: 4px; width: 26px; height: 26px; border: 0; background: transparent; color: var(--text-faint); border-radius: 6px; }
.h-rz-drawer { position: sticky; top: 8px; }
.h-rz-sec { display: flex; flex-direction: column; gap: 8px; }
.h-rz-cap { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.h-rz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.h-rz-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); min-width: 0; }
.h-rz-drawer .rz-in { height: 36px; width: 100%; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--bg); color: var(--text-main); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; outline: none; }
.h-rz-drawer .rz-in:focus { border-color: var(--acid); box-shadow: 0 0 0 3px var(--acid-dim); }
.h-rz-drawer .rz-in[readonly] { opacity: .7; }
.h-rz .rz-in.rz-dirty { border-color: var(--h-warn) !important; }
.h-rz .rz-in.rz-saved { border-color: var(--h-ok) !important; }
.h-rz .rz-in.rz-error { border-color: var(--h-bad) !important; }
.h-rz-res { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-muted); padding: 5px 0; border-top: 1px solid var(--border); }
.h-rz-res b { color: var(--text-main); font-size: 14px; font-variant-numeric: tabular-nums; }
.rz-filter-hidden { display: none !important; }
@media (max-width: 700px) {
  .h-rz-head { display: none; }
  .h-rz-row { grid-template-columns: minmax(0, 1fr) auto 18px; }
  .h-rz-row > span:nth-child(2), .h-rz-row > span:nth-child(3) { display: none; }
  .h-rz-drawer { position: static; max-width: none !important; }
}
.h-rz-row .rz-calc-ship, .h-rz-row .rz-calc-closed { border: 0 !important; background: none !important; padding: 0 !important; box-shadow: none !important; min-height: 0 !important; }
.h-rz-row .rz-value { font-size: 14px; }
.h-rz-drawer .h-rz-res { border-left: 0 !important; background: none !important; padding-left: 0 !important; padding-right: 0 !important; box-shadow: none !important; min-height: 0 !important; }
.h-rz-drawer .rz-in { text-align: left; }

/* ---------- Клиенты ---------- */
.h-cl-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 150px 18px; gap: 12px; align-items: center; width: 100%; padding: 11px 16px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text-main); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.h-cl-head { cursor: default; border-top: 0; padding-top: 10px; padding-bottom: 10px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
button.h-cl-row:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.h-cl-row.is-sel { background: color-mix(in srgb, var(--acid) 7%, var(--card)); box-shadow: inset 3px 0 0 var(--acid); }
@media (max-width: 700px) { .h-cl-row { grid-template-columns: minmax(0, 1fr) auto 14px; } .h-cl-row > span:nth-child(2) { display: none; } }

/* ============================================================
   Общий набор деталей старых страниц (k-*, tkf-*, ks-*, btn-chip, task-*) — в стиле гибрида H.
   Логику и разметку страниц не трогаем: только вид.
   ============================================================ */
.k { gap: 16px; }
.k-hero { padding: 18px 20px !important; border-radius: 16px !important; }
.k-eyebrow { font-size: 13px !important; font-weight: 500 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-faint) !important; }
.k-title { font-size: 22px !important; margin-top: 2px !important; }
.k-lead { font-size: 14px !important; color: var(--text-muted) !important; }
.k-btn {
  height: 38px !important; padding: 0 14px !important; border-radius: 10px !important; border: 1px solid var(--ctl-border) !important;
  background: var(--card) !important; color: var(--text-main) !important; font-weight: 600 !important; font-size: 13px !important;
  box-shadow: none !important; transform: none !important;
}
.k-btn:hover { border-color: var(--text-faint) !important; }
.k-btn-primary { background: var(--acid) !important; color: var(--on-acid) !important; border-color: transparent !important; font-weight: 800 !important; }
.k-btn-danger { color: var(--h-bad) !important; border-color: color-mix(in srgb, var(--h-bad) 35%, var(--border)) !important; }
.k-btn-sm { height: 32px !important; padding: 0 11px !important; font-size: 12.5px !important; }
.k-kpi {
  border-radius: 16px !important; border: 1px solid var(--border) !important; background: var(--card) !important;
  box-shadow: none !important; transform: none !important; padding: 16px 18px !important; animation: none !important;
}
.k-kpi::after { display: none !important; }
.k-kpi .k-bar { width: 3px !important; opacity: .8; }
.k-kpi .k-kpi-label { font-size: 13px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; }
.k-kpi .k-kpi-value { font-size: clamp(20px, 1.7vw, 26px) !important; margin-top: 6px !important; font-variant-numeric: tabular-nums; }
.k-kpi .k-kpi-hint { font-size: 13px !important; }
button.k-kpi.is-active, .k-kpi.stat-btn.active { border-color: var(--acid) !important; box-shadow: 0 0 0 1px var(--acid) inset !important; }
.k-segs { background: var(--ctl) !important; border: 1px solid var(--ctl-border) !important; border-radius: 11px !important; padding: 3px !important; gap: 2px !important; box-shadow: none !important; }
.k-seg { border-radius: 8px !important; padding: 7px 12px !important; font-size: 13px !important; color: var(--text-muted) !important; background: transparent !important; box-shadow: none !important; }
.k-seg.is-active { background: var(--sel) !important; color: var(--sel-text) !important; font-weight: 700 !important; }
.k-seg .k-cnt { background: transparent !important; color: inherit !important; opacity: .75; font-variant-numeric: tabular-nums; }
.k-panel { background: var(--card) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; box-shadow: none !important; }
.k-card { background: var(--card) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; box-shadow: none !important; transform: none !important; }
.k-card:hover { border-color: var(--border-strong) !important; }
.k-badge { border-radius: 99px !important; font-size: 12px !important; font-weight: 700 !important; padding: 3px 9px !important; background: var(--hover) !important; color: var(--text-muted) !important; border: 0 !important; }
.k-badge-green { background: var(--h-ok-bg) !important; color: var(--h-ok) !important; }
.k-badge-amber { background: var(--h-warn-bg) !important; color: var(--h-warn) !important; }
.k-badge-rose { background: var(--h-bad-bg) !important; color: var(--h-bad) !important; }
.k-badge-sky { background: var(--h-info-bg) !important; color: var(--h-info) !important; }
.k-badge-violet { background: var(--h-ai-bg) !important; color: var(--h-ai) !important; }
.k-pager button { border-radius: 10px !important; border: 1px solid var(--ctl-border) !important; background: var(--ctl) !important; color: var(--text-main) !important; }
.k-pager button.is-active { background: var(--acid) !important; color: var(--on-acid) !important; border-color: transparent !important; }
.k-table th { font-size: 11px !important; font-weight: 600 !important; letter-spacing: .04em !important; text-transform: uppercase !important; color: var(--text-faint) !important; }

/* фильтры-«таблетки» и выпадающие списки */
.tkf-chip {
  height: 34px !important; padding: 0 12px !important; border-radius: 99px !important; border: 1px solid var(--ctl-border) !important;
  background: var(--card) !important; color: var(--text-main) !important; font-size: 13px !important; font-weight: 500 !important; transform: none !important;
}
.tkf-chip .tkf-cnt { background: transparent !important; color: var(--text-main) !important; font-weight: 700 !important; }
.tkf-chip.tkf-rose .tkf-cnt { color: var(--h-bad) !important; }
.tkf-chip.tkf-amber .tkf-cnt { color: var(--h-warn) !important; }
.tkf-chip.tkf-green .tkf-cnt { color: var(--h-ok) !important; }
.tkf-chip.tkf-sky .tkf-cnt { color: var(--h-info) !important; }
.tkf-chip.tkf-violet .tkf-cnt { color: var(--h-ai) !important; }
.tkf-chip.is-active, .tkf-chip.active { background: var(--text-main) !important; color: var(--bg) !important; border-color: var(--text-main) !important; font-weight: 700 !important; }
.tkf-chip.is-active .tkf-cnt, .tkf-chip.active .tkf-cnt { color: var(--bg) !important; }
.tkf-label { font-size: 12px !important; font-weight: 700 !important; letter-spacing: .06em !important; text-transform: uppercase !important; color: var(--text-faint) !important; }
.ks-trigger { height: 38px !important; border-radius: 10px !important; border: 1px solid var(--ctl-border) !important; background: var(--ctl) !important; color: var(--text-main) !important; box-shadow: none !important; transform: none !important; font-size: 13px !important; }
.ks-menu { background: var(--card) !important; border: 1px solid var(--border-strong) !important; border-radius: 14px !important; box-shadow: 0 18px 40px rgba(0, 0, 0, .45) !important; }
.ks-opt { border-radius: 10px !important; font-size: 13.5px !important; }
.ks-opt.is-active { background: var(--hover) !important; color: var(--text-main) !important; }
.btn-chip { border-radius: 10px !important; font-weight: 600 !important; box-shadow: none !important; }
.btn-secondary { border-radius: 10px !important; border: 1px solid var(--ctl-border) !important; background: var(--ctl) !important; color: var(--text-main) !important; box-shadow: none !important; font-weight: 600 !important; }

/* задачи: карточки и кнопки действий */
.task-card { border-radius: 16px !important; background: var(--card) !important; border: 1px solid var(--border) !important; box-shadow: none !important; }
.task-action-btn { border-radius: 10px !important; box-shadow: none !important; font-weight: 700 !important; }
.task-action-btn-acid, .task-action-btn-success { background: var(--acid) !important; color: var(--on-acid) !important; border-color: transparent !important; }
.task-meta-card { border-radius: 12px !important; background: var(--card-2) !important; border-color: var(--border) !important; }

/* старый переключатель режима (Склад / Производство) на других страницах */
.workspace-switcher-panel { background: var(--card) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; box-shadow: none !important; }
.workspace-switcher-btn { border-radius: 10px !important; }
.workspace-switcher-btn.is-active { background: var(--acid) !important; color: var(--on-acid) !important; }

/* ============================================================
   Меню: кнопка сворачивания внутри, карточка пользователя с меню действий
   ============================================================ */
.sidebar-collapse-btn { display: none !important; }
.h-collapse {
  margin-left: auto; width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent;
  color: var(--text-faint); display: grid; place-items: center; cursor: pointer;
}
.h-collapse:hover { background: var(--hover); color: var(--text-main); }
.h-collapse svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }
@media (max-width: 767px) { .h-collapse { display: none; } }
#sidebar.is-collapsed .sidebar-brand { flex-direction: column; justify-content: center; gap: 6px; height: auto; padding: 14px 0 6px; }
#sidebar.is-collapsed .h-collapse { margin: 0; }
#sidebar.is-collapsed .h-collapse svg { transform: scaleX(-1); }

.h-me { position: relative; }
.h-me-card {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card-2); color: var(--text-main); cursor: pointer; text-align: left; font: inherit;
}
.h-me-card:hover, .h-me.is-open .h-me-card { border-color: var(--border-strong); background: var(--hover); }
.h-me-ava {
  position: relative; width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: var(--on-acid);
  background: conic-gradient(from 210deg, #E8FF66, #D4FF00, #A8CC00, #E8FF66);
}
.h-me-ava::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 99px; background: var(--h-ok); border: 2px solid var(--card-2); }
.h-me-copy { min-width: 0; flex: 1; line-height: 1.25; }
.h-me-copy #userName { font-size: 13px !important; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-me-copy #userRole { font-size: 12px !important; color: var(--text-faint) !important; font-weight: 500 !important; letter-spacing: 0 !important; text-transform: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-me-dots { color: var(--text-faint); font-size: 14px; padding: 0 4px; }
.h-me-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 70; display: none;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 16px; padding: 6px;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .45);
}
.h-me.is-open .h-me-menu { display: block; }
.h-me-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-main); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.h-me-menu button:hover { background: var(--hover); }
.h-me-menu button i { width: 18px; text-align: center; color: var(--text-faint); }
.h-me-menu .sep { height: 1px; background: var(--border); margin: 5px 4px; }
.h-me-menu .danger, .h-me-menu .danger i { color: var(--h-bad); }
.h-me-menu .h-switch { margin-left: auto; width: 34px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; flex: none; }
.h-me-menu .h-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 99px; background: var(--text-main); transition: left .15s ease; }
html.dark .h-me-menu .h-switch { background: var(--acid); }
html.dark .h-me-menu .h-switch::after { left: 17px; background: var(--on-acid); }
#sidebar.is-collapsed .h-me-copy, #sidebar.is-collapsed .h-me-dots { display: none; }
#sidebar.is-collapsed .h-me-card { justify-content: center; padding: 6px; }
#sidebar.is-collapsed .h-me-menu { left: 0; right: auto; width: 230px; }

/* ============================================================
   Шапка: поиск, язык, уведомления, звук, дата — одним рядом, без старых зелёных/лаймовых обводок
   ============================================================ */
#desktopHeader .lang-switch { height: 38px; align-items: center; }
#desktopHeader .lang-switch-btn { border: 0 !important; box-shadow: none !important; outline: none !important; color: var(--text-faint) !important; background: transparent !important; }
#desktopHeader .lang-switch-btn.is-active { background: var(--hover) !important; color: var(--text-main) !important; }
.h-tools { display: flex; align-items: center; gap: 2px; height: 38px; padding: 2px; border-radius: 11px; border: 1px solid var(--ctl-border); background: var(--ctl); }
.h-tools .h-icon-btn { width: 32px; height: 32px; border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--text-muted) !important; }
.h-tools .h-icon-btn:hover { background: var(--hover) !important; color: var(--text-main) !important; }
.h-tools .audio-toggle-on, .h-tools .audio-toggle-off { box-shadow: none !important; }
.h-tools [data-audio-toggle] { color: var(--text-muted) !important; }
.h-date { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; padding-left: 6px; }
.h-date b { font-size: 13px; color: var(--text-main); font-weight: 700; }
.h-date span { font-size: 12px; color: var(--text-faint); }
.h-me-ava img { border-radius: 12px !important; }
#sidebar .sidebar-bottom { padding: 10px !important; }
#sidebar #userAvatar.h-me-ava { width: 38px; height: 38px; border-radius: 12px !important; background: conic-gradient(from 210deg, #E8FF66, #D4FF00, #A8CC00, #E8FF66) !important; color: #0E0F11 !important; border: 0 !important; }
#sidebar .sidebar-user-row { margin: 0 !important; }
.h-me-menu [data-app-install] { height: 40px !important; font-size: 14px !important; border: 0 !important; background: transparent !important; color: var(--text-main) !important; padding: 0 10px !important; margin: 0 !important; }
#desktopHeader .h-tools [data-audio-toggle], #desktopHeader .h-tools .audio-toggle-on { color: var(--text-muted) !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
#desktopHeader .h-tools .audio-toggle-off { color: var(--h-bad) !important; background: transparent !important; }

/* ---------- Задачи (H-Tasks) ---------- */
.h-tk-add { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 8px 0 16px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--ctl); cursor: text; }
.h-tk-add:focus-within { border-color: var(--acid); }
.h-tk-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-main); font: inherit; font-size: 15px; }
.h-tk-add input::placeholder { color: var(--text-faint); }
.h-tk-plus { width: 26px; height: 26px; border-radius: 99px; background: var(--acid); color: var(--on-acid); display: grid; place-items: center; font-weight: 800; flex: none; }
.h-tk-hint { font-size: 12px; color: var(--h-ai); white-space: nowrap; }
@media (max-width: 700px) { .h-tk-hint { display: none; } }
.h-tk-sec { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.h-tk { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.h-tk:hover { border-color: var(--border-strong); }
.h-tk.is-sel { border-color: var(--ck); }
.h-tk.g-overdue { border-color: #5A2E26; box-shadow: inset 3px 0 0 var(--h-bad); }
html:not(.dark) .h-tk.g-overdue { border-color: #F2C4BA; }
.h-tk.g-done { opacity: .72; }
.h-tk-main { display: flex; align-items: flex-start; gap: 12px; }
.h-tk-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.h-tk-title.is-done { text-decoration: line-through; color: var(--text-muted); }
.h-tk-meta { font-size: 13px; color: var(--text-faint); margin-top: 3px; overflow-wrap: anywhere; }
.h-tk-check { width: 24px; height: 24px; flex: none; border-radius: 99px; border: 2px solid var(--ck); background: transparent; display: grid; place-items: center; padding: 0; cursor: pointer; }
button.h-tk-check:hover { border-color: var(--h-ok); }
.h-tk-check.review { border-color: var(--h-ai); }
.h-tk-check.idle { cursor: default; }
.h-tk-check.done { background: var(--h-ok); border-color: var(--h-ok); cursor: default; }
.h-tk-check.cancel { border-style: dashed; cursor: default; }
.h-tk-check svg { width: 12px; height: 12px; fill: none; stroke: #0E0F11; stroke-width: 3; }
.h-due { font-size: 12px; font-weight: 700; border-radius: 99px; padding: 4px 10px; white-space: nowrap; flex: none; }
.h-due.bad { background: var(--h-bad-bg); color: var(--h-bad); }
.h-due.lime { background: #2A3016; color: var(--acid); }
html:not(.dark) .h-due.lime { background: #EEF7C8; color: #3F6212; }
.h-due.ok { background: var(--h-ok-bg); color: var(--h-ok); }
.h-due.warn { background: var(--h-warn-bg); color: var(--h-warn); }
.h-due.info { background: var(--h-info-bg); color: var(--h-info); }
.h-due.ai { background: var(--h-ai-bg); color: var(--h-ai); }
.h-due.muted { background: var(--av); color: var(--nav-text); }
.h-tk-group { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-left: 36px; }
.h-tk-avs { display: flex; gap: 6px; }
.h-tk-av { width: 30px; height: 30px; border-radius: 99px; background: var(--av); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; position: relative; color: var(--text-main); }
.h-tk-av .dn { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 99px; background: var(--h-ok); border: 2px solid var(--card); }
.h-tk-av.late { box-shadow: 0 0 0 2px var(--h-bad); }
.h-tk-av.wait { box-shadow: 0 0 0 2px var(--h-warn); }
.h-tk-bar { height: 6px; border-radius: 9px; background: var(--av); overflow: hidden; }
.h-tk-bar > i { display: block; height: 100%; background: var(--h-ok); }
.h-tk-prog { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.h-tk-p { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.h-tk-in { height: 34px; width: 100%; padding: 0 10px; border-radius: 9px; border: 1px solid #343052; background: #100F1E; color: var(--text-main); font: inherit; font-size: 13px; outline: none; }
html:not(.dark) .h-tk-in { background: #fff; border-color: #D9D4FF; }
.h-tk-in:focus { border-color: var(--h-ai); }
.h-tk-sug { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid #343052; }
.h-ai-card { background: #17162A !important; border-color: #343052 !important; }
html:not(.dark) .h-ai-card { background: #F4F2FF !important; border-color: #DCD6FF !important; }
.h-ai-sub { font-size: 13px; color: #B9B4D6; }
html:not(.dark) .h-ai-sub { color: #5B5390; }
.h-ai-k { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border: 0; background: transparent; color: var(--text-main); font-family: inherit; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.h-ai-k:hover span { text-decoration: underline; text-underline-offset: 3px; }
.h-ai-more { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; margin-top: 6px; padding-top: 10px; border-top: 1px solid #343052; color: #B9B4D6; }
html:not(.dark) .h-ai-more { border-color: #DCD6FF; color: #5B5390; }
@media (max-width: 700px) { .h-tk-group { padding-left: 0; } }

/* фильтры-таблетки, ссылки, маленькие кнопки-иконки (как на холсте) */
.h-f { height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--ctl-border); background: var(--ctl); color: var(--nav-text); font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.h-f b { font-weight: 700; color: var(--text-main); }
.h-f:hover { border-color: var(--ck); }
.h-f.on { background: var(--sel-text); color: var(--bg); border-color: var(--sel-text); }
.h-f.on b { color: var(--bg) !important; }
.h-f-sel { position: relative; padding-right: 10px; }
.h-f-sel select { appearance: none; -webkit-appearance: none; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; padding: 0 4px 0 0; cursor: pointer; max-width: 220px; }
.h-f-sel select option { background: var(--card); color: var(--text-main); }
.h-f-sel span { font-size: 10px; pointer-events: none; }
.h-link { font-size: 13px; font-weight: 700; color: var(--acid-text); text-decoration: underline; text-underline-offset: 2px; }
.h-link:hover { color: #E8FF66; }
.h-ico-btn { width: 28px; height: 28px; flex: none; border-radius: 8px; border: 0; background: transparent; color: var(--text-faint); display: grid; place-items: center; cursor: pointer; }
.h-ico-btn:hover { background: var(--hover); color: var(--text-main); }
.h-ico-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.h-mobile-head { display: none; }
@media (max-width: 767px) { .h-mobile-head { display: flex; flex-wrap: wrap; gap: 8px; } }
#tasksGrid { display: flex !important; flex-direction: column !important; gap: 12px !important; grid-template-columns: none !important; }
#tasksGrid > .h-tk { width: 100% !important; max-width: none !important; }
.h-tk-main > .h-pill { flex: none; }
.h-tk-main > .h-btn { flex: none; }

/* ============================================================
   Каркас точно по холсту (HNav + шапка страниц H-*)
   ============================================================ */
html, body, #main, #content { background-color: var(--bg) !important; }
/* uikit задаёт заголовкам свой шрифт и цвет — возвращаем Onest */
h1, h2, h3, h4, h5, h6 { font-family: 'Onest', system-ui, sans-serif !important; color: inherit; }

/* меню слева: плавающая карточка 224px, высота по содержимому */
@media (min-width: 768px) {
  #sidebar {
    width: 224px !important; flex: 0 0 224px !important; margin: 12px 0 12px 12px;
    height: auto !important; max-height: calc(100% - 24px); align-self: flex-start;
    background: var(--nav-bg) !important; border: 1px solid var(--nav-border) !important; border-radius: 22px;
    padding: 16px 10px 12px;
  }
}
#sidebar { background: var(--nav-bg) !important; }
#sidebar .sidebar-brand { height: auto !important; padding: 0 10px 6px !important; gap: 10px; }
#sidebar .h-logo { margin-right: 10px; }
#sidebar nav { padding: 0 !important; flex: 1 1 auto; }
.nav-group-title { padding: 14px 12px 6px !important; color: var(--text-faint) !important; }
.nav-item { color: var(--nav-text) !important; opacity: 1 !important; font-weight: 400 !important; }
.nav-item:hover { background: var(--hover) !important; color: var(--text-main) !important; }
.nav-item.active { color: var(--on-acid) !important; font-weight: 700 !important; }
.nav-badge { background: var(--sel); color: var(--text-main); padding: 1px 8px; height: auto; min-width: 0; line-height: 18px; }
.nav-item.active .nav-badge { background: #2A2E35; color: #ECEDEF; }
.nav-badge.warn { background: var(--h-warn-bg); color: var(--h-warn); }

/* колокольчик в строке логотипа */
.h-bell { margin-left: auto; position: relative; width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text-faint); }
.h-bell:hover { background: var(--hover); color: var(--text-main); }
.h-bell svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.h-bell #notifBadgeDesktop { position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px; background: var(--acid); color: var(--on-acid); font-size: 9px; font-weight: 800; line-height: 15px; text-align: center; }
.h-bell #notifBadgeDesktop.hidden { display: none; }

/* низ меню: аватар, имя, RU/UZ */
#sidebar .sidebar-bottom { margin-top: 12px; padding: 12px 6px 0 !important; border-top: 1px solid var(--line) !important; }
#sidebar .h-me-card { display: flex; align-items: center; gap: 8px; padding: 0; border: 0 !important; background: transparent !important; margin: 0 !important; }
#sidebar .h-me-open { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
#sidebar .h-me-open:hover { background: var(--hover); }
#sidebar .h-me-open { padding: 4px; margin: -4px; }
#sidebar #userAvatar.h-me-ava { width: 34px !important; height: 34px !important; flex: none; border-radius: 99px !important; background: var(--av) !important; color: var(--text-main) !important; display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 0 !important; overflow: hidden; }
#sidebar #userAvatar.h-me-ava img { border-radius: 99px !important; width: 100%; height: 100%; object-fit: cover; }
.h-me-ava::after { display: none !important; }
.h-me-copy #userName { font-size: 13px !important; font-weight: 700 !important; }
.h-me-copy #userRole { font-size: 12px !important; color: var(--text-faint) !important; }
#sidebar .h-lang { margin-left: auto; flex: none; display: flex; background: var(--bg) !important; border: 0 !important; border-radius: 8px !important; padding: 2px !important; gap: 0; height: auto; }
#sidebar .h-lang .lang-switch-btn { min-width: 0 !important; width: auto !important; flex: none; gap: 0; letter-spacing: 0; height: auto !important; border: 0; background: transparent; color: var(--text-faint) !important; border-radius: 6px !important; font-size: 11px !important; font-weight: 700 !important; padding: 4px 6px !important; }
#sidebar .h-lang .lang-switch-btn.is-active, #sidebar .h-lang .lang-switch-btn.active { background: var(--av) !important; color: var(--text-main) !important; }
.h-me-menu { bottom: calc(100% + 8px) !important; }

/* шапка страницы: заголовок + переключатели в одну строку */
@media (min-width: 768px) {
  #desktopHeader { display: flex !important; flex-wrap: wrap; align-items: center; gap: 12px; height: auto !important; min-height: 0 !important; padding: 18px 28px 0 !important; background: transparent !important; border: 0 !important; }
}
#desktopHeader #desktopTitle { margin: 0; font-size: 28px !important; font-weight: 800 !important; letter-spacing: -.02em; line-height: 1.25; color: var(--text-main); white-space: nowrap; }
.h-head-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
#hHeadLeft { margin-left: 8px; }
.h-head-slot:empty { display: none; }
.h-head-right { margin-left: auto; }
#content { padding: 14px 28px 40px !important; }
@media (max-width: 767px) { #content { padding: 12px 14px 96px !important; } }
.h-page { gap: 14px; }

#desktopHeader .h-date { display: none !important; }
#sidebar .h-me-copy { flex: 1; min-width: 0; }

/* подзаголовок под заголовком страницы (Главная: дата и сколько дней до конца месяца) */
.h-title-wrap { display: flex; flex-direction: column; min-width: 0; }
.h-head-sub { font-size: 14px; color: var(--text-muted); margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.h-head-sub:empty { display: none; }
/* поле поиска в шапке — как на холсте (открывает общий поиск Ctrl K) */
.h-search-f { display: flex; align-items: center; gap: 8px; background: var(--ctl); border: 1px solid var(--ctl-border); border-radius: 10px; padding: 0 10px; height: 38px; width: 260px; max-width: 100%; color: var(--text-faint); font: inherit; font-size: 14px; cursor: text; text-align: left; }
.h-search-f:hover { border-color: var(--ck); }
.h-search-f svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.h-search-f span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-search-f kbd { font: 11px 'Onest', sans-serif; color: var(--text-faint); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px; }
.h-mini-seg { display: inline-flex; background: var(--ctl); border: 1px solid var(--ctl-border); border-radius: 8px; padding: 2px; }
.h-mini-seg button { border: 0; background: transparent; color: var(--text-faint); border-radius: 6px; font: inherit; font-size: 12px; font-weight: 600; padding: 2px 8px; cursor: pointer; }
.h-mini-seg button.on { background: var(--sel); color: var(--sel-text); font-weight: 700; }

/* карточки-показатели (H-Home) */
.h-kpi { gap: 6px; padding: 16px 18px; }
.h-kpi .lbl { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.h-kpi .val { font-size: 23px; font-weight: 800; letter-spacing: 0; line-height: 1.25; }
.h-kpi .val small { font-size: 14px; font-weight: 400; color: var(--text-faint); }
.h-kpi .sub { font-size: 13px; color: var(--text-muted); }
.h-kpi .go { font-size: 13px; font-weight: 700; color: var(--nav-text); }
.h-kpi:hover { border-color: var(--border-strong); }
html.dark .h-kpi.hero { background: #1B1D17; border-color: #3A4220; }
html.dark .h-kpi.hero .lbl, html.dark .h-kpi.hero .sub { color: #C6CF9E; }
html.dark .h-kpi.hero .val small { color: #A9B08A; }
html.dark .h-kpi.hero .h-bar { background: #2A3016; }
.h-bar { background: var(--av); }
.h-mgr { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr) 120px 48px; align-items: center; gap: 14px; padding: 10px 18px; border: 0; border-top: 1px solid var(--line); font: inherit; font-size: 14px; width: 100%; background: transparent; color: var(--text-main); text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.h-mgr:hover { background: var(--hover); }
.h-att { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; color: var(--text-main); }
.h-att:hover { background: var(--hover); }
@media (max-width: 700px) { .h-mgr { grid-template-columns: minmax(0, 1fr) 90px 44px; } .h-mgr > .h-bar { display: none; } }

#desktopHeader .h-crumb { font-size: 13px; color: var(--text-faint); line-height: 1.2; }
#desktopHeader .h-crumb:empty, body[data-hpage="dashboard"] #desktopHeader .h-crumb, body[data-hpage="tasks"] #desktopHeader .h-crumb { display: none; }
#desktopHeader .h-crumb + .h-title-row { margin-top: 2px; }
.h-title-row { display: flex; align-items: baseline; gap: 8px; }
.h-head-count { font-size: 20px; font-weight: 600; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.h-head-count:empty { display: none; }

/* ---------- Реализация точно по H-Realization ---------- */
.h-rz-chip { height: 38px; padding: 0 14px 0 5px; border-color: var(--ctl-border); background: var(--ctl); color: var(--nav-text); gap: 8px; font-variant-numeric: tabular-nums; position: relative; }
.h-rz-chip .h-av { width: 28px; height: 28px; font-size: 11px; background: var(--av); color: var(--text-main); }
.h-rz-chip.on { background: var(--sel-text); color: var(--bg); border-color: var(--sel-text); font-weight: 700; }
.h-rz-chip.on .h-av { background: var(--bg); color: var(--text-main); }
.h-rz-more { padding-left: 14px; cursor: pointer; }
.h-rz-more select, .h-seg-more select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.h-seg-more { position: relative; display: inline-grid; place-items: center; padding: 7px 10px; border-radius: 8px; color: var(--text-muted); font-size: 13px; cursor: pointer; }
.h-seg-more:hover { color: var(--text-main); }
.h-rz-kv { border-right-color: var(--border); }
.h-rz-kv > span { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.h-rz-kv > b { font-size: 19px; font-weight: 800; }
.h-rz-kv small { font-size: 12px; }
html.dark .h-rz-kv.hero { background: #1B1D17; }
html.dark .h-rz-kv.hero > span { color: #C6CF9E; }
html.dark .h-rz-kv.hero small { color: #A9B08A; }
html:not(.dark) .h-rz-kv.hero { background: #F6FADF; }
.h-rz-search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--ctl); border: 1px solid var(--ctl-border); border-radius: 10px; padding: 0 10px; height: 36px; width: 220px; max-width: 100%; }
.h-rz-search svg { width: 14px; height: 14px; fill: none; stroke: var(--text-faint); stroke-width: 2; flex: none; }
.h-rz-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-main); font: inherit; font-size: 13px; }
.h-rz-orghead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 13px 16px; }
.h-rz-org.is-open .h-rz-orghead { background: var(--card-2); }
.h-rz-caret { width: 20px; height: 24px; border: 0; background: transparent; color: var(--text-main); padding: 0; cursor: pointer; display: grid; place-items: center; font-size: 12px; }
.h-rz-caret span { display: inline-block; transition: transform .15s ease; }
.h-rz-org.is-open .h-rz-caret span { transform: rotate(90deg); }
.h-rz-org-name { flex: 0 1 auto; min-width: 140px; max-width: 340px; }
.h-rz-org-name .rz-in { font-size: 15px !important; font-weight: 700 !important; padding: 3px 6px !important; }
.h-rz-orgsum { margin-left: auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.h-rz-orgsum b { color: var(--text-main); }
.h-rz-body { display: none; }
.h-rz-org.is-open .h-rz-body, .rz-ledger.is-searching .h-rz-body { display: block; }
.h-rz-pill { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.h-rz-pill.ok { background: var(--h-ok-bg); color: var(--h-ok); }
.h-rz-pill.warn { background: var(--h-warn-bg); color: var(--h-warn); }
.h-rz-pill.bad { background: var(--h-bad-bg); color: var(--h-bad); }
.h-rz-pill.info { background: var(--h-info-bg); color: var(--h-info); }
.h-rz-head, .h-rz-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) 110px 110px 34px !important; padding: 11px 16px; }
.h-rz-head { padding-top: 8px; padding-bottom: 8px; border-top: 1px solid var(--line); }
.h-rz-head .r, .h-rz-row .r { text-align: right; }
.h-rz-row { border-top: 1px solid var(--line); }
.h-rz-row.is-sel { background: #1B1D17; box-shadow: inset 3px 0 0 var(--acid); }
html:not(.dark) .h-rz-row.is-sel { background: #F6FADF; }
.h-rz-total { background: var(--card-2); font-weight: 800; cursor: default; }
.h-rz-total:hover { background: var(--card-2) !important; }
.h-rz-add { display: block; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--acid-text); text-decoration: underline; text-underline-offset: 2px; }
.h-rz-save:not(.is-dirty):not(.is-saving) { display: none; }
.h-rz-drawer .rz-in { height: 36px; border-color: var(--border-strong) !important; background: var(--bg) !important; border-radius: 9px; }
@media (max-width: 700px) { .h-rz-row { grid-template-columns: minmax(0, 1fr) auto 18px !important; } .h-rz-total > span:nth-child(2), .h-rz-total > span:nth-child(3) { display: none; } }

.h-rz-org-name .rz-pick-trigger { opacity: 0; }
.h-rz-org-name:hover .rz-pick-trigger, .h-rz-org-name:focus-within .rz-pick-trigger { opacity: 1; }

/* ---------- Новые заказы (H-NewOrders) ---------- */
.h-no { display: flex; gap: 14px; align-items: flex-start; }
.h-no-pill { font-size: 13px; font-weight: 700; border-radius: 99px; padding: 6px 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.h-no-pill.warn { background: var(--h-warn-bg); color: var(--h-warn); }
.h-no-pill.bad { background: var(--h-bad-bg); color: var(--h-bad); }
.h-no-pill.ok { background: var(--h-ok-bg); color: var(--h-ok); }
.h-no-mgrs { flex: 0 0 210px; padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 8px; max-height: calc(100vh - 140px); overflow-y: auto; }
.h-no-cap { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); padding: 8px 10px 4px; }
.h-no-mg { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 0; background: transparent; color: var(--nav-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; width: 100%; }
.h-no-mg:hover { background: var(--hover); }
.h-no-mg.on { background: var(--av); color: var(--sel-text); font-weight: 700; }
.h-no-mg .h-av { width: 28px; height: 28px; font-size: 11px; }
.h-no-mg.on .h-av { background: var(--acid); color: var(--on-acid); }
.h-no-mg .nm { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.h-no-mg .wait { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--h-warn-bg); color: var(--h-warn); border-radius: 99px; padding: 1px 8px; }
.h-no-mg .cnt { margin-left: auto; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.h-no-list { flex: 0 0 290px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.h-no-tabs { display: flex; }
.h-no-tabs > button { flex: 1; padding: 7px 6px; }
.h-no-ord { display: flex; flex-direction: column; gap: 8px; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; width: 100%; font-variant-numeric: tabular-nums; }
.h-no-ord:hover { border-color: var(--border-strong); }
.h-no-ord.on { border-color: var(--acid); background: #1B1D17; }
html:not(.dark) .h-no-ord.on { background: #F6FADF; }
.h-no-ord .r1 { display: flex; gap: 8px; align-items: center; }
.h-no-ord .r1 b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-no-ord .r2 { font-size: 13px; color: var(--text-muted); }
.h-no-ord .r3 { display: flex; gap: 6px; align-items: center; }
.h-no-ord .r3 b { font-size: 16px; }
.h-no-ord .dt { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.h-no-age { margin-left: auto; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; white-space: nowrap; flex: none; }
.h-no-age.bad { background: var(--h-bad-bg); color: var(--h-bad); }
.h-no-age.warn { background: var(--h-warn-bg); color: var(--h-warn); }
.h-no-age.muted { background: var(--av); color: var(--nav-text); }
.h-no-age.ok { background: var(--h-ok-bg); color: var(--h-ok); }
.h-no-age.info { background: var(--h-info-bg); color: var(--h-info); }
.h-no-pay { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 3px 8px; white-space: nowrap; }
.h-no-pay.debt { background: #2A1C1A; color: var(--h-bad); }
.h-no-pay.cash { background: var(--h-ok-bg); color: var(--h-ok); }
.h-no-pay.tr { background: var(--h-info-bg); color: var(--h-info); }
.h-no-pay.muted { background: var(--av); color: var(--nav-text); }
html:not(.dark) .h-no-pay.debt { background: var(--h-bad-bg); }
.h-no-det { flex: 1 1 0; min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 8px; }
.h-no-steps { display: flex; align-items: flex-start; }
.h-no-st { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); text-align: center; flex: 1; min-width: 0; }
.h-no-st .dot { width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--av); color: var(--text-main); }
.h-no-st.done .dot { background: var(--h-ok); color: #0E0F11; }
.h-no-st.now { color: var(--h-warn); font-weight: 700; }
.h-no-st.now .dot { background: var(--h-warn-bg); color: var(--h-warn); box-shadow: 0 0 0 3px #4A3B17; }
.h-no-st.bad { color: var(--h-bad); font-weight: 700; }
.h-no-st.bad .dot { background: var(--h-bad-bg); color: var(--h-bad); }
.h-no-ln { flex: 1; height: 2px; background: var(--sel); margin-top: 13px; }
.h-no-ln.done { background: var(--h-ok); }
.h-no-items { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.h-no-ir { display: grid; grid-template-columns: minmax(0, 1fr) 92px 96px 70px 110px; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.h-no-ir .n { text-align: right; white-space: nowrap; }
.h-no-ir.head { border-top: 0; background: var(--card-2); font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding-top: 8px; padding-bottom: 8px; }
.h-no-ir.total { background: var(--card-2); font-weight: 800; }
.h-no-kvs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-variant-numeric: tabular-nums; }
.h-no-kv { background: var(--card-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.h-no-kv span { font-size: 12px; color: var(--text-faint); }
.h-no-ap { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 9px; background: var(--av); color: var(--nav-text); }
.h-no-ap.ok { background: var(--h-ok-bg); color: var(--h-ok); }
.h-no-ap.bad { background: var(--h-bad-bg); color: var(--h-bad); }
.h-no-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--border); padding-top: 14px; }
.h-no-reject { color: var(--h-bad) !important; border-color: #4A2A24 !important; }
@media (max-width: 1180px) {
  .h-no { flex-wrap: wrap; }
  .h-no-mgrs { flex: 1 1 100%; flex-direction: row; overflow-x: auto; position: static; max-height: none; }
  .h-no-mgrs .h-no-cap { display: none; }
  .h-no-mg { width: auto; flex: none; }
  .h-no-det { position: static; }
}
@media (max-width: 760px) {
  .h-no-list, .h-no-det { flex: 1 1 100%; }
  .h-no-ir { grid-template-columns: minmax(0, 1fr) 64px 52px 90px; }
  .h-no-ir > :nth-child(3) { display: none; }
  .h-no-kvs { grid-template-columns: 1fr; }
}

/* ---------- Клиенты (H-Clients) ---------- */
.h-cl-search { flex: 1 1 280px; width: 420px; max-width: 100%; margin-left: 4px; display: flex; align-items: center; gap: 8px; background: var(--ctl); border: 1px solid var(--ctl-border); border-radius: 12px; padding: 0 12px; height: 42px; }
.h-cl-search:focus-within { border-color: var(--ck); }
.h-cl-search svg { width: 16px; height: 16px; fill: none; stroke: var(--text-faint); stroke-width: 2; flex: none; }
.h-cl-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-main); font: inherit; font-size: 14px; }
#hHeadLeft:has(.h-cl-search) { flex: 1 1 300px; max-width: 460px; }
.h-cl-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 150px 40px !important; padding: 12px 16px; border-top-color: var(--line); }
.h-cl-head { padding-top: 10px; padding-bottom: 10px; border-top: 0; }
.h-cl-row.is-sel { background: #1B1D17; box-shadow: inset 3px 0 0 var(--acid); }
html:not(.dark) .h-cl-row.is-sel { background: #F6FADF; }
.h-cl-ava { width: 36px; height: 36px; border-radius: 12px; background: var(--av); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; color: var(--text-main); }
.h-cl-ava.big { width: 48px; height: 48px; border-radius: 16px; font-size: 20px; background: var(--acid); color: var(--on-acid); }
.h-cl-pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.h-cl-card { flex: 1 1 300px; max-width: 360px; padding: 18px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 8px; }
.h-cl-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.h-cl-act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border); color: var(--text-main); text-decoration: none; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.h-cl-act:hover { border-color: var(--border-strong); }
.h-cl-act.off { opacity: .45; cursor: default; }
.h-cl-act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.h-cl-debt { background: #1E1A12; border: 1px solid #4A3B17; border-radius: 14px; padding: 14px; font-variant-numeric: tabular-nums; }
.h-cl-debt .t1 { color: #F3E3B8; }
.h-cl-debt .v { font-size: 26px; font-weight: 800; color: var(--h-warn); }
.h-cl-debt .v span, .h-cl-debt .t2 { font-size: 13px; color: #C9B27A; }
.h-cl-debt .v span { font-size: 14px; }
html:not(.dark) .h-cl-debt { background: #FBF3DE; border-color: #EBD7A1; }
html:not(.dark) .h-cl-debt .t1 { color: #6B4E00; }
html:not(.dark) .h-cl-debt .v span, html:not(.dark) .h-cl-debt .t2 { color: #8A6A20; }
.h-cl-kvs { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.h-cl-kvs > div { display: flex; justify-content: space-between; gap: 10px; }
.h-cl-kvs > div > span:first-child { color: var(--text-faint); flex: none; }
.h-cl-kvs > div > span:last-child { text-align: right; overflow-wrap: anywhere; }
.h-cl-hist { display: flex; flex-direction: column; gap: 10px; border-left: 2px solid var(--av); padding-left: 12px; font-size: 13px; }
@media (max-width: 700px) { .h-cl-row { grid-template-columns: minmax(0, 1fr) auto 14px !important; } .h-cl-row > span:nth-child(2), .h-cl-row > span:nth-child(3) { display: none; } }

/* ---------- Бальная система (H-Scoreboard) ---------- */
.h-sb-hero { flex: 1 1 420px; min-width: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
html.dark .h-sb-hero { background: #1B1D17; border-color: #3A4220; }
html.dark .h-sb-hero .t { color: #C6CF9E; }
html.dark .h-sb-hero .s { color: #A9B08A; }
html.dark .h-sb-hero .h-sb-track { background: #2A3016; }
html:not(.dark) .h-sb-hero { background: #F6FADF; border-color: #DDE8A8; }
.h-sb-track { position: relative; display: block; height: 10px; border-radius: 99px; background: var(--av); }
.h-sb-track.big { height: 14px; }
.h-sb-track > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.h-sb-track > em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-main); opacity: .55; border-radius: 2px; }
.h-sb-pod { width: 100%; border-radius: 12px 12px 4px 4px; background: var(--av); display: grid; place-items: center; font-weight: 800; color: var(--nav-text); }
.h-sb-pod.first { background: #2A3016; color: var(--acid); }
html:not(.dark) .h-sb-pod.first { background: #EEF7C8; color: #3F6212; }
.h-sb-r, .h-sb-p { display: grid; gap: 12px; align-items: center; padding: 11px 16px; border: 0; border-top: 1px solid var(--line); font: inherit; font-size: 14px; width: 100%; background: transparent; color: var(--text-main); text-align: left; font-variant-numeric: tabular-nums; }
.h-sb-r { grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 2fr) 64px 64px 86px 86px 86px 96px; cursor: pointer; }
.h-sb-p { grid-template-columns: 34px minmax(0, 1.4fr) 100px 110px 100px 110px 110px 70px 110px; }
.h-sb-r:not(.head):hover { background: var(--hover); }
.h-sb-r .n, .h-sb-p .n { text-align: right; }
.h-sb-r.head, .h-sb-p.head { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding-top: 8px; padding-bottom: 8px; cursor: default; }

/* ---------- Команды (H-Teams) ---------- */
.h-tm-race { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 70px; gap: 14px; align-items: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.h-tm-race b:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-tm-race .h-sb-track > em { opacity: .18; }
.h-tm-race .h-sb-track > em.norm { opacity: .7; }
.h-tm-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
html.dark .h-tm-card.lead { border-color: #3A4220; background: #181A15; }
.h-tm-place { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--av); flex: none; }
.h-tm-card.lead .h-tm-place { background: var(--acid); color: var(--on-acid); }
.h-tm-m { display: grid; grid-template-columns: 30px minmax(0, 1fr) 54px; gap: 10px; align-items: center; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text-main); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.h-tm-m:hover b { text-decoration: underline; text-underline-offset: 3px; }
.h-tm-m.on { background: color-mix(in srgb, var(--acid) 8%, transparent); }
@media (max-width: 700px) { .h-tm-race { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 56px; } }

/* ============================================================
   Телефон (макет H-Phone): шапка «раздел + заголовок + иконки», нижняя панель из 5 кнопок
   ============================================================ */
#desktopHeader.h-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.h-head-tools { display: none; }
.h-tabbar { display: none; }
.h-mobile-head { display: none !important; }
@media (max-width: 767px) {
  #mobileHeader { display: none !important; }
  #desktopHeader.h-head { padding: 16px 16px 8px !important; gap: 10px; background: var(--bg) !important; border: 0 !important; height: auto !important; }
  #desktopHeader .h-title-wrap { flex: 1 1 auto; min-width: 0; order: 1; }
  #desktopHeader .h-crumb { font-size: 12px; }
  body[data-hpage="dashboard"] #desktopHeader .h-crumb, body[data-hpage="tasks"] #desktopHeader .h-crumb { display: none; }
  #desktopHeader #desktopTitle { font-size: 24px !important; white-space: normal; }
  .h-head-count { font-size: 17px; }
  .h-head-sub { font-size: 13px; }
  .h-head-tools { display: flex; gap: 8px; order: 2; margin-left: auto; align-self: flex-start; }
  .h-head-ico { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--ctl-border); background: var(--ctl); color: var(--text-main); display: grid; place-items: center; cursor: pointer; }
  .h-head-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  #hHeadLeft, #hHeadRight { order: 3; flex: 1 1 100%; margin-left: 0 !important; max-width: none !important; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  #hHeadLeft::-webkit-scrollbar, #hHeadRight::-webkit-scrollbar { display: none; }
  #hHeadRight { order: 4; }
  #hHeadLeft > *, #hHeadRight > * { flex: none; }
  #hHeadLeft .h-cl-search { flex: 1 1 auto; width: auto; }
  .h-search-f { display: none; }
  #content { padding: 6px 16px calc(96px + env(safe-area-inset-bottom)) !important; }
  .h-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--nav-bg) 96%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
  .h-tabbar button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border: 0; border-radius: 16px; background: transparent; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
  .h-tabbar button[hidden] { display: none; }
  .h-tabbar button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .h-tabbar button.on { background: var(--acid); color: var(--on-acid); font-weight: 800; }
  /* меню-шторка на телефоне — тот же вид, что и на компьютере */
  #sidebar { background: var(--nav-bg) !important; border-right: 1px solid var(--nav-border) !important; padding: 16px 10px calc(12px + env(safe-area-inset-bottom)); }
  .h-page { gap: 12px; }
  .h-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .h-kpi { padding: 12px 14px; }
  .h-kpi .val { font-size: 19px; }
  .h-card { border-radius: 16px; }
  .h-tk-add .h-btn { display: none; }
  .h-tk-add { height: 50px; }
  .h-no-pill { font-size: 12px; padding: 5px 10px; }
}

/* телефонные блоки страниц */
.h-ph-only { display: none !important; }
@media (max-width: 767px) {
  .h-ph-only { display: revert !important; }
  section.h-ph-only, div.h-ph-only { display: block !important; }
  div.h-ph-only[style*="display:flex"] { display: flex !important; }
  button.h-ph-only { display: flex !important; }
  .h-ph-hide { display: none !important; }
  .h-head-sub { display: none; }
  body[data-hpage="dashboard"] .h-head-sub { display: flex; }
  #desktopHeader .h-title-wrap { flex: 1 1 0; }
  body[data-hpage="tasks"] #hHeadRight { display: none; }
  .h-tk-main { flex-wrap: wrap; }
  .h-tk-main > div { flex: 1 1 calc(100% - 40px) !important; }
  .h-tk-main > .h-due { margin-left: 36px; }
  .h-ph-hero { padding: 16px; display: flex !important; flex-direction: column; gap: 4px; }
  html.dark .h-ph-hero { background: #1B1D17; border-color: #3A4220; }
  html.dark .h-ph-hero .t { color: #C6CF9E; }
  .h-ph-mini { background: var(--card-2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  html.dark .h-ph-hero .h-ph-mini { background: #12140F; }
  .h-ph-mini span { font-size: 12px; color: var(--text-muted); }
  .h-ph-mini b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .h-ph-alert { align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 16px; border: 1px solid #4A3B17; background: #1E1A12; color: var(--text-main); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
  html:not(.dark) .h-ph-alert { background: #FBF3DE; border-color: #EBD7A1; }
  .h-ph-grp { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--card-2); border-top: 1px solid var(--line); font-size: 14px; }
  .h-ph-grp:first-child { border-top: 0; }
  .h-ph-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px; border-top: 1px solid var(--line); }
}

/* ---------- Аналитика — в стиле холста ---------- */
#content .an { gap: 14px; }
#content .an-seg { align-self: flex-start; }
.h-head-sub .an-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; font-size: 14px; color: var(--text-muted); }
.h-head-sub .an-sub b { color: var(--text-main); }
.h-head-sub .an-sub i.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); }
#content .an-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
#content .an-panel { border-radius: 16px; border: 1px solid var(--border); background: var(--card); box-shadow: none; animation: none; }
#content .an-table thead th { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-faint); background: var(--card); padding: 10px 16px; border-bottom: 1px solid var(--line); }
#content .an-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
#content .an-name span { font-size: 14px; font-weight: 700; }
#content .an-dot { box-shadow: none; }
#content .an-badge { border-radius: 99px; }
#content .an-prog .track { background: var(--av); }
#content .an-money { font-size: 14px; }

/* ---------- Склад ---------- */
.h-f.js-chip.is-active { background: var(--sel-text) !important; color: var(--bg) !important; border-color: var(--sel-text) !important; box-shadow: none !important; }
.h-f.js-chip.is-active b { color: var(--bg) !important; }
.h-inv-row { display: grid; grid-template-columns: minmax(0, 2.4fr) 130px 70px 120px 120px 76px; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.h-inv-row.head { border-top: 0; font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding-top: 10px; padding-bottom: 10px; }
.h-inv-row .n { text-align: right; }
.h-inv-row:not(.head):hover { background: var(--hover); }
.h-inv-sku { font: 600 11px 'JetBrains Mono', ui-monospace, monospace; color: var(--text-faint); background: var(--card-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; flex: none; }
@media (max-width: 760px) { .h-inv-row { grid-template-columns: minmax(0, 1fr) 100px 60px; } .h-inv-row > :nth-child(3), .h-inv-row > :nth-child(4), .h-inv-row > :nth-child(5) { display: none; } }

/* ---------- Ожидаемые заказы ---------- */
.h-fo-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 110px 100px 120px; gap: 12px; align-items: center; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text-main); font: inherit; font-size: 14px; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.h-fo-row.head { border-top: 0; cursor: default; font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding-top: 10px; padding-bottom: 10px; }
.h-fo-row .n { text-align: right; }
button.h-fo-row:hover { background: var(--hover); }
.h-fo-row.is-sel { background: #1B1D17; box-shadow: inset 3px 0 0 var(--acid); }
html:not(.dark) .h-fo-row.is-sel { background: #F6FADF; }
@media (max-width: 760px) { .h-fo-row { grid-template-columns: minmax(0, 1fr) 90px; } .h-fo-row > :nth-child(2), .h-fo-row > :nth-child(3), .h-fo-row > :nth-child(5) { display: none; } }

/* ============================================================
   Звонки, Наличные (общий набор cl-*) — в стиле холста
   ============================================================ */
#content .cl { gap: 14px; }
#content .cl-head { align-items: center; }
#content .cl-head .cl-title { display: none; }
#content .cl-subtitle { margin-top: 0; font-size: 14px; color: var(--text-muted); }
#content .cl-tabs { padding: 3px; gap: 0; border-radius: 11px; border: 1px solid var(--ctl-border); background: var(--ctl); box-shadow: none; }
#content .cl-tab { height: auto; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 400; color: var(--text-muted); }
#content .cl-tab.is-active { background: var(--sel); color: var(--sel-text); font-weight: 700; box-shadow: none; }
#content .cl-tab .cnt { background: var(--av); color: var(--text-main); border-radius: 99px; }
#content .cl-tab .cnt.red { background: var(--h-bad-bg); color: var(--h-bad); }
#content .cl-pulsebtn { height: 38px; padding: 0 14px; border-radius: 10px; background: var(--ctl); color: var(--acid-text); font-size: 13px; box-shadow: none; border: 1px solid var(--ctl-border); }
#content .cl-input, #content .cl-select { height: 38px; border-radius: 10px; border: 1px solid var(--ctl-border); background: var(--ctl); font-size: 13px; }
#content .cl-btn { height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--ctl-border); background: var(--ctl); font-size: 13px; font-weight: 600; }
#content .cl-btn:hover { border-color: var(--ck); }
#content .cl-btn.primary { background: var(--acid); color: var(--on-acid); border-color: transparent; font-weight: 800; height: 38px !important; font-size: 13px !important; }
#content .cl-kpis { gap: 12px; }
#content .cl-kpi { border-left: 1px solid var(--border); border-radius: 16px; box-shadow: none; padding: 16px 18px; transition: none; }
#content .cl-kpi:hover { transform: none; border-color: var(--border-strong); }
#content .cl-kpi.is-active { border-color: var(--acid); box-shadow: inset 0 0 0 1px var(--acid); }
#content .cl-kpi .lbl { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
#content .cl-kpi .val { margin-top: 6px; font-size: 23px; color: var(--kc, var(--text-main)); }
#content .cl-panel { border-radius: 16px; box-shadow: none; }
#content .cl-table thead th { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-faint); background: var(--card); padding: 10px 16px; border-bottom: 1px solid var(--line); }
#content .cl-table td { font-size: 14px; border-bottom: 1px solid var(--line); }
#content .cl-table tbody tr.is-pending { background: color-mix(in srgb, var(--h-bad) 5%, transparent); }
#content .cl-badge { border-radius: 99px; font-size: 12px; padding: 3px 10px; }
#content .cl-green { background: var(--h-ok-bg); color: var(--h-ok); }
#content .cl-blue { background: var(--h-info-bg); color: var(--h-info); }
#content .cl-red { background: var(--h-bad-bg); color: var(--h-bad); }
#content .cl-yellow { background: var(--h-warn-bg); color: var(--h-warn); }
#content .cl-gray { background: var(--av); color: var(--nav-text); }
#content .cl-no { color: var(--h-bad); }
#content .cl-ok { color: var(--h-ok); }
#content .cl-warn { color: var(--h-warn); }
#content .cl-arrow.in { color: var(--h-ok); }
#content .cl-arrow.out { color: var(--h-info); }
#content .cl-play { border-radius: 10px; background: var(--ctl); border: 1px solid var(--ctl-border); }
#content .cl-heard { color: var(--h-ai); }
#content .cl-empty i { display: none; }
#content .cs-cards { gap: 12px; }
#content .cs-card { border-radius: 16px; box-shadow: none; padding: 16px; gap: 8px; }
#content .cs-amount { font-size: 26px; font-weight: 800; }
#content .cs-row { font-size: 14px; }
#content .cs-debt { border-radius: 12px; background: var(--card-2); font-size: 13px; }
#content .cs-debt.has-debt { background: #1E1A12; border: 1px solid #4A3B17; color: #F3E3B8; }
html:not(.dark) #content .cs-debt.has-debt { background: #FBF3DE; border-color: #EBD7A1; color: #6B4E00; }
#content .cs-note { border-left: 0; border-radius: 12px; background: var(--card-2); }
#content .cs-actions .cl-btn { height: 38px; font-size: 13px; }
#content .cs-seg { border-radius: 11px; border-color: var(--ctl-border); background: var(--ctl); padding: 3px; gap: 0; }
#content .cs-seg button { padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 400; }
#content .cs-seg button.on { background: var(--sel); color: var(--sel-text); font-weight: 700; }

/* ---------- Долги ---------- */
.h-dt-row { display: grid; grid-template-columns: 28px minmax(0, 2fr) 140px 100px 120px 100px 70px; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.h-dt-row.head { border-top: 0; font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding-top: 10px; padding-bottom: 10px; }
.h-dt-row .n { text-align: right; }
.h-dt-row:not(.head):hover { background: var(--hover); }
@media (max-width: 760px) { .h-dt-row { grid-template-columns: 24px minmax(0, 1fr) 110px; } .h-dt-row > :nth-child(n+4) { display: none; } }

/* старые шапки-«герои» внутри страниц (Доставка и др.): заголовок уже в шапке панели */
#content .k-hero { background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
#content .k-hero .k-title, #content .k-hero .k-eyebrow { display: none !important; }
#content .k-hero .k-lead { margin-top: 0 !important; font-size: 14px !important; }
#content .dl-kpis { gap: 12px; }
html.dark #content .dl-chip.is-go { color: var(--h-warn); }
html.dark #content .dl-chip.is-done { color: var(--h-ok); }
html.dark #content .dl-chip.is-cancel { color: var(--h-bad); }
#content .dl-chip { border-radius: 99px; height: 24px; padding: 0 10px; font-weight: 700; }
#content .dl-driver, #content .dl-card { border-color: var(--border); border-radius: 14px; }
#content .dl-bigbtn.is-done { color: #0E0F11; }
/* значок «ждут проверки» у Наличных — как остальные счётчики меню (таблетка) */
#navCash .cash-badge { background: var(--h-warn-bg) !important; color: var(--h-warn) !important; border-radius: 99px !important; height: auto !important; padding: 1px 8px !important; font-size: 12px !important; font-weight: 700 !important; line-height: 18px; }
#navCash.active .cash-badge { background: #2A2E35 !important; color: #ECEDEF !important; }
#content .dl-kpi { border-radius: 16px; border: 1px solid var(--border); background: var(--card); box-shadow: none; padding: 16px 18px; }
#content .dl-kpi span { font-size: 13px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-muted) !important; }
#content .dl-kpi b { font-size: 23px !important; font-weight: 800; }

/* ---------- Сотрудники ---------- */
.h-f.js-stat.is-active { background: var(--sel-text) !important; color: var(--bg) !important; border-color: var(--sel-text) !important; box-shadow: none !important; }
.h-f.js-stat.is-active b { color: var(--bg) !important; }
.h-us-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 130px 110px 130px 70px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.h-us-row.head { border-top: 0; cursor: default; font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.h-us-row:not(.head):hover { background: var(--hover); }
.h-us-ava { position: relative; width: 34px; height: 34px; border-radius: 99px; background: var(--av); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.h-us-ava i { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 99px; background: var(--ck); border: 2px solid var(--card); }
.h-us-ava i.on { background: var(--h-ok); }
@media (max-width: 760px) { .h-us-row { grid-template-columns: minmax(0, 1fr) auto; } .h-us-row > :nth-child(n+3):not(:last-child) { display: none; } .h-us-row > :nth-child(2) { display: none; } }

/* компактная пагинация (все страницы) */
.h-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.h-pager-size select { height: 32px; border-radius: 9px; border: 1px solid var(--ctl-border); background: var(--ctl); color: var(--text-main); font: inherit; font-size: 13px; padding: 0 8px; }
.h-pager-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ---------- Права доступа — в стиле холста ---------- */
#content .access-header { display: none !important; }
#content .role-manager-card { padding: 18px !important; border-radius: 16px !important; background: var(--card) !important; }
#content .role-manager-head > div:first-child > div:first-child { display: none; }
#content .role-manager-head h3 { margin-top: 0 !important; font-size: 16px !important; font-weight: 700 !important; }
#content .role-stat { background: var(--card-2) !important; border: 1px solid var(--border) !important; border-radius: 12px !important; box-shadow: none !important; }
#content .role-stat span { font-size: 12px !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-muted) !important; font-weight: 600 !important; }
#content .role-stat strong { font-size: 20px !important; }
#content .role-manager-add { height: 38px !important; padding: 0 14px !important; font-size: 13px !important; border-radius: 10px !important; }
#content .role-pill { background: var(--card-2) !important; background-image: none !important; border: 1px solid var(--border) !important; border-radius: 12px !important; box-shadow: none !important; padding: 12px 14px !important; }
#content .role-pill-label { font-size: 14px !important; font-weight: 700 !important; }
#content .role-pill-meta { font-size: 12px !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-faint) !important; }
#content .role-pill-lock { background: transparent !important; border: 0 !important; color: var(--text-faint) !important; box-shadow: none !important; }
#content .role-pill-btn { border-radius: 9px !important; border: 1px solid var(--ctl-border) !important; background: var(--ctl) !important; color: var(--text-main) !important; font-size: 12px !important; }
#content .role-pill-btn.is-danger { color: var(--h-bad) !important; }
#content .access-card { border-radius: 16px !important; background: var(--card) !important; box-shadow: none !important; }
#content .access-edit-btn { height: 34px; padding: 0 12px; border-radius: 10px !important; border: 1px solid var(--ctl-border) !important; background: var(--ctl) !important; color: var(--text-main) !important; font-size: 13px !important; font-weight: 600 !important; }
#content .access-perm-row { border-radius: 9px !important; border: 0 !important; font-size: 12.5px !important; padding: 6px 10px !important; }
#content .access-perm-row.is-on { background: var(--h-ok-bg) !important; color: var(--text-main) !important; }
#content .access-perm-row.is-on .access-perm-val { color: var(--h-ok) !important; }
#content .access-perm-row.is-off { background: var(--card-2) !important; color: var(--text-faint) !important; }
#content .access-perm-row.is-off .access-perm-val { color: var(--text-faint) !important; }
/* старые цветные кнопки-фильтры и прочее, что осталось на редких экранах */
#content .btn-chip { height: 34px !important; padding: 0 12px !important; border-radius: 99px !important; border: 1px solid var(--ctl-border) !important; background: var(--ctl) !important; color: var(--nav-text) !important; font-size: 13px !important; font-weight: 500 !important; box-shadow: none !important; }
#content .btn-chip.is-active, #content .btn-chip.active { background: var(--sel-text) !important; color: var(--bg) !important; border-color: var(--sel-text) !important; font-weight: 700 !important; }
#content .btn-chip-success:not(.is-active) { color: var(--h-ok) !important; }
#content .btn-chip-danger:not(.is-active) { color: var(--h-bad) !important; }
#content .btn-chip-warning:not(.is-active) { color: var(--h-warn) !important; }
#content .btn-chip-info:not(.is-active) { color: var(--h-info) !important; }
#content .btn-chip-violet:not(.is-active) { color: var(--h-ai) !important; }
#content .status-pill { border-radius: 99px !important; font-size: 12px !important; font-weight: 700 !important; padding: 3px 10px !important; border: 0 !important; }
#content .void-card { border-radius: 16px !important; }
.h-home-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 767px) {
  .h-home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-home-kpis .h-kpi.hero { grid-column: 1 / -1; }
  #hHeadLeft, #hHeadRight { flex-wrap: wrap; overflow: visible; }
  .h-rz-kv > b { font-size: 16px; white-space: normal; }
  .h-rz-search { width: 100% !important; margin-left: 0; }
  .h-no-mgrs { padding: 6px; }
}
@media (max-width: 767px) {
  #content div[style*="min-width:900px"], #content div[style*="min-width:860px"] { min-width: 0 !important; }
  .h-sb-r { grid-template-columns: 24px minmax(0, 1fr) 48px 56px; }
  .h-sb-r > :nth-child(3), .h-sb-r > :nth-child(n+6) { display: none; }
  .h-sb-p { grid-template-columns: 24px minmax(0, 1fr) 70px 80px; }
  .h-sb-p > :nth-child(n+4):not(:nth-child(8)):not(:last-child) { display: none; }
  .h-sb-p > :nth-child(8) { display: none; }
}

/* uikit подчёркивает и красит в синий любую ссылку при наведении — у нас карточки-ссылки и строки списков, это лишнее */
a:hover, a:focus { text-decoration: none; }
#content a:not(.h-link):hover, #sidebar a:hover, #desktopHeader a:hover { color: inherit; text-decoration: none; }
a.h-kpi:hover, a.h-att:hover, a.h-btn:hover, a.h-cl-act:hover { color: var(--text-main); text-decoration: none; }
.h-link:hover { text-decoration: underline; color: var(--acid-text); }
.h-ai-k:hover span, .h-tm-m:hover b { text-decoration: none; }
.h-tm-m:hover { background: var(--hover); }
.h-ai-k:hover { color: var(--h-ai); }
a.h-kpi { transition: border-color .15s ease, background-color .15s ease; }

/* ---------- карточка профиля внизу меню: две строки, не прилипает к краю ---------- */
#sidebar .sidebar-bottom { margin-top: 10px; padding: 10px 2px 6px !important; border-top: 1px solid var(--line) !important; }
@media (min-width: 768px) { #sidebar { padding-bottom: 14px; } }
#sidebar .h-me-card { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px !important; border: 1px solid var(--border) !important; border-radius: 14px; background: var(--card-2) !important; }
#sidebar .h-me-open { margin: 0; padding: 4px; gap: 10px; border-radius: 10px; transition: background-color .15s ease; }
#sidebar .h-me-open:hover, .h-me.is-open #sidebar .h-me-open { background: var(--hover); }
#sidebar #userAvatar.h-me-ava { width: 36px !important; height: 36px !important; background: var(--acid) !important; color: var(--on-acid) !important; font-weight: 800; }
.h-me-copy #userName { font-size: 14px !important; line-height: 1.25; }
.h-me-copy #userRole { font-size: 12px !important; line-height: 1.3; margin-top: 1px; }
.h-me-more { margin-left: auto; flex: none; width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-faint); border-radius: 7px; transition: transform .15s ease, color .15s ease; }
.h-me-more svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#sidebar .h-me-open:hover .h-me-more { color: var(--text-main); }
.h-me.is-open .h-me-more { transform: rotate(180deg); color: var(--text-main); }
#sidebar .h-lang { margin-left: 0 !important; width: 100%; display: grid !important; grid-template-columns: 1fr 1fr; padding: 3px !important; border-radius: 10px !important; background: var(--bg) !important; }
#sidebar .h-lang .lang-switch-btn { width: 100% !important; justify-content: center; padding: 6px 0 !important; border-radius: 8px !important; font-size: 12px !important; transition: background-color .15s ease, color .15s ease; }
#sidebar .h-lang .lang-switch-btn:hover { color: var(--text-main) !important; }
#sidebar .h-lang .lang-switch-btn.is-active, #sidebar .h-lang .lang-switch-btn.active { background: var(--sel) !important; color: var(--sel-text) !important; }
.h-me-menu { bottom: calc(100% + 8px) !important; }

/* ---------- заметные, но спокойные эффекты наведения ---------- */
a.h-kpi, .h-card, .h-tk, .h-no-ord, .h-btn, .h-f, .h-rz-chip, .nav-item { transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease, color .15s ease; }
a.h-kpi:hover { border-color: #3A3F47; background: #1A1C21; transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .7); }
html.dark a.h-kpi.hero:hover { border-color: #55611F; background: #20231A; }
html:not(.dark) a.h-kpi:hover { border-color: #C9CDC5; background: #FFFFFF; box-shadow: 0 10px 24px -16px rgba(16, 24, 40, .25); }
a.h-kpi .go { display: inline-flex; align-items: center; gap: 4px; transition: gap .15s ease; }
a.h-kpi:hover .go { gap: 8px; }
a.h-kpi:hover .go { color: var(--text-main); }
a.h-kpi:hover .go[style*="h-warn"] { color: var(--h-warn) !important; filter: brightness(1.15); }
.h-btn:hover { border-color: #3A3F47; background: #1C1E23; }
.h-btn.primary:hover { background: #E2FF4D; border-color: transparent; }
html:not(.dark) .h-btn:hover { background: #F4F5F2; border-color: #C9CDC5; }
.h-f:hover, .h-rz-chip:not(.on):hover { border-color: #3A3F47; color: var(--text-main); }
.h-tk:hover, .h-no-ord:not(.on):hover { border-color: #3A3F47; background: #191B20; }
html:not(.dark) .h-tk:hover, html:not(.dark) .h-no-ord:not(.on):hover { background: #FAFAF8; border-color: #C9CDC5; }
.h-att:hover, .h-mgr:hover, button.h-cl-row:hover, button.h-fo-row:hover, .h-sb-r:not(.head):hover, .h-rz-row:hover { background: #1A1C21; }
html:not(.dark) .h-att:hover, html:not(.dark) .h-mgr:hover, html:not(.dark) button.h-cl-row:hover, html:not(.dark) button.h-fo-row:hover, html:not(.dark) .h-sb-r:not(.head):hover, html:not(.dark) .h-rz-row:hover { background: #F4F5F2; }
.h-att:hover b { color: var(--text-main); }
#sidebar .h-me-open:hover, #sidebar .h-me.is-open .h-me-open { background: var(--av) !important; }
html:not(.dark) #sidebar .h-me-open:hover, html:not(.dark) #sidebar .h-me.is-open .h-me-open { background: #E9EBE6 !important; }
.h-me-copy #userRole { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
html.dark a.h-kpi:not(.hero):hover { border-color: #474D57; background: #1C1F24; }

/* ============================================================
   Реализация — прежняя разметка (как было до редизайна), но в цветах и деталях нового дизайна
   ============================================================ */
#content .rz-premium {
  --rz-violet: #D4FF00; --rz-blue: var(--h-info); --rz-green: var(--h-ok); --rz-purple: var(--h-ai); --rz-orange: var(--h-warn); --rz-danger: var(--h-bad);
  --rz-panel: var(--card); --rz-panel-2: var(--card-2); --rz-input: var(--bg); --rz-line: var(--border); --rz-line-soft: var(--line); --rz-shadow: none;
}
html:not(.dark) #content .rz-premium { --rz-violet: #84B000; }
#content .rz-premium .rz-tone-blue { --rz-tone: var(--h-info); }
#content .rz-premium .rz-tone-emerald { --rz-tone: var(--h-ok); }
#content .rz-premium .rz-tone-slate { --rz-tone: var(--h-ai); }
#content .rz-premium .rz-tone-amber { --rz-tone: var(--h-warn); }
/* верх: пояснение слева, период и кнопки справа */
#content .rz-premium .rz-command { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
#content .rz-premium .rz-command::before, #content .rz-premium .rz-command::after { display: none !important; }
#content .rz-premium .k-hero-top { display: flex !important; flex-wrap: wrap; align-items: center; gap: 12px; }
#content .rz-premium .rz-command-copy { flex: 1 1 260px; min-width: 0; }
#content .rz-premium .k-hero-actions { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 !important; }
#content .rz-premium .rz-period { background: var(--ctl) !important; border: 1px solid var(--ctl-border) !important; border-radius: 11px !important; box-shadow: none !important; }
#content .rz-premium .rz-period-control > span { color: var(--text-faint) !important; font-size: 11px !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 600 !important; }
#content .rz-premium .rz-period-control + .rz-period-control { border-left-color: var(--ctl-border) !important; }
#content .rz-premium .rz-period-button { color: var(--text-main) !important; background: transparent !important; }
#content .rz-premium .rz-period-menu { background: var(--card) !important; border-color: var(--border-strong) !important; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7) !important; }
#content .rz-premium .rz-period-menu button.is-selected { color: var(--sel-text) !important; background: var(--sel) !important; border-color: transparent !important; }
#content .rz-premium .rz-period-menu button:hover { background: var(--hover) !important; border-color: transparent !important; }
#content .rz-premium .k-btn { height: 38px !important; border-radius: 10px !important; border: 1px solid var(--ctl-border) !important; background: var(--ctl) !important; color: var(--text-main) !important; font-weight: 600 !important; box-shadow: none !important; transform: none !important; }
#content .rz-premium .k-btn:hover { border-color: #3A3F47 !important; background: #1C1E23 !important; }
#content .rz-premium .k-btn-primary { min-width: 0 !important; background: var(--acid) !important; color: var(--on-acid) !important; border-color: transparent !important; font-weight: 800 !important; }
#content .rz-premium .k-btn-primary:hover { background: #E2FF4D !important; }
#content .rz-premium .rz-save-btn:not(.is-dirty):not(.is-saving) { display: none !important; }
#content .rz-premium .rz-command-foot { border-top: 0 !important; padding-top: 0 !important; margin-top: 10px !important; }
#content .rz-premium .rz-command-foot span { background: transparent !important; border: 0 !important; color: var(--text-faint) !important; padding: 0 12px 0 0 !important; font-size: 12px !important; }
/* карточки итогов, журнал, организации */
#content .rz-premium .rz-metric { background: var(--card) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; box-shadow: none !important; }
#content .rz-premium .rz-metric::before, #content .rz-premium .rz-metric::after { display: none !important; }
#content .rz-premium .rz-metric .k-kpi-label { color: var(--rz-tone) !important; font-size: 13px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; }
#content .rz-premium .rz-metric .k-kpi-value { font-size: 26px !important; font-weight: 800 !important; }
#content .rz-premium .rz-metric-icon { background: color-mix(in srgb, var(--rz-tone) 12%, transparent) !important; border-color: color-mix(in srgb, var(--rz-tone) 25%, transparent) !important; color: var(--rz-tone) !important; box-shadow: none !important; }
#content .rz-premium .rz-metric-icon svg { stroke: var(--rz-tone) !important; }
#content .rz-premium .rz-registry-head, #content .rz-premium .rz-client-group, #content .rz-premium .rz-summary-card { background: var(--card) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; box-shadow: none !important; }
#content .rz-premium .rz-client-head { background: var(--card-2) !important; border-bottom-color: var(--line) !important; }
#content .rz-premium .rz-registry-icon { background: var(--acid) !important; color: var(--on-acid) !important; box-shadow: none !important; border-radius: 9px !important; }
#content .rz-premium .rz-client-no { background: var(--acid) !important; color: var(--on-acid) !important; box-shadow: none !important; border-radius: 9px !important; font-weight: 800 !important; }
#content .rz-premium .rz-add-product { background: var(--ctl) !important; border: 1px solid var(--ctl-border) !important; color: var(--text-main) !important; box-shadow: none !important; border-radius: 10px !important; height: 38px !important; font-weight: 600 !important; }
#content .rz-premium .rz-add-product:hover { border-color: #3A3F47 !important; background: #1C1E23 !important; filter: none !important; transform: none !important; }
#content .rz-premium .rz-add-product i { color: var(--acid-text); }
#content .rz-premium .rz-search { background: var(--ctl) !important; border: 1px solid var(--ctl-border) !important; border-radius: 10px !important; box-shadow: none !important; }
#content .rz-premium .rz-search:focus-within { border-color: var(--ck) !important; box-shadow: none !important; }
#content .rz-premium .rz-in { background: var(--bg) !important; border-color: var(--ctl-border) !important; border-radius: 9px !important; box-shadow: none !important; }
#content .rz-premium .rz-in:focus { border-color: var(--acid) !important; box-shadow: 0 0 0 3px var(--acid-dim) !important; }
#content .rz-premium .rz-in.rz-dirty { border-color: var(--h-warn) !important; }
#content .rz-premium .rz-in.rz-saved { border-color: var(--h-ok) !important; }
#content .rz-premium .rz-in.rz-error { border-color: var(--h-bad) !important; }
#content .rz-premium .rz-pick-trigger { background: var(--ctl) !important; border-color: var(--ctl-border) !important; border-radius: 9px !important; color: var(--text-faint) !important; }
#content .rz-premium .rz-ic-del { background: var(--ctl) !important; border-color: var(--ctl-border) !important; border-radius: 9px !important; }
#content .rz-premium .rz-ic-del:hover { border-color: color-mix(in srgb, var(--h-bad) 45%, var(--ctl-border)) !important; color: var(--h-bad) !important; }
#content .rz-premium .rz-carry-pill { background: var(--h-info-bg) !important; color: var(--h-info) !important; border: 0 !important; border-radius: 99px !important; }
#content .rz-premium .rz-calc-cell, #content .rz-premium .rz-result { background: var(--card-2) !important; border-color: var(--line) !important; box-shadow: none !important; }
#content .rz-premium .rz-product-row:hover { background: color-mix(in srgb, var(--hover) 60%, transparent) !important; }
#content .rz-premium .rz-product-labels span, #content .rz-premium .rz-client-name > span, #content .rz-premium .rz-client-stats span { letter-spacing: .03em !important; color: var(--text-faint) !important; }
#content .rz-premium .rz-summary-item > i { box-shadow: none !important; }
#content .rz-premium::before, #content .rz-premium::after { display: none !important; }
#content .rz-premium .k-hero-actions .k-btn, #content .rz-premium .rz-period { align-self: center; }
@media (max-width: 767px) {
  #content .rz-premium .rz-metrics { grid-template-columns: minmax(0, 1fr) !important; }
  #content .rz-premium .rz-metric { min-height: 0 !important; padding: 16px !important; }
  #content .rz-premium .rz-metric .k-kpi-value { font-size: 22px !important; }
  #content .rz-premium .rz-metric-icon { width: 40px !important; height: 40px !important; }
  #content .rz-premium .k-hero-actions .rz-notify-btn { display: none !important; }
}

/* Новые заказы: «ждём» у проверяющего + колокольчик «Напомнить» */
.h-no-ap { display: inline-flex; align-items: center; gap: 6px; }
.h-no-ap.wait { background: var(--h-warn-bg); color: var(--h-warn); }
.h-no-pen { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 8px; vertical-align: -6px; border-radius: 7px; border: 1px solid var(--ctl-border); background: var(--ctl); color: var(--text-muted); cursor: pointer; }
.h-no-pen svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.h-no-pen:hover { color: var(--acid-text); border-color: var(--ck); }
.h-no-bell { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; padding: 2px 8px 2px 6px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--h-warn) 40%, transparent); background: transparent; color: var(--h-warn); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; transition: background-color .15s ease; }
.h-no-bell:hover { background: color-mix(in srgb, var(--h-warn) 16%, transparent); }
.h-no-bell svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.h-no-bell[disabled] { opacity: .6; cursor: default; }
.h-no-bell.sent { border-color: transparent; color: var(--h-ok); }
