/* ==========================================
   Máy chủ: danh sách (UI-REST-SERVERS, Graphite). Loaded after infra.css; reuses the released pieces
   (us-head, us-alert, us-toast, us-modal, sd-toolbar, sd-seg, sd-table, sd-pager, sd-state) and only adds what the
   server list needs. Colours only from --g-* tokens (plus the same literals sd-table uses for its own surfaces).
   ========================================== */

/* sr-only spans inside the headers are absolutely positioned: keep their containing block inside the scroller so they cannot widen the document */
.sv .sd-scroll { position: relative; }
.sv .sv-table { min-width: 1000px; }
.sv .sv-table td.sv-name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.sv .sv-table td.sv-name .sub { color: var(--g-muted); }
.sv .sv-ok { color: var(--g-ok); font-weight: 550; }
.sv .sv-of { color: var(--g-muted); }
.sv .sv-strong { font-weight: 600; }
.sv .sv-seen { color: var(--g-muted); }
.sv .sd-status.muted i { background: #6d6e74; }

/* Row actions: open detail (link) and delete (Admin / SuperAdmin) */
.sv .sv-actions { width: 1%; text-align: right; white-space: nowrap; }
.sv .sv-actions .g-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; vertical-align: middle; text-decoration: none; }
.sv .sv-actions .g-icon-btn svg { width: 16px; height: 16px; }
.sv .g-icon-btn.bad { color: var(--g-bad); }

/* The first column stays visible while the table scrolls sideways on narrow screens */
.sv .sv-table th:first-child, .sv .sv-table td:first-child, .sv .sv-table tfoot td:first-child { position: sticky; left: 0; z-index: 1; }
.sv .sv-table td:first-child { background: #1a1b1e; }
.sv .sv-table th:first-child { background: #1e1f23; }
[data-theme="light"] .sv .sv-table td:first-child { background: var(--g-panel); }
[data-theme="light"] .sv .sv-table th:first-child { background: #f1eee9; }

/* Totals over the filtered rows (all pages) */
.sv .sv-total td { height: 42px; background: #1e1f23; border-top: 1px solid #3a3b41; border-bottom: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
[data-theme="light"] .sv .sv-total td { background: #f1eee9; border-top-color: var(--g-line); }
.sv .sv-total td:first-child { background: #1e1f23; }
[data-theme="light"] .sv .sv-total td:first-child { background: #f1eee9; }

.sv .sv-page { min-width: 84px; text-align: center; font-size: 12.5px; color: var(--g-text-2); font-variant-numeric: tabular-nums; }
.sv .sd-pager button svg { width: 16px; height: 16px; }

/* Sort chooser only for the phone list (the column headers are hidden there) */
.sv .sv-msort { display: none; }

@media (max-width: 720px) {
    /* graphite.css turns .sd-table into list rows: name + total earned on the first line, the rest on one wrapped line */
    .sv .sv-table { min-width: 0; }
    .sv .sv-table th:first-child, .sv .sv-table td:first-child, .sv .sv-table tfoot td:first-child { position: static; }
    .sv .sv-table td.sv-name { max-width: none; overflow: visible; }
    .sv .sv-table td.sv-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 6px; width: auto; }
    .sv .sv-table td.m-line { display: flex; flex-wrap: wrap; align-items: center; row-gap: 3px; }
    .sv .sv-table td.m-line > .sd-status { margin-right: 7px; }
    .sv .sv-table td.m-line > .sd-status + span::before { content: none; }
    .sv .sv-table tfoot { display: block; }
    .sv .sv-table .sv-total { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 11px 14px; border-top: 1px solid var(--g-line); background: #1e1f23; }
    [data-theme="light"] .sv .sv-table .sv-total { background: #f1eee9; }
    .sv .sv-table .sv-total td { height: auto; border: 0; }
    [data-theme="light"] .sv .sv-table tbody tr { border-bottom-color: var(--g-line-soft); }
    .sv .sv-msort { display: block; }
    .sv .sv-msort select { width: 100%; max-width: none; }
    .sv .us-head-actions { flex-wrap: wrap; }
}
