/* Фаза17: адресная поверхность статистики; общие страницы и модалки не меняются. */
#statisticsList { display:block; flex:1 1 auto; min-width:0; min-height:0; overflow-y:auto; overscroll-behavior:auto; }
#statisticsList[hidden] { display:none; }
.statistics-workspace { max-width:1480px; margin-inline:auto; font-size:12px; font-weight:400; line-height:1.4; --statistics-source-0:#2563eb; --statistics-source-1:#0f8f86; --statistics-source-2:#8b7bb8; --statistics-source-3:#a1b0c4; --statistics-source-4:#758eb0; }
.statistics-workspace *, .statistics-detail-dialog * { box-sizing:border-box; }
.statistics-controls { display:flex; flex-wrap:wrap; align-items:end; gap:8px 12px; }
.statistics-controls label, .statistics-manager-select { display:grid; gap:4px; color:var(--muted); }
.statistics-controls select, .statistics-manager-select select { height:34px; min-height:34px; padding:5px 8px; font:inherit; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:6px; max-width:100%; }
.statistics-controls .secondary-button, .statistics-pager .secondary-button, .statistics-state .secondary-button, .statistics-status .secondary-button, .statistics-detail-dialog .secondary-button { min-height:34px; font-size:12px; font-weight:400; }
.statistics-refresh-slot { min-height:34px; display:flex; align-items:center; color:var(--muted); }
.statistics-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px 16px; margin-top:12px; color:var(--muted); }
.statistics-note { color:var(--muted); font-size:12px; line-height:1.4; margin:10px 0; overflow-wrap:anywhere; }
.statistics-tabs { display:flex; gap:20px; margin:16px 0; border-bottom:1px solid var(--line); overflow-x:auto; }
.statistics-tabs button { flex-shrink:0; min-height:40px; border:0; border-bottom:2px solid transparent; padding:8px 0; background:transparent; color:var(--muted); font:inherit; cursor:pointer; }
.statistics-tabs button[aria-selected=true] { color:var(--primary-strong); border-bottom-color:var(--primary); }
.statistics-status { display:flex; flex-wrap:wrap; gap:8px; align-items:center; min-height:0; color:var(--danger); margin-bottom:12px; }
.statistics-status:empty { display:none; }
.statistics-workspace .work-table-columns-panel { left:0; right:auto; max-width:calc(100vw - 48px); }
.statistics-state { min-height:180px; display:flex; gap:12px; align-items:center; justify-content:center; flex-direction:column; color:var(--muted); text-align:center; }
.statistics-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.statistics-kpi { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-height:106px; padding:14px 16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--text); text-align:left; font:inherit; }
button.statistics-kpi { cursor:pointer; }
.statistics-kpi strong { font-size:28px; font-weight:400; line-height:1.2; }
.statistics-kpi small { color:var(--muted); font-size:12px; }
.statistics-kpi[aria-pressed=true] { border-color:var(--primary); background:var(--surface-muted); }
.statistics-priorities { grid-template-columns:repeat(4,minmax(0,1fr)); }
.statistics-split { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.statistics-panel { min-width:0; margin-bottom:16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.statistics-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; border-bottom:1px solid var(--line); }
.statistics-panel h2, .statistics-detail-dialog h2 { margin:0; font-size:15px; font-weight:400; line-height:1.4; overflow-wrap:anywhere; }
.statistics-panel-head p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.statistics-panel-body { padding:14px 16px; }
.statistics-panel-body > :last-child { margin-bottom:0; }
.statistics-text-button { min-height:32px; padding:5px 0; border:0; border-radius:3px; background:transparent; font:inherit; color:var(--primary-strong); text-align:left; cursor:pointer; overflow-wrap:anywhere; }
.statistics-workspace button:focus-visible, .statistics-workspace select:focus-visible, .statistics-workspace summary:focus-visible, .statistics-detail-dialog button:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.statistics-workspace .work-table-scroll, .statistics-table-scroll, .statistics-detail-dialog .statistics-table-scroll { max-height:none; height:auto; overflow-x:auto; overflow-y:visible; overscroll-behavior:auto; }
.statistics-workspace .work-table, .statistics-detail-dialog .work-table { font-size:12px; }
.statistics-workspace .work-table th, .statistics-detail-dialog .work-table th { height:42px; padding:8px 10px; font-size:12px; font-weight:600; line-height:1.35; }
.statistics-workspace .work-table td, .statistics-detail-dialog .work-table td { height:42px; padding:8px 10px; font-size:12px; font-weight:400; line-height:1.35; vertical-align:middle; }
.statistics-workspace .work-table td small, .statistics-detail-dialog .work-table td small { display:block; color:var(--muted); font-size:11px; }
.statistics-cell-value { min-width:0; overflow-wrap:anywhere; }
.statistics-workspace .work-table-toolbar-actions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.statistics-team-table { width:var(--work-table-width); table-layout:fixed; }
.statistics-team-table th, .statistics-team-table td { overflow-wrap:anywhere; }
.statistics-manager-select { margin:4px 0 14px; max-width:360px; }
.statistics-duration h3 { font-size:13px; font-weight:400; margin:0 0 8px; }
.statistics-duration dl, .statistics-facts { display:grid; gap:10px; margin:0; }
.statistics-duration dl { grid-template-columns:1fr 1fr; }
.statistics-duration dt, .statistics-facts dt { color:var(--muted); }
.statistics-duration dd { margin:4px 0 0; font-size:21px; font-weight:400; }
.statistics-facts dd { margin:3px 0 0; }
.statistics-timing-lines { display:grid; gap:12px; }
.statistics-timing-lines > div { display:grid; grid-template-columns:minmax(120px,1fr) minmax(80px,1fr) 82px; gap:8px; align-items:center; }
.statistics-timing-track { height:10px; background:var(--surface-muted); border-radius:3px; overflow:hidden; }
.statistics-timing-track i { display:block; height:100%; background:var(--primary); }
.statistics-timing-lines small { display:block; color:var(--muted); font-size:10px; }
.statistics-preparation-stack { display:flex; height:14px; margin-top:12px; border-radius:4px; overflow:hidden; background:var(--surface-muted); }
.statistics-preparation-stack span { display:block; height:100%; }
.statistics-missing { font-size:28px; color:var(--muted); margin:12px 0; }
.statistics-legend { display:flex; flex-wrap:wrap; gap:8px 14px; margin:12px 0; }
.statistics-legend > span { display:flex; align-items:center; gap:6px; }
.statistics-legend i, .statistics-ap-legend i { width:8px; height:8px; border-radius:2px; flex:0 0 auto; }
.statistics-trend { display:grid; grid-template-columns:38px minmax(0,1fr); gap:8px; }
.statistics-y-axis { position:relative; height:210px; color:var(--muted); font-size:11px; }
.statistics-y-axis span { position:absolute; right:0; transform:translateY(-50%); }
.statistics-trend-main { min-width:0; }
.statistics-trend-main svg { display:block; width:100%; height:210px; overflow:visible; }
.statistics-trend-grid { stroke:var(--line); stroke-width:1; vector-effect:non-scaling-stroke; }
.statistics-trend-series { fill:none; stroke-width:2; vector-effect:non-scaling-stroke; stroke-linejoin:round; stroke-linecap:round; }
.statistics-trend-dot { stroke:var(--surface); stroke-width:1; vector-effect:non-scaling-stroke; }
.statistics-trend-point { cursor:pointer; }
.statistics-trend-point:focus-visible .statistics-trend-dot { stroke:var(--text); stroke-width:3; }
.statistics-x-axis { position:relative; height:42px; color:var(--muted); font-size:11px; margin-top:4px; }
.statistics-x-axis > span { position:absolute; transform:translateX(-50%); white-space:nowrap; text-align:center; }
.statistics-x-axis small { display:block; font-size:10px; }
.statistics-x-axis .is-first { transform:none; text-align:left; }
.statistics-x-axis .is-last { transform:translateX(-100%); text-align:right; }
.statistics-chart-data { margin-top:12px; }
.statistics-chart-data summary { min-height:32px; padding-block:7px; color:var(--primary-strong); cursor:pointer; }
.statistics-chart-data .work-table { min-width:640px; }
.statistics-bars { display:flex; gap:4px; height:192px; margin-top:10px; }
.statistics-bar-column { flex:1 1 0; min-width:0; display:grid; grid-template-rows:164px 28px; }
.statistics-bar { display:block; position:relative; height:164px; min-height:0; width:100%; padding:0; border:0; border-radius:0; background:transparent; cursor:pointer; }
.statistics-bar-stack { position:absolute; bottom:0; left:0; right:0; display:flex; flex-direction:column-reverse; background:var(--muted); border-radius:3px 3px 0 0; overflow:hidden; }
.statistics-bar-stack > span { display:block; width:100%; flex-shrink:0; }
.statistics-bar-number { position:absolute; top:-18px; left:0; right:0; color:var(--muted); font-size:10px; }
.statistics-bar-label { padding-top:6px; color:var(--muted); white-space:nowrap; font-size:10px; text-align:center; }
.statistics-ap-strip { display:flex; height:40px; overflow:hidden; border-radius:6px; margin-block:10px 14px; background:var(--surface-muted); }
.statistics-ap-strip button { min-width:0; min-height:40px; padding:0; border:0; border-radius:0; cursor:pointer; }
.statistics-ap-strip button[aria-pressed=true] { box-shadow:inset 0 -4px var(--text); }
.statistics-ap-legend { display:grid; gap:8px; }
.statistics-ap-legend button { display:grid; grid-template-columns:8px minmax(0,1fr) auto; align-items:center; gap:8px; min-height:40px; padding:7px 8px; border:1px solid transparent; border-radius:6px; background:transparent; font:inherit; color:var(--text); text-align:left; cursor:pointer; }
.statistics-ap-legend button[aria-pressed=true] { background:var(--surface-muted); border-color:var(--primary); }
.statistics-donut { display:block; width:min(285px,100%); margin:14px auto; }
.statistics-donut text { fill:var(--text); font-size:26px; }
.statistics-donut text.statistics-donut-caption { fill:var(--muted); font-size:11px; }
.statistics-donut circle[role=button] { cursor:pointer; }
.statistics-donut circle:focus-visible { outline:none; stroke-width:28px; }
.statistics-ap-row { display:grid; grid-template-columns:110px minmax(140px,1fr) 160px minmax(110px,.7fr); align-items:center; gap:12px; padding-block:7px; min-height:42px; border-bottom:1px solid var(--line); }
.statistics-ap-row > span { overflow-wrap:anywhere; }
.statistics-open-feedback { display:block; grid-column:1 / -1; min-width:0; color:var(--danger); font-size:12px; overflow-wrap:anywhere; }
.statistics-open-feedback[role=status] { color:var(--muted); }
.statistics-pager { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:12px; }
.statistics-pager > span { margin-right:auto; color:var(--muted); }
.statistics-detail-dialog { width:min(960px,calc(100vw - 32px)); max-height:calc(100dvh - 48px - var(--environment-banner-height)); padding:0; overflow:hidden; }
#statisticsDetailDialog[open] { display:flex; flex-direction:column; max-height:calc(100dvh - 64px - var(--environment-banner-height)) !important; margin:0 auto; overflow:hidden !important; overflow-y:hidden !important; }
.statistics-detail-head { display:flex; align-items:center; gap:16px; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--line); }
#statisticsDetailDialog .statistics-detail-head { flex:0 0 auto; min-width:0; }
#statisticsDetailDialog .statistics-detail-head h2 { min-width:0; overflow-wrap:anywhere; }
.statistics-detail-head .dialog-close-button { position:static; display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; padding:0; border:0; background:transparent; color:var(--muted); }
.statistics-detail-head .dialog-close-button svg { display:block; width:20px; height:20px; }
.statistics-detail-body { max-height:calc(100dvh - 126px - var(--environment-banner-height)); overflow-y:auto; padding:14px 18px; font-size:12px; }
#statisticsDetailDialog .statistics-detail-body { flex:1 1 auto; min-height:0; max-height:none; }
.statistics-detail-body .statistics-table-scroll { overflow-x:auto; }
.statistics-detail-body .work-table { width:100%; min-width:100%; }
@media(min-width:761px) {
  .statistics-detail-body .work-table :is(th,td):first-child { padding-left:0; }
  .statistics-detail-body .work-table :is(th,td):last-child { padding-right:0; }
}
@media(max-width:760px) {
  #statisticsList { padding:12px; }
  .statistics-controls { align-items:stretch; }
  .statistics-controls label { flex:1 1 150px; }
  .statistics-controls .secondary-button { min-height:40px; }
  .statistics-workspace .work-table-columns-panel { gap:8px; }
  .statistics-workspace .work-table-columns-panel label { min-height:32px; }
  .statistics-refresh-slot { flex:1 1 100%; min-height:20px; }
  .statistics-tabs { gap:16px; }
  .statistics-split { grid-template-columns:minmax(0,1fr); gap:0; }
  .statistics-kpis { gap:8px; }
  .statistics-kpi { padding:10px; min-height:116px; }
  .statistics-kpi strong { font-size:24px; }
  .statistics-priorities { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .statistics-panel-head, .statistics-panel-body { padding:12px; }
  .statistics-trend { grid-template-columns:32px minmax(0,1fr); gap:4px; }
  .statistics-trend-point, .statistics-ap-strip button, .statistics-donut circle[role=button] { pointer-events:none; }
  .statistics-bars { gap:2px; }
  .statistics-bar-number { display:none; }
  .statistics-bar-label { font-size:9px; }
  .statistics-timing-lines > div { grid-template-columns:minmax(100px,1fr) minmax(50px,.7fr) 76px; }
  .statistics-ap-row { grid-template-columns:100px minmax(0,1fr); gap:6px 8px; }
  .statistics-donut { max-width:230px; }
  .statistics-ap-legend button { font-size:12px; }
  .statistics-detail-dialog { width:calc(100vw - 16px); max-width:none; max-height:calc(100dvh - 24px - var(--environment-banner-height)); }
  #statisticsDetailDialog[open] { max-height:calc(100dvh - 24px - var(--environment-banner-height) - env(safe-area-inset-bottom,0px)) !important; margin:12px auto; }
  .statistics-detail-head, .statistics-detail-body { padding:12px; }
  .statistics-detail-body { max-height:calc(100dvh - 104px - var(--environment-banner-height)); }
}
