/* Стили для живых данных: состояния загрузки, ошибки источников, фильтры, журнал. */
.live-loading { color: #8a9a97; padding: 28px 4px; font-size: 13px; }
.muted { color: #8a9a97; }
.updated-at { color: #8a9a97; font-size: 12px; align-self: center; }
.home-filters { margin-bottom: 8px; }
.home-note { margin: 0 0 14px; }
.home-market { margin-bottom: 15px; }
.home-market[hidden] { display: none; }
.nav-item[hidden], .system-label[hidden] { display: none !important; }
.access-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 16px 0; }
.access-form label { display: grid; gap: 5px; font-size: 12px; color: #607773; flex: 1 1 220px; }
.access-form input { min-height: 36px; border: 1px solid #dfe7e5; border-radius: 10px; padding: 0 10px; font: inherit; }
.access-form select { min-height: 36px; border: 1px solid #dfe7e5; border-radius: 10px; padding: 0 10px; font: inherit; }
.access-form #new-manager-sections { flex-basis: 100%; }
.access-sections { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 14px; }
.access-sections label { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 160px; color: #263c39; font-size: 13px; }
.access-sections input { width: 16px; height: 16px; min-height: 0; accent-color: #17685f; }
.access-details { border-top: 1px solid #e4ece9; padding: 9px 0 14px; }
.access-details summary { cursor: pointer; color: #17685f; }
.access-details [role="status"] { margin-left: 10px; }
.home-shop { grid-template-columns: minmax(180px, 1.5fr) minmax(115px, 1fr) minmax(90px, .7fr) auto auto; gap: 10px; }
.home-business { padding: 12px 4px 5px; color: #607773; font-size: 12px; font-weight: 700; }
.home-section-title { font-size: 18px; margin: 25px 0 12px; }
@media (max-width: 760px) { .home-shop { grid-template-columns: 1fr 1fr; } .home-shop > div:first-child { grid-column: 1 / -1; }
  .home-market[data-home-metric="buyouts"] .home-shop .market-stat:nth-child(4) { display: block; }
}

.src-error { display: grid; gap: 3px; padding: 12px 14px; margin: 6px 0; border-radius: 12px;
  background: #fdf1ec; border: 1px solid #f2d3c6; color: #8e4a2e; font-size: 13px; }
.src-error b { font-weight: 600; }
.src-error small { color: #b07a63; font-size: 11px; }

.demo-banner { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; font-size: 13px;
  background: #fff6e5; border: 1px solid #f1dfb4; color: #8a6420; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.filters select, .filters input { height: 36px; border: 1px solid #dfe7e5; border-radius: 10px; padding: 0 10px;
  font: inherit; font-size: 13px; background: #fff; }
.filters input { flex: 1 1 260px; min-width: 0; }
.filters #product-custom { flex: none; width: 16px; height: 16px; min-height: 0; accent-color: #17685f; }

.reason-cell { font-size: 12px; color: #6f7f7c; max-width: 260px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; color: #6f7f7c; }

.automation-row { grid-template-columns: minmax(220px, 2fr) auto 1fr 1fr 1.4fr auto; }
.err-line { margin-top: 4px; font-size: 11px; color: #b0583a; word-break: break-word; }
.result-cell span { font-size: 12px; color: #6f7f7c; }

.log-box { background: #0f1f1d; color: #d7e6e2; border-radius: 12px; padding: 12px; font-size: 11.5px; line-height: 1.5;
  max-height: 70vh; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.plain-list { margin: 0; padding-left: 18px; font-size: 13px; }
.login-error { color: #b0583a; min-height: 16px; }
.status-dot.bad { background: #d0694a; box-shadow: 0 0 0 4px #fbe6de; }

@media (max-width: 760px) {
  .automation-row { grid-template-columns: 1fr; }
  .reason-cell { max-width: none; }
}
.queue-row { grid-template-columns: 1.4fr repeat(4, minmax(70px, .7fr)) auto; }
@media (max-width: 760px) { .queue-row { grid-template-columns: 1fr 1fr; } }

/* Аналитика: график выручки, легенда, рекламная воронка */
.sales-chart { width: 100%; height: auto; display: block; }
.sales-chart .bar-rev { fill: #1a4b45; opacity: .85; }
.sales-chart .bar-rev:hover { opacity: 1; }
.sales-chart .bar-gap { fill: #cbd5d2; }
.sales-chart .bar-zero { fill: #7d9b92; }
.sales-chart .line-ad { fill: none; stroke: #c9963b; stroke-width: 2; }
.sales-chart .axis { fill: #8a9a97; font-size: 11px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #6f7f7c; margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend .lg-rev { background: #1a4b45; height: 10px; }
.legend .lg-ad { background: #c9963b; }
.funnel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.funnel > div:not(.arr) { flex: 1 1 120px; background: #f4f8f7; border-radius: 12px; padding: 12px; }
.funnel b { display: block; font-size: 20px; }
.funnel span { font-size: 12px; color: #6f7f7c; }
.funnel .arr { color: #8a9a97; font-size: 18px; }
.down { color: #b0583a; }
#an-days { margin-top: 10px; }

/* Меню на телефоне: вместо узкой полосы с обрезанными подписями — выезжающее меню по кнопке ☰ */
.nav-toggle, .nav-shade { display: none; }
@media (max-width: 760px) {
  .topbar { gap: 10px; justify-content: flex-start; }
  .topbar .top-actions { margin-left: auto; }
  .nav-toggle { display: inline-grid; place-items: center; flex: none; }
  .sidebar { width: 264px; padding: 22px 14px 16px; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; }
  body.nav-open .sidebar { transform: none; box-shadow: 14px 0 30px rgba(20, 55, 51, .25); }
  .brand { padding: 0 10px 25px; }
  .brand > div:last-child, .workspace-switch > div, .nav-label, .sidebar-footer { display: block; }
  .workspace-switch .chevron { display: inline; }
  .nav-item em { display: inline-block; }
  .workspace-switch { padding: 10px 9px; margin: 0 3px 22px; }
  .nav-item { justify-content: flex-start; padding: 10px 12px; }
  .main-content { margin-left: 0; }
  body.nav-open .nav-shade { display: block; position: fixed; inset: 0; background: rgba(17, 36, 33, .3); z-index: 29; }
  .page h1 { font-size: 23px; }
  .page-header { gap: 12px; }
  .tabs { flex-wrap: wrap; }
}
/* длинные строки без пробелов (коды, ссылки) переносятся, а не растягивают страницу */
.event > div, .incident > div, .market-row > div { min-width: 0; overflow-wrap: anywhere; }
/* таблицы внутри сетки не растягивают колонку: листаются внутри своего блока */
.detail-grid > *, .metric-grid > * { min-width: 0; }
.table-wrap { max-width: 100%; }

/* Помощник */
.as-chat { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.as-q { align-self: flex-end; max-width: 85%; background: var(--mint, #e6f4ee); border-radius: 12px 12px 2px 12px; padding: 9px 12px; font-size: 13px; }
.as-a { align-self: flex-start; max-width: 95%; background: #fff; border: 1px solid var(--line, #e4ece9); border-radius: 12px 12px 12px 2px; padding: 10px 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.as-err { color: #ba5b5b; }
.as-src { margin-top: 8px; font-size: 12px; }
.as-src summary { cursor: pointer; color: var(--teal, #17685f); }
.as-src-item { border-top: 1px solid #eef2f0; padding: 6px 0; }
.as-kv { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0; }
.as-sub { margin: 4px 0 4px 8px; }
.as-sub > i { display: block; color: var(--muted, #71817f); font-style: normal; font-size: 11px; margin-bottom: 2px; }
.as-input { display: flex; gap: 8px; align-items: flex-end; }
.as-input textarea { flex: 1; min-width: 0; border: 1px solid var(--line, #e4ece9); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.as-examples { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.as-examples .tab { background: #eff4f2; text-align: left; }
@media (max-width: 760px) { .as-input { flex-direction: column; align-items: stretch; } .as-q, .as-a { max-width: 100%; } }

/* Keep every navigation item reachable on shorter desktop and mobile screens. */
.sidebar { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
