/* ==========================================
   UI-REST — Đối tác (Graphite), approved mockup 05/10/2026 + D1–D4 10/10/2026. Tenant-only pieces on top of users.css;
   scoped under .us / .tn-*, colours from --g-* tokens.
   ========================================== */
/* Summary strip: counts of the loaded list only (no money, no stats endpoint). */
.tn-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tn-stat { padding: 12px 14px; border: 1px solid var(--g-line-soft); border-radius: 11px; background: var(--g-panel); }
.tn-stat span { display: block; font-size: 11.5px; color: var(--g-muted); }
.tn-stat b { display: block; margin-top: 3px; font-size: 22px; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--g-text); }
.tn-stat.warn b { color: var(--g-warn); }
button.tn-stat { width: 100%; text-align: left; font: inherit; cursor: pointer; }
button.tn-stat:hover { border-color: var(--g-line); }
button.tn-stat[aria-pressed="true"] { border-color: var(--g-coral-line); background: var(--g-coral-bg); }

.tn-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; color: var(--g-muted); }
.tn-main { margin-left: 6px; padding: 0 5px; border: 1px solid var(--g-line); border-radius: 4px; font-size: 10.5px; font-weight: 500; color: var(--g-text-2); }
.tn-host { color: var(--g-text-2); text-decoration: none; }
.tn-host:hover { color: var(--g-coral-ink); text-decoration: underline; }
.tn-host.off { color: var(--g-muted); text-decoration: line-through; }
.tn-limits { display: block; font-variant-numeric: tabular-nums; }
.tn-limits small { display: block; font-size: 11.5px; color: var(--g-muted); }
.us-avatar.tn-sq { border-radius: 9px; }

/* Panel */
.tn-conn { display: block; }
.tn-conn small { display: block; font-size: 11.5px; color: var(--g-muted); }
.tn-tech { margin-top: 16px; border-top: 1px solid var(--g-line-soft); padding-top: 10px; }
.tn-tech summary { cursor: pointer; font-size: 12px; color: var(--g-muted); }
.tn-tech summary:focus-visible { outline: 2px solid var(--g-coral); outline-offset: 2px; border-radius: 4px; }
.tn-tech dl { margin: 10px 0 0; display: grid; gap: 6px; font-size: 11.5px; }
.tn-tech dt { color: var(--g-muted); }
.tn-tech dd { margin: 0 0 4px; overflow-wrap: anywhere; color: var(--g-text-2); }
.tn-tech ul { margin: 6px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--g-text-2); }

/* Dialogs */
.tn-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tn-suffix { display: flex; align-items: center; }
.tn-suffix .us-input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tn-suffix span { height: 36px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid var(--g-line); border-left: 0; border-radius: 0 8px 8px 0; color: var(--g-muted); font-size: 12.5px; white-space: nowrap; }
.tn-checks { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.tn-checks legend { margin-bottom: 4px; padding: 0; font-size: 12.5px; color: var(--g-text-2); }
.tn-checks label { display: grid !important; grid-template-columns: auto 1fr; gap: 1px 10px !important; align-items: start; cursor: pointer; }
.tn-checks input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--g-coral); grid-row: span 2; }
.tn-checks small { font-size: 11.5px; color: var(--g-muted); }
.tn-key { display: flex; gap: 6px; align-items: center; }
.tn-key .us-input { flex: 1; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .3px; }
.tn-key .g-btn { height: 36px; flex: none; white-space: nowrap; }
.tn-keyline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--g-line-soft); border-radius: 9px; }
.tn-key .g-btn svg, .tn-keyline .g-btn svg { width: 15px; height: 15px; }
.tn-keyline b { font-weight: 550; }
.tn-keyline small { display: block; font-size: 11.5px; color: var(--g-muted); }
.tn-keyline .g-btn { height: 32px; flex: none; white-space: nowrap; }

@media (max-width: 1150px) {
    .tn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .tn-stats { gap: 8px; }
    .tn-stat { padding: 9px 11px; }
    .tn-stat b { font-size: 19px; }
    .tn-row2 { grid-template-columns: 1fr; }
    .us-table td.m-line .tn-code { font-size: 11px; }
    .tn-key { flex-wrap: wrap; }
    .tn-key .us-input { flex: 1 1 100%; }
}

/* Clipboard refused: the message stays inside the key dialog. */
.tn-copy-err { margin: 8px 0 0; }
