.stats-shell { max-width: 1500px; font-size: 16px; }
.stats-heading, .stats-period, .stats-filter-footer, .stats-table-tools, .stats-pagination, .stats-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stats-heading { margin-bottom: 20px; }
.stats-heading h1 { margin: 5px 0 0; font-size: 28px; }
.stats-shell .eyebrow, .stats-shell .field > span { font-size: 14px; letter-spacing: 0; }
.stats-period { justify-content: flex-start; align-items: end; margin-bottom: 22px; }
.stats-period .field { flex: 0 1 185px; }
.stats-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.stats-presets button[aria-pressed="true"] { color: white; background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 2px #1167a933; }
.stats-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats-extra { margin-top: 18px; }
.stats-extra summary { color: var(--blue); cursor: pointer; font-weight: 650; padding: 8px 0; }
.stats-extra[open] summary { margin-bottom: 12px; }
.stats-filter-footer { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.stats-filter-footer span, .stats-meta, .stats-table-tools p { color: #536573; font-size: 14px; }
.stats-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0 22px; }
.stats-card { padding: 22px; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 5px 18px #17243008; }
.stats-card span { color: #526573; font-size: 14px; display: block; }
.stats-card strong { display: block; margin-top: 12px; font-size: clamp(24px, 2.3vw, 34px); color: var(--blue-dark); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stats-card small { display: block; margin-top: 10px; font-size: 14px; color: #526573; }
.stats-card.received { background: #0b5e96; border-color: #0b5e96; }
.stats-card.received :is(span, strong, small) { color: white; }
.stats-card .negative, .stats-table .negative { color: #b1342d; }
.stats-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stats-shell h2 { margin: 0 0 20px; font-size: 18px; }
.stats-bar { margin: 18px 0; }
.stats-bar-label { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.stats-bar-track { margin-top: 8px; height: 9px; background: #edf2f6; border-radius: 9px; overflow: hidden; }
.stats-bar-fill { height: 100%; background: #217eb6; border-radius: inherit; }
.stats-bar:nth-child(2) .stats-bar-fill { background: #238767; }
.stats-bar:nth-child(3) .stats-bar-fill { background: #8972bd; }
.stats-bar:nth-child(4) .stats-bar-fill { background: #b87c25; }
.stats-details { padding: 0; overflow: hidden; }
.stats-tabs { display: flex; gap: 4px; padding: 12px 20px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stats-tabs button { border: 0; border-bottom: 3px solid transparent; background: transparent; color: #536573; padding: 15px 12px; font-weight: 700; font-size: 14px; }
.stats-tabs button[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.stats-table-tools { padding: 12px 24px; }
.stats-table-tools label { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.stats-table-tools select { width: auto; max-width: 280px; }
.stats-table-scroll { overflow-x: auto; }
.stats-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.statistics-page .stats-table { display: table; }
.statistics-page .stats-table thead { display: table-header-group; }
.statistics-page .stats-table tbody { display: table-row-group; }
.statistics-page .stats-table tr { display: table-row; }
.statistics-page .stats-table :is(th, td) { display: table-cell; }
.statistics-page .stats-table td::before { content: none; }
.stats-table th { background: #f4f7fa; color: #4a6173; font-weight: 650; text-align: left; }
.stats-table :is(th, td) { padding: 15px 18px; border-bottom: 1px solid #e7edf1; vertical-align: top; }
.stats-table td { max-width: 330px; overflow-wrap: anywhere; }
.stats-table td.numeric { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats-table small { display: block; font-size: 13px; color: #627383; margin-top: 5px; }
.stats-row-button { padding: 0; border: 0; background: none; color: var(--blue-dark); text-align: left; text-decoration: underline; text-underline-offset: 3px; font-weight: 650; }
.stats-tag { display: inline-block; border-radius: 6px; padding: 4px 7px; background: #eaf3fb; color: #215d86; font-size: 13px; }
.stats-tag.excluded { color: #7b6351; background: #f4eade; }
.stats-pagination { justify-content: flex-end; padding: 16px 24px; font-size: 14px; }
.stats-notes { color: #546674; font-size: 14px; line-height: 1.75; padding: 0 6px 20px; }
.stats-notes h2 { font-size: 16px; margin-bottom: 8px; }
.stats-notes p { margin: 6px 0; }
#load-message { border-radius: 9px; padding: 14px 18px; background: #eaf3fb; color: #215d86; }
#load-message.error { background: #fbeceb; color: #a6322c; }
.statistics-page button:focus-visible, .stats-table-scroll:focus-visible, .stats-extra summary:focus-visible { outline: 3px solid #79b3df; outline-offset: 3px; }
.statistics-page button:disabled { opacity: .45; cursor: default; }
.stats-dialog { width: min(960px, calc(100% - 32px)); max-height: 88vh; border: 1px solid var(--line); border-radius: 16px; padding: 26px; color: var(--ink); }
.stats-dialog::backdrop { background: #102e4a99; }
.stats-dialog-heading h2 { margin: 0; font-size: 21px; }
.stats-dialog-heading { margin-bottom: 20px; }
.stats-dialog dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 14px; }
.stats-dialog dt { color: #617484; }
.stats-dialog dd { margin: 0; overflow-wrap: anywhere; }
.stats-dialog .stats-table-scroll { margin: 20px 0; }
.stats-dialog .detail-totals { display: flex; gap: 24px; flex-wrap: wrap; }
@media (max-width: 1100px) { .stats-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .stats-shell { padding: 22px 12px; } .stats-cards, .stats-charts { grid-template-columns: 1fr; } .stats-filters { padding: 18px; } .stats-filter-grid { grid-template-columns: 1fr; } .stats-period .field { flex: 1 1 140px; } .stats-card { padding: 18px; } .stats-table-tools { padding: 12px; } .stats-dialog { padding: 18px; } .stats-dialog dl { grid-template-columns: 1fr; gap: 5px; } .stats-dialog dd { margin-bottom: 10px; } }
