/* Risk Assessment widgets on the personalised (dark) dashboard */

.pd-ra-widget-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  border-radius: 10px;
  /* Opaque surface — same family as .personalized-dashboard .stat-card (#363434) */
  background: #363434;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box;
  color: rgba(255, 255, 255, 0.92);
}

.pd-ra-widget-panel h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
}

.pd-ra-recent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.pd-ra-recent-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.pd-ra-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.pd-ra-status-cell {
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-align: center;
  background: rgba(0, 0, 0, 0.12);
}

.pd-ra-status-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
}

.pd-ra-status-count {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 6px;
}

/* ── Trend chart ── */
.pd-ra-trend {
  border-radius: 12px;
  padding: 10px 12px 8px;
  background: #363434;
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 0;
}

.pd-ra-trend--empty {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
}

.pd-ra-trend-empty-msg {
  margin: 0;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  line-height: 1.4;
}

.pd-ra-trend-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.pd-ra-trend-head-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.pd-ra-trend-subtitle {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.01em;
}

.pd-ra-trend-head--empty {
  margin-bottom: 4px;
}

.pd-ra-trend-head-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.pd-ra-trend-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.pd-ra-trend-period {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.pd-ra-trend-period-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pd-ra-trend-period-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.pd-ra-trend-period-btn--active {
  background: rgba(242, 27, 35, 0.25);
  color: #fecaca;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pd-ra-trend-legend-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.pd-ra-trend-key {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.pd-ra-trend-key--assigned {
  background: #f87171;
}

.pd-ra-trend-key--completed {
  background: #34d399;
}

.pd-ra-trend-chart-wrap {
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.pd-ra-trend-caption {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Location drilldown ── */
.pd-ra-drill {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
  /* Opaque card — translucent rgba on #3a3838 was visually identical to “no background” */
  padding: 12px 14px 14px;
  border-radius: 12px;
  background: #363434;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.pd-ra-drill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pd-ra-drill-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.pd-ra-drill-lede {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
  max-width: 42rem;
}

.pd-ra-drill-clear {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pd-ra-drill-clear:hover {
  background: rgba(242, 27, 35, 0.15);
  border-color: rgba(242, 27, 35, 0.35);
}

.pd-ra-drill-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

@media (max-width: 900px) {
  .pd-ra-drill-filters {
    grid-template-columns: 1fr;
  }
}

.pd-ra-drill-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 5px;
}

.pd-ra-drill-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.92);
}

.pd-ra-drill-select:focus-visible {
  outline: 2px solid rgba(242, 27, 35, 0.6);
  outline-offset: 2px;
}

.pd-ra-drill-crumb {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.pd-ra-drill-crumb span {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.pd-ra-drill-crumb--muted {
  color: rgba(255, 255, 255, 0.4);
}

.pd-ra-drill-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 700px) {
  .pd-ra-drill-body {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
  }

  .pd-ra-drill-chart-wrap {
    flex: 1 1 55%;
    min-width: 0;
  }

  .pd-ra-drill-side {
    flex: 1 1 45%;
    min-width: 0;
  }
}

.pd-ra-drill-chart-wrap {
  border-radius: 12px;
  background: #2e2c2c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-ra-drill-chart-wrap--empty {
  min-height: 160px;
}

.pd-ra-drill-empty {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 24px 12px;
}

.pd-ra-drill-tooltip {
  padding: 8px 10px;
  border-radius: 10px;
  background: #2a2828;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
}

.pd-ra-drill-tooltip-num {
  display: block;
  margin-top: 4px;
}

.pd-ra-drill-tooltip-pct {
  opacity: 0.75;
}

.pd-ra-drill-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pd-ra-drill-rates {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pd-ra-drill-rate {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pd-ra-drill-rate-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.pd-ra-drill-rate-label {
  color: rgba(255, 255, 255, 0.6);
}

.pd-ra-drill-rate-n {
  opacity: 0.75;
  font-size: 11px;
}

.pd-ra-drill-stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 520px) {
  .pd-ra-drill-stat-cards {
    grid-template-columns: 1fr;
  }
}

.pd-ra-drill-stat-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: #2a2828;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pd-ra-drill-stat-card-title {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.pd-ra-drill-stat-card-big {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

.pd-ra-drill-stat-card-hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.45);
}
