.period-phase2-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 0 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin-top: 12px;
  flex-wrap: wrap;
}

.period-phase2-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 240px;
  color: #64748b;
  font-size: 12px;
}

.period-phase2-toolbar input,
.period-phase2-drill-controls select {
  height: 36px;
  border: 1px solid rgba(100, 116, 139, 0.24);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  padding: 0 11px;
  font: inherit;
  outline: none;
}

.period-phase2-toolbar input:focus,
.period-phase2-drill-controls select:focus {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.period-phase2-toolbar > span {
  margin: 0 0 9px auto;
  color: #64748b;
  font-size: 12px;
}

.period-analytics-phase2 {
  margin-top: 16px;
}

.period-phase2-status {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.period-phase2-body {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.period-phase2-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.period-phase2-summary article {
  min-width: 0;
  padding: 15px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #fff;
}

.period-phase2-summary article span {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.period-phase2-summary article strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.period-phase2-summary article p {
  margin: 7px 0 0;
  color: #94a3b8;
  font-size: 11px;
}

.period-phase2-summary article.danger {
  border-color: rgba(220, 38, 38, 0.2);
  background: #fffafa;
}

.period-phase2-summary article.danger strong {
  color: #b91c1c;
}

.period-phase2-summary article.positive {
  border-color: rgba(5, 150, 105, 0.2);
  background: #f7fdf9;
}

.period-phase2-summary article.positive strong {
  color: #047857;
}

.period-phase2-section {
  margin: 0;
}

.period-phase2-drill-controls {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) auto minmax(170px, 0.8fr) minmax(250px, 1.4fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.period-phase2-drill-controls > span {
  align-self: center;
  color: #94a3b8;
  padding-bottom: 4px;
}

.period-phase2-drill-controls label {
  display: grid;
  gap: 5px;
  color: #64748b;
  font-size: 12px;
}

.period-phase2-drill-controls > div {
  display: grid;
  gap: 3px;
  min-height: 36px;
  align-content: center;
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, 0.25);
}

.period-phase2-drill-controls b {
  color: #0f172a;
  font-size: 13px;
}

.period-phase2-drill-controls small {
  color: #64748b;
  font-size: 11px;
}

.period-phase2-table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
}

.period-phase2-table-wrap table {
  min-width: 960px;
  margin: 0;
}

.period-phase2-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.period-phase2-table-wrap td {
  vertical-align: top;
  color: #334155;
  font-size: 12px;
}

.period-phase2-table-wrap td strong,
.period-phase2-table-wrap td small {
  display: block;
}

.period-phase2-table-wrap td strong {
  color: #0f172a;
}

.period-phase2-table-wrap td small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
}

.period-phase2-table-wrap td.negative {
  color: #b91c1c;
  font-weight: 700;
}

.period-phase2-table-wrap td.positive {
  color: #047857;
  font-weight: 700;
}

.period-phase2-anomaly-table td ul {
  display: grid;
  gap: 5px;
  min-width: 230px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.period-phase2-anomaly-table td li {
  position: relative;
  padding-left: 11px;
  color: #475569;
}

.period-phase2-anomaly-table td li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #ef4444;
}

.period-risk {
  display: inline-flex;
  min-width: 62px;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.period-risk.critical {
  color: #991b1b;
  background: #fee2e2;
}

.period-risk.high {
  color: #9a3412;
  background: #ffedd5;
}

.period-risk.medium {
  color: #854d0e;
  background: #fef9c3;
}

.period-phase2-empty {
  display: grid;
  min-height: 88px;
  place-items: center;
  padding: 18px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: #fbfdff;
}

.period-phase2-saved {
  padding: 0;
  overflow: hidden;
}

.period-phase2-saved > summary {
  cursor: pointer;
  padding: 15px 16px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.period-phase2-reports {
  padding: 12px;
}

.period-phase2-report-list {
  display: grid;
  gap: 8px;
}

.period-phase2-report-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  background: #fff;
}

.period-phase2-report-list article > div {
  display: grid;
  gap: 3px;
}

.period-phase2-report-list article > div:last-child {
  grid-auto-flow: column;
  align-items: center;
  gap: 10px;
}

.period-phase2-report-list strong {
  color: #0f172a;
  font-size: 12px;
}

.period-phase2-report-list span,
.period-phase2-report-list small {
  color: #64748b;
  font-size: 10px;
}

.period-report-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(6px);
}

.period-report-modal[hidden] {
  display: none;
}

.period-report-modal-card {
  width: min(1120px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.period-report-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.period-report-modal-head span {
  display: block;
  color: #64748b;
  font-size: 10px;
}

.period-report-modal-head h3 {
  margin: 3px 0 0;
  color: #0f172a;
  font-size: 19px;
}

.period-report-modal-body {
  max-height: calc(90vh - 78px);
  overflow: auto;
  padding: 18px 20px 24px;
}

.period-report-snapshot-range {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 12px;
}

.period-report-snapshot-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.period-report-snapshot-metrics article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
}

.period-report-snapshot-metrics span,
.period-report-snapshot-metrics small {
  color: #64748b;
  font-size: 10px;
}

.period-report-snapshot-metrics strong {
  color: #0f172a;
  font-size: 17px;
}

.period-report-modal-body > section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.period-report-modal-body h4 {
  margin: 0 0 10px;
  color: #0f172a;
}

.period-report-modal-body section > p {
  color: #475569;
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .period-phase2-summary,
  .period-report-snapshot-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .period-phase2-drill-controls {
    grid-template-columns: 1fr auto 1fr;
  }

  .period-phase2-drill-controls > div {
    grid-column: 1 / -1;
    padding: 8px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
  }
}

@media (max-width: 720px) {
  .period-phase2-toolbar {
    align-items: stretch;
  }

  .period-phase2-toolbar label,
  .period-phase2-toolbar button,
  .period-phase2-toolbar > span {
    width: 100%;
    min-width: 0;
  }

  .period-phase2-toolbar > span {
    margin: 2px 0 0;
  }

  .period-phase2-summary,
  .period-report-snapshot-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .period-phase2-drill-controls {
    grid-template-columns: 1fr;
  }

  .period-phase2-drill-controls > span {
    display: none;
  }

  .period-phase2-report-list article,
  .period-phase2-report-list article > div:last-child {
    grid-auto-flow: row;
    align-items: stretch;
  }

  .period-phase2-report-list article {
    display: grid;
  }

  .period-report-modal {
    padding: 8px;
  }

  .period-report-modal-card {
    width: 100%;
    max-height: 96vh;
  }
}
