/*
 * Admin redesign (2026-11-22): the Overview and Live (Queue, Live calls,
 * Interpreters, Connected). Only what these views need on top of
 * css/admin-shell.css and css/admin-redesign.css. Tokens only; 4pt spacing.
 */

/* Overview: two columns; they stack below 1100px. */
.rd-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.rd-overview-col {
    display: grid;
    gap: 16px;
    min-width: 0;
}
.rd-overview-col > .section { margin: 0; }

/* The four numbers. */
.rd-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.rd-stats a {
    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-stats strong {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.rd-stats strong[data-tone="orange"] { color: var(--status-orange-text); }
.rd-stats strong[data-tone="red"] { color: var(--status-red-text); }
.rd-stats span { color: var(--color-text-2); font-size: 13px; }

/* A calm line: nothing waits, nothing to list, or a count under a list. */
.rd-calm {
    margin: 0;
    padding: 12px 16px;
    color: var(--color-text-2);
}
.rd-calm[hidden] { display: none; }
.rd-calm-line { border-top: 1px solid var(--color-border); }
.rd-att:not(:empty) + .rd-calm { border-top: 1px solid var(--color-border); }

/* The tone of a "Needs attention" or Services row is its dot. */
.rd-att > a { --attention-tone: var(--status-grey); }
.rd-att > a[data-tone="green"] { --attention-tone: var(--status-green); }
.rd-att > a[data-tone="orange"] { --attention-tone: var(--status-orange); }
.rd-att > a[data-tone="red"] { --attention-tone: var(--status-red); }
.rd-att > a[data-tone="indigo"] { --attention-tone: var(--status-indigo); }
.rd-att > a:hover { background: var(--color-row-hover); }
.rd-att .rd-att-text { min-width: 0; }
.rd-att .panel-age { margin-left: auto; white-space: nowrap; }
.rd-att .panel-age + .rd-go { margin-left: 0; }

/* Last 7 days. */
.rd-chart { padding: 16px; }
.rd-chart .mini-chart { height: 112px; margin-top: 0; }
.rd-chart-labels {
    display: flex;
    justify-content: space-between;
    margin: 8px 0 12px;
    color: var(--color-text-2);
    font-size: 12px;
}
.rd-chart-labels span { flex: 1; text-align: center; }

/* A list with the open item beside it; one column when nothing is open. */
.rd-live-split:has(> .rd-panel[hidden]),
.rd-live-split:has(> .rd-panel.is-view-hidden) {
    grid-template-columns: minmax(0, 1fr);
}
.rd-live-split > .section { margin: 0; }
.rd-live-split > * { min-width: 0; }
.rd-panel-head .rd-sub { margin-right: auto; }
.rd-panel-head:has(.rd-sub) h3 { margin-right: 0; }
.rd-panel-section { margin-top: 24px; }
.rd-panel-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}
.rd-panel .rd-live-table { width: 100%; }
#callDetailDeveloper { margin: 12px 0 0; overflow-wrap: anywhere; }
#callDetailDeveloper[hidden] { display: none; }

/* The live tables: names stay on one line, the table scrolls inside its card. */
.rd-live-table { width: 100%; }
.rd-live-table .rd-name { white-space: nowrap; }
.rd-live-table .rd-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rd-live-table .rd-actions { text-align: right; white-space: nowrap; }
.rd-live-table tr.rd-row-link { cursor: pointer; }
.rd-live-table tr.is-selected > td { background: var(--color-surface-2); }
.rd-live-table tr.is-dim > td { color: var(--color-text-2); }
.rd-table-message {
    padding: 24px;
    color: var(--color-text-2);
    text-align: center;
}

/* Search and segmented filters in one row; they wrap on a small screen. */
.rd-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.rd-filter-row .search-input { flex: 1 1 200px; max-width: 320px; }

/* The Transfer dialog: one line for each interpreter. */
.rd-transfer-list td { vertical-align: middle; }
.rd-transfer-list tr.is-dim td { color: var(--color-text-2); }

/* Smaller screens: the panels and the tables keep inside the page. */
@media (max-width: 1100px) {
    .rd-overview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
    .rd-filter-row .search-input { max-width: none; }
    .rd-att > a { flex-wrap: wrap; row-gap: 4px; }
    .rd-att .panel-age { display: none; }
    .rd-att .rd-go { margin-left: auto; }
}
@media (max-width: 390px) {
    .rd-stats a { padding: 12px; }
    .rd-stats strong { font-size: 20px; }
    .rd-panel-actions .btn { flex: 1 1 auto; }
}
