/* © 2026 ООО «Спецэкоэра». Все права защищены. */
/* =====================================================================
   База и оболочка: сброс, типографика, боковое меню, верхняя панель,
   сетки страниц, адаптивность (1440 / 1024 / 768 / 375).
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-md); line-height: var(--lh-md);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); letter-spacing: var(--tracking-tight); }
h1 { font-size: var(--fs-2xl); line-height: var(--lh-2xl); font-weight: var(--fw-bold); }
h2 { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-semibold); }
h3 { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
.ico { flex: none; display: inline-block; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
::selection { background: var(--primary-soft); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .95em; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--surface); padding: 8px 12px; border-radius: var(--r-md); }
.skip-link:focus { left: 8px; }

/* ---------- Оболочка ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--dur-3) var(--ease); }
.app.is-collapsed { grid-template-columns: var(--side-w-collapsed) minmax(0, 1fr); }

.side {
  position: sticky; top: 0; height: 100vh; z-index: var(--z-side);
  display: flex; flex-direction: column; background: var(--side-bg); color: var(--side-text);
  border-right: 1px solid var(--side-border); overflow: hidden;
}
.side__brand { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 18px; border-bottom: 1px solid var(--side-border); color: #fff; text-decoration: none; flex: none; }
.side__brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, #2a78d6, #12a594); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.side__name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.side__name b { font-size: 14px; font-weight: 700; white-space: nowrap; }
.side__name small { font-size: 11px; color: var(--side-text-2); white-space: nowrap; }
.side__nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side__group { margin-top: 14px; }
.side__group:first-child { margin-top: 4px; }
.side__label { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--side-text-2); white-space: nowrap; }
.side__link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px;
  border-radius: var(--r-md); color: var(--side-text); text-decoration: none; white-space: nowrap; font-weight: 500;
  transition: background var(--dur-1), color var(--dur-1);
}
.side__link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side__link[aria-current="page"] { background: var(--side-active-bg); color: var(--side-active); }
.side__link[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #4fd1c1; }
.side__link .ico { opacity: .9; }
.side__count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: rgba(255,255,255,.1); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.side__count.is-hot { background: #c42b1c; color: #fff; }
.side__foot { flex: none; padding: 10px; border-top: 1px solid var(--side-border); display: grid; gap: 4px; }
.side__copy { display: block; padding: 6px 10px 2px; font-size: 11px; color: var(--side-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__copy:hover { color: var(--side-text); }
.app.is-collapsed .side__copy { display: none; }
@media (max-width: 1100px) { .app:not(.is-expanded) .side__copy { display: none; } }
.side__collapse { width: 100%; background: none; border: 0; cursor: pointer; }
.app.is-collapsed .side__name, .app.is-collapsed .side__label span, .app.is-collapsed .side__link span, .app.is-collapsed .side__count { display: none; }
.app.is-collapsed .side__label { height: 1px; margin: 0 8px 8px; padding: 0; background: var(--side-border); }
.app.is-collapsed .side__link { justify-content: center; padding: 0; }
.app.is-collapsed .side__brand { justify-content: center; padding: 0; }
.app.is-collapsed .side__collapse .ico { transform: scaleX(-1); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: var(--z-top); height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.top .top__burger { display: none; }
.top__search {
  flex: 1 1 140px; min-width: 0; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-3); cursor: text; text-align: left;
}
.top__search:hover { border-color: var(--border-strong); }
.top__search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: var(--r-xs); background: var(--surface); font-size: 11px; font-weight: 600; color: var(--text-2); font-family: var(--font); white-space: nowrap; }
.top__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top__ai { gap: 8px; }
.top__dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
.profile { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: var(--r-md); background: none; border: 0; cursor: pointer; text-align: left; }
.profile:hover { background: var(--surface-3); }
.profile__who { line-height: 1.15; }
.profile__who b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; }
.profile__who small { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 24px 24px 48px; min-width: 0; }

/* Шапка экрана: заголовок + «что здесь и что делать» + кнопка помощи + действия */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head__text { flex: 1 1 360px; min-width: 0; }
.page-head__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head__lead { margin-top: 4px; color: var(--text-2); font-size: var(--fs-md); max-width: 760px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs .ico { width: 14px; height: 14px; opacity: .6; }

/* Сетки */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1279px) { .grid-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.layout-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1279px) {
  .layout-main-side { grid-template-columns: minmax(0, 1fr) 320px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: var(--side-w-collapsed) minmax(0, 1fr); }
  .app:not(.is-expanded) .side__name, .app:not(.is-expanded) .side__label span, .app:not(.is-expanded) .side__link span, .app:not(.is-expanded) .side__count { display: none; }
  .app:not(.is-expanded) .side__label { height: 1px; margin: 0 8px 8px; padding: 0; background: var(--side-border); }
  .app:not(.is-expanded) .side__link { justify-content: center; padding: 0; }
  .app:not(.is-expanded) .side__brand { justify-content: center; padding: 0; }
  .app.is-expanded .side { position: fixed; left: 0; width: var(--side-w); box-shadow: var(--shadow-lg); }
  .layout-main-side { grid-template-columns: minmax(0, 1fr); }
  .profile__who { display: none; }
  .top__ai span, .top__search .kbd { display: none; }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 767px) {
  .app, .app.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform var(--dur-3) var(--ease); box-shadow: var(--shadow-lg); }
  .app.is-expanded .side { transform: none; width: min(300px, 86vw); }
  .app .side__name, .app .side__label span, .app .side__link span, .app .side__count { display: initial !important; }
  .app .side__count { display: grid !important; }
  .app .side__link { justify-content: flex-start !important; padding: 0 10px !important; }
  .app .side__brand { justify-content: flex-start !important; padding: 0 18px !important; }
  .app .side__label { height: auto !important; background: none !important; margin: 0 !important; padding: 0 10px 6px !important; }
  .side__collapse { display: none !important; }
  .top { padding: 0 12px; gap: 6px; }
  .top .top__burger { display: inline-flex; }
  .top__search { max-width: none; }
  .top__search .kbd, .top__ai span { display: none; }
  .content { padding: 16px 16px 40px; }
  h1 { font-size: var(--fs-xl); line-height: var(--lh-xl); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3 { grid-column: auto; }
  .page-head { margin-bottom: 16px; }
  .page-head__actions { width: 100%; }
  .page-head__actions > .btn { flex: 1 1 auto; justify-content: center; }
  .hide-sm { display: none !important; }
}
@media (max-width: 420px) {
  .top__theme { display: none; }
}
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: calc(var(--z-side) - 1); opacity: 0; pointer-events: none; transition: opacity var(--dur-2); }
.app.is-expanded .scrim { opacity: 1; pointer-events: auto; }
@media (min-width: 1101px) { .scrim { display: none; } }

@media print {
  .side, .top, .page-head__actions, .help-btn { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}

/* ---------- Полоса «Демо-режим» ---------- */
.demo-strip { display: flex; align-items: center; gap: 12px; padding: 7px 24px; background: repeating-linear-gradient(135deg, var(--warning-soft) 0 14px, color-mix(in srgb, var(--warning-soft) 70%, var(--surface)) 14px 28px); border-bottom: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border)); font-size: 13px; color: var(--text-2); }
.demo-strip__badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-full); background: var(--warning); color: var(--text-inverse); font-weight: 700; font-size: 12px; white-space: nowrap; }
.demo-strip__text { flex: 1; min-width: 0; }
.demo-strip__btn { flex: none; }
@media (max-width: 767px) { .demo-strip { padding: 6px 12px; flex-wrap: wrap; gap: 6px 10px; } .demo-strip__text { font-size: 12px; flex-basis: calc(100% - 120px); } .demo-strip__btn { margin-left: auto; } }
@media (max-width: 420px) { .demo-strip__text { display: none; } }

/* =====================================================================
   Визуальный слой 2.0: глубина, воздух, фирменный градиент
   ===================================================================== */
body {
  background:
    radial-gradient(1100px 520px at 105% -8%, var(--bg-glow-2), transparent 62%),
    radial-gradient(900px 480px at 18% -12%, var(--bg-glow-1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.app, .content, .m-wrap, .login, .st, .ix, .p-main { position: relative; z-index: 1; }
.content { padding: 28px 32px 56px; }
.grid { gap: 20px; }
.mt-4 { margin-top: 20px; }
.page-head { margin-bottom: 24px; }
h1 { font-size: 26px; line-height: 34px; letter-spacing: -0.02em; }
.logo { background: var(--brand-grad); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 4px 14px -4px rgba(18, 134, 181, .6); border-radius: 10px; }
.side { background: linear-gradient(180deg, var(--side-bg-2) 0%, var(--side-bg) 38%); }
.side__link[aria-current="page"] { background: linear-gradient(90deg, rgba(42, 120, 214, .32), rgba(18, 165, 148, .10)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.side__link[aria-current="page"]::before { background: linear-gradient(180deg, #5aa2ff, #4fd1c1); }
.top { background: color-mix(in srgb, var(--surface) 78%, transparent); }
@media (max-width: 767px) { .content { padding: 16px 16px 40px; } .grid { gap: 14px; } }
