.stats-page { padding-top: 12px; }
.stats-header { display: grid; grid-template-columns: 54px minmax(220px, 1fr) auto; align-items: center; gap: 17px; }
.stats-header .brand-mark { grid-row: 1; }
.heading-copy h1 { margin: 2px 0 3px; }
.heading-copy p { margin: 0; }
.heading-copy .eyebrow { margin-bottom: 5px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.period-control { display: flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid #ebe8e4; border-radius: 13px; background: #fff; box-shadow: 0 3px 12px #30241a08; }
.period-control button { padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: #77746f; font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: .18s ease; }
.period-control button:hover { background: #faf7f4; color: #39342f; }
.period-control button.active { background: #fff0e7; color: #d45108; box-shadow: inset 0 0 0 1px #f7dfd0; }
.stats-context { display: flex; align-items: center; gap: 9px; margin: 0 0 20px 2px; color: #817a73; font-size: 11px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #55a979; box-shadow: 0 0 0 3px #55a9791a; }
.context-separator { color: #c5beb5; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 14px; }
.kpi-card,.widget { min-width: 0; border: 1px solid #ebe8e4; border-radius: 17px; background: #fff; box-shadow: 0 7px 22px #34251808; }
.kpi-card { position: relative; min-height: 152px; overflow: hidden; padding: 17px 18px 16px; }
.kpi-primary { background: linear-gradient(140deg,#fff 35%,#fff8f2); }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.kpi-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 9px; background: #fff0e8; color: #d9570c; font-size: 15px; font-weight: 800; }
.online-icon { background: #eaf6ef; color: #408e62; }
.manual-icon { background: #f1effb; color: #7162b6; }
.duration-icon { background: #fff3df; color: #ba7b1f; }
.kpi-label { color: #77746f; font-size: 11px; font-weight: 650; }
.kpi-card > strong { display: block; color: #25221f; font-size: clamp(27px,3vw,34px); font-weight: 750; letter-spacing: -.06em; line-height: 1; }
.kpi-card > p { margin: 8px 0 0; color: #969089; font-size: 10px; }
.kpi-track { height: 4px; margin-top: 14px; overflow: hidden; border-radius: 5px; background: #f0eeeb; }
.kpi-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: #55a979; transition: width .35s ease; }
#kpi-manual-track { background: #8173c5; }
.duration-scale { display: flex; gap: 4px; margin-top: 14px; }
.duration-scale i { flex: 1; height: 4px; border-radius: 4px; background: #f1eee8; }
.duration-scale i:nth-child(-n+3) { background: #f4c58f; }
.sparkline { position: absolute; right: -4px; bottom: -1px; width: 100px; height: 39px; opacity: .5; }
.sparkline svg { display: block; width: 100%; height: 100%; overflow: visible; }
.insight-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(285px,.85fr); gap: 14px; }
.widget { padding: 20px 21px; }
.widget-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.widget-kicker { margin: 0 0 6px; color: #d85a11; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.widget h2 { margin: 0; color: #282522; font-size: 16px; font-weight: 730; letter-spacing: -.035em; }
.widget-subtitle { margin: 5px 0 0; color: #99928b; font-size: 10px; }
.widget-badge { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #f5e2d5; border-radius: 9px; background: #fff7f1; color: #d45108; font-size: 10px; font-weight: 750; }
.soft-badge { border-color: #ebe8e4; background: #faf9f7; color: #6f6860; }
.trend-widget { min-height: 285px; }
.trend-chart { height: 174px; margin-top: 18px; }
.trend-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #efede9; stroke-width: 1; }
.chart-label { fill: #9b958e; font: 10px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.chart-value { fill: #ad7b5c; font: 9px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.trend-area { fill: url(#trendFill); }
.trend-line { fill: none; stroke: #e85b0b; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.trend-point { fill: #fff; stroke: #e85b0b; stroke-width: 2; }
.donut-layout { display: flex; align-items: center; gap: 20px; min-height: 190px; padding-top: 11px; }
.donut-chart { position: relative; display: grid; flex: 0 0 144px; width: 144px; height: 144px; place-items: center; border-radius: 50%; background: conic-gradient(#e8e4de 0 100%); }
.donut-chart::before { position: absolute; width: 103px; height: 103px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px #34251808; content: ""; }
.donut-chart > div { position: relative; display: grid; gap: 2px; text-align: center; }
.donut-chart strong { color: #292521; font-size: 24px; letter-spacing: -.06em; }
.donut-chart span { color: #9a938b; font-size: 9px; }
.legend-list { display: grid; flex: 1; gap: 14px; }
.legend-list > div { display: grid; grid-template-columns: 8px minmax(72px,1fr) auto; align-items: center; gap: 7px; color: #77716b; font-size: 10px; }
.legend-list strong { color: #34302c; font-size: 11px; font-weight: 750; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; background: #e85b0b; }
.dot-online { background: #e85b0b; }.dot-manual { background: #d7c1af; }
.dot-waiting { background: #e8a23a; }.dot-confirmed { background: #e85b0b; }.dot-done { background: #56a979; }.dot-cancelled { background: #d4d0cb; }
.status-donut { background: conic-gradient(#e8a23a 0deg 0deg,#e85b0b 0deg 0deg,#56a979 0deg 0deg,#d4d0cb 0deg 360deg); }
.weekday-chart { display: grid; gap: 11px; margin-top: 22px; }
.weekday-row { display: grid; grid-template-columns: 36px minmax(50px,1fr) 24px; align-items: center; gap: 10px; color: #817b74; font-size: 10px; }
.weekday-track { height: 8px; overflow: hidden; border-radius: 8px; background: #f3f0ec; }
.weekday-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#f3a06d,#e85b0b); transition: width .35s ease; }
.weekday-row.peak .weekday-label,.weekday-row.peak .weekday-count { color: #cf5009; font-weight: 800; }
.weekday-row.peak .weekday-fill { background: linear-gradient(90deg,#f4a36f,#de4e05); }
.weekday-count { text-align: right; color: #4d4842; font-weight: 700; }
.hours-widget { grid-column: 1; }
.hours-chart { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); align-items: end; gap: 7px; height: 144px; margin-top: 24px; padding-bottom: 2px; border-bottom: 1px solid #efede9; }
.hour-column { display: flex; height: 100%; min-width: 0; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.hour-column i { display: block; width: min(100%,18px); min-height: 3px; border-radius: 5px 5px 2px 2px; background: #f3d9c8; transition: height .35s ease; }
.hour-column.peak i { background: #e85b0b; }
.hour-column span { color: #9a938b; font-size: 8px; }
.services-chart { display: grid; gap: 16px; margin-top: 24px; }
.service-row { display: grid; grid-template-columns: 23px minmax(0,1fr) 30px; align-items: center; gap: 9px; }
.service-rank { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 8px; background: #faf2ec; color: #c65a1b; font-size: 10px; font-weight: 800; }
.service-name { overflow: hidden; color: #514b45; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.service-meter { height: 4px; margin-top: 5px; overflow: hidden; border-radius: 4px; background: #f2efeb; }
.service-meter i { display: block; height: 100%; border-radius: inherit; background: #e85b0b; }
.service-count { color: #514b45; font-size: 11px; font-weight: 750; text-align: right; }
.chart-empty { display: grid; height: 100%; min-height: 105px; place-items: center; color: #aaa39b; font-size: 11px; }
.empty-note { margin: 15px 0 0; padding: 14px 16px; border: 1px dashed #e6ded5; border-radius: 12px; color: #898178; font-size: 11px; text-align: center; }
.stats-footer { margin: 19px 0 8px; color: #a29b92; font-size: 10px; text-align: center; }

@media (max-width: 950px) {
  .stats-header { grid-template-columns: 54px minmax(180px,1fr); }
  .period-control { grid-column: 1/-1; justify-self: end; }
  .insight-grid { grid-template-columns: minmax(0,1fr) minmax(270px,.9fr); }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .stats-header { gap: 12px; }
  .period-control { width: 100%; justify-content: space-between; }
  .period-control button { flex: 1; padding: 9px 5px; font-size: 10px; }
  .insight-grid { grid-template-columns: 1fr; }
  .hours-widget { grid-column: auto; }
  .widget { padding: 18px; }
  .donut-layout { justify-content: center; }
  .source-widget .donut-layout,.status-widget .donut-layout { gap: clamp(17px,8vw,40px); }
}
@media (max-width: 420px) {
  .stats-page { padding-right: 8px; padding-left: 8px; }
  .kpi-grid { gap: 9px; }
  .kpi-card { min-height: 139px; padding: 13px 12px; }
  .kpi-top { gap: 6px; margin-bottom: 13px; }
  .kpi-label { font-size: 9px; }
  .kpi-icon { width: 24px; height: 24px; }
  .donut-chart { flex-basis: 126px; width: 126px; height: 126px; }
  .donut-chart::before { width: 91px; height: 91px; }
  .legend-list { gap: 12px; }
  .legend-list > div { grid-template-columns: 8px minmax(64px,1fr) auto; gap: 5px; font-size: 9px; }
}
