.dora-panel {
  background: var(--dp-bg);
  color: var(--dp-text-primary);
  border-radius: 12px;
  padding: 24px 28px;
  margin: 24px 0;
}

.dora-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dora-panel-header h2 {
  font-size: var(--text-heading-md);
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0;
  color: var(--dp-text-primary);
}

.dora-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dora-period-badge {
  font-size: var(--text-label-xs);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--dp-text-muted);
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 5px;
  padding: 5px 10px;
}

.dora-week-nav,
.dora-period-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dora-period-toggle { margin-right: 8px; }

.dora-priority-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.dora-priority-filter-label {
  font-size: var(--text-label-xs);
  font-weight: 500;
  color: var(--dp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dora-priority-option {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-label-xs);
  font-weight: 500;
  color: var(--dp-text-secondary);
  cursor: pointer;
}

.dora-priority-option input { accent-color: var(--dp-accent); }

.dora-filter-note {
  font-size: var(--text-paragraph-xs);
  color: var(--dp-text-secondary);
  margin-bottom: 16px;
}

.dora-filter-note strong { color: var(--dp-text-primary); }

.dora-col-unfiltered {
  color: var(--dp-text-muted);
  font-style: italic;
  opacity: 0.7;
}

.dora-nav-btn {
  font-size: var(--text-label-xs);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--dp-text-secondary);
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 5px;
  padding: 5px 10px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.dora-nav-btn:hover {
  color: var(--dp-text-primary);
  border-color: var(--dp-text-muted);
}

.dora-nav-home {
  border-radius: 0;
  border-left: none;
  border-right: none;
}

.dora-nav-btn:first-child { border-radius: 5px 0 0 5px; }
.dora-nav-btn:last-child  { border-radius: 0 5px 5px 0; }

.dora-nav-active {
  color: var(--dp-text-primary);
  border-color: var(--dp-text-muted);
}

.dora-nav-disabled {
  color: var(--dp-text-muted);
  pointer-events: none;
  opacity: 0.4;
}

.dora-legend {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 10px 14px;
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.dora-legend-title {
  font-size: var(--text-label-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dp-text-muted);
  font-weight: 500;
}

.dora-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-paragraph-xs);
  color: var(--dp-text-secondary);
}

.dora-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dora-legend-dot.green  { background: var(--dp-green); }
.dora-legend-dot.yellow { background: var(--dp-yellow); }
.dora-legend-dot.red    { background: var(--dp-red); }

.dora-legend-sep {
  width: 1px;
  height: 16px;
  background: var(--dp-border);
}

/* Grid */

.dora-grid-header {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.dora-col-label {
  text-align: center;
  padding: 10px 8px;
  background: var(--dp-surface);
  border-radius: 6px 6px 0 0;
  position: relative;
}

.dora-col-label .metric-name {
  font-size: var(--text-label-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--dp-text-secondary);
  margin-bottom: 2px;
}

.dora-col-label .metric-desc {
  font-size: var(--text-paragraph-xs);
  color: var(--dp-text-muted);
}

.metric-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 4px;
  background: none;
  border: 0;
  color: var(--dp-text-muted);
  cursor: help;
  font-size: 12px;
  line-height: 1;
  vertical-align: baseline;
}

.metric-help:hover,
.metric-help:focus-visible {
  color: var(--dp-accent);
  outline: none;
}

.metric-help [role="tooltip"] {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 6px);
  z-index: 20;
  width: 260px;
  padding: 10px 12px;
  background: var(--dp-surface-raised);
  border: 1px solid var(--dp-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px color-mix(in srgb, #000 35%, transparent);
  font-size: var(--text-paragraph-xs);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  color: var(--dp-text-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.metric-help:hover [role="tooltip"],
.metric-help:focus-visible [role="tooltip"] {
  opacity: 1;
  pointer-events: auto;
}

.dora-metrics-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  animation: dpFadeRow 0.4s ease forwards;
}

@keyframes dpFadeRow {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dora-metric-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  background: var(--dp-surface);
}

.dora-metric-cell:first-child { border-radius: 0 0 0 6px; }
.dora-metric-cell:last-child  { border-radius: 0 0 6px 0; }

.dora-metric-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dora-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dora-status-dot.green  { background: var(--dp-green);  box-shadow: 0 0 6px color-mix(in srgb, var(--dp-green) 35%, transparent); }
.dora-status-dot.yellow { background: var(--dp-yellow); box-shadow: 0 0 6px color-mix(in srgb, var(--dp-yellow) 35%, transparent); }
.dora-status-dot.red    { background: var(--dp-red);    box-shadow: 0 0 6px color-mix(in srgb, var(--dp-red) 35%, transparent); }
.dora-status-dot.none   { background: var(--dp-border); }

.dora-metric-value {
  font-size: var(--text-label-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--dp-text-primary);
  min-width: 56px;
  text-align: right;
}

.dora-metric-raw {
  font-size: var(--text-paragraph-xs);
  font-variant-numeric: tabular-nums;
  color: var(--dp-text-muted);
  text-align: center;
}

.dora-metric-trend {
  font-size: var(--text-paragraph-sm);
  width: 14px;
  text-align: center;
  line-height: 1;
}

.dora-trend-improving { color: var(--dp-green); }
.dora-trend-declining { color: var(--dp-red); }
.dora-trend-stable    { color: var(--dp-text-muted); }

/* Sparkline */

.dora-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.dora-spark-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: help;
}

.dora-spark-col [role="tooltip"] {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -6px);
  z-index: 20;
  white-space: nowrap;
  padding: 6px 9px;
  background: var(--dp-surface-raised);
  border: 1px solid var(--dp-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px color-mix(in srgb, #000 35%, transparent);
  font-size: var(--text-paragraph-xs);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  color: var(--dp-text-primary);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.dora-spark-col [role="tooltip"] strong {
  font-weight: 600;
  color: var(--dp-text-primary);
}

.dora-spark-col:hover [role="tooltip"],
.dora-spark-col:focus-visible [role="tooltip"] {
  opacity: 1;
}

/* Latest week — marked with a neutral ring + bold label, never by saturation.
   A full-opacity status fill (e.g. amber) reads as a darker "red" tier, so the
   current bar keeps the same opacity as the rest and is set apart structurally. */
.dora-spark-col:last-child .dora-spark-bar {
  outline: 1.5px solid var(--dp-text-secondary);
  outline-offset: 1.5px;
}
.dora-spark-col:last-child .dora-spark-week {
  font-weight: 600;
  color: var(--dp-text-primary);
}

.dora-spark-bar {
  width: 5px;
  border-radius: 1.5px 1.5px 0 0;
  min-height: 2px;
  opacity: 0.6;
}

.dora-spark-bar.green  { background: var(--dp-green); }
.dora-spark-bar.yellow { background: var(--dp-yellow); }
.dora-spark-bar.red    { background: var(--dp-red); }
.dora-spark-bar.none   { background: var(--dp-border); }

.dora-spark-week {
  font-size: var(--text-paragraph-xs);
  font-variant-numeric: tabular-nums;
  color: var(--dp-text-muted);
  line-height: 1;
  overflow: visible;
  white-space: nowrap;
}

/* Threshold reference */

.dora-thresholds {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin-top: 16px;
}

.dora-threshold-card {
  background: var(--dp-surface);
  padding: 12px 14px;
  border-radius: 6px;
}

.dora-threshold-card h4 {
  font-size: var(--text-label-xs);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--dp-text-muted);
  margin: 0 0 8px;
  font-weight: 500;
}

.dora-threshold-note {
  margin-top: 8px;
  font-size: var(--text-paragraph-xs);
  color: var(--dp-text-muted);
  line-height: 1.5;
}

.dora-threshold-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: var(--text-paragraph-xs);
  font-variant-numeric: tabular-nums;
  color: var(--dp-text-secondary);
}

.dora-threshold-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dora-threshold-dot.green  { background: var(--dp-green); }
.dora-threshold-dot.yellow { background: var(--dp-yellow); }
.dora-threshold-dot.red    { background: var(--dp-red); }

/* ── Full-page Engineering Health Dashboard ── */

/* Header */

.dbd-dept-health {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 10px;
  padding: 10px 18px;
}

.dbd-dept-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: dbd-pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dbd-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

.dbd-dept-label {
  font-size: var(--text-label-xs);
  font-weight: 500;
  color: var(--dp-text-secondary);
  margin-bottom: 2px;
}

.dbd-dept-value {
  font-size: var(--text-heading-sm);
  font-weight: 600;
}

/* Grid */

.dbd-grid-header {
  display: grid;
  grid-template-columns: 260px 1fr 1fr 1fr 1fr 1fr;
  gap: 2px;
  margin-bottom: 2px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--dp-bg);
}

.dbd-corner {
  background: transparent;
}

.dbd-grid-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}

.dbd-squad-row {
  display: grid;
  grid-template-columns: 260px 1fr 1fr 1fr 1fr 1fr;
  gap: 2px;
  opacity: 0;
  animation: dbd-fade-row 0.4s ease forwards;
}

@keyframes dbd-fade-row {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dbd-squad-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--dp-surface);
  border-radius: 6px 0 0 6px;
}

.dbd-squad-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-label-xs);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  flex-shrink: 0;
  background: var(--dp-surface-raised);
  border: 1px solid var(--dp-border);
  color: var(--dp-text-secondary);
}

.dbd-squad-link {
  font-size: var(--text-label-xs);
  font-weight: 500;
  color: var(--dp-link);
  text-decoration: none;
  line-height: 1.3;
}

.dbd-squad-link:hover {
  color: var(--dp-accent);
}

.dbd-squad-row .dora-metric-cell:last-child {
  border-radius: 0 6px 6px 0;
}

/* Collapsible details/summary wrapper */
.dbd-collapsible {
  margin-bottom: 8px;
}

.dbd-collapsible > summary {
  list-style: none;
  cursor: pointer;
}

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

/* Donorbox Engineering aggregate row */
.dbd-engineering-row {
  opacity: 1;
  animation: none;
  margin-bottom: 0;
}

.dbd-engineering-row .dbd-squad-name-cell {
  background: var(--dp-surface-raised);
  border-left: 3px solid var(--dp-green);
}

.dbd-engineering-row .dora-metric-cell {
  background: color-mix(in srgb, var(--dp-surface-raised) 80%, transparent);
}

.dbd-engineering-icon {
  background: var(--dp-green) !important;
  color: #0a0a0a !important;
  border-color: var(--dp-green) !important;
}

.dbd-engineering-label {
  font-size: var(--text-heading-sm) !important;
  font-weight: 600 !important;
  color: var(--dp-text-primary) !important;
}

.dbd-collapse-chevron {
  margin-left: auto;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.5;
}

.dbd-collapse-chevron::after {
  content: "▾";
  font-size: var(--text-paragraph-sm);
  transition: transform 0.2s ease;
  display: inline-block;
}

details.dbd-collapsible:not([open]) .dbd-collapse-chevron::after {
  transform: rotate(-90deg);
}

details.dbd-collapsible[open] .dbd-squad-row:not(.dbd-engineering-row) {
  margin-top: 2px;
}

/* Summary strip */

.dbd-summary {
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
}

.dbd-summary-card {
  flex: 1;
  background: var(--dp-surface);
  padding: 14px 18px;
  border-radius: 6px;
  text-align: center;
}

.dbd-s-number {
  font-size: var(--text-heading-2xl);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--dp-text-primary);
  margin-bottom: 2px;
}

.dbd-s-label {
  font-size: var(--text-label-xs);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--dp-text-muted);
  font-weight: 500;
}

.dbd-green  .dbd-s-number { color: var(--dp-green); }
.dbd-yellow .dbd-s-number { color: var(--dp-yellow); }
.dbd-red    .dbd-s-number { color: var(--dp-red); }

/* Footer */

.dbd-footer {
  margin-top: 16px;
  font-size: var(--text-paragraph-xs);
  font-variant-numeric: tabular-nums;
  color: var(--dp-text-muted);
  text-align: center;
}
