/* ── Titan Health widget — polished dashboard card ── */

.widget-titan-health {
  --kpi-bg: hsl(240 8 12 / 0.5);
  --sep-color: hsl(240 8 14);
  --bar-track: hsl(240 8 16);
}

/* ── KPI cards ── */

.titan-kpis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.titan-kpi {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 14px 10px;
  background: var(--kpi-bg);
  border-radius: 8px;
  text-align: center;
}

.titan-kpi-value {
  font-size: 2.0rem;
  font-weight: 600;
  line-height: 1.2;
}

.titan-kpi-label {
  display: block;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  opacity: 0.55;
}

/* ── Mini KPI (processes) ── */

.titan-kpi--sm {
  padding: 10px 12px;
}

.titan-kpi--sm .titan-kpi-value {
  font-size: 1.5rem;
}

.titan-kpi--sm .titan-kpi-label {
  font-size: 1.0rem;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Progress bars (matching server-stats bar height) ── */

.titan-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bar-track);
  margin-bottom: 10px;
  overflow: hidden;
}

.titan-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  background: currentColor;
  opacity: 0.8;
}

.titan-bar-fill--green {
  background: hsl(115 54 76);
  opacity: 0.75;
}

.titan-bar-fill--thermal {
  opacity: 0.9;
}

/* ── Battery icon (pure CSS) ── */

.titan-battery-icon {
  display: block;
  margin: 0 auto 6px auto;
  width: 32px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
  position: relative;
}

.titan-battery-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 3px;
  width: 4px;
  height: 8px;
  background: currentColor;
  border-radius: 0 3px 3px 0;
}

.titan-battery-icon span {
  display: block;
  height: 100%;
  background: currentColor;
  border-radius: 1px;
}

/* ── Service row ── */

.titan-svc-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.titan-svc-dot {
  font-size: 1.1em;
  line-height: 1;
  width: 10px;
  flex-shrink: 0;
}

.titan-svc-name {
  flex: 1 1 0;
  min-width: 0;
  font-size: 1.2rem;
}

.titan-svc-status {
  width: 60px;
  font-size: 1.1rem;
  text-transform: capitalize;
  flex-shrink: 0;
}

.titan-svc-uptime {
  font-size: 1.1rem;
  opacity: 0.55;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Sensor row ── */

.titan-sensor-bar {
  flex: 1 1 0;
  min-width: 40px;
  height: 5px;
  border-radius: 2.5px;
  background: var(--bar-track);
  overflow: hidden;
}

.titan-sensor-bar-fill {
  height: 100%;
  border-radius: 2.5px;
  transition: width 0.5s ease;
}

.titan-sensor-name {
  min-width: 130px;
  font-size: 0.8rem;
}

.titan-sensor-value {
  font-size: 0.82rem;
  min-width: 38px;
  text-align: right;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Section divider ── */

.titan-section-hr {
  border: none;
  border-top: 1px solid var(--sep-color);
  margin: 10px 0;
}

/* ── Footer ── */

.titan-footer {
  margin-top: 12px;
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.5;
}
