/* Admin console (/admin): the app's shell and Accounts list look, plus tiles and cards. */
.ad-main { max-width: 1040px; }
.ad-badge { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 3px 9px; }
.sidebar .tabs a.tab { text-decoration: none; }
.ad-side-foot { margin-top: auto; display: grid; gap: 6px; }
.ad-side-foot .tab { color: var(--text); text-decoration: none; }
.ad-who { margin: 0 10px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-gate-text { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.ad-gate-btn { text-align: center; text-decoration: none; padding: 10px; }

.ad-view { padding: 6px 0 40px; display: grid; gap: 16px; }
.ad-h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 10px 2px 0; }
.ad-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ad-tile { background: var(--card); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; min-width: 0; }
.ad-tile span { font-size: 12px; color: var(--muted); }
.ad-tile strong { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ad-tile small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ad-tile.warn strong { color: var(--warn); }
.ad-tile.bad strong { color: var(--danger); }

.ad-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ad-card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 10px;
  align-content: start; min-width: 0; }
.ad-card > .btn { justify-self: start; }
.ad-card p { margin: 0; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ad-card progress { width: 100%; height: 6px; appearance: none; border: 0; background: var(--fill); border-radius: 5px; accent-color: var(--accent); }
.ad-card progress::-webkit-progress-bar { background: var(--fill); border-radius: 5px; }
.ad-card progress::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
.ad-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ad-card-head .ac-status { margin: 0; font-size: 12px; }
.ad-muted { color: var(--muted); }
.ad-bad { color: var(--danger); }
.ad-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ad-grow { flex: 1; }
.ac-status.bad i { background: var(--danger); }
.ac-status.warn i { background: var(--warn); }
.ad-note { color: var(--muted); }

.ad-parts, .ad-plain, .ad-commits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ad-parts li, .ad-plain li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.ad-parts .ac-status { margin: 0; font-size: 13px; color: var(--text); }
.ad-parts small, .ad-plain small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ad-commits li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; font-size: 13.5px; }
.ad-commits small { grid-column: 2; font-size: 12px; }
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--fill-soft);
  border-radius: 6px; padding: 1px 6px; }

.ad-log { margin: 0; max-height: 420px; overflow: auto; background: var(--fill-soft); border-radius: 12px; padding: 12px 14px;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-short { max-height: none; }
.ad-setup { border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.ad-reconnect { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }

.ad-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--fill-soft); color: var(--text);
  padding: 10px 12px; font-size: 14px; font-weight: 400; }
.ad-inline { width: auto; padding: 7px 10px; font-size: 13px; }
.ad-link { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--fill-soft); color: var(--text);
  padding: 10px 12px; font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ad-dialog { width: min(500px, calc(100% - 32px)); }
.ad-dialog > .ad-input { margin-top: 4px; }
.ad-dialog-danger h2 { color: var(--danger); }
.ad-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 14px 0; font-size: 13.5px; }
.ad-facts dt { color: var(--muted); }
.ad-facts dd { margin: 0; overflow-wrap: anywhere; }
.ad-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ad-danger-zone p { margin: 0; font-size: 13px; }
.btn.ad-warn { color: var(--warn); }

@media (max-width: 900px) { .ad-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) {
  .ad-grid2 { grid-template-columns: minmax(0, 1fr); }
  .ad-tile strong { font-size: 22px; }
  .ad-row > .btn.primary { width: 100%; }
}

/* Tables: their own scrolling box (both ways) so the page stays short; the header row stays put. */
.ad-table-wrap { max-height: calc(100vh - 300px); min-height: 160px; overflow: auto; background: var(--card);
  border-radius: var(--radius); overscroll-behavior: contain; }
.ad-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ad-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.ad-table th, .ad-table td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ad-table thead th { position: sticky; top: 0; z-index: 2; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 600;
  box-shadow: inset 0 -1px 0 var(--line); border-bottom: 0; }
.ad-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--card); font-weight: 400; }
.ad-table thead th:first-child { left: 0; z-index: 3; }
.ad-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ad-table tbody tr:last-child > * { border-bottom: 0; }
.ad-table tr.ad-click { cursor: pointer; }
.ad-table tr.ad-click:hover > * { background: var(--card-hover, var(--fill-soft)); }
.ad-table .ac-status { margin: 0; font-size: 12px; color: var(--text); }
.ad-sort { border: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: pointer; white-space: nowrap; }
.ad-sort:hover { color: var(--text); }
.ad-person { display: grid; gap: 1px; } .ad-person b { font-weight: 600; } .ad-person small { color: var(--muted); font-size: 12px; }
.ad-links li { align-items: center; }
.ad-short-table { max-height: 240px; min-height: 0; margin-top: 8px; background: var(--fill-soft); }
.ad-short-table .ad-table thead th, .ad-short-table .ad-table tbody th { background: var(--fill-soft); }

/* Usage charts: one measure each, accent bars, recessive grid. */
.ad-tiles6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ad-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ad-chart { margin: 0; background: var(--card); border-radius: var(--radius); padding: 16px 18px 12px; min-width: 0; display: grid; gap: 8px; }
.ad-chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; }
.ad-chart figcaption span { color: var(--muted); font-size: 12px; }
.ad-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ad-bar { fill: var(--accent); }
.ad-grid { stroke: var(--line); stroke-width: 1; }
.ad-base { stroke: var(--faint, var(--line)); stroke-width: 1; }
.ad-axis { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ad-hit { fill: transparent; }
.ad-hit.on { fill: var(--fill-soft); }
.ad-details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.ad-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 10px; box-shadow: var(--shadow-pop); display: grid; gap: 2px; font-size: 12px; }
.ad-tip span { color: var(--muted); }
.ad-tip[hidden] { display: none; }
.ad-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ad-hbars li { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.ad-hbars li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-hbar { height: 8px; background: var(--fill-soft); border-radius: 4px; overflow: hidden; }
.ad-hbar i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.ad-hbars b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
@media (max-width: 650px) {
  .ad-charts, .ad-tiles6 { grid-template-columns: minmax(0, 1fr); }
  .ad-tiles6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-table-wrap { max-height: calc(100vh - 340px); }
}
.ad-view > *, .ad-fill, .ad-fill > * { min-width: 0; max-width: 100%; }
@media (max-width: 650px) {
  .ad-row > .ac-tools.ad-grow { flex: 1 1 100%; }
  .ad-row > .btn:not(.primary) { flex: 1 1 auto; }
}

/* Sources: dialog fields with the label above. */
.ad-field { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.ad-field .ad-input { color: var(--text); }
.ad-table .ad-actions { flex-wrap: nowrap; }
