/* ── Assets admin ────────────────────────────────────────── */
.source-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
}

.source-tag.manual {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
}

.asset-edit-row > td {
  background: var(--bg);
  padding: 14px;
}

.asset-edit-row .inline-form {
  flex-wrap: wrap;
  align-items: center;
}

/* Collapsible panel: summary doubles as the navy header, with a +/– affordance. */
details.panel > summary {
  list-style: none;
  cursor: pointer;
}

details.panel > summary::-webkit-details-marker {
  display: none;
}

details.panel > summary.panel-header h2::before {
  content: "＋  ";
  font-weight: 700;
}

details.panel[open] > summary.panel-header h2::before {
  content: "–  ";
}

/* ── Monitors grouped by asset (navy-header panel, collapsible) ───────────── */
.asset-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
  scroll-margin-top: 20px;
}

.asset-group > summary.asset-group-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px;
  background: var(--panel-header);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.asset-group > summary.asset-group-title::-webkit-details-marker {
  display: none;
}

.asset-group .findings-table-wrap {
  margin: 0;
}

.asset-group-meta,
.panel-header .panel-hint {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.category-row td {
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.monitors-table tr.row-disabled td {
  color: var(--text-muted);
}

.asset-status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  align-self: center;
  flex: 0 0 auto;
  background: #94a3b8;
}
.asset-status-dot.status-up { background: var(--ok); }
.asset-status-dot.status-warning { background: #f59e0b; }
.asset-status-dot.status-down { background: var(--bad); }
.asset-status-dot.status-error { background: #7f1d1d; }
.asset-status-dot.status-skipped,
.asset-status-dot.status-nodata { background: #94a3b8; }

.asset-pills {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.asset-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
}
.asset-pill.status-up { background: var(--ok); }
.asset-pill.status-warning { background: #f59e0b; }
.asset-pill.status-down { background: var(--bad); }
.asset-pill.status-error { background: #7f1d1d; }
.asset-pill.status-skipped,
.asset-pill.status-nodata { background: #64748b; }
.asset-pill.status-pending { background: #6366f1; }
.asset-pill.pill-stale {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.85);
}
.asset-pill.severity-info { background: #64748b; }
.asset-pill.severity-low { background: #3b82f6; }
.asset-pill.severity-medium { background: #f59e0b; }
.asset-pill.severity-high { background: #ef4444; }
.asset-pill.severity-critical { background: #b91c1c; }

.monitor-why,
.event-detail {
  margin-top: 3px;
  font-size: 12.5px;
  color: #475569;
}

.monitor-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0;
}

.obs-summary {
  margin: 0 0 14px;
  font-size: 13px;
}

.asset-search {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.asset-search input[type="search"] {
  flex: 1;
  max-width: 380px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
}
.asset-search input[type="search"]:focus,
.asset-search input[type="search"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 63, 143, 0.15);
}

a.asset-pill {
  text-decoration: none;
}
.check-code {
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: #f1f5f9;
  color: #475569;
}

.filters .filter-count {
  opacity: 0.6;
  font-weight: 600;
}

.badge.fstatus-open { background: #fef3c7; color: #92400e; }
.badge.fstatus-acknowledged { background: #dbeafe; color: #1e40af; }
.badge.fstatus-resolved { background: #dcfce7; color: #166534; }

.monitors-table .badge.badge-muted {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
}

.freshness-flag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #fef3c7;
  color: #b45309;
}

/* ── Shared page-section vocabulary (used across every admin page) ─────────── */
.page-title {
  margin: 4px 0 6px;
  font-size: 24px;
  font-weight: 700;
}

.page-intro {
  margin: 0 0 24px;
  max-width: 760px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Direct children only, so panel-header h2 (nested) keeps its inherited white text. */
.dashboard > h2 {
  margin: 30px 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

/* White card wrapping an action form (add asset / create plan), matching the runner form. */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 8px;
}

.form-card .inline-form {
  flex-wrap: wrap;
  margin: 0;
}

/* Management tables size columns to content so the actions column never wraps its buttons. */
.findings-table.layout-auto {
  table-layout: auto;
}

.findings-table.layout-auto td .row-actions {
  flex-wrap: nowrap;
}

/* Source provenance: synced mirrors the platform (view/deactivate), manual is owned here (full CRUD). */
.source-tag.synced {
  background: #e0e7ff;
  color: #3730a3;
}
