/* ══ Тема 2 (09.11.2026): единый стиль с дашбордами площадок ═══════════════════
   Подключается после app.css и перекрывает его. Тёплый светлый фон, графитовое меню,
   карточки 18px с мягкой тенью, линейные иконки (_icons.html), тёмные основные кнопки,
   синий #2a78d6 — для данных, ссылок и фокуса. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e7e4dc;
  --line-strong: #d6d2c6;
  --text: #14130f;
  --text-2: #56544d;
  --muted: #8c897f;
  --ink: #14130f;
  --brand: #2a78d6;
  --brand-soft: #eaf2fc;
  --ok: #0b7a0b; --ok-soft: #e6f4e6;
  --warn: #8a5a00; --warn-soft: #fdf1d8;
  --danger: #b02c2c; --danger-soft: #fbe9e7;
  --info: #2a78d6; --info-soft: #eaf2fc;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,19,15,.04), 0 8px 24px rgba(20,19,15,.06);
  --shadow-sm: 0 1px 2px rgba(20,19,15,.04), 0 4px 14px rgba(20,19,15,.04);
}
body { background: var(--bg); color: var(--text); font-feature-settings: "tnum"; }
::selection { background: #d6e6f8; }
a { color: var(--brand); }
h1, h2, h3 { letter-spacing: -.02em; }
.ico { display: inline-block; vertical-align: middle; }

/* ── меню ── */
.sidebar { width: 252px; flex-basis: 252px; background: #14130f; color: #cfcbc0; padding: 20px 12px 18px; gap: 16px;
  scrollbar-width: thin; scrollbar-color: #3a3833 transparent; }
.brand { padding: 2px 8px 6px; gap: 11px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: #f6f4ef; color: #14130f; flex: none;
  font-size: 18px; font-weight: 800; letter-spacing: -.5px; box-shadow: inset 0 -2px 0 rgba(20,19,15,.12); }
.brand-text { color: #f6f4ef; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { color: #8c897f; font-size: 11.5px; font-weight: 500; margin-top: 2px; letter-spacing: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; margin: -4px 0 -2px; align-self: flex-start;
  border-radius: 9px; font-size: 12.5px; font-weight: 600; color: #8c897f; background: none; border: 0; }
.back-link .ico { width: 15px; height: 15px; }
.back-link:hover { color: #f6f4ef; background: rgba(255,255,255,.05); text-decoration: none; }
.nav-group { gap: 1px; }
.nav-title { font-size: 10.5px; letter-spacing: .1em; color: #6f6c63; padding: 6px 10px 5px; font-weight: 700; }
.nav-link { position: relative; gap: 11px; padding: 8px 10px; border-radius: 10px; color: #cfcbc0;
  font-size: 13.5px; font-weight: 500; line-height: 1.3; transition: background .12s ease, color .12s ease; }
.nav-link .ico { width: 18px; height: 18px; flex: none; opacity: .72; transition: opacity .12s ease; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #f6f4ef; }
.nav-link:hover .ico { opacity: 1; }
.nav-link.active { background: rgba(255,255,255,.09); color: #fff; font-weight: 600; }
.nav-link.active .ico { opacity: 1; color: #8fbcf0; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: #2a78d6; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-mp { flex: none; width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center;
  font-size: 8.5px; font-weight: 800; letter-spacing: 0; color: #14130f; background: #cfcbc0; text-transform: uppercase; }
.nav-mp.mp-wb { background: #c4b0ee; }
.nav-mp.mp-oz, .nav-mp.mp-ozon { background: #a8c9f3; }
.nav-mp.mp-la, .nav-mp.mp-lamoda { background: #ebe8e0; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 4px 0 8px; font-size: 13px; color: #f6f4ef; font-weight: 600; }
.who-text { flex: 1; min-width: 0; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; color: #8c897f; font-weight: 500; font-size: 11.5px; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #2b2a26; color: #f6f4ef; font-weight: 700; font-size: 13px; border: 1px solid #3a3833; }
.who-out { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #8c897f; }
.who-out .ico { width: 17px; height: 17px; }
.who-out:hover { background: rgba(255,255,255,.07); color: #f6f4ef; }

/* ── верхняя полоса ── */
.topbar { background: rgba(246,244,239,.88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); padding: 16px 28px; }
.topbar h1 { font-size: 22px !important; font-weight: 800; letter-spacing: -.025em; }
.topbar .small.muted { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.content { padding: 24px 28px 64px; }

/* ── карточки, плитки ── */
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); padding: 18px 20px; }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.metric-value { font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.metric-label { font-size: 12px; color: var(--text-2); text-transform: none; letter-spacing: 0; font-weight: 600; }
.channel-card, .section-card { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.channel-card:hover, .section-card:hover { border-color: var(--line-strong); box-shadow: 0 2px 4px rgba(20,19,15,.05), 0 14px 34px rgba(20,19,15,.09); }
.plate { background: var(--surface-2); border-color: var(--line); border-radius: 14px; }
.plate-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text-2); }
.hbar-track, .bar { background: #efede7; }
.chart-bar.is-last { fill: #eb6834; }
.report-text { border-radius: 14px; }
.empty { color: var(--muted); }

/* ── бейджи ── */
.badge { border-radius: 999px; font-weight: 700; padding: 3px 9px; border: 0; background: #f1efe9; color: var(--text-2); }
.badge.brand, .badge.info { background: var(--brand-soft); color: #1d5fae; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.solid-danger { background: var(--danger); color: #fff; }
.scheme-chip { background: #14130f; border-radius: 6px; }
.scheme-chip.fbo { background: #2a78d6; }
.scheme-chip.fbs { background: #6a4fc2; }

/* ── таблицы ── */
th { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted);
  background: transparent; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid var(--line); }
tbody tr:hover, tbody tr:hover .col-sticky { background: #faf9f6; }
th.col-sticky { background: #fff; }
.size-chip { background: #f6f4ef; border-color: var(--line); border-radius: 7px; }

/* ── кнопки, вкладки, поля ── */
.btn { border-radius: 10px; border-color: var(--line); font-weight: 600; box-shadow: 0 1px 1px rgba(20,19,15,.03); }
.btn:hover { background: #faf9f6; border-color: var(--line-strong); }
.btn.primary { background: #14130f; border-color: #14130f; color: #f6f4ef; }
.btn.primary:hover { background: #2b2a26; border-color: #2b2a26; }
.btn.ghost { box-shadow: none; }
.btn.ghost:hover { background: rgba(20,19,15,.05); }
.btn .ico { width: 16px; height: 16px; }
.tab { border-radius: 999px; border-color: var(--line); color: var(--text-2); font-weight: 600; }
.tab:hover { border-color: var(--line-strong); background: #fff; color: var(--text); }
.tab.active, .mode-btn.active { background: #14130f; border-color: #14130f; color: #f6f4ef; }
.pill:hover, .pill.active { border-color: #14130f; }
.pill.active { background: #f1efe9; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], select, textarea { border-color: var(--line-strong); border-radius: 10px; }
input:focus, select:focus, textarea:focus { border-color: #2a78d6; box-shadow: 0 0 0 3px rgba(42,120,214,.15); }
.scan-panel #scan-input { border-color: #14130f; background: #fff; }
.scan-panel #scan-input:focus { box-shadow: 0 0 0 4px rgba(42,120,214,.16); }
.alert { border-radius: 12px; }
.alert.info { background: var(--info-soft); color: #1d5fae; border-color: #d3e4f8; }
details.box { border-radius: 14px; }

/* ── вход ── */
.login-wrap { background: radial-gradient(900px 480px at 20% -10%, #2b2a26 0%, #14130f 60%, #0c0b09 100%); }
.login-card { border-radius: 22px; }

/* ── главная ── */
.home-hero { background: #14130f; color: #f6f4ef; border-radius: 22px; padding: 26px 28px; margin-bottom: 18px;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; }
.home-hero h2 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 0; color: #f6f4ef; }
.home-hero .hint { color: #b9b5aa; font-size: 14px; margin-top: 6px; }
.home-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.home-stats .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.home-stats .l { font-size: 12px; color: #b9b5aa; font-weight: 600; margin-top: 2px; }
.home-stats .v.bad { color: #ff9b8f; }
.home-stats .v.good { color: #9fdc9f; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.home-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px 22px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.home-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 2px 4px rgba(20,19,15,.05), 0 16px 38px rgba(20,19,15,.10); }
.home-card .hc-top { display: flex; align-items: center; gap: 14px; padding-right: 26px; }
.home-card .hc-ico { width: 46px; height: 46px; border-radius: 14px; background: #14130f; color: #f6f4ef; display: grid; place-items: center; flex: none; }
.home-card .hc-ico .ico { width: 23px; height: 23px; }
.home-card h3 { font-size: 19px; font-weight: 800; margin: 0; }
.home-card h3 a { color: var(--text); }
.home-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.home-card h3 a:hover { text-decoration: none; }
.home-card .hc-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.home-card .hc-metrics { display: flex; gap: 26px; margin: 20px 0 14px; flex-wrap: wrap; }
.home-card .hc-metrics .v { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.home-card .hc-metrics .l { font-size: 12px; color: var(--text-2); font-weight: 600; margin-top: 3px; }
.home-card .hc-status { margin-bottom: 14px; }
.home-card .hc-links { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 1; }
.home-card .hc-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  padding: 5px 10px; border-radius: 999px; background: #f6f4ef; border: 1px solid var(--line); }
.home-card .hc-links a .ico { width: 14px; height: 14px; }
.home-card .hc-links a:hover { color: var(--text); border-color: var(--line-strong); text-decoration: none; background: #fff; }
.home-card .hc-go { position: absolute; top: 24px; right: 20px; color: var(--muted); }
.home-card .hc-go .ico { width: 18px; height: 18px; }
.home-card:hover .hc-go { color: var(--text); }
@media (max-width: 1000px) { .home-hero { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-hero h2 { font-size: 24px; } }

@media (max-width: 900px) {
  .sidebar { width: 100%; flex-basis: auto; }
  .nav-link.active::before { display: none; }
}
@media print { .topbar { backdrop-filter: none; } }
.tab .ico { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }
.card-head h2 .ico, .card-head h3 .ico, .topbar h1 .ico { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; color: var(--muted); }
.home-quick { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.home-quick .hq { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.07); color: #e9e6dd; font-size: 13px; font-weight: 600; border: 1px solid rgba(255,255,255,.08); }
.home-quick a.hq:hover { background: rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.home-quick .hq .ico { width: 16px; height: 16px; }
.home-quick .hq.bad { color: #ffb4aa; } .home-quick .hq.good { color: #a9e2a9; }
@media (max-width: 1000px) { .home-quick { align-items: flex-start; } }
