/* System (#/system/:tab): the five tabs (API v2, API v1, Providers, Catalog, Web & server).
   Page-specific rules only: shared components live in app.css and charts.css, colors in tokens.css.
   Prefix every selector with this page's root class (see js/README.md, "CSS conventions"). */

/* The tab content: a stack of sections (some paired in .grid-2), never cards in cards */
.page-system .system-panel { display: flex; flex-direction: column; gap: var(--section-gap); min-width: 0; }

/* On phones the five tabs wrap onto two lines instead of hiding some behind a sideways scroll */
@media (max-width: 639px) {
  .page-system .tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
  .page-system .tab { min-height: var(--touch); padding: var(--space-2); }
}

/* A section's body: blocks spaced like a stack. Rendered content sits in one .system-view (patched in place on
   refresh, see stable() in system.js); states sit directly in the body. */
.page-system .section-body > * + *,
.page-system .system-view > * + * { margin-top: var(--space-4); }
.page-system .system-view > .subsection-title { margin-top: var(--space-5); }

/* A ?section= link focuses the section's heading (tabindex -1): no ring on a heading nobody tabbed to */
.page-system .section-title[tabindex="-1"]:focus { outline: none; }

.page-system .system-notices { display: flex; flex-direction: column; gap: var(--space-2); }
.page-system .system-note { font-size: var(--text-meta); color: var(--ink-3); }
.page-system .system-figure { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.page-system .system-error { color: var(--delta-bad); }

/* A chart or meter beside its facts: one column on phones and tablets, side by side from 1024 px */
.page-system .system-split { display: grid; gap: var(--space-4) var(--space-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .page-system .system-split { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

/* Providers: the per-service tables under one provider */
.page-system .system-subsection { display: flex; align-items: center; gap: var(--space-2); }
.page-system .system-last-error { display: inline; overflow-wrap: anywhere; }
.page-system .system-last-error .tag { vertical-align: 1px; }
/* Wide tables (a provider's nine columns) between the card breakpoint and desktop: headers and paired values
   wrap instead of pushing the table sideways */
@media (min-width: 640px) {
  .page-system .data-table thead th { white-space: normal; }
  .page-system .data-table td.system-wrap { white-space: normal; }
}

/* Dashboard session: one row per API */
.page-system .system-row { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: var(--space-3); font-size: var(--text-secondary); }
.page-system .system-row-name { font-weight: 600; }
@media (max-width: 479px) { .page-system .system-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); } }

/* The event log: time, then the sentence with who, from where and which app */
.page-system .system-events { list-style: none; margin: 0; padding: 0; }
.page-system .system-event {
  display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: var(--space-3);
  font-size: var(--text-secondary);
}
.page-system .system-event:focus { outline: none; }
.page-system .system-event:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.page-system .system-event-time { color: var(--ink-2); white-space: nowrap; }
.page-system .system-event-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.page-system .system-event-meta { font-size: var(--text-meta); color: var(--ink-3); }
.page-system .system-event-meta a { color: var(--accent-text); }
@media (max-width: 479px) {
  .page-system .system-event { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .page-system .system-event-time { font-size: var(--text-meta); }
}
.page-system .system-more-error .field-error { margin: 0; }
@media (max-width: 767px) { .page-system .system-panel .table-footer .btn, .page-system .system-panel .cluster > .btn { min-height: var(--touch); } }
