/* Fleet Health dashboard, embedded natively into index.html's Orchestra View
   (#page-fleet). Ported from static/fleet-health.html (2026-07-27).
   Re-themed 2026-07-27 (Jon: "looks like an iframe, style to match and
   inherit all maestro stuff") - the original standalone page carried its
   own self-contained color palette + a prefers-color-scheme dark-mode
   override; with the SPA itself always light (no dark mode at all), that
   media query made this block go solid black on any dark-mode OS/browser
   while the rest of the page stayed light - a hard color-boundary that
   read exactly like an embedded iframe. Every color below is now the
   app's own :root variable (static/index.html ~line 12), not a local
   redefinition, so this can never diverge from the rest of the page again. */
.fh-embed * { box-sizing: border-box; }
.fh-embed { font-size: 12px; }
.fh-embed .kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.fh-embed .kpi {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 18px;
}
.fh-embed .kpi .label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.fh-embed .kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.fh-embed .kpi .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.fh-embed .kpi .value.amber { color: var(--yellow); }
.fh-embed .kpi .value.danger { color: var(--red); }
.fh-embed .kpi .value.success { color: var(--green); }
.fh-embed .kpi .value.accent { color: var(--blue); }
.fh-embed .panel {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 20px; margin-bottom: 18px;
}
.fh-embed .panel h2 { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.fh-embed .panel .desc { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.fh-embed .panel-body { font-size: 12px; color: var(--text); }
.fh-embed .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) {
.fh-embed .row2 { grid-template-columns: 1fr; }
}
.fh-embed table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fh-embed thead th {
    text-align: left; padding: 9px 8px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    font-size: 10px; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.fh-embed tbody td {
    padding: 9px 8px; border-bottom: 1px solid var(--border-light);
    color: var(--text-dim);
}
.fh-embed tbody tr:hover { background: var(--card-hover); }
.fh-embed .badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em;
}
.fh-embed .badge.high, .fh-embed .badge.danger { background: var(--red-dim); color: var(--red); }
.fh-embed .badge.medium, .fh-embed .badge.amber { background: var(--yellow-dim); color: var(--yellow); }
.fh-embed .badge.low, .fh-embed .badge.muted { background: var(--border-light); color: var(--text-muted); }
.fh-embed .badge.success { background: var(--green-dim); color: var(--green); }
.fh-embed .badge.accent { background: rgba(37,99,235,.1); color: var(--blue); }
.fh-embed .skel {
    background: linear-gradient(90deg, var(--card-hover), var(--border), var(--card-hover));
    background-size: 200% 100%; animation: fh-shimmer 1.4s infinite;
    border-radius: 6px; height: 14px;
}
@keyframes fh-shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.fh-embed .empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 13px; }
.fh-embed .error {
    background: var(--red-dim); color: var(--red);
    padding: 12px; border-radius: 8px; font-size: 12px;
}
.fh-embed .bar-row {
    display: grid; grid-template-columns: 140px 1fr 70px;
    gap: 10px; align-items: center; padding: 4px 0; font-size: 12px;
}
.fh-embed .bar-row .label { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-embed .bar-bg { height: 8px; background: var(--card-hover); border-radius: 4px; overflow: hidden; }
.fh-embed .bar-fill { height: 100%; background: var(--blue); }
.fh-embed .bar-fill.danger { background: var(--red); }
.fh-embed .bar-fill.amber { background: var(--yellow); }
.fh-embed .bar-fill.success { background: var(--green); }
.fh-embed .count { text-align: right; color: var(--text-muted); }
.fh-embed code { font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace; background: var(--card-hover); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.fh-embed .dollar { color: var(--green); font-weight: 600; }
.fh-embed .muted { color: var(--text-muted); }
.fh-embed .section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted); margin: 30px 0 10px;
}
/* Active agents */
.fh-embed .agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 24px; }
.fh-embed .agent-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px; cursor: pointer;
    transition: border-color .15s;
}
.fh-embed .agent-card:hover { border-color: var(--blue); }
.fh-embed .agent-card.expanded { border-color: var(--blue); }
.fh-embed .agent-header { display: flex; align-items: flex-start; gap: 10px; }
.fh-embed .agent-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green); margin-top: 5px; flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(22,163,74,0.6);
    animation: fh-pulse-ring 1.4s ease-out infinite;
}
.fh-embed .agent-pulse.dead { background: var(--red); animation: none; box-shadow: none; }
@keyframes fh-pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(22,163,74,0.6); }
    70%  { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
    100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
.fh-embed .agent-meta { flex: 1; min-width: 0; }
.fh-embed .agent-name { font-weight: 700; font-size: 13px; color: var(--text); }
.fh-embed .agent-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.fh-embed .agent-last-step {
    margin-top: 10px; font-size: 11px; color: var(--text-dim);
    background: var(--card-hover); border-radius: 6px; padding: 6px 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fh-embed .agent-trigger {
    margin-top: 8px; font-size: 11px; color: var(--text-muted);
    overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.fh-embed .agent-steps {
    display: none; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px;
}
.fh-embed .agent-card.expanded .agent-steps { display: block; }
.fh-embed .step-list { list-style: none; font-size: 11px; }
.fh-embed .step-list li {
    padding: 3px 0 3px 16px; position: relative; color: var(--text-dim);
    border-left: 2px solid var(--border);
}
.fh-embed .step-list li:last-child { color: var(--blue); border-color: var(--blue); font-weight: 600; }
.fh-embed .step-list li::before { content: ""; position: absolute; left: -5px; top: 8px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.fh-embed .step-list li:last-child::before { background: var(--blue); }
.fh-embed .agent-channel-link { font-size: 11px; margin-top: 10px; }
.fh-embed .agent-channel-link a { color: var(--blue); text-decoration: none; }
.fh-embed .agent-channel-link a:hover { text-decoration: underline; }
.fh-embed .agents-quiet { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.fh-embed .agents-header-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fh-embed .agents-refresh-label { font-size: 11px; color: var(--text-muted); margin-left: auto; }
