/*
 * dashboard-vocabulary.css
 *
 * Shared severity palette + dashboard component primitives for the staff
 * front door (Phase 1) and subsystem dashboards (Phase 3). Colors locked
 * in by the dashboard-v2.html brainstorm; replaces the three different
 * severity palettes that grew up independently in cooling / power / UPS.
 *
 * Class vocabulary:
 *   .severity-ok      — system normal (green)
 *   .severity-warn    — degraded but operational (amber)
 *   .severity-crit    — alarm active, intervention needed (red)
 *   .severity-emer    — emergency, immediate action (dark red)
 *   .severity-stale   — data missing / sensor not reporting (gray, solid border)
 *   .severity-pending — feature monitored but not yet wired (gray, DASHED border)
 *
 * The visual distinction between .severity-stale (solid border) and
 * .severity-pending (dashed border) is deliberate — operators should be able
 * to tell at a glance whether something is "we're not getting data right now"
 * (stale: investigate) vs "we haven't built that yet" (pending: by design).
 */

.severity-ok {
  background: #0d8a5a;
  color: #ffffff;
}

.severity-warn {
  background: #e0a420;
  color: #ffffff;
}

.severity-crit {
  background: #c8333a;
  color: #ffffff;
}

.severity-emer {
  background: #8b1a1f;
  color: #ffffff;
}

.severity-stale {
  background: rgba(120, 120, 120, 0.18);
  color: #5b5b5b;
  border: 1px solid rgba(120, 120, 120, 0.4);
}

.severity-pending {
  background: rgba(120, 120, 120, 0.18);
  color: #5b5b5b;
  border: 1px dashed rgba(120, 120, 120, 0.4);
}

/* ---------------------------------------------------------------------------
 * Stripe variant — left-border indicator for action queue items
 * ------------------------------------------------------------------------- */
.stripe-ok      { border-left: 3px solid #0d8a5a; }
.stripe-warn    { border-left: 3px solid #e0a420; }
.stripe-crit    { border-left: 3px solid #c8333a; }
.stripe-emer    { border-left: 3px solid #8b1a1f; }
.stripe-stale   { border-left: 3px solid rgba(120, 120, 120, 0.5); }
.stripe-pending { border-left: 3px dashed rgba(120, 120, 120, 0.5); }
.stripe-info    { border-left: 3px solid #5b67ca; }

/* ---------------------------------------------------------------------------
 * Dashboard layout primitives
 * ------------------------------------------------------------------------- */

.dash-health-strip {
  background: rgba(99, 102, 241, 0.06);
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* `minmax(0, 1fr)` rather than `1fr` so columns are TRULY equal — without
   the `min: 0`, CSS Grid lets each track grow to its min-content size, so
   a pill with longer content (e.g. Tickets' "3 open · ⚠ 1 unassigned")
   stretches its column wider than its neighbors. */
.dash-health-pills {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 992px) {
  .dash-health-pills {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

.dash-health-pill {
  padding: 12px;
  border-radius: 8px;
  position: relative;
  /* Allow the pill to shrink to its grid column even when its content
     would otherwise force min-content sizing. Combined with the children's
     overflow rules below, content stays inside the box. */
  min-width: 0;
  overflow: hidden;
}

/* "You are here" — the pill matching the current subsystem page gets a
   prominent outline + slight scale so the operator sees their location
   in the health row at a glance. */
.dash-health-pill.is-current {
  outline: 2px solid rgba(31, 31, 31, 0.85);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.dash-health-pill .pill-label {
  font-size: 0.7em;
  opacity: 0.9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-health-pill .pill-headline {
  font-size: 1.4em;
  font-weight: 700;
  margin-top: 2px;
  /* Allow inline elements (headline text + .pill-badge) to wrap when narrow
     so the column doesn't stretch to fit a long combined line. */
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25em;
  min-width: 0;
}

.dash-health-pill .pill-subline {
  font-size: 0.75em;
  opacity: 0.85;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-health-pill .pill-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.85em;
}

.dash-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
}

@media (max-width: 992px) {
  .dash-body {
    grid-template-columns: 1fr;
  }
}

.dash-action-queue {
  padding: 16px 18px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.dash-activity-feed {
  padding: 16px 18px;
}

.dash-kpi-footer {
  background: rgba(0, 0, 0, 0.03);
  padding: 14px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 992px) {
  .dash-kpi-footer {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dash-section-label {
  font-size: 0.7em;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #6b6b6b;
  font-weight: 600;
}

.dash-kpi-value {
  font-size: 1.3em;
  font-weight: 700;
}

.dash-kpi-sub {
  font-size: 0.6em;
  font-weight: 400;
  color: #888;
}

.dash-kpi-trend-up   { color: #0d8a5a; font-size: 0.6em; }
.dash-kpi-trend-down { color: #c8333a; font-size: 0.6em; }

/* ---------------------------------------------------------------------------
 * Action queue items
 * ------------------------------------------------------------------------- */

.dash-action-item {
  padding: 8px 10px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}

.dash-action-item.has-modal,
.dash-action-item.has-link {
  cursor: pointer;
}

.dash-action-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dash-action-affordance-modal { font-size: 0.8em; color: #5b67ca; }
.dash-action-affordance-link  { font-size: 0.8em; color: #888;    }

/* ---------------------------------------------------------------------------
 * Segmented filter toggle (Mine / All)
 * ------------------------------------------------------------------------- */
.dash-filter-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  padding: 2px;
  font-size: 0.75em;
}

.dash-filter-toggle .toggle-option {
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: #666;
  border: 0;
  background: transparent;
}

.dash-filter-toggle .toggle-option.active {
  background: #ffffff;
  font-weight: 600;
  color: #1f1f1f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ---------------------------------------------------------------------------
 * Refresh strip header
 * ------------------------------------------------------------------------- */
.dash-refresh-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.8em;
  color: #666;
}

.dash-refresh-strip .live-dot {
  color: #0d8a5a;
}
