
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.stats-toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.source-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: end;
}

.source-selector__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.source-selector__item:hover,
.source-selector__item.is-active {
  border-color: rgba(215, 25, 32, 0.28);
  background: var(--soft-red);
  color: var(--red);
}

.period-selector {
  display: grid;
  grid-template-columns: minmax(150px, 180px) auto;
  gap: 8px;
  align-items: end;
}

.period-selector--range {
  grid-template-columns: repeat(3, minmax(132px, 1fr)) auto auto;
}

.period-selector label {
  grid-column: 1 / -1;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 850;
}

.period-selector--range label {
  grid-column: auto;
  display: grid;
  gap: 7px;
}

.period-selector select,
.period-selector input,
.period-selector button,
.stats-export-button {
  min-height: 38px;
}

.period-selector select,
.period-selector input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background-color: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 34px 0 12px;
}

.period-selector button {
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0 12px;
}

.stats-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.stats-list {
  display: grid;
}

.stats-list__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.stats-list__item:hover {
  background: var(--panel-2);
}

.stats-list__item--meter {
  overflow: hidden;
}

.stats-list__item--meter::before {
  position: absolute;
  left: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #d71920;
  content: "";
  opacity: 0.78;
  width: var(--bar, 0%);
}

.stats-list__item span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.stats-list__item strong,
.stats-list__item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-list__item small {
  color: var(--muted);
}

.stats-list__item b {
  flex: 0 0 auto;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}

.stats-list--compact .stats-list__item {
  padding: 10px 0;
}

.stats-list--compact .stats-list__item--meter::before {
  left: 0;
}

.stats-bars {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.stats-bar-row {
  display: grid;
  grid-template-columns: 98px minmax(80px, 1fr) 58px;
  align-items: center;
  gap: 10px;
}

.stats-bar-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

.stats-bar-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stats-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1f4;
}

.stats-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d71920;
}

.stats-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 14px 16px 16px;
}

.stats-split h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  text-transform: uppercase;
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead {
  background: var(--panel-2);
}

th {
  color: var(--muted-strong);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

td {
  color: #242a35;
  font-size: 0.9rem;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: var(--panel-2);
}

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-meter {
  position: relative;
  display: inline-grid;
  min-width: 70px;
  justify-items: end;
  padding-bottom: 8px;
}

.table-meter::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--bar, 0%);
  min-width: 0;
  height: 3px;
  border-radius: 999px;
  background: #d71920;
  content: "";
}

.table-link,
.button-link {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.table-link:hover,
.button-link:hover,
.logout-link:hover,
.admin-sidebar nav a:hover {
  color: var(--red-2);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.button-link:hover,
.button-link:focus-visible {
  border-color: var(--line-strong);
  background: var(--soft-hover);
  outline: none;
}

.button-link:is(button) {
  cursor: pointer;
  font: inherit;
}

.table-link:is(button) {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.table-link.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-link.is-active {
  border-color: var(--red-2);
  background: var(--soft-red);
  color: var(--red);
}

.button-link.danger {
  border-color: rgba(215, 31, 42, 0.35);
  color: var(--red);
}

.button-link.danger:hover,
.button-link.danger:focus-visible {
  background: var(--soft-red);
}

.icon-action {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

.admin-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-title-cell {
  min-width: 280px;
}

.content-title-cell strong,
.content-title-cell .table-link {
  display: inline-block;
  max-width: min(560px, 52vw);
  line-height: 1.25;
}
