/*
 * Admin redesign (2026-11-22): Captioning and System views.
 * Only what css/admin-redesign.css does not have. Tokens only; 4pt spacing;
 * weights 400 and 600.
 */

/* A segmented filter keeps its value in a hidden control. */
select[hidden],
input[hidden] { display: none; }

/* The Captioning views are links (#captioning/<view>). */
a.sub-tab { text-decoration: none; }

/* A wide table scrolls inside its card; names do not break into lines. */
.rd-nowrap th,
.rd-nowrap td { white-space: nowrap; }
.rd-nowrap td.rd-wrap { white-space: normal; min-width: 240px; }
.rd-num { text-align: right; }
td.rd-sub { color: var(--color-text-2); }

/* A row that opens its item beside or below the list. */
tr.rd-row-open { cursor: pointer; }
.rd-row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* The open item: fields, its last row of buttons. */
.rd-panel-field { margin-top: 16px; }
.rd-full { width: 100%; }
.rd-field-error { margin: 4px 0 0; color: var(--status-danger-text); font-size: 13px; }
.rd-panel-ends { justify-content: flex-end; }
.rd-panel-ends .rd-first { margin-right: auto; }
.rd-panel-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--color-border);
}
.rd-panel-foot:empty { display: none; }
.rd-panel-foot .rd-more { margin-right: auto; }
.rd-copy-row { display: flex; gap: 8px; align-items: flex-start; }
.rd-copy-row input,
.rd-copy-row textarea { flex: 1; min-width: 0; }

/* Choices (the languages of an event): each one a chip that is on or off. */
.rd-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-choice {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    color: var(--color-text-2);
    font-size: 13px;
    cursor: pointer;
}
.rd-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rd-choice:has(input:checked) {
    border-color: var(--color-action-primary);
    background: var(--color-action-primary);
    color: var(--color-action-primary-text);
    font-weight: 600;
}
.rd-choice:has(input:focus-visible) { outline: 2px solid var(--color-action-primary); outline-offset: 2px; }
.rd-choice:has(input:disabled) { opacity: 0.6; cursor: default; }

/* "More": the actions that cancel or delete, behind one button. */
.rd-more { position: relative; }
.rd-more > summary { list-style: none; cursor: pointer; }
.rd-more > summary::-webkit-details-marker { display: none; }
.rd-more-menu {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    z-index: 5;
    display: grid;
    gap: 4px;
    min-width: 180px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-1);
}

/* Three numbers above a table (Security, QA). */
.rd-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.rd-stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rd-stat {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface-1);
    color: inherit;
    text-decoration: none;
}
.rd-stat strong { font-size: 24px; font-weight: 600; }
.rd-stat span { color: var(--color-text-2); font-size: 13px; }
.rd-stat[data-tone="warning"] strong { color: var(--status-warning-text); }
.rd-stat[data-tone="danger"] strong { color: var(--status-danger-text); }

/* The line under a table (the release) and the open alert. */
.rd-foot-line { margin: 12px 0 0; color: var(--color-text-2); font-size: 12px; }
.rd-open-card { margin-top: 16px; }
.rd-open-card .alert-detail-cell { margin-top: 16px; border-radius: 8px; }
[data-diagnostics-table][hidden] { display: none; }
.rd-more-detail { margin-top: 16px; color: var(--color-text-2); font-size: 13px; }
.rd-more-detail > summary { cursor: pointer; }
.rd-more-detail > div { margin-top: 8px; display: grid; gap: 4px; }
.rd-table-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.rd-table-title h3 { margin: 0 auto 0 0; font-size: 16px; font-weight: 600; }
.rd-muted { color: var(--color-text-2); }

/* System > Watch software (docs/watch-updates.md): the upload checks and the row actions. */
.rd-watch-upload { border-style: dashed; padding: 16px; }
.rd-watch-checks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rd-watch-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rd-watch-icon { display: inline-flex; flex: none; }
.rd-watch-check--ok .rd-watch-icon { color: var(--status-success-text); }
.rd-watch-check--warn .rd-watch-icon { color: var(--status-warning-text); }
.rd-watch-check--bad .rd-watch-icon { color: var(--status-danger-text); }
.rd-watch-check--wait .rd-watch-icon { color: var(--color-text-2); }
.rd-watch-publish { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.rd-watch-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.rd-watch-version { font-weight: 600; }

@media (max-width: 820px) {
    .rd-stats,
    .rd-stats-5 { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .rd-stat { grid-template-columns: auto 1fr; align-items: baseline; gap: 12px; padding: 12px 16px; }
}
