/* Phase 19A app UI modernization: front-end-only workflow guidance. */
.workspace {
  width: 100%;
  max-width: none;
  margin: 0;
}

@media (min-width: 1280px) {
  .app-layout {
    grid-template-columns: minmax(290px, 320px) minmax(0, 1fr);
  }

  .workspace {
    padding: 28px 44px 36px;
  }
}

.workspace-heading {
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid rgba(203, 222, 255, .12);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 35, 59, .78), rgba(8, 19, 35, .58));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}

.workspace-heading h2 {
  font-size: 1.5rem;
  letter-spacing: -.015em;
}

.apr-next-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid rgba(58, 179, 255, .26);
  border-radius: 18px;
  background:
    radial-gradient(540px 220px at 8% 0%, rgba(58, 179, 255, .16), transparent 62%),
    linear-gradient(135deg, rgba(18, 37, 63, .92), rgba(9, 21, 38, .92));
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22);
}

.apr-next-action-card[data-tone="complete"] {
  border-color: rgba(53, 208, 132, .28);
  background:
    radial-gradient(540px 220px at 8% 0%, rgba(53, 208, 132, .13), transparent 62%),
    linear-gradient(135deg, rgba(18, 37, 63, .92), rgba(9, 21, 38, .92));
}

.apr-next-action-card[data-tone="locked"] {
  border-color: rgba(244, 184, 74, .34);
}

.apr-next-copy h3 {
  margin-bottom: 6px;
  font-size: 1.18rem;
}

.apr-next-copy p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.apr-next-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.apr-progress-tracker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.apr-progress-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(5, 15, 28, .34);
}

.apr-progress-step[data-state="active"] {
  border-color: rgba(58, 179, 255, .48);
  background: rgba(21, 72, 113, .24);
}

.apr-progress-step[data-state="complete"] {
  border-color: rgba(53, 208, 132, .36);
  background: rgba(53, 208, 132, .08);
}

.apr-progress-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(203, 222, 255, .18);
  border-radius: 999px;
  color: #d9eaff;
  background: rgba(255, 255, 255, .06);
  font-weight: 850;
  font-size: .8rem;
}

.apr-progress-step[data-state="complete"] .apr-progress-index {
  color: #08111f;
  border-color: rgba(53, 208, 132, .9);
  background: var(--green);
}

.apr-progress-step strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .86rem;
}

.apr-progress-step small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-grid {
  gap: 16px;
}

.upload-panel .muted {
  margin-bottom: 0;
  font-size: .91rem;
}

.reconciliation-panel {
  display: grid;
  gap: 18px;
}

.workflow-heading,
.workflow-finish-heading {
  margin-bottom: 0;
}

.workflow-run-heading {
  padding: 16px;
  border: 1px solid rgba(203, 222, 255, .10);
  border-radius: 14px;
  background: rgba(3, 13, 26, .22);
}

.workflow-options {
  gap: 16px;
}

.workflow-option {
  min-height: 220px;
}

.summary-section {
  margin-top: 26px;
}

.apr-executive-summary {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(203, 222, 255, .22);
  border-radius: 20px;
  background:
    radial-gradient(600px 240px at 10% 100%, rgba(58, 179, 255, .12), transparent 62%),
    radial-gradient(520px 240px at 92% 0%, rgba(53, 208, 132, .08), transparent 58%),
    linear-gradient(145deg, rgba(20, 35, 58, .92), rgba(8, 17, 32, .96));
  box-shadow: 0 22px 60px rgba(0, 0, 0, .24);
}

.apr-progress-tracker + .apr-executive-summary {
  margin-top: -2px;
}

.apr-executive-summary::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, .07), transparent 35%, rgba(255, 255, 255, .04));
  opacity: .45;
}

.apr-exec-header,
.apr-exec-chips,
.apr-exec-metrics {
  position: relative;
  z-index: 1;
}

.apr-exec-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.apr-exec-header h3 {
  margin-bottom: 5px;
  font-size: 1.45rem;
  letter-spacing: -.02em;
}

.apr-exec-header p,
.apr-exec-subtitle {
  margin-bottom: 0;
  color: #c8d8ee;
}

.apr-exec-header > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(203, 222, 255, .22);
  border-radius: 999px;
  color: #c9d8ec;
  background: rgba(255, 255, 255, .06);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.apr-exec-subtitle {
  position: relative;
  z-index: 1;
  margin-top: 8px;
}

.apr-exec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.apr-exec-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(58, 179, 255, .23);
  border-radius: 999px;
  color: #dcecff;
  background: rgba(21, 72, 113, .28);
  font-size: .82rem;
  font-weight: 850;
}

.apr-exec-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.apr-exec-metric {
  min-height: 90px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid rgba(203, 222, 255, .18);
  border-radius: 13px;
  background: rgba(255, 255, 255, .04);
  text-align: center;
}

.apr-exec-metric strong {
  display: block;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  line-height: 1;
}

.apr-exec-metric span {
  display: block;
  margin-top: 6px;
  color: #dbe8fb;
  font-size: .95rem;
}

.apr-exec-metric.success {
  border-color: rgba(0, 214, 143, .48);
  background: rgba(0, 214, 143, .09);
}

.apr-exec-metric.success strong {
  color: #00e69f;
}

.apr-exec-metric.warning {
  border-color: rgba(255, 204, 48, .48);
  background: rgba(255, 204, 48, .08);
}

.apr-exec-metric.warning strong {
  color: #ffdc45;
}

.apr-exec-metric.danger {
  border-color: rgba(255, 107, 107, .48);
  background: rgba(255, 107, 107, .08);
}

.apr-exec-metric.danger strong {
  color: #ff7878;
}

.apr-results-details {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 19, 35, .34);
}

.apr-results-details > summary {
  padding: 14px 16px;
  color: #dbe8fb;
  cursor: pointer;
  font-weight: 850;
}

.apr-results-details .results-wrap {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 0 14px 14px;
}

.apr-results-details #results-note {
  margin: 0;
  padding: 12px 16px 14px;
}

@media (max-width: 980px) {
  .apr-next-action-card {
    align-items: stretch;
    flex-direction: column;
  }

  .apr-next-actions {
    justify-content: flex-start;
  }

  .apr-progress-tracker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .workspace-heading {
    padding: 16px;
  }

  .apr-progress-tracker,
  .apr-exec-metrics {
    grid-template-columns: 1fr;
  }

  .apr-exec-header {
    flex-direction: column;
  }

  .apr-next-actions .button {
    width: 100%;
  }
}
