/* =====================================================
   KB Dashboard Widget (Data Engineer / Historian)
   Component-level, theme-neutral.
   ===================================================== */

.kb-widget-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kb-widget-actions .btn {
  width: 100%;
}

.kb-health {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
}

.kb-health-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.kb-health-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

.kb-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1200px) {
  .kb-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kb-health-grid {
    grid-template-columns: 1fr;
  }
}

.kb-health-card {
  border: 1px solid var(--border-color);
  background: var(--background);
  border-radius: 10px;
  padding: 10px;
}

.kb-health-card.is-warn {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.08);
}

.kb-health-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.kb-health-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 4px;
}

.kb-health-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.kb-health-alert {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.kb-health-details {
  margin-top: 10px;
}

.kb-health-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.kb-health-splits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .kb-health-splits {
    grid-template-columns: 1fr;
  }
}

.kb-health-mini-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kb-health-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kb-health-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.kb-health-list li span {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-health-list li strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Historian-specific helpers (no dependency on Bootstrap, but plays well with it) */
.kb-panel details > summary {
  user-select: none;
}


