/* ═════════════ sp-monitor dashboard — sidebar + main ═════════════ */

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1c1e21;
  background: #f6f7f9;
  min-height: 100vh;
}
body.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* ══════════ SIDEBAR ══════════ */

.sidebar {
  background: #0f172a;
  color: #cbd5e1;
  padding: 22px 0 32px;
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  margin-bottom: 16px;
}
.brand-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22d3ee, #a855f7);
  color: #0b1220;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.brand-title {
  font-weight: 700;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.2;
}
.brand-sub {
  color: #64748b;
  font-size: 11px;
  margin-top: 2px;
}

.side-nav {
  padding: 0 12px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  margin-bottom: 12px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 2px;
}
.side-link:hover { background: rgba(148, 163, 184, 0.08); color: #f8fafc; }
.side-link.is-active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.15), rgba(34, 211, 238, 0.04));
  color: #67e8f9;
  font-weight: 600;
}
.side-link.side-link-alt {
  color: #94a3b8;
  font-size: 12.5px;
}
.side-link.side-link-alt:hover { color: #cbd5e1; }

/* The whole host section is a <details> — clickable to collapse the
   entire host group when you have many servers. */
details.side-section {
  padding: 0 12px;
  margin-bottom: 18px;
}
details.side-section > summary {
  list-style: none;
  cursor: pointer;
  outline: none;
}
details.side-section > summary::-webkit-details-marker { display: none; }
details.side-section > summary::marker { content: ""; }

.side-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  border-radius: 6px;
  transition: background 0.12s;
}
details.side-section > summary.side-section-head:hover {
  background: rgba(148, 163, 184, 0.06);
}

.side-host-caret {
  color: #64748b;
  font-size: 10px;
  width: 10px;
  flex-shrink: 0;
  display: inline-block;
  transition: transform 0.15s ease;
}
details.side-section[open] > summary .side-host-caret {
  transform: rotate(90deg);
}

.side-section-title { color: #f1f5f9; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 700; }

.side-ver {
  margin-left: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.side-ver.side-ver-old {
  color: #fbbf24;
}
.ver-badge {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.host-ver {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: #6b7280;
  font-weight: 500;
  margin-left: 4px;
}
.host-ver.host-ver-old { color: #b45309; }
.host-ver .ver-badge {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, 0.35);
  margin-left: 2px;
}

/* Each box is a <details> element — clickable summary shows the header,
   child <a> elements only visible when open. */
details.side-box {
  margin-bottom: 4px;
}
details.side-box > summary {
  list-style: none;
  cursor: pointer;
  outline: none;
}
details.side-box > summary::-webkit-details-marker { display: none; }
details.side-box > summary::marker { content: ""; }

.side-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 6px;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
details.side-box > summary.side-box-head:hover {
  background: rgba(148, 163, 184, 0.06);
  color: #cbd5e1;
}

.side-box-caret {
  color: #64748b;
  font-size: 10px;
  width: 10px;
  flex-shrink: 0;
  display: inline-block;
  transition: transform 0.15s ease;
}
details.side-box[open] > summary .side-box-caret {
  transform: rotate(90deg);
}

.side-box-name { color: #cbd5e1; }
.side-count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.side-count-fail { background: rgba(251, 113, 133, 0.15); color: #fda4af; }
.side-count-ok   { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }

.side-svc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 24px;
  border-radius: 6px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 12.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  transition: background 0.1s, color 0.1s;
  margin-bottom: 1px;
}
.side-svc:hover { background: rgba(148, 163, 184, 0.08); color: #f8fafc; }
.side-svc.is-active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(34, 211, 238, 0.05));
  color: #67e8f9;
  font-weight: 600;
}
.side-svc-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.side-svc-x {
  color: #fda4af;
  font-weight: 700;
  font-size: 11px;
}

.side-foot {
  margin-top: auto;
  padding: 16px 20px 0;
  color: #64748b;
  font-size: 10.5px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  line-height: 1.5;
}
.side-foot-time {
  color: #475569;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
}
.side-logout {
  display: block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, .15);
  color: #64748b;
  font-size: 11px;
  text-align: center;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.side-logout:hover {
  background: rgba(239, 68, 68, .1);
  border-color: rgba(239, 68, 68, .3);
  color: #fca5a5;
}

/* ══════════ MAIN ══════════ */

.main {
  padding: 26px 32px 60px;
  overflow-x: hidden;
}


.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 18px;
}
.crumb a {
  color: #2563eb;
  text-decoration: none;
}
.crumb a:hover { text-decoration: underline; }
.crumb-sep { color: #9ca3af; }
.crumb-current { color: #111827; font-weight: 600; }

/* ── overview header ── */

.overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}
.overview-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}
.overview-sub {
  color: #6b7280;
  font-size: 13px;
  margin-top: 4px;
}
.overview-refresh {
  color: #9ca3af;
  font-size: 11.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── host section ── */

details.host {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 24px;
}
.host-head {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: 6px;
  padding: 4px 6px;
  transition: background 0.15s;
}
.host-head::-webkit-details-marker { display: none; }
.host-head:hover { background: #f1f5f9; }
.host-caret { font-size: 10px; color: #94a3b8; transition: transform 0.15s; }
details.host[open] > .host-head > .host-caret { transform: rotate(90deg); }
.host-name { font-size: 15px; font-weight: 600; }
.host-head .meta {
  margin-left: auto;
  font-weight: normal;
  color: #6b7280;
  font-size: 12px;
}

/* ── dots ── */
.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #9ca3af;
  flex-shrink: 0;
}
.dot-sm { width: 8px; height: 8px; }
.dot-xs { width: 7px; height: 7px; }
.dot-ok      { background: #16a34a; box-shadow: 0 0 6px rgba(22, 163, 74, 0.35); }
.dot-fail    { background: #dc2626; box-shadow: 0 0 6px rgba(220, 38, 38, 0.4); }
.dot-unknown { background: #eab308; }

/* ── boxes ── */

.boxes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
details.box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}
details.box.box-ok      { border-left-color: #16a34a; }
details.box.box-fail    { border-left-color: #dc2626; }
details.box.box-unknown { border-left-color: #eab308; }

details.box > summary {
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary:hover { background: #fafbfc; }

.box-name {
  font-weight: 700;
  color: #111827;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.box-desc {
  color: #6b7280;
  font-size: 12.5px;
  flex: 1 1 auto;
}
.box-counts {
  display: flex; gap: 6px; align-items: center; flex-shrink: 0;
}
.cnt {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.cnt-ok      { background: #dcfce7; color: #14532d; }
.cnt-fail    { background: #fee2e2; color: #7f1d1d; }
.cnt-unknown { background: #fef3c7; color: #78350f; }

details.box > table {
  border-top: 1px solid #eef0f3;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 8px 14px;
  border-bottom: 1px solid #eef0f3;
  vertical-align: top;
}
th {
  font-weight: 600;
  color: #4b5563;
  background: #fafbfc;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tr:last-child td { border-bottom: none; }
tr.row-ok      { background: transparent; }
tr.row-fail    { background: #fef2f2; }
tr.row-unknown { background: #fffbeb; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge.big { padding: 4px 12px; font-size: 12px; }
.badge-ok      { background: #dcfce7; color: #14532d; }
.badge-fail    { background: #fee2e2; color: #7f1d1d; }
.badge-unknown { background: #fef3c7; color: #78350f; }

.msg { max-width: 480px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #374151; }
.ts { color: #6b7280; font-size: 12px; white-space: nowrap; }
.svc-link { color: #111827; text-decoration: none; }
.svc-link:hover { text-decoration: underline; }
.svc-link code { background: #f3f4f6; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.empty { color: #6b7280; font-style: italic; }
code { background: #f3f4f6; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ══════════ SERVICE DETAIL VIEW ══════════ */

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 20px;
}
.detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}
.detail-title code {
  font-size: 20px;
  background: #f3f4f6;
  padding: 4px 12px;
  border-radius: 6px;
  color: #111827;
}
.detail-title .dot { width: 14px; height: 14px; }
.detail-sub {
  color: #6b7280;
  font-size: 13px;
  margin-top: 8px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.check-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 14px 16px;
}
.check-card.check-ok      { border-left-color: #16a34a; }
.check-card.check-fail    { border-left-color: #dc2626; background: #fef2f2; }
.check-card.check-unknown { border-left-color: #eab308; background: #fffbeb; }

.check-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.check-name {
  font-weight: 700;
  font-size: 13px;
  color: #111827;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: lowercase;
}
.check-msg {
  color: #374151;
  font-size: 12.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin: 4px 0;
}
.check-ts {
  color: #6b7280;
  font-size: 11px;
  margin-bottom: 4px;
}
.check-kv {
  font-size: 11px;
  color: #4b5563;
  margin-top: 8px;
}
.check-kv code {
  background: rgba(0,0,0,0.05);
  color: #111827;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  word-break: break-all;
}
.check-kv .lbl {
  color: #6b7280;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}

/* ── classification block (reused in detail view) ── */

.classification {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid #6b7280;
  font-size: 12px;
  background: #f8fafc;
}
.classification-known {
  border-left-color: #16a34a;
  background: #f0fdf4;
}
.classification-unknown {
  border-left-color: #eab308;
  background: #fefce8;
}
.cls-category {
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}
.cls-category code {
  background: rgba(0,0,0,0.06);
  color: #111827;
  font-size: 11.5px;
  margin-left: 4px;
}
.cls-hint, .cls-action {
  color: #374151;
  font-size: 11.5px;
  margin-top: 3px;
}
.cls-hint .lbl, .cls-action .lbl {
  color: #6b7280;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

.struct { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; }
.pill {
  padding: 1px 8px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #4338ca;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.pill.muted { background: #f3f4f6; border-color: #e5e7eb; color: #6b7280; font-weight: 400; }
.event {
  margin: 6px 0;
  color: #111827;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
pre.exc {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  overflow: auto;
  margin: 6px 0 0;
  white-space: pre-wrap;
  max-height: 300px;
}

/* ── key-value grid on check cards ── */

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 12px;
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kv .k {
  color: #6b7280;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.kv .v {
  color: #111827;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  word-break: break-word;
}
.kv .v code {
  background: transparent;
  padding: 0;
  color: #111827;
  font-size: 12px;
}
.kv .v-running, .kv .v-RUNNING { color: #16a34a; font-weight: 600; }
.kv .v-exited, .kv .v-EXITED, .kv .v-STOPPED, .kv .v-FATAL { color: #dc2626; font-weight: 600; }
.kv .v-restarting { color: #f59e0b; font-weight: 600; }

/* ── parsed structured log lines ── */

.log-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.log-line {
  padding: 8px 12px;
  border-radius: 6px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.5;
}
.log-line-info  { border-left-color: #22d3ee; }
.log-line-warn  { border-left-color: #f59e0b; background: #fef3c7; }
.log-line-error { border-left-color: #dc2626; background: #fef2f2; }
.log-line-crit,
.log-line-fatal { border-left-color: #7f1d1d; background: #fee2e2; }
.log-line-plain { border-left-color: #9ca3af; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; word-break: break-word; }

.log-line-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10.5px;
  color: #6b7280;
  margin-bottom: 3px;
}
.log-lvl {
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.log-lvl-info  { background: #cffafe; color: #155e75; }
.log-lvl-warn  { background: #fef3c7; color: #78350f; }
.log-lvl-error { background: #fecaca; color: #7f1d1d; }
.log-lvl-crit,
.log-lvl-fatal { background: #7f1d1d; color: #fee2e2; }
.log-lvl-debug,
.log-lvl-log   { background: #e5e7eb; color: #374151; }

.log-ts { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; color: #9ca3af; }
.log-logger { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; color: #6b7280; }

.log-event {
  color: #111827;
  font-size: 12.5px;
  margin: 2px 0;
}
.log-err {
  margin: 4px 0;
  padding: 6px 8px;
  background: rgba(220, 38, 38, 0.06);
  border-left: 2px solid #dc2626;
  color: #7f1d1d;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  white-space: pre-wrap;
  border-radius: 3px;
}
.log-tb {
  margin-top: 4px;
}
.log-tb summary {
  cursor: pointer;
  font-size: 11px;
  color: #2563eb;
  padding: 2px 0;
}
.log-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.log-kv {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.log-kv .log-k { color: #6b7280; font-weight: 600; }
.log-kv .log-v { color: #111827; }

/* ══════════ GPU strip (overview) ══════════ */

.gpu-section { margin: 8px 0 4px; }
.gpu-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  padding: 4px 0;
  list-style: none;
  user-select: none;
}
.gpu-section-head::-webkit-details-marker { display: none; }
.gpu-section-head::before { content: '▸'; font-size: 10px; color: #94a3b8; }
details.gpu-section[open] > .gpu-section-head::before { content: '▾'; }
.gpu-section-count { font-weight: 400; color: #94a3b8; }

.gpu-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}
.gpu-card {
  display: block;
  border: 1px solid #e5e7eb;
  border-left-width: 3px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.gpu-card:hover { border-color: #94a3b8; }
.gpu-card.gpu-ok      { border-left-color: #16a34a; }
.gpu-card.gpu-fail    { border-left-color: #dc2626; background: #fef2f2; }
.gpu-card.gpu-unknown { border-left-color: #eab308; background: #fffbeb; }
.gpu-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.gpu-idx  { font-weight: 700; font-size: 13px; color: #111827; }
.gpu-name { color: #6b7280; font-size: 12px; }
.gpu-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin-bottom: 6px;
}
.gpu-metrics .lbl { color: #6b7280; margin-right: 6px; }
.gpu-metrics .val { color: #111827; }
.gpu-msg  { color: #4b5563; font-size: 11.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ══════════ system strip (disk mounts on overview) ══════════ */

.sys-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}
.sys-card {
  display: block;
  border: 1px solid #e5e7eb;
  border-left-width: 3px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.sys-card:hover { border-color: #94a3b8; }
.sys-card.sys-ok   { border-left-color: #16a34a; }
.sys-card.sys-fail { border-left-color: #dc2626; background: #fef2f2; }
.sys-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.sys-icon { font-size: 14px; }
.sys-mount {
  font-weight: 600;
  font-size: 13px;
  color: #111827;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  flex: 1;
}
.sys-mount .sys-sub {
  color: #6b7280;
  font-weight: 400;
  margin-left: 4px;
}
.sys-pct { font-weight: 700; font-size: 13px; color: #111827; }
.sys-card.sys-fail .sys-pct { color: #b91c1c; }
.sys-bar {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.sys-bar-fill {
  height: 100%;
  background: #16a34a;
  transition: width 200ms ease-out;
}
.sys-card.sys-fail .sys-bar-fill { background: #dc2626; }
.sys-foot {
  color: #6b7280;
  font-size: 11.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ══════════ stopped-container details (stop reason + log tail) ══════════ */

.stop-reason {
  margin-top: 10px;
  border-left: 3px solid #dc2626;
  background: #fef2f2;
  border-radius: 4px;
  padding: 8px 10px;
}
.stop-reason-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #b91c1c;
  margin-bottom: 4px;
}
.stop-reason-body {
  color: #7f1d1d;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.container-logs {
  margin-top: 10px;
}
.container-logs > summary {
  cursor: pointer;
  font-size: 12px;
  color: #4b5563;
  font-weight: 600;
  padding: 4px 0;
}
.container-logs > summary:hover { color: #111827; }
.log-tail {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  border-radius: 6px;
  white-space: pre;
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}

/* ══════════ ranked services table (host detail: CPU top-offenders) ══════════ */

.rank-block { margin-top: 20px; }
.rank-head h3 {
  margin: 0 0 2px;
  font-size: 15px;
  color: #111827;
}
.rank-sub {
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 8px;
}
.rank-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
.rank-table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.rank-table td {
  padding: 6px 12px;
  border-top: 1px solid #f1f5f9;
  color: #111827;
}
.rank-row:hover { background: #f9fafb; }
.rank-row a { color: inherit; text-decoration: none; }
.rank-row a:hover code { text-decoration: underline; }
.rank-pos { width: 40px; color: #94a3b8; text-align: right; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.rank-name code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.rank-num {
  text-align: right;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  width: 100px;
}
.rank-row.rank-fail { background: #fef2f2; }
.rank-row.rank-fail:hover { background: #fee2e2; }
.rank-row.rank-unknown { color: #a16207; }

/* ══════════ responsive ══════════ */

@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
}
