.dashboard-view {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}

.dashboard-metric-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-emphasis);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-metric-value {
  margin-top: var(--space-4);
  color: var(--color-text);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-emphasis);
  line-height: var(--line-height-tight);
  font-variant-numeric: tabular-nums;
}

.dashboard-metric-detail {
  margin-top: 5px;
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
}

.dashboard-section {
  padding: var(--space-9) 0;
  border-bottom: var(--border-width) solid var(--color-border);
}

.dashboard-leaderboard-section {
  padding-top: var(--space-2);
  border-bottom: 0;
}

.dashboard-section-head {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-7);
  margin-bottom: 18px;
}

.dashboard-section-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-emphasis);
}

.dashboard-section-note {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.dashboard-nav-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  margin-left: auto;
  gap: 9px;
}

.dashboard-nav-controls[hidden] {
  display: none;
}

.dashboard-nav-controls:not([hidden]) ~ .global-search-trigger {
  margin-left: 0;
}

.dashboard-range-filter {
  display: inline-grid;
  grid-template-columns: repeat(3, max-content);
  overflow: hidden;
  border: var(--border-width) solid var(--color-control-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
}

.dashboard-range-button {
  appearance: none;
  height: calc(var(--control-height-md) - 2px);
  padding: 0 var(--control-padding-inline);
  border: 0;
  border-right: var(--border-width) solid var(--color-control-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.dashboard-range-button:last-child {
  border-right: 0;
}

.dashboard-range-button:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.dashboard-range-button.active {
  color: var(--color-text);
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.dashboard-range-button:focus-visible {
  position: relative;
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: calc(-1 * var(--focus-ring-width));
}

.dashboard-date-input {
  appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  min-width: 0;
  width: 84px;
  height: var(--control-height-md);
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  border: var(--border-width) solid var(--color-control-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.dashboard-date-input[aria-expanded="true"] {
  border-color: var(--color-text);
}

.dashboard-date-input:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}

.dashboard-date-input:disabled {
  color: var(--color-text-disabled);
  cursor: default;
  opacity: 1;
}

.dashboard-date-input:hover:not(:disabled) {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.dashboard-date-picker {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.dashboard-calendar-popover {
  box-sizing: border-box;
  position: absolute;
  z-index: 500;
  top: calc(100% + var(--space-4));
  right: 0;
  width: 238px;
  padding: var(--space-6);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  box-shadow: 0 12px 30px rgb(0 0 0 / 12%);
}

.dashboard-calendar-header {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  margin-bottom: var(--space-4);
}

.dashboard-calendar-month {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-align: center;
}

.dashboard-calendar-nav {
  appearance: none;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.dashboard-calendar-nav:disabled {
  color: var(--color-text-disabled);
  cursor: default;
  opacity: 0.45;
}

.dashboard-calendar-nav svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.dashboard-calendar-nav:focus-visible {
  position: relative;
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: 1px;
}

.dashboard-calendar-nav:hover:not(:disabled) {
  color: var(--color-text);
}

.dashboard-calendar-weekdays,
.dashboard-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
}

.dashboard-calendar-weekdays {
  margin-bottom: var(--space-2);
}

.dashboard-calendar-weekday {
  color: var(--color-text-muted);
  font-size: var(--font-size-3xs);
  font-weight: var(--font-weight-medium);
  line-height: 22px;
  text-align: center;
}

.dashboard-calendar-grid {
  display: grid;
  gap: var(--space-1);
}

.dashboard-calendar-day {
  appearance: none;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.dashboard-calendar-day.in-range {
  background: var(--color-surface);
}

.dashboard-calendar-day.outside {
  color: var(--color-text-disabled);
}

.dashboard-calendar-day.today:not(.selected) {
  box-shadow: inset 0 0 0 var(--border-width) var(--color-text-muted);
}

.dashboard-calendar-day.selected {
  background: var(--color-text);
  color: var(--color-on-accent);
  font-weight: var(--font-weight-semibold);
}

.dashboard-calendar-day:disabled {
  color: var(--color-text-disabled);
  cursor: default;
  opacity: 0.35;
}

.dashboard-calendar-day:focus-visible {
  position: relative;
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: 1px;
}

.dashboard-calendar-day:hover:not(:disabled, .selected) {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.dashboard-date-range {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.dashboard-date-range-separator {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.dashboard-live-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-emphasis);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  box-shadow: none;
}

.dashboard-rank {
  width: 42px;
  color: var(--color-text-muted) !important;
}

.dashboard-demo-count {
  color: var(--color-text) !important;
  font-weight: var(--font-weight-emphasis);
}

.dashboard-operator-link {
  appearance: none;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-medium);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-operator-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-operator-link:focus-visible {
  border-radius: var(--radius-sm);
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}

.dashboard-total-row td {
  border-top: 2px solid var(--color-border);
  border-bottom: 0 !important;
  color: var(--color-text);
  font-weight: var(--font-weight-emphasis);
}

.dashboard-table-wrap {
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}

.dashboard-table th {
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-emphasis);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  padding: 0 10px 8px 0;
  border-bottom: var(--border-width) solid var(--color-border);
}

.dashboard-sort-button {
  appearance: none;
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.dashboard-sort-button:hover,
.dashboard-table th[aria-sort="ascending"],
.dashboard-table th[aria-sort="descending"] {
  color: var(--color-text);
}

.dashboard-sort-button:focus-visible {
  border-radius: var(--radius-sm);
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}

.dashboard-table td {
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
  padding: 10px 10px 10px 0;
  border-bottom: var(--border-width) solid var(--color-surface-subtle);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-table tr:last-child td {
  border-bottom: 0;
}

.dashboard-table .dashboard-operator-cell {
  width: 26%;
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.dashboard-table .dashboard-unattributed {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  font-style: italic;
}

.dashboard-empty {
  padding: var(--space-6) 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

@media (width <= 760px) {
  .dashboard-metric-value {
    font-size: var(--font-size-2xl);
  }

  .dashboard-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar.dashboard-controls-visible {
    flex-wrap: wrap;
  }

  .dashboard-nav-controls {
    order: 2;
    flex: 1 0 100%;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: thin;
  }

  .dashboard-range-filter {
    grid-template-columns: repeat(3, 1fr);
    flex: 0 0 auto;
  }

  .dashboard-date-input,
  .dashboard-date-range {
    flex: 0 0 auto;
  }

  .dashboard-calendar-popover {
    position: fixed;
    top: calc(var(--app-header-height) + var(--space-3));
    right: var(--space-6);
  }
}
