/* An event's numbers as pictures on its overview (ticketing/office/events/_dashboard): the fill ring, the money, the bars and each zone's fill. */

.tk-dash { display: grid; gap: var(--space-5); }

.tk-dash--sold { --tk-dash-c: var(--accent); }
.tk-dash--held { --tk-dash-c: var(--gold); }
.tk-dash--closed { --tk-dash-c: var(--fg-faint); }
.tk-dash--open { --tk-dash-c: var(--rule); }

.tk-dash__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

@media (min-width: 48rem) {
  .tk-dash__hero { grid-template-columns: minmax(16rem, 1fr) minmax(0, 2fr); }
}

.tk-dash__ring-card,
.tk-dash__money,
.tk-dash__chart {
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.tk-dash__ring-card {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
}

.tk-dash__ring { display: block; inline-size: 100%; block-size: auto; }
.tk-dash__ring-track { fill: none; stroke: var(--surface-sunken); stroke-width: 5; }
.tk-dash__ring-slice { fill: none; stroke: var(--tk-dash-c); stroke-width: 5; transition: stroke-dasharray 600ms cubic-bezier(.16, 1, .3, 1); }

.tk-dash__ring-wrap { position: relative; inline-size: min(13rem, 100%); }

.tk-dash__ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.tk-dash__ring-big {
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg1);
  font-variant-numeric: tabular-nums;
}

.tk-dash__ring-small,
.tk-dash__label,
.tk-dash__tiles dt {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg2);
}

.tk-dash__key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--fg2);
}

.tk-dash__key strong { color: var(--fg1); font-variant-numeric: tabular-nums; }

.tk-dash__swatch {
  display: inline-block;
  inline-size: 0.75rem;
  block-size: 0.75rem;
  margin-inline-end: var(--space-1);
  border-radius: 2px;
  background: var(--tk-dash-c);
  vertical-align: -0.05em;
}

.tk-dash__money {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  border-block-start: 4px solid var(--accent);
}

.tk-dash__label { margin: 0; }

.tk-dash__big {
  margin: var(--space-1) 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg1);
  font-variant-numeric: tabular-nums;
}

.tk-dash__meter {
  margin-block-start: var(--space-3);
  block-size: 0.625rem;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.tk-dash__meter > span {
  display: block;
  block-size: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.tk-dash__note { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--fg2); }

.tk-dash__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: var(--space-3);
  margin: 0;
}

.tk-dash__tiles > div {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

.tk-dash__tiles dd {
  margin: var(--space-1) 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--fg1);
  font-variant-numeric: tabular-nums;
  /* A large sum in the narrowest tile, with a reader's own letter spacing, wraps inside the tile rather than running out of it (WCAG 1.4.12). */
  overflow-wrap: anywhere;
}

.tk-dash__charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-4);
}

.tk-dash__chart h3 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg1);
}

.tk-dash__bars,
.tk-dash__stacks {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tk-dash__bars li,
.tk-dash__stacks li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.tk-dash__bar-label { color: var(--fg1); font-weight: 600; overflow-wrap: anywhere; }
.tk-dash__bar-value { color: var(--fg1); font-variant-numeric: tabular-nums; text-align: end; }
.tk-dash__bar-value small { color: var(--fg2); font-size: var(--text-xs); }

.tk-dash__bar,
.tk-dash__stack {
  grid-column: 1 / -1;
  display: flex;
  block-size: 0.75rem;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.tk-dash__bar > span {
  display: block;
  border-radius: inherit;
  background: var(--tk-dash-bar, var(--accent));
}

.tk-dash__bars--1 { --tk-dash-bar: var(--gold); }
.tk-dash__bars--2 { --tk-dash-bar: var(--good); }
.tk-dash__bars--3 { --tk-dash-bar: var(--accent-text); }

.tk-dash__stack > span { display: block; background: var(--tk-dash-c); }

.tk-zone-fill__pct {
  display: inline-block;
  margin-block-end: var(--space-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tk-zone-fill__bar {
  min-inline-size: 5rem;
  block-size: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .tk-dash__ring-slice { transition: none; }
}

/* The Reports page: its totals as one big number and tiles, and each table's bars above it (the table under them says the same in words). */
.ticketing-reports__hero { margin-block: var(--space-4); }
.ticketing-reports__chart { margin-block-end: var(--space-4); }
.ticketing-reports__chart .tk-dash__label { margin-block-end: var(--space-3); }

/* A fill meter (sold, then held, on the open rest), on the office's event cards, the window's event choice and the events list. */
.tk-fill {
  display: flex;
  align-items: stretch;
  inline-size: 100%;
  block-size: 0.5rem;
  margin-block: var(--space-3) var(--space-1);
  border-radius: 999px;
  background: var(--surface-sunken);
  box-shadow: inset 0 0 0 1px var(--rule-soft);
  overflow: hidden;
}

.tk-fill__sold,
.tk-fill__held {
  display: block;
  block-size: 100%;
  flex: 0 0 auto;
}

.tk-fill__sold { background: var(--accent); }
.tk-fill__held { background: var(--gold); }
.tk-fill--thin { block-size: 0.375rem; margin-block: var(--space-1) 0; }

.ticketing-office-events__pct {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg2);
}

/* An office's event card puts its badge after the title on one line, not under it. */
.ticketing-office-events__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); }

/* The events list: every month's table lines up with the next, and a sold cell carries its meter. */
@media (min-width: 48rem) {
  [id^="ticketing-month-"] table { table-layout: fixed; inline-size: 100%; }
  [id^="ticketing-month-"] th:nth-child(1) { inline-size: 28%; }
  [id^="ticketing-month-"] th:nth-child(2) { inline-size: 22%; }
  [id^="ticketing-month-"] th:nth-child(3) { inline-size: 13%; }
  [id^="ticketing-month-"] th:nth-child(4) { inline-size: 15%; }
}
.tk-window__event .tk-fill { margin-block-start: var(--space-2); }

/* The office's door: the totals read as a scoreboard, the sections as cards, the gates side by side, and the earlier events as a list of meters. */
.tk-door-office__totals dd { font-family: var(--font-display); letter-spacing: -0.02em; }
.tk-door-office__totals > div:first-child { border-block-start: 4px solid var(--accent); }
.tk-door-office__heading { margin-block: var(--space-5) var(--space-2); font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.tk-door-office__scanner {
  display: flex;
  inline-size: fit-content;
  max-inline-size: 100%;
  box-sizing: border-box;
  align-items: center;
  min-block-size: var(--target-min);
  margin-block: var(--space-3);
  padding-inline: var(--space-4);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  text-decoration: none;
}
.tk-door-office__scanner:hover { background: var(--accent-hover); color: var(--accent-fg); }
.tk-door-office__gates { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: var(--space-3); }
.tk-door-office__gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.tk-door-office__gate form { margin-inline-start: auto; }
.tk-door-office__earlier { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: var(--space-3); }
.tk-door-office__earlier li {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
