/* AIVA Аналитика — тонкий слой поверх Fila: бренд + компоненты отчётов. */

/* Компактность: общая плотность под 13" экран */
.main-content-container { font-size: 13px; }
.main-content-container .card.p-20 { padding: 13px 15px !important; }
.main-content-container .card { margin-bottom: 14px !important; }
.main-content-container h2 { font-size: 20px; }
.main-content-container h3 { font-size: 14.5px; }
.main-content-container .fs-28 { font-size: 20px !important; }
.main-content-container .fs-17 { font-size: 14px !important; }
.main-content-container .fs-16 { font-size: 12.5px !important; }
.main-content-container .fs-15 { font-size: 12px !important; }
.main-content-container .row { --bs-gutter-y: 0; }
.main-content-container .table { font-size: 12.5px; margin-bottom: 0; }
.main-content-container .table th { font-size: 11.5px; text-transform: none; color: #64748b; font-weight: 600; }
.main-content-container .table > :not(caption) > * > * { padding: 6px 8px; }
.main-content-container .table-sm > :not(caption) > * > * { padding: 5px 8px; }
/* круглые иконки в кастомных карточках воронки */
.main-content-container .rounded-circle[style*="56px"] { width: 40px !important; height: 40px !important; }
.main-content-container .rounded-circle[style*="56px"] .material-symbols-outlined { font-size: 21px; }

.stat-card { padding: 12px 14px !important; }
.stat-title { font-size: 12px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 20px; }
.stat-ic { width: 38px; height: 38px; }
.stat-ic .material-symbols-outlined { font-size: 20px; }
.min-w-0 { min-width: 0; }
.spark-box { width: 104px; height: 42px; }

/* Фильтр под кнопкой */
.filterbar { position: relative; display: inline-block; }
.filter-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #334155; background: #fff; border: 1px solid rgba(15,23,42,.14); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.filter-btn:hover { background: #f8fafc; border-color: rgba(15,121,243,.4); }
.filter-btn .material-symbols-outlined { font-size: 18px; }
.filter-btn .filter-range { color: #0f79f3; font-weight: 700; padding-left: 2px; }
.filter-btn .chev { transition: transform .2s; opacity: .55; margin-left: 1px; }
.filter-btn.open .chev { transform: rotate(180deg); }
.filter-pop { position: absolute; z-index: 1040; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid rgba(15,23,42,.10); border-radius: 12px; box-shadow: 0 20px 48px -18px rgba(15,40,60,.34); padding: 14px; min-width: min(520px, 92vw); }
.filter-pop .form-control { max-width: 168px; }
@media (max-width: 575px) { .filter-pop { min-width: 0; left: 0; right: 0; position: fixed; margin: 6px 12px 0; } }

/* Полоса чипов (стадии шахматки и т.п.) */
.chip-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; padding: 7px 11px; background: #fff; border: 1px solid rgba(15,23,42,.07); border-radius: 11px; }
.fl-chip { padding: 3px 11px !important; font-size: 12px !important; font-weight: 600; border-radius: 8px !important; line-height: 1.5; }
/* Важный показатель «без сотрудника Лидоруба» — всегда на виду, ярко */
.nokc-alert { display: flex; align-items: center; gap: 10px; padding: 11px 15px; margin-bottom: 14px; background: linear-gradient(90deg, #fff7ed, #ffedd5); border: 1px solid #fdba74; border-left: 4px solid #f97316; border-radius: 11px; color: #9a3412; font-size: 13px; }
.nokc-alert .material-symbols-outlined { color: #f97316; font-size: 22px; flex-shrink: 0; }
.nokc-alert b { color: #c2410c; font-weight: 700; }

/* Кросс-таб воронки МОП */
.text-purple { color: #7c3aed; }
.mf-wrap { border-radius: 10px; }
.mf-table { font-size: 12px; white-space: nowrap; }
.mf-table th { font-size: 10.5px; line-height: 1.15; vertical-align: bottom; color: #64748b; font-weight: 600; text-align: right; }
.mf-table td, .mf-table th { padding: 6px 9px; }
.mf-table .mf-name { position: sticky; left: 0; background: #fff; z-index: 2; text-align: left !important; font-weight: 600; min-width: 158px; box-shadow: 1px 0 0 rgba(15,23,42,.08); }
.mf-table thead .mf-name { z-index: 3; }
.mf-table .mf-total td { background: #eff6ff; font-weight: 700; border-top: 2px solid #bfdbfe; border-bottom: 2px solid #bfdbfe; }
.mf-table .mf-total .mf-name { background: #eff6ff; }
.mf-table .mf-meet { color: #b45309; background: rgba(251,191,36,.09); }
.mf-table th.mf-carry, .mf-table td.mf-carry { color: #7c3aed; background: rgba(124,58,237,.08); font-weight: 600; }
.mf-table .mf-zero { color: #cbd5e1; }
.mf-table tbody tr:hover td { background: #f8fafc; }
.mf-table tbody tr:hover .mf-name { background: #f1f5f9; }

.fac-select { width: auto; min-width: 144px; font-size: 12px; padding: 3px 26px 3px 10px; font-weight: 600; color: #334155; border-color: rgba(15,23,42,.14); }
.fac-select:focus { border-color: rgba(15,121,243,.5); box-shadow: 0 0 0 .18rem rgba(15,121,243,.12); }


/* Сворачивание сайдбара (кнопка-меню в шапке) */
.sidebar-area { transition: transform .25s ease; }
.main-content { transition: padding-left .25s ease; }
body.sb-collapsed .sidebar-area { transform: translateX(-105%); }
body.sb-collapsed .main-content { padding-left: 16px !important; }
.sb-toggle { cursor: pointer; }
.sb-toggle:hover .material-symbols-outlined { color: #0f79f3 !important; }
@media (max-width: 1199px) { body.sb-collapsed .main-content { padding-left: 12px !important; } }

/* Сводная таблица маркетинга (как в гугл-таблице) — компактная, с конверсиями */
.mf-wide { font-size: 11.5px; white-space: nowrap; }
.mf-wide th, .mf-wide td { padding: 4px 7px; }
.mf-wide thead th { border-bottom: 1px solid rgba(15,23,42,.1); vertical-align: middle; }
.mf-wide thead tr:first-child th[colspan] { background: rgba(15,23,42,.03); }
.mf-conv { color: #7c3aed !important; background: rgba(124,58,237,.06); font-weight: 600; }
.mf-wide tbody tr.mfw-day .mf-conv { background: rgba(124,58,237,.03); }

/* Аккордеон-группы левого меню (как в Fila) */
.menu-group { list-style: none; margin-bottom: 4px; }
.menu-group-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 8px 14px 6px; color: #94a3b8; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; user-select: none; border-radius: 8px; }
.menu-group-head:hover { color: #64748b; background: rgba(15,23,42,.03); }
.menu-group-head .menu-caret { font-size: 18px; transition: transform .2s; opacity: .7; }
.menu-group.collapsed .menu-caret { transform: rotate(-90deg); }
.menu-group-items { overflow: hidden; transition: max-height .25s ease, opacity .2s; max-height: 800px; }
.menu-group.collapsed .menu-group-items { max-height: 0; opacity: 0; }

/* Активный пункт меню — чёткая подсветка (какой отчёт открыт) */
.sidebar-area .menu-link { border-radius: 9px; transition: background .15s, color .15s; }
.sidebar-area .menu-link:hover { background: rgba(15,121,243,.06); }
.sidebar-area .menu-link.active { background: linear-gradient(90deg, rgba(15,121,243,.16), rgba(15,121,243,.05)) !important; color: #0f79f3 !important; font-weight: 600; position: relative; box-shadow: inset 0 0 0 1px rgba(15,121,243,.12); }
.sidebar-area .menu-link.active::before { content: ''; position: absolute; left: -6px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: #0f79f3; }
.sidebar-area .menu-link.active .menu-icon, .sidebar-area .menu-link.active .title { color: #0f79f3 !important; }
.sidebar-area .menu-item { position: relative; }

/* Бренд в сайдбаре */
.sidebar-area .logo { min-height: 64px; padding: 10px 20px; }
.brand-link { display: flex; align-items: center; gap: 11px; overflow: hidden; }
.sidebar-area .logo .brand-mark { display: inline-block !important; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, #0f79f3, #0a5bc4); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 20px -8px #0a5bc4; flex-shrink: 0; position: static !important; }
.sidebar-area .logo .logo-text { position: static !important; opacity: 1 !important; visibility: visible !important; left: auto !important; top: auto !important; transform: none !important; font-size: 14.5px; letter-spacing: -.02em; white-space: nowrap; }
.sidebar-burger-menu-close { display: none !important; }
@media (max-width: 1199px) { .sidebar-burger-menu-close { display: inline-flex !important; } }

/* Бар-листы рейтингов */
.barrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-bottom: 7px; }
.barrow .bl-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barrow .bl-num { font-weight: 700; font-size: 13px; }
.barrow .bl-track { grid-column: 1/-1; height: 7px; border-radius: 999px; background: rgba(15,23,42,.08); overflow: hidden; }
.barrow .bl-fill { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #16a34a); transition: width .5s cubic-bezier(.16,1,.3,1); }
.barrow.blue .bl-fill { background: linear-gradient(90deg, #0f79f3, #0a5bc4); }
.barrow.danger .bl-fill { background: linear-gradient(90deg, #f43f5e, #e11d48); }
.calls-row { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 9px 2px; font-size: 14px; }
.calls-row + .calls-row { border-top: 1px solid rgba(15,23,42,.06); }
.rank { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; font-size: 12px; font-weight: 700; background: rgba(15,23,42,.08); color: #64748b; margin-right: 9px; }
.rank.r1 { background: linear-gradient(140deg,#fbbf24,#d97706); color: #fff; }
.rank.r2 { background: linear-gradient(140deg,#cbd5e1,#94a3b8); color: #fff; }
.rank.r3 { background: linear-gradient(140deg,#f0a173,#c2703a); color: #fff; }
.mono { font-variant-numeric: tabular-nums; }

/* Пилюли */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(15,23,42,.08); color: #64748b; }
.pill.office { background: rgba(34,197,94,.14); color: #16a34a; }
.pill.online { background: rgba(15,121,243,.12); color: #0f79f3; }
.pill.street { background: rgba(217,119,6,.14); color: #d97706; }
.pill.self { background: rgba(15,121,243,.12); color: #0f79f3; }
.pill.came { background: rgba(34,197,94,.14); color: #16a34a; }
.pill.upcoming { background: rgba(217,119,6,.15); color: #d97706; }
.pill.noshow { background: rgba(220,38,38,.13); color: #dc2626; }
.pill.rpt-visit { background: rgba(124,58,237,.13); color: #7c3aed; font-weight: 700; }
.pill.rpt-lead { background: rgba(15,121,243,.10); color: #0f79f3; }

/* Гант */
.gantt { overflow-x: auto; } .gantt-inner { min-width: 640px; }
.gantt-axis { display: grid; grid-template-columns: 140px 1fr; align-items: end; margin-bottom: 6px; }
.gantt-hours { position: relative; display: flex; justify-content: space-between; font-size: 10.5px; color: #94a3b8; }
.gnow-tag { position: absolute; top: -2px; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: #e11d48; white-space: nowrap; z-index: 2; }
.gnow { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #e11d48; border-radius: 2px; z-index: 1; }
.gantt-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; padding: 5px 0; border-top: 1px solid rgba(15,23,42,.06); }
.gantt-mgr { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.gantt-track { position: relative; height: 26px; border-radius: 8px; background: #f1f5f9; }
.gbar { position: absolute; top: 3px; height: 20px; min-width: 8px; border-radius: 6px; background: linear-gradient(140deg,#0f79f3,#0a5bc4); cursor: pointer; display: flex; align-items: center; padding: 0 6px; font-size: 10px; color: #fff; font-weight: 700; overflow: hidden; white-space: nowrap; text-decoration: none; }
.gbar.came { background: linear-gradient(140deg,#22c55e,#16a34a); }
.gbar.noshow { background: linear-gradient(140deg,#f43f5e,#e11d48); }
.gbar.wait { background: linear-gradient(140deg,#fbbf24,#f59e0b); color: #3b2a06; }
.gbar.online { outline: 2px dashed rgba(255,255,255,.85); outline-offset: -3px; }

/* Таблица: значки повторных не ломают строку */
.table td .pill { vertical-align: middle; }

/* Прогресс живого запроса */
.prog-bar { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.prog-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #0f79f3, #0a5bc4); transition: width .35s ease; }
.prog-label { font-size: 13.5px; font-weight: 600; color: #334155; }
.prog-pct { font-weight: 700; color: #0f79f3; min-width: 44px; text-align: right; }
.spin { animation: aivaspin 1s linear infinite; display: inline-block; }
@keyframes aivaspin { to { transform: rotate(360deg); } }

/* Воронка конверсии */
.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 220px 1fr 64px; gap: 14px; align-items: center; }
.funnel-name { font-size: 13.5px; font-weight: 600; color: #334155; }
.funnel-track { background: #f1f5f9; border-radius: 8px; overflow: hidden; }
.funnel-fill { color: #fff; font-weight: 700; font-size: 13px; padding: 9px 12px; border-radius: 8px; min-width: 40px; text-align: center; white-space: nowrap; transition: width .6s cubic-bezier(.16,1,.3,1); }
.funnel-conv { text-align: right; }
@media (max-width: 640px) { .funnel-row { grid-template-columns: 130px 1fr 52px; gap: 8px; } .funnel-name { font-size: 12px; } }

/* Спарклайн-бокс в KPI-карточке */
.spark-box { width: 130px; height: 60px; flex-shrink: 0; }
@media (max-width: 420px) { .spark-box { display: none; } }

/* Экспорт в PDF: печатаем только контент, без сайдбара/шапки */
@media print {
  .sidebar-area, .header-area, #print-btn { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  body.bg-body-bg { background: #fff !important; }
  .card, .acard { box-shadow: none !important; border: 1px solid #e2e8f0 !important; break-inside: avoid; }
  .row > [class*="col-"] { break-inside: avoid; }
  a { text-decoration: none !important; color: #0f172a !important; }
  @page { margin: 12mm; size: A4; }
}

/* Роадмап (№6) — горизонтальные полосы стадий */
.roadmap { display: flex; flex-direction: column; gap: 10px; }
.rm-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; }
.rm-name { font-size: 13px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.rm-track { background: #f1f5f9; border-radius: 8px; overflow: hidden; }
.rm-fill { background: linear-gradient(90deg, #7c6cf6, #6f6af8); color: #fff; font-weight: 700; font-size: 12px; padding: 7px 10px; border-radius: 8px; min-width: 28px; text-align: center; white-space: nowrap; transition: width .5s cubic-bezier(.16,1,.3,1); }
@media (max-width: 575px) { .rm-row { grid-template-columns: 100px 1fr; } .rm-name { font-size: 12px; } }

/* Глобальный поиск */
.src-form .form-control { min-width: 260px; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 420px; max-height: 60vh; overflow-y: auto; background: #fff; border: 1px solid rgba(15,23,42,.10); border-radius: 12px; box-shadow: 0 24px 60px -20px rgba(15,40,60,.35); z-index: 1050; display: none; padding: 6px; }
.search-results.open { display: block; }
.sr-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 700; padding: 8px 10px 6px; }
.sr-empty { padding: 16px; text-align: center; color: #64748b; font-size: 14px; }
.sr-item { display: block; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: inherit; }
.sr-item:hover { background: #f1f5f9; text-decoration: none; }
.sr-main { font-size: 14.5px; font-weight: 600; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.sr-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 3px; font-size: 12.5px; color: #64748b; }
.sr-meta span { display: inline-flex; align-items: center; gap: 3px; }
.sr-meta .material-symbols-outlined { font-size: 15px; opacity: .7; }
@media (max-width: 575px) { .search-results { min-width: 0; position: fixed; left: 12px; right: 12px; } }
