/* What only the admin page has; the primitives, colours and shell are the panels' design (panel-design/design.css, loaded first). */

.signin-box { width: min(400px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 16px; }
.signin-box h1 { margin: 0; }
.signin-box p { margin: 0; }
.signin-box #gsi { display: flex; min-height: 44px; }
.signin-box #signin-retry { align-self: flex-start; }

/* Live: each kind of event has its colour, as a label in the table and a dot in its filter chip. */
.kind-command { --c: var(--accent-text); --cb: var(--container); --dot: var(--accent); }
.kind-sign_in { --c: var(--cyan); --cb: var(--cyan-bg); --dot: var(--cyan); }
.kind-rejected, .kind-error { --c: var(--danger-text); --cb: var(--danger-bg); --dot: var(--danger); }
.kind-account { --c: var(--ok); --cb: var(--ok-bg); --dot: var(--ok); }
.kind-link { --c: var(--attn); --cb: var(--attn-bg); --dot: var(--attn); }
.kind-admin { --c: var(--violet); --cb: var(--violet-bg); --dot: var(--violet); }
#live-events td:last-child { overflow-wrap: anywhere; }
.account-cell { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.account-cell .icon-button { width: 28px; height: 28px; }
.account-cell .icon-button .icon { width: 16px; height: 16px; }

/* Players: the list and the open player side by side. */
.master-detail { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
.pane { min-height: 0; min-width: 0; }
.list-pane { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-right: 1px solid var(--line); }
.list-pane .toolbar { flex-wrap: nowrap; }
.detail-pane { padding: 0 32px 48px; }
.empty-state { margin: 20vh auto 0; max-width: 320px; text-align: center; }
.detail-head { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 20px 0 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-head h2 { flex: 1; min-width: 0; margin: 0; font-family: var(--mono); font-size: 18px; line-height: 28px; font-weight: 400; letter-spacing: 0; overflow-wrap: anywhere; }
/* The dates go on a line of their own, under the id. */
.detail-head .muted { order: 1; flex-basis: 100%; margin-top: -8px; font-size: 12px; }
.back { display: none; }
#player-commands td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
@media (pointer: coarse) {
  /* The other cells' text on the same 32 px line as a folded summary's */
  #player-commands td { padding-top: 4px; padding-bottom: 4px; line-height: 32px; }
}

/* Metrics: one series of bars per chart, on a zero baseline. */
.chart { min-height: 180px; }
.chart-empty { margin: 60px 0; text-align: center; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; }
.bar-slot { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-slot:hover .chart-bar { opacity: 0.8; }
.chart-bar { width: 100%; max-width: 28px; border-radius: 2px 2px 0 0; background: var(--accent); }
.bar-value { font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.bar-axis { display: flex; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.bar-axis span { flex: 1; min-width: 0; font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; }
/* The end labels grow inwards, so they stay inside the chart. */
.bar-axis span:first-child { text-align: left; }
.bar-axis span:last-child { display: flex; justify-content: flex-end; }
#chart-tip { position: fixed; }

/* Medium and compact windows: the list and the open player one at a time. Matches isPhone in app.js. */
@media (max-width: 839px) {
  .master-detail { grid-template-columns: minmax(0, 1fr); }
  .master-detail .detail-pane { display: none; padding: 0 24px 32px; }
  .master-detail.detail-open .list-pane { display: none; }
  .master-detail.detail-open .detail-pane { display: block; }
  .list-pane { border-right: 0; }
  /* Back on a line of its own, its icon in line with the id under it; then the id, the dates and the button. */
  .back { display: inline-flex; margin-left: -8px; }
  .detail-head h2 { flex-basis: 100%; }
  #player-live { order: 2; }
  /* The kind shows as the row's colour instead, so the account's buttons keep their place. */
  #live-events td:nth-child(2), #live-events th:nth-child(2) { display: none; }
  #live-events tr[class^="kind-row-"] td:first-child { box-shadow: inset 3px 0 var(--accent); }
  #live-events tr.kind-row-sign_in td:first-child { box-shadow: inset 3px 0 var(--cyan); }
  #live-events tr.kind-row-rejected td:first-child, #live-events tr.kind-row-error td:first-child { box-shadow: inset 3px 0 var(--danger); }
  #live-events tr.kind-row-account td:first-child { box-shadow: inset 3px 0 var(--ok); }
  #live-events tr.kind-row-link td:first-child { box-shadow: inset 3px 0 var(--attn); }
  #live-events tr.kind-row-admin td:first-child { box-shadow: inset 3px 0 var(--violet); }
  #live .search-bar { flex-basis: 100%; }
}

@media (max-width: 599px) {
  .list-pane { padding: 12px 16px 16px; }
  .master-detail .detail-pane { padding: 0 16px 32px; }
  /* A whole account id fits on one line. */
  .detail-head h2 { font-size: 15px; line-height: 24px; }
}
