/* acutes_sla_html — the Interims (acutes) SLA dashboard.
 *
 * Moved verbatim out of the form's template <style> block: the Anvil server
 * strips the text out of a <style> in a template, so the rules have to be a
 * head-linked asset instead. Nothing but the selector preludes changed — every
 * declaration, comment, url() data URI and @keyframes body is byte for byte
 * what the template carried.
 *
 * THE SUBJECT IS NOT THIS FORM'S ROOT. `__init__.py` builds
 * `<div class="interims-dashboard">…</div>` as a STRING and pushes it into the
 * PARENT form's #sla-dashboard-content through setDashboardContent, so the
 * dashboard is never inside this form's own root and `:where(.acutes-sla-root)`
 * would match nothing. The scope is `:where(.interims-dashboard)`, the private
 * name nearly every rule here already named — grepped estate-wide: no other
 * repo or host declares it except the two host `::after` rules below.
 *
 * Three buckets:
 *
 *  1. inside the dashboard — `:where(.interims-dashboard) <selector>`, which
 *     adds no specificity and so cannot change which rule wins;
 *  2. the dashboard itself — `.interims-dashboard`, its ::before/::after and
 *     the `[data-theme="dark"]` arm: BARE, because the subject IS the scope;
 *  3. the custom tooltip — showInterimsTooltip does
 *     `document.body.appendChild(tooltip)`, so the element leaves this subtree
 *     the moment it is shown and a scoped rule would stop matching. Its three
 *     rules ship UNSCOPED; `.interims-custom-tooltip` is unique estate-wide.
 *
 * Every `[data-theme="dark"]` arm stays BARE for the same reason it always
 * outranked its light-mode twin: it is (0,2,0) against (0,1,0), and wrapping it
 * in `:where()` would keep that edge but wrapping the light rule and not the
 * dark one is what the pairs below already do.
 *
 * `.interims-dashboard::after` ships GEOMETRY ONLY and deliberately no
 * `background-image` (1A-37 / OD-06): each host supplies the grain texture from
 * its own theme asset. Do not add one and do not re-word that selector —
 * px-internal-app/tests/test_sla_grain_host_asset.py reads it from this repo.
 *
 * The six @keyframes are already per-screen prefixed (`interims-*`) and are
 * unique across every asset here, so they carry across unrenamed. All url()
 * values are inline data URIs; there is no relative path to rewrite.
 */

/* INTERIMS SLA DASHBOARD STYLES - Dual Gauge Observatory Design */

/* ========================================
   BASE DASHBOARD STYLES
   ======================================== */
.interims-dashboard {
  /* Accent colors for this dashboard */
  --accent: #d97706;
  --accent-hover: #f59e0b;
  --accent-subtle: rgba(217, 119, 6, 0.25);
  --accent-text: #422006;
  --px-loading-accent: #d97706;

  /* HP-specific colors */
  --interims-hp-accent: #d97706;
  --interims-hp-light: #f59e0b;
  --interims-hp-glow: rgba(217, 119, 6, 0.12);

  /* Others-specific colors */
  --interims-others-accent: #0891b2;
  --interims-others-light: #06b6d4;
  --interims-others-glow: rgba(6, 182, 212, 0.12);

  /* Status colors */
  --interims-success: #16a34a;
  --interims-success-glow: rgba(22, 163, 74, 0.15);
  --interims-high: #65a30d;
  --interims-warning: #ea580c;
  --interims-danger: #dc2626;

  /* Component-specific */
  --interims-noise-opacity: 0.015;
  --interims-gauge-track: #e2e8f0;
  --interims-purple: #8b5cf6;
  --interims-yellow: #eab308;
  --interims-green: #22c55e;

  font-family: var(--px-font);
  background: var(--px-bg-deep);
  padding: 24px;
  color: var(--px-text-primary);
  position: relative;
  transition: background 0.4s ease, color 0.3s ease;
}

[data-theme="dark"] .interims-dashboard {
  --interims-hp-accent: #f59e0b;
  --interims-hp-light: #fbbf24;
  --interims-hp-glow: rgba(245, 158, 11, 0.4);
  --interims-others-accent: #22d3ee;
  --interims-others-light: #67e8f9;
  --interims-others-glow: rgba(34, 211, 238, 0.4);
  --interims-success: #4CAF50;
  --interims-success-glow: rgba(76, 175, 80, 0.4);
  --interims-high: #8BC34A;
  --interims-warning: #FF5722;
  --interims-danger: #ef4444;
  --interims-noise-opacity: 0.02;
  --interims-gauge-track: var(--px-bg-elevated);
  --interims-purple: #a78bfa;
  --interims-yellow: #facc15;
  --interims-green: #4ade80;
}

.interims-dashboard::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at top left, var(--interims-hp-glow) 0%, transparent 40%),
    radial-gradient(ellipse at top right, var(--interims-others-glow) 0%, transparent 40%),
    radial-gradient(ellipse at bottom, var(--interims-success-glow) 0%, transparent 35%);
  pointer-events: none;
}

/* 1A-37 / OD-06: the grain texture is a PER-HOST theme asset. This
   dependency ships the overlay geometry only; each host supplies
   `background-image` for `.interims-dashboard::after` from its own
   `theme/assets` in its own theme CSS. The dep must never hardcode a
   host asset path. */
.interims-dashboard::after {
  content: '';
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  opacity: var(--interims-noise-opacity);
  pointer-events: none;
}

/* ========================================
   TOP SECTION
   ======================================== */
:where(.interims-dashboard) .interims-top-section {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
}

:where(.interims-dashboard) .interims-title-block {
  text-align: center;
  margin-bottom: 32px;
}

:where(.interims-dashboard) .interims-title-block h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.08em;
  color: var(--px-text-primary);
  margin: 0;
  line-height: 1;
}

[data-theme="dark"] .interims-title-block h1 {
  text-shadow: 0 0 40px var(--interims-hp-glow);
}

:where(.interims-dashboard) .interims-subtitle {
  font-family: var(--px-mono);
  font-size: 0.75rem;
  color: var(--px-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 8px;
}

/* ========================================
   MANAGE HIGH PRIORITY BUTTON
   ======================================== */
:where(.interims-dashboard) .interims-manage-hp-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--px-font);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--interims-hp-accent) 0%, #c2410c 100%);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
  z-index: 10;
}

:where(.interims-dashboard) .interims-manage-hp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.4);
}

:where(.interims-dashboard) .interims-manage-hp-btn:active {
  transform: translateY(0);
}

[data-theme="dark"] .interims-manage-hp-btn {
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .interims-manage-hp-btn:hover {
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
}

/* Disabled button wrapper for tooltip positioning */
:where(.interims-dashboard) .interims-manage-hp-btn-wrapper {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
}

:where(.interims-dashboard) .interims-manage-hp-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

:where(.interims-dashboard) .interims-manage-hp-btn-wrapper:hover .interims-hp-btn-tooltip {
  opacity: 1;
  visibility: visible;
}

:where(.interims-dashboard) .interims-hp-btn-tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

/* ========================================
   DUAL GAUGES
   ======================================== */
:where(.interims-dashboard) .interims-gauges-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

:where(.interims-dashboard) .interims-gauge-card {
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  border-radius: 20px;
  padding: 20px 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--px-shadow);
  min-width: 260px;
  flex: 0 1 320px;
  cursor: pointer;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:where(.interims-dashboard) .interims-gauge-card.hp:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--px-shadow), 0 8px 32px var(--interims-hp-glow), 0 0 24px var(--interims-hp-glow);
  border-color: var(--interims-hp-accent);
}

:where(.interims-dashboard) .interims-gauge-card.others:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--px-shadow), 0 8px 32px var(--interims-others-glow), 0 0 24px var(--interims-others-glow);
  border-color: var(--interims-others-accent);
}

:where(.interims-dashboard) .interims-gauge-card:active {
  transform: translateY(-2px) scale(1.01);
}

:where(.interims-dashboard) .interims-gauge-card::after {
  content: '📈 Click for trend';
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-family: var(--px-font);
  font-size: 10px;
  color: var(--px-text-muted);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

:where(.interims-dashboard) .interims-gauge-card:hover::after {
  opacity: 1;
}

:where(.interims-dashboard) .interims-gauge-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  opacity: 0.2;
  animation: interims-pulse 4s ease-in-out infinite;
}

:where(.interims-dashboard) .interims-gauge-card.hp::before {
  background: radial-gradient(circle at center, var(--interims-hp-glow) 0%, transparent 40%);
}

:where(.interims-dashboard) .interims-gauge-card.others::before {
  background: radial-gradient(circle at center, var(--interims-others-glow) 0%, transparent 40%);
}

@keyframes interims-pulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.05); }
}

:where(.interims-dashboard) .interims-gauge-label {
  font-family: var(--px-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

:where(.interims-dashboard) .interims-gauge-card.hp .interims-gauge-label { color: var(--interims-hp-accent); }
:where(.interims-dashboard) .interims-gauge-card.others .interims-gauge-label { color: var(--interims-others-accent); }

:where(.interims-dashboard) .interims-gauge-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  color: var(--px-text-primary);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

:where(.interims-dashboard) .interims-gauge {
  position: relative;
  width: 240px;
  height: 140px;
  margin: 0 auto;
}

:where(.interims-dashboard) .interims-gauge svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

:where(.interims-dashboard) .interims-gauge-bg {
  fill: none;
  stroke: var(--interims-gauge-track);
  stroke-width: 12;
  stroke-linecap: round;
}

:where(.interims-dashboard) .interims-gauge-needle {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

:where(.interims-dashboard) .interims-gauge-count {
  font-family: var(--px-font);
  font-size: 14px;
  color: var(--px-text-secondary);
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

:where(.interims-dashboard) .interims-gauge-count strong {
  color: var(--px-text-primary);
  font-weight: 600;
}

/* ========================================
   CONFIG BAR
   ======================================== */
:where(.interims-dashboard) .interims-config-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  border-radius: 12px;
  box-shadow: var(--px-shadow);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

:where(.interims-dashboard) .interims-date-pickers {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

:where(.interims-dashboard) .interims-date-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

:where(.interims-dashboard) .interims-date-picker label {
  font-family: var(--px-mono);
  font-size: 10px;
  color: var(--px-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

:where(.interims-dashboard) .interims-date-picker input {
  font-family: var(--px-mono);
  padding: 10px 14px;
  border: 2px solid var(--px-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--px-text-primary);
  background: var(--px-input-bg);
  min-width: 175px;
  box-shadow: var(--px-shadow), inset 0 1px 2px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

:where(.interims-dashboard) .interims-date-picker input:hover {
  border-color: var(--interims-others-accent);
  background: linear-gradient(135deg, var(--px-input-bg) 0%, rgba(6, 182, 212, 0.05) 100%);
  box-shadow: var(--px-shadow), 0 0 12px var(--interims-others-glow);
}

:where(.interims-dashboard) .interims-date-picker input:focus {
  outline: none;
  border-color: var(--interims-others-accent);
  box-shadow: 0 0 0 3px var(--interims-others-glow), 0 0 20px var(--interims-others-glow);
  background: linear-gradient(135deg, var(--px-input-bg) 0%, rgba(6, 182, 212, 0.08) 100%);
}

/* Calendar picker icon styling */
:where(.interims-dashboard) .interims-date-picker input::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-size: 16px 16px;
  background-repeat: no-repeat;
  background-position: center;
  width: 20px;
  height: 20px;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.3));
}

:where(.interims-dashboard) .interims-date-picker input::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(6, 182, 212, 0.15);
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.6));
  transform: scale(1.1);
}

/* Date input text segments */
:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit {
  padding: 0;
  font-family: var(--px-mono);
}

:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit-text {
  color: var(--px-text-muted);
  padding: 0 2px;
}

:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit-day-field,
:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit-month-field,
:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit-year-field {
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit-day-field:focus,
:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit-month-field:focus,
:where(.interims-dashboard) .interims-date-picker input::-webkit-datetime-edit-year-field:focus {
  background: rgba(6, 182, 212, 0.2);
  color: var(--interims-others-accent);
  outline: none;
}

/* Dark color scheme for calendar popup */
:where(.interims-dashboard) .interims-date-picker input {
  color-scheme: light;
}

[data-theme="dark"] .interims-date-picker input {
  color-scheme: dark;
}

:where(.interims-dashboard) .interims-divider {
  width: 1px;
  height: 40px;
  background: var(--px-border);
}

/* ========================================
   DROPDOWN BASE STYLES
   ======================================== */
:where(.interims-dashboard) .interims-dropdown {
  font-family: var(--px-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--px-text-primary);
  padding: 10px 36px 10px 14px;
  border: 2px solid var(--px-border);
  border-radius: 8px;
  background-color: var(--px-input-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 120px;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--px-shadow);
}

:where(.interims-dashboard) .interims-dropdown option {
  background: var(--px-bg-card);
  color: var(--px-text-primary);
  padding: 10px;
}

/* Dark mode dropdown arrow */
[data-theme="dark"] .interims-dropdown {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

/* Others Gauge Mode Selector */
:where(.interims-dashboard) .interims-gauge-mode-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

:where(.interims-dashboard) .interims-gauge-mode-group label {
  font-family: var(--px-mono);
  font-size: 10px;
  color: var(--px-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

:where(.interims-dashboard) .interims-gauge-mode-group .interims-dropdown {
  border-color: var(--interims-others-accent);
  background-color: var(--px-input-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2306b6d4' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

[data-theme="dark"] .interims-gauge-mode-group .interims-dropdown {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2322d3ee' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

:where(.interims-dashboard) .interims-gauge-mode-group .interims-dropdown:hover {
  border-color: var(--interims-others-light);
  box-shadow: 0 0 0 2px var(--interims-others-glow);
}

:where(.interims-dashboard) .interims-gauge-mode-group .interims-dropdown:focus {
  outline: none;
  border-color: var(--interims-others-accent);
  box-shadow: 0 0 0 3px var(--interims-others-glow), 0 0 12px var(--interims-others-glow);
}

/* Cutoff Time Inputs */
:where(.interims-dashboard) .interims-cutoffs-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

:where(.interims-dashboard) .interims-cutoff-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

:where(.interims-dashboard) .cutoff-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

:where(.interims-dashboard) .interims-cutoff-item.purple .cutoff-dot { background: var(--interims-purple); box-shadow: 0 0 6px var(--interims-purple); }
:where(.interims-dashboard) .interims-cutoff-item.yellow .cutoff-dot { background: var(--interims-yellow); box-shadow: 0 0 6px var(--interims-yellow); }
:where(.interims-dashboard) .interims-cutoff-item.green .cutoff-dot { background: var(--interims-green); box-shadow: 0 0 6px var(--interims-green); }

:where(.interims-dashboard) .interims-cutoff-item input[type="time"] {
  font-family: var(--px-mono);
  padding: 8px 14px;
  border: 2px solid var(--px-border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--px-text-primary);
  background: var(--px-input-bg);
  width: 115px;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--px-shadow), inset 0 1px 2px rgba(0,0,0,0.1);
}

/* Color-coded hover states */
:where(.interims-dashboard) .interims-cutoff-item.purple input[type="time"]:hover {
  border-color: var(--interims-purple);
  background: linear-gradient(135deg, var(--px-input-bg) 0%, rgba(139, 92, 246, 0.08) 100%);
  box-shadow: var(--px-shadow), 0 0 10px rgba(139, 92, 246, 0.3);
}
:where(.interims-dashboard) .interims-cutoff-item.yellow input[type="time"]:hover {
  border-color: var(--interims-yellow);
  background: linear-gradient(135deg, var(--px-input-bg) 0%, rgba(234, 179, 8, 0.08) 100%);
  box-shadow: var(--px-shadow), 0 0 10px rgba(234, 179, 8, 0.3);
}
:where(.interims-dashboard) .interims-cutoff-item.green input[type="time"]:hover {
  border-color: var(--interims-green);
  background: linear-gradient(135deg, var(--px-input-bg) 0%, rgba(34, 197, 94, 0.08) 100%);
  box-shadow: var(--px-shadow), 0 0 10px rgba(34, 197, 94, 0.3);
}

/* Focus states with glow */
:where(.interims-dashboard) .interims-cutoff-item.purple input:focus {
  outline: none;
  border-color: var(--interims-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25), 0 0 16px rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, var(--px-input-bg) 0%, rgba(139, 92, 246, 0.1) 100%);
}
:where(.interims-dashboard) .interims-cutoff-item.yellow input:focus {
  outline: none;
  border-color: var(--interims-yellow);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25), 0 0 16px rgba(234, 179, 8, 0.4);
  background: linear-gradient(135deg, var(--px-input-bg) 0%, rgba(234, 179, 8, 0.1) 100%);
}
:where(.interims-dashboard) .interims-cutoff-item.green input:focus {
  outline: none;
  border-color: var(--interims-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25), 0 0 16px rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, var(--px-input-bg) 0%, rgba(34, 197, 94, 0.1) 100%);
}

/* Time picker clock icon styling - color coded */
:where(.interims-dashboard) .interims-cutoff-item.purple input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center;
  width: 16px;
  height: 16px;
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.4));
}
:where(.interims-dashboard) .interims-cutoff-item.yellow input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23eab308' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center;
  width: 16px;
  height: 16px;
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  filter: drop-shadow(0 0 3px rgba(234, 179, 8, 0.4));
}
:where(.interims-dashboard) .interims-cutoff-item.green input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center;
  width: 16px;
  height: 16px;
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  filter: drop-shadow(0 0 3px rgba(34, 197, 94, 0.4));
}

/* Clock icon hover effects */
:where(.interims-dashboard) .interims-cutoff-item.purple input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(139, 92, 246, 0.15);
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
  transform: scale(1.1);
}
:where(.interims-dashboard) .interims-cutoff-item.yellow input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(234, 179, 8, 0.15);
  filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.6));
  transform: scale(1.1);
}
:where(.interims-dashboard) .interims-cutoff-item.green input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(34, 197, 94, 0.15);
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.6));
  transform: scale(1.1);
}

/* Time input text segments */
:where(.interims-dashboard) .interims-cutoff-item input[type="time"]::-webkit-datetime-edit {
  padding: 0;
  font-family: var(--px-mono);
}

:where(.interims-dashboard) .interims-cutoff-item input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

:where(.interims-dashboard) .interims-cutoff-item input[type="time"]::-webkit-datetime-edit-text {
  color: var(--px-text-muted);
  padding: 0 1px;
}

:where(.interims-dashboard) .interims-cutoff-item input[type="time"]::-webkit-datetime-edit-hour-field,
:where(.interims-dashboard) .interims-cutoff-item input[type="time"]::-webkit-datetime-edit-minute-field {
  padding: 2px 3px;
  border-radius: 3px;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

:where(.interims-dashboard) .interims-cutoff-item.purple input[type="time"]::-webkit-datetime-edit-hour-field:focus,
:where(.interims-dashboard) .interims-cutoff-item.purple input[type="time"]::-webkit-datetime-edit-minute-field:focus {
  background: rgba(139, 92, 246, 0.2);
  color: var(--interims-purple);
  outline: none;
}
:where(.interims-dashboard) .interims-cutoff-item.yellow input[type="time"]::-webkit-datetime-edit-hour-field:focus,
:where(.interims-dashboard) .interims-cutoff-item.yellow input[type="time"]::-webkit-datetime-edit-minute-field:focus {
  background: rgba(234, 179, 8, 0.2);
  color: var(--interims-yellow);
  outline: none;
}
:where(.interims-dashboard) .interims-cutoff-item.green input[type="time"]::-webkit-datetime-edit-hour-field:focus,
:where(.interims-dashboard) .interims-cutoff-item.green input[type="time"]::-webkit-datetime-edit-minute-field:focus {
  background: rgba(34, 197, 94, 0.2);
  color: var(--interims-green);
  outline: none;
}

/* Dark color scheme for time picker popup */
:where(.interims-dashboard) .interims-cutoff-item input[type="time"] {
  color-scheme: light;
}

[data-theme="dark"] .interims-cutoff-item input[type="time"] {
  color-scheme: dark;
}

/* Acutes Configuration */
:where(.interims-dashboard) .interims-acutes-config {
  display: flex;
  gap: 16px;
  align-items: center;
}

:where(.interims-dashboard) .interims-threshold-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

:where(.interims-dashboard) .interims-threshold-group label {
  font-family: var(--px-mono);
  font-size: 10px;
  color: var(--px-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

:where(.interims-dashboard) .interims-threshold-group input[type="number"] {
  font-family: var(--px-mono);
  padding: 8px 10px;
  border: 1px solid var(--px-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--px-text-primary);
  background: var(--px-input-bg);
  width: 60px;
  text-align: center;
}

:where(.interims-dashboard) .interims-threshold-group input[type="number"]:focus {
  outline: none;
  border-color: var(--interims-others-accent);
  box-shadow: 0 0 0 2px var(--interims-others-glow);
}

/* ========================================
   DEBOUNCE PROGRESS INDICATOR
   ======================================== */
@keyframes interims-debounce-progress {
  0% {
    border-color: var(--interims-others-accent);
    box-shadow: 0 0 0 3px var(--interims-others-glow),
                inset 4px 0 0 0 var(--interims-others-accent);
  }
  100% {
    border-color: var(--px-border);
    box-shadow: 0 0 0 0px transparent,
                inset 0px 0 0 0 transparent;
  }
}

@keyframes interims-debounce-progress-cutoff-purple {
  0% {
    border-color: var(--interims-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25),
                inset 4px 0 0 0 var(--interims-purple);
  }
  100% {
    border-color: var(--px-border);
    box-shadow: 0 0 0 0px transparent,
                inset 0px 0 0 0 transparent;
  }
}

@keyframes interims-debounce-progress-cutoff-yellow {
  0% {
    border-color: var(--interims-yellow);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25),
                inset 4px 0 0 0 var(--interims-yellow);
  }
  100% {
    border-color: var(--px-border);
    box-shadow: 0 0 0 0px transparent,
                inset 0px 0 0 0 transparent;
  }
}

@keyframes interims-debounce-progress-cutoff-green {
  0% {
    border-color: var(--interims-green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25),
                inset 4px 0 0 0 var(--interims-green);
  }
  100% {
    border-color: var(--px-border);
    box-shadow: 0 0 0 0px transparent,
                inset 0px 0 0 0 transparent;
  }
}

:where(.interims-dashboard) .interims-debouncing {
  animation: interims-debounce-progress 1s ease-out forwards;
}

:where(.interims-dashboard) .interims-cutoff-item.purple input.interims-debouncing {
  animation: interims-debounce-progress-cutoff-purple 1s ease-out forwards;
}

:where(.interims-dashboard) .interims-cutoff-item.yellow input.interims-debouncing {
  animation: interims-debounce-progress-cutoff-yellow 1s ease-out forwards;
}

:where(.interims-dashboard) .interims-cutoff-item.green input.interims-debouncing {
  animation: interims-debounce-progress-cutoff-green 1s ease-out forwards;
}

/* Tooltip - Underlined Text Style */
:where(.interims-dashboard) .interims-tooltip-label {
  position: relative;
  cursor: help;
}

:where(.interims-dashboard) .interims-tooltip-text {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--interims-others-accent);
  text-underline-offset: 3px;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

:where(.interims-dashboard) .interims-tooltip-label:hover .interims-tooltip-text {
  color: var(--interims-others-accent);
  text-decoration-style: solid;
}

:where(.interims-dashboard) .interims-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 12px 14px;
  background: var(--px-bg-card);
  border: 1px solid var(--interims-others-accent);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--interims-others-glow);
  font-family: var(--px-font);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--px-text-primary);
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

:where(.interims-dashboard) .interims-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--interims-others-accent);
}

:where(.interims-dashboard) .interims-tooltip-label:hover .interims-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

[data-theme="dark"] .interims-tooltip {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px var(--interims-others-glow);
}

/* Checkbox */
:where(.interims-dashboard) .interims-checkbox-group {
  display: flex;
  align-items: center;
}

:where(.interims-dashboard) .interims-checkbox-label {
  font-family: var(--px-mono);
  font-size: 10px;
  color: var(--px-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

:where(.interims-dashboard) .interims-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

:where(.interims-dashboard) .interims-checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--px-border);
  border-radius: 4px;
  background: var(--px-input-bg);
  position: relative;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

:where(.interims-dashboard) .interims-checkbox-label input:checked + .interims-checkbox-custom {
  background: var(--interims-others-accent);
  border-color: var(--interims-others-accent);
}

:where(.interims-dashboard) .interims-checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

:where(.interims-dashboard) .interims-checkbox-label input:checked + .interims-checkbox-custom::after {
  transform: rotate(45deg) scale(1);
}

:where(.interims-dashboard) .interims-checkbox-label:hover .interims-checkbox-custom {
  border-color: var(--interims-others-accent);
}

/* ========================================
   DATA TABLE
   ======================================== */
:where(.interims-dashboard) .interims-table-container {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: auto;
  overflow-y: clip;
}

:where(.interims-dashboard) .interims-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--px-bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--px-border);
  box-shadow: var(--px-shadow);
}

:where(.interims-dashboard) .interims-table thead {
  background: linear-gradient(180deg, var(--px-bg-elevated) 0%, var(--px-bg-card) 100%);
}

:where(.interims-dashboard) .interims-table th {
  font-family: var(--px-mono);
  padding: 12px 12px;
  text-align: center;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--px-text-muted);
  border-bottom: 1px solid var(--px-border);
  white-space: nowrap;
  vertical-align: bottom;
}

:where(.interims-dashboard) .interims-table th:first-child {
  text-align: left;
}

:where(.interims-dashboard) .interims-table th:not(:last-child) {
  border-right: 1px solid var(--px-border);
}

:where(.interims-dashboard) .interims-table th .col-subtitle {
  font-size: 9px;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

:where(.interims-dashboard) .interims-table th.others-col.green .col-subtitle { color: #4CAF50; }
:where(.interims-dashboard) .interims-table th.others-col.yellow .col-subtitle { color: #FFC107; }
:where(.interims-dashboard) .interims-table th.others-col.orange .col-subtitle { color: #FF9800; }
:where(.interims-dashboard) .interims-table th.others-col.red .col-subtitle { color: #F44336; }

:where(.interims-dashboard) .interims-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--px-border);
  color: var(--px-text-primary);
  font-size: 13px;
}

:where(.interims-dashboard) .interims-table td:not(:last-child) {
  border-right: 1px solid var(--px-border-subtle);
}

:where(.interims-dashboard) .interims-table tbody tr:last-child td {
  border-bottom: none;
}

:where(.interims-dashboard) .interims-table tbody tr {
  opacity: 0;
  animation: interims-fadeSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

:where(.interims-dashboard) .interims-table tbody tr:hover {
  background: var(--interims-others-glow);
}

:where(.interims-dashboard) .interims-table .home-name {
  font-family: var(--px-font);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

:where(.interims-dashboard) .interims-table .interim-items {
  font-family: var(--px-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--px-text-secondary);
  text-align: center;
}

:where(.interims-dashboard) .interims-table .hp-pct,
:where(.interims-dashboard) .interims-table .others-same-pct,
:where(.interims-dashboard) .interims-table .others-next-pct,
:where(.interims-dashboard) .interims-table .others-two-pct,
:where(.interims-dashboard) .interims-table .others-three-pct {
  text-align: center;
}

:where(.interims-dashboard) .interims-pct {
  font-family: var(--px-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Percentage colors */
:where(.interims-dashboard) .interims-color-success { color: #4CAF50 !important; }
:where(.interims-dashboard) .interims-color-high { color: #8BC34A !important; }
:where(.interims-dashboard) .interims-color-warning { color: #FF9800 !important; }
:where(.interims-dashboard) .interims-color-danger { color: #F44336 !important; }

[data-theme="dark"] .interims-color-success { text-shadow: 0 0 10px rgba(76, 175, 80, 0.5); }
[data-theme="dark"] .interims-color-high { text-shadow: 0 0 8px rgba(139, 195, 74, 0.5); }
[data-theme="dark"] .interims-color-warning { text-shadow: 0 0 8px rgba(255, 152, 0, 0.5); }
[data-theme="dark"] .interims-color-danger { text-shadow: 0 0 6px rgba(244, 67, 54, 0.5); }

/* Comment badge */
:where(.interims-dashboard) .interims-comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--px-mono);
  background: var(--px-bg-elevated);
  border: 1px solid var(--px-border);
  border-radius: 10px;
  color: var(--px-text-secondary);
  margin-left: 8px;
  white-space: nowrap;
  cursor: default;
}

:where(.interims-dashboard) .interims-comment-badge.overdue {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--interims-danger);
}

/* ========================================
   CLICKABLE HOME NAMES
   ======================================== */
:where(.interims-dashboard) .interims-home-clickable {
  cursor: pointer;
  color: var(--interims-others-accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

:where(.interims-dashboard) .interims-home-clickable:hover {
  color: var(--interims-others-light);
  text-decoration-style: solid;
}

[data-theme="dark"] .interims-home-clickable {
  text-shadow: 0 0 8px var(--interims-others-glow);
}

[data-theme="dark"] .interims-home-clickable:hover {
  text-shadow: 0 0 12px var(--interims-others-glow);
}

/* ========================================
   ANIMATIONS
   ======================================== */
:where(.interims-dashboard) .interims-fade-in {
  animation: interims-fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

@keyframes interims-fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   LEGEND STYLES
   ======================================== */
:where(.interims-dashboard) .interims-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  border-radius: 10px;
  box-shadow: var(--px-shadow);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

:where(.interims-dashboard) .interims-legend-title {
  font-family: var(--px-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--px-text-muted);
  white-space: nowrap;
}

:where(.interims-dashboard) .interims-legend-items {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

:where(.interims-dashboard) .interims-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

:where(.interims-dashboard) .interims-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  transition: box-shadow 0.3s ease;
}

:where(.interims-dashboard) .interims-legend-swatch.success { background: #4CAF50; }
:where(.interims-dashboard) .interims-legend-swatch.high { background: #8BC34A; }
:where(.interims-dashboard) .interims-legend-swatch.warning { background: #FF9800; }
:where(.interims-dashboard) .interims-legend-swatch.danger { background: #F44336; }

[data-theme="dark"] .interims-legend-swatch.success { box-shadow: 0 0 6px rgba(76, 175, 80, 0.5); }
[data-theme="dark"] .interims-legend-swatch.high { box-shadow: 0 0 6px rgba(139, 195, 74, 0.5); }
[data-theme="dark"] .interims-legend-swatch.warning { box-shadow: 0 0 6px rgba(255, 152, 0, 0.5); }
[data-theme="dark"] .interims-legend-swatch.danger { box-shadow: 0 0 6px rgba(244, 67, 54, 0.5); }

:where(.interims-dashboard) .interims-legend-text {
  font-family: var(--px-font);
  font-size: 13px;
  color: var(--px-text-secondary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 950px) {
  :where(.interims-dashboard) .interims-gauges-container { gap: 24px; }
  :where(.interims-dashboard) .interims-gauge-card { min-width: 240px; padding: 16px 20px 20px; }
  :where(.interims-dashboard) .interims-gauge { width: 200px; height: 120px; }
}

@media (max-width: 700px) {
  .interims-dashboard { padding: 16px; }
  :where(.interims-dashboard) .interims-title-block h1 { font-size: 2rem; }
  :where(.interims-dashboard) .interims-subtitle { font-size: 0.65rem; }

  /* Make top-section a flex column so button flows between title and gauges */
  :where(.interims-dashboard) .interims-top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  /* Reposition Manage HP button: static flow between title and gauges */
  :where(.interims-dashboard) .interims-manage-hp-btn,
  :where(.interims-dashboard) .interims-manage-hp-btn-wrapper {
    position: static;
    width: 100%;
    max-width: 320px;
    text-align: center;
    order: 2;
  }
  :where(.interims-dashboard) .interims-manage-hp-btn {
    width: 100%;
  }
  :where(.interims-dashboard) .interims-title-block {
    order: 1;
    width: 100%;
  }
  :where(.interims-dashboard) .interims-gauges-container {
    order: 3;
  }

  :where(.interims-dashboard) .interims-gauges-container { flex-direction: column; align-items: center; gap: 20px; }
  :where(.interims-dashboard) .interims-gauge-card { width: 100%; max-width: 320px; }
  :where(.interims-dashboard) .interims-config-bar { flex-direction: column; gap: 16px; padding: 16px; }
  :where(.interims-dashboard) .interims-date-pickers { flex-direction: column; width: 100%; gap: 12px; }
  :where(.interims-dashboard) .interims-date-picker { width: 100%; }
  :where(.interims-dashboard) .interims-date-picker input { width: 100%; min-width: unset; }
  :where(.interims-dashboard) .interims-divider { width: 100%; height: 1px; }
  :where(.interims-dashboard) .interims-gauge-mode-group { width: 100%; }
  :where(.interims-dashboard) .interims-gauge-mode-group select { width: 100%; }
  :where(.interims-dashboard) .interims-cutoffs-group { width: 100%; justify-content: center; gap: 16px; }
  :where(.interims-dashboard) .interims-acutes-config { width: 100%; flex-direction: column; gap: 12px; align-items: flex-start; }
  :where(.interims-dashboard) .interims-threshold-group { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  :where(.interims-dashboard) .interims-threshold-group input[type="number"] { width: 70px; }

  /* LEGEND RESPONSIVE */
  :where(.interims-dashboard) .interims-legend { flex-direction: column; gap: 8px; padding: 12px 16px; }
  :where(.interims-dashboard) .interims-legend-items { justify-content: center; gap: 8px 12px; }
  :where(.interims-dashboard) .interims-legend-text { font-size: 11px; }
  :where(.interims-dashboard) .interims-legend-swatch { width: 12px; height: 12px; }

  /* TABLE TO COMPACT CARDS */
  :where(.interims-dashboard) .interims-table-container { overflow: visible; }
  :where(.interims-dashboard) .interims-table thead { display: none; }
  :where(.interims-dashboard) .interims-table,
  :where(.interims-dashboard) .interims-table tbody {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    box-shadow: none;
  }
  :where(.interims-dashboard) .interims-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "name name name name items"
      "hp same next two three";
    gap: 6px 6px;
    background: var(--px-bg-card);
    border: 1px solid var(--px-border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: var(--px-shadow);
    position: relative;
    animation: none !important;
    opacity: 1 !important;
  }
  :where(.interims-dashboard) .interims-table tbody tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--interims-hp-accent) 0%, var(--interims-others-accent) 100%);
    border-radius: 10px 0 0 10px;
  }
  :where(.interims-dashboard) .interims-table td {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
  :where(.interims-dashboard) .interims-table td.home-name {
    grid-area: name;
    font-size: 14px;
  }
  :where(.interims-dashboard) .interims-table td.interim-items {
    grid-area: items;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 12px;
    color: var(--px-text-muted);
  }
  :where(.interims-dashboard) .interims-table td.interim-items::before {
    content: 'Items:';
    font-size: 9px;
    font-weight: 400;
  }
  :where(.interims-dashboard) .interims-table td.hp-pct {
    grid-area: hp;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  :where(.interims-dashboard) .interims-table td.hp-pct::before {
    content: 'HP';
    font-family: var(--px-mono);
    font-size: 8px;
    color: var(--interims-hp-accent);
    font-weight: 700;
  }
  :where(.interims-dashboard) .interims-table td.others-same-pct {
    grid-area: same;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  :where(.interims-dashboard) .interims-table td.others-same-pct::before {
    content: 'Same';
    font-family: var(--px-mono);
    font-size: 8px;
    color: #4CAF50;
    font-weight: 700;
  }
  :where(.interims-dashboard) .interims-table td.others-next-pct {
    grid-area: next;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  :where(.interims-dashboard) .interims-table td.others-next-pct::before {
    content: 'Next';
    font-family: var(--px-mono);
    font-size: 8px;
    color: #FFC107;
    font-weight: 700;
  }
  :where(.interims-dashboard) .interims-table td.others-two-pct {
    grid-area: two;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  :where(.interims-dashboard) .interims-table td.others-two-pct::before {
    content: '2 Day';
    font-family: var(--px-mono);
    font-size: 8px;
    color: #FF9800;
    font-weight: 700;
  }
  :where(.interims-dashboard) .interims-table td.others-three-pct {
    grid-area: three;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  :where(.interims-dashboard) .interims-table td.others-three-pct::before {
    content: '3+';
    font-family: var(--px-mono);
    font-size: 8px;
    color: #F44336;
    font-weight: 700;
  }
  :where(.interims-dashboard) .interims-table td .interims-pct {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .interims-dashboard { padding: 12px; }
  :where(.interims-dashboard) .interims-title-block h1 { font-size: 1.6rem; }
  :where(.interims-dashboard) .interims-gauge-card { padding: 14px 16px 18px; }
  :where(.interims-dashboard) .interims-gauge { width: 180px; height: 105px; }
  :where(.interims-dashboard) .interims-gauge-title { font-size: 1.2rem; }
  :where(.interims-dashboard) .interims-gauge-count { font-size: 12px; }
  :where(.interims-dashboard) .interims-cutoffs-group { gap: 10px; }
  :where(.interims-dashboard) .interims-cutoff-item input[type="time"] { width: 80px; font-size: 11px; padding: 6px 8px; }
}

/* Standard media queries as fallback */
@media (max-width: 768px) {
  .interims-dashboard { padding: 16px; }
  /* Make top-section a flex column so button flows between title and gauges */
  :where(.interims-dashboard) .interims-top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  /* Reposition Manage HP button: static flow between title and gauges */
  :where(.interims-dashboard) .interims-manage-hp-btn,
  :where(.interims-dashboard) .interims-manage-hp-btn-wrapper {
    position: static;
    width: 100%;
    max-width: 320px;
    text-align: center;
    order: 2;
  }
  :where(.interims-dashboard) .interims-manage-hp-btn {
    width: 100%;
  }
  :where(.interims-dashboard) .interims-title-block {
    order: 1;
    width: 100%;
  }
  :where(.interims-dashboard) .interims-gauges-container {
    order: 3;
  }
  :where(.interims-dashboard) .interims-gauges-container { flex-direction: column; align-items: center; }
  :where(.interims-dashboard) .interims-config-bar { flex-direction: column; gap: 16px; }
  :where(.interims-dashboard) .interims-date-pickers { flex-direction: column; width: 100%; }
}

/* ========================================
   TOOLTIP STYLES
   ======================================== */
.interims-custom-tooltip {
  position: fixed;
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 300px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 10000;
  pointer-events: none;
  color: var(--px-text-primary);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.interims-custom-tooltip.visible {
  opacity: 1;
}

[data-theme="dark"] .interims-custom-tooltip {
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

:where(.interims-dashboard) .interims-tooltip-trigger {
  cursor: help;
}

/* Warning triangle for no-colour homes */
:where(.interims-dashboard) .no-colour-warning {
  color: #dc2626;
  cursor: help;
  font-size: 1.1em;
}

/* Empty state */
:where(.interims-dashboard) .interims-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--px-text-muted);
  font-style: italic;
}

/* Muted color class for dashes */
:where(.interims-dashboard) .interims-color-muted {
  color: var(--px-text-muted) !important;
}

/* Toggle Switch */
:where(.interims-dashboard) .interims-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

:where(.interims-dashboard) .interims-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

:where(.interims-dashboard) .interims-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--px-bg-card);
  border-radius: 24px;
  border: 2px solid var(--px-border);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

:where(.interims-dashboard) .interims-slider::before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 2px;
  background: var(--px-text-secondary);
  border-radius: 50%;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

:where(.interims-dashboard) .interims-switch input:checked + .interims-slider {
  background: var(--interims-others-accent);
  border-color: var(--interims-others-accent);
  box-shadow: 0 0 12px var(--interims-others-glow);
}

:where(.interims-dashboard) .interims-switch input:checked + .interims-slider::before {
  transform: translateX(20px);
  background: #fff;
}

:where(.interims-dashboard) .interims-toggle-label {
  font-family: var(--px-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--px-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

:where(.interims-dashboard) .interims-toggle-label.active {
  color: var(--interims-others-accent);
  text-shadow: 0 0 8px var(--interims-others-glow);
}

:where(.interims-dashboard) .interims-toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
