/* Аналитика (19.11.2026): конструктор, показатели, графики, рейтинг. Цвета графиков — из темы:
   основная линия — антрацит/лайм (--mark), вторая — приглушённый текст, «позже срока» — янтарь, «просрочено» — красный. */
.an { display: flex; flex-direction: column; gap: 20px; }
.an-per-m { display: none; }
.an-ctl { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.an-ctl-r { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.an-ctl-r .seg { height: 40px; align-items: stretch; } .an-ctl-r .seg-opt { padding-block: 0; }
.an-dates { display: flex; align-items: center; gap: 8px; } .an-dates .input { width: 160px; }
.an-acts { margin-left: auto; display: flex; gap: 8px; } .an-acts .btn { min-height: 40px; } .an-acts .btn-icon { width: 40px; }
.an-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.an-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; } .an-head b { font-size: 18px; font-family: var(--font-heading); } .an-head .mut { font-size: 13px; }
.kpis { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(7, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--sh); padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; animation: kpiIn .5s var(--ease-out) both; }
.kpi:nth-child(2) { animation-delay: .04s; } .kpi:nth-child(3) { animation-delay: .08s; } .kpi:nth-child(4) { animation-delay: .12s; } .kpi:nth-child(5) { animation-delay: .16s; } .kpi:nth-child(6) { animation-delay: .2s; } .kpi:nth-child(7) { animation-delay: .24s; }
@keyframes kpiIn { from { opacity: 0; transform: translateY(8px); } }
.k-l { font-size: 12px; color: var(--mut); line-height: 1.25; }
.k-v { font-family: var(--font-heading); font-size: 30px; line-height: 1; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.k-v small { font-size: 16px; margin-left: 2px; color: var(--mut); }
.k-d { font-size: 12px; color: var(--mut); font-variant-numeric: tabular-nums; }
.k-d.up { color: #1f8a4c; } .k-d.down { color: var(--p-high); }
[data-theme="dark"] .k-d.up { color: #8be0a8; }
.kpi-ring { flex-direction: row; align-items: center; gap: 14px; background: #1f2426; color: #eceded; border-color: transparent; }
.kpi-ring .k-l { color: rgba(236,237,238,.7); font-size: 13px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.kpi-ring .ring { flex: none; }
.ring.big { width: 76px; height: 76px; background: radial-gradient(closest-side, #1f2426 78%, transparent 79% 100%), conic-gradient(var(--lime) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.ring.big b { font-size: 22px; color: #fff; }
[data-theme="dark"] .kpi-ring { background: #0f1011; } [data-theme="dark"] .ring.big { background: radial-gradient(closest-side, #0f1011 78%, transparent 79% 100%), conic-gradient(var(--lime) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.an-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.an-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.an-ch { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.an-legend { display: flex; gap: 14px; font-size: 12px; color: var(--mut); flex-wrap: wrap; }
.an-legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-legend i { width: 12px; height: 8px; border-radius: 3px; display: inline-block; }
.an-line { width: 100%; height: auto; overflow: visible; }
.an-line .grid { stroke: var(--color-divider); stroke-width: 1; }
.an-line .ax { fill: var(--mut); font-size: 11px; font-family: var(--font-body); }
.ln-created { fill: none; stroke: color-mix(in srgb, var(--color-text) 40%, transparent); stroke-width: 2; stroke-dasharray: 5 4; }
.ln-closed { fill: none; stroke: var(--mark); stroke-width: 2.6; stroke-linejoin: round; stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: draw 1.2s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ar-closed { fill: color-mix(in srgb, var(--mark) 10%, transparent); }
.dt-closed { fill: var(--card); stroke: var(--mark); stroke-width: 2; opacity: 0; transition: opacity .15s ease; }
.pt:hover .dt-closed { opacity: 1; }
.l-created { background: color-mix(in srgb, var(--color-text) 40%, transparent); } .l-closed { background: var(--mark); }
.an-bars { display: flex; flex-direction: column; gap: 8px; }
.ab-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 52px; gap: 12px; align-items: center; font-size: 13px; }
.ab-n { display: flex; align-items: center; gap: 8px; min-width: 0; } .ab-n span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ab-n .ava:hover { transform: none; }
.ab-track { display: flex; height: 14px; border-radius: 99px; background: var(--inset); overflow: hidden; }
.ab-track i { display: block; height: 100%; animation: grow .8s var(--ease-out) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.b-on { background: var(--mark); } .b-late { background: var(--p-mid); } .b-over { background: var(--p-high); }
.an-legend .b-on, .an-legend .b-late, .an-legend .b-over { display: inline-block; }
.ab-v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; } .ab-v em { font-style: normal; color: var(--p-high); margin-left: 3px; font-size: 12px; }
.an-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.an-status div { display: flex; flex-direction: column; gap: 4px; } .an-status span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mut); } .an-status b { font-size: 24px; font-family: var(--font-heading); }
.an-stbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--inset); }
.an-stbar i { display: block; min-width: 0; } .an-stbar .st0 { background: var(--tint-2); } .an-stbar .st1 { background: color-mix(in srgb, var(--mark) 55%, transparent); } .an-stbar .st2 { background: var(--mark); }
.an-sub { margin-top: 8px; }
.an-heat { display: grid; grid-template-columns: 22px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; font-size: 10px; color: var(--mut); }
.an-heat .hh { text-align: center; } .an-heat .hd { align-self: center; }
.an-heat i { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--mark) calc(var(--a) * 100%), var(--inset)); }
.an-over .row:first-child { border-top: 0; }
.an-table { padding: 18px 0 8px; }
.an-table .an-ch { padding: 0 18px 8px; }
.at-wrap { overflow-x: auto; }
.an-table table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.an-table th, .an-table td { padding: 10px 14px; text-align: right; white-space: nowrap; border-top: 1px solid var(--color-divider); }
.an-table th { font-weight: 500; color: var(--mut); font-size: 12px; cursor: pointer; user-select: none; border-top: 0; }
.an-table th.on { color: var(--color-text); font-weight: 700; } .an-table th.on::after { content: " ↓"; }
.an-table .l { text-align: left; } .an-table td.l { display: flex; align-items: center; gap: 8px; } .an-table td.l .ava:hover { transform: none; }
.an-table td.bad { color: var(--p-high); font-weight: 600; }
.an-table td.warn { font-weight: 600; }
/* закрыто не в полном объёме: название и под ним, что осталось */
.an-part { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.an-part .row:nth-child(-n+2) { border-top: 0; }
.an-part .t { display: block; min-width: 0; } .an-part .ap-note { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 999px) { .an-part { grid-template-columns: 1fr; } .an-part .row:nth-child(2) { border-top: 1px solid var(--edge); } }
.an-table tfoot td { font-weight: 700; border-top: 2px solid var(--color-divider); }
.an-table tbody tr:hover { background: var(--inset); }
.ix { display: inline-grid; place-items: center; min-width: 40px; height: 24px; border-radius: 99px; font-weight: 700; padding: 0 8px;
  background: color-mix(in srgb, var(--mark) calc(var(--p) * 1%), var(--inset)); color: var(--color-text); }
@media (max-width: 1500px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 999px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .an-grid { grid-template-columns: 1fr; }
  .an-acts, .an-presets { margin-left: 0; } .ab-row { grid-template-columns: 110px 1fr 44px; }
  /* Телефон: пять периодов в сегмент не помещаются — вместо него выпадающий список в одну строку с Excel и печатью. */
  .an-ctl-r .seg { display: none; } .an-per-m { display: block; flex: 1 1 150px; min-width: 0; } .an-per-m .input { width: 100%; }
  .an-dates { order: 3; flex: 1 1 100%; } .an-dates .input { width: auto; flex: 1; min-width: 0; }
  .an-ctl-r.chips > .fsel { flex: 1 1 calc(50% - 6px); min-width: 0; } .an-ctl-r.chips .fsel .input { width: 100%; }
  .an-presets { flex: 1 1 100%; }
  .an-acts .btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .kpi, .ab-track i, .ln-closed { animation: none; } .ln-closed { stroke-dashoffset: 0; } }
@media print {
  .side, .tabs, .top .acts, .an-ctl, .team-seg, #install-bar { display: none !important; }
  .shell, .main, .view { display: block !important; overflow: visible !important; height: auto !important; }
  body { background: #fff; } .card, .kpi { box-shadow: none !important; break-inside: avoid; }
  .an-grid { grid-template-columns: 1fr 1fr; }
}
/* Окно отчёта: параметры аналитики для рассылки в MAX — одной строкой полей */
.rf-an-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.rf-an-g > .full { grid-column: 1 / -1; } /* список филиалов во всю ширину блока */
.rf-when { display: grid; grid-template-columns: auto minmax(0, 1fr) 130px; gap: 12px; align-items: end; }
@media (min-width: 1000px) { .rp-dlg .rep-rcp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; align-content: start; } .rp-dlg .rep-rcp .pick { min-width: 0; } }
@media (max-width: 560px) { .rf-when { grid-template-columns: 1fr 1fr; } .rf-when > .field:first-child { grid-column: 1 / 3; } }
.an-req .row:first-child { border-top: 0; }
.an-req .rq { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 12.5px; }
.an-req .rq b { font-size: 15px; font-variant-numeric: tabular-nums; }
.an-full { grid-column: 1 / -1; }
.an-req { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.an-req .row:nth-child(2) { border-top: 0; }
@media (max-width: 999px) { .an-req { grid-template-columns: 1fr; } .an-req .row:nth-child(2) { border-top: 1px solid var(--edge); } }
