/* Progress Bar + Navigation */

/* ── Step Navigator / Stepper ────────────── */
.wizard-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: var(--space-lg) 0 var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.wizard-stepper::-webkit-scrollbar { display: none; }

.wizard-stepper__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
  cursor: default;
}

.wizard-stepper__item--done { cursor: pointer; }

/* Connector line between dots */
.wizard-stepper__item:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-light);
  z-index: 0;
}

.wizard-stepper__item--done:not(:first-child)::before {
  background: linear-gradient(to right, var(--green) 0%, var(--green-light) 100%);
}

.wizard-stepper__item--active:not(:first-child)::before {
  background: linear-gradient(to right, var(--green-light) 0%, var(--gold) 100%);
}

.wizard-stepper__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  position: relative;
  z-index: 1;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--muted);
}

.wizard-stepper__item--done .wizard-stepper__dot {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.wizard-stepper__item--done:hover .wizard-stepper__dot {
  transform: scale(1.12);
  background: var(--green-light);
  border-color: var(--green-light);
}

.wizard-stepper__item--active .wizard-stepper__dot {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
  box-shadow: 0 0 0 3px rgba(197, 165, 90, 0.2);
}

.wizard-stepper__item--future .wizard-stepper__dot {
  background: var(--off-white);
  border-color: var(--border-light);
  color: var(--border);
}

.wizard-stepper__label {
  margin-top: var(--space-xs);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  transition: color 0.2s;
}

.wizard-stepper__item--done .wizard-stepper__label {
  color: var(--green);
}

.wizard-stepper__item--done:hover .wizard-stepper__label {
  color: var(--green-light);
}

.wizard-stepper__item--active .wizard-stepper__label {
  color: var(--gold);
}

@media (max-width: 640px) {
  .wizard-stepper__label {
    font-size: 0.6rem;
    max-width: 60px;
  }
  .wizard-stepper__dot {
    width: 26px;
    height: 26px;
    font-size: 0.65rem;
  }
}

/* ── Progress Bar (below stepper) ────────── */
.wizard-progress {
  margin-bottom: var(--space-xl);
  padding: 0 0 var(--space-md);
}

.wizard-progress__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-xs);
}

.wizard-progress__label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--green);
}

.wizard-progress__count {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.wizard-progress__track {
  width: 100%;
  height: 3px;
  background: var(--border-light);
  overflow: hidden;
}

.wizard-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-light) 60%, var(--gold) 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Step Content Container ───────────────── */
.step-content {
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

.step-panel {
  animation-duration: 0.28s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: both;
}

/* Forward: slide in from right */
.step-panel--enter-forward {
  animation-name: slideInRight;
}

/* Back: slide in from left */
.step-panel--enter-back {
  animation-name: slideInLeft;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-title {
  margin-bottom: var(--space-lg);
}

.step-description {
  color: var(--muted);
  margin-bottom: var(--space-xl);
  font-size: 0.95rem;
  max-width: 640px;
}

/* ── Navigation Buttons ───────────────────── */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-light);
}

.wizard-nav .btn--primary {
  padding: 0.8rem 2rem;
  font-size: 0.95rem;
  min-width: 160px;
  justify-content: center;
}

.wizard-nav .btn--secondary {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  min-width: 130px;
  justify-content: center;
}

.wizard-nav__spacer {
  flex: 1;
}

/* ── Running Totals Summary Bar ──────────── */
.summary-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(0deg, #0F1D0F 0%, var(--green) 50%, var(--green-light) 100%);
  backdrop-filter: blur(8px);
  border-top: 2px solid rgba(197, 165, 90, 0.3);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.2);
}

.summary-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-xl);
}

.summary-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.summary-bar__label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
}

.summary-bar__value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
}

.summary-bar__item--highlight .summary-bar__label {
  color: var(--gold);
}

.summary-bar__item--highlight .summary-bar__value {
  color: var(--gold);
  font-size: 0.95rem;
}

.summary-bar__sep {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.summary-bar__toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 var(--space-sm);
  margin-left: var(--space-sm);
  transition: color 0.15s;
}

.summary-bar__toggle:hover {
  color: var(--white);
}

.summary-bar__reopen {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-xl);
  z-index: 100;
  background: var(--green);
  color: var(--white);
  border: none;
  padding: var(--space-xs) var(--space-md);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius);
  opacity: 0.7;
  transition: opacity 0.15s;
}

.summary-bar__reopen:hover {
  opacity: 1;
}

@media (max-width: 640px) {
  .summary-bar__inner {
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
  }
  .summary-bar__value { font-size: 0.75rem; }
  .summary-bar__label { font-size: 0.55rem; }
  .summary-bar__sep { height: 22px; }
  .summary-bar__item--highlight .summary-bar__value { font-size: 0.8rem; }
}

/* ── Monthly Detail ──────────────────────── */
.monthly-detail {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.monthly-detail__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.monthly-detail__toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.monthly-detail__toggle span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--green);
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .monthly-grid { grid-template-columns: repeat(3, 1fr); }
}

.monthly-grid__cell label {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.monthly-grid__cell input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  background: var(--off-white);
  color: var(--charcoal);
  font-family: var(--font-body);
}

.monthly-grid__cell input:focus {
  outline: none;
  border-color: var(--gold);
}

.monthly-detail__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.monthly-detail__total {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--charcoal);
}

.monthly-detail__distribute {
  font-size: 0.75rem;
  color: var(--gold);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  background: none;
  border: none;
  text-decoration: underline;
  padding: 0;
}

.monthly-detail__distribute:hover {
  color: var(--gold-hover);
}

/* ── Tabs ────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-xl);
}

.tabs__tab {
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tabs__tab:hover {
  color: var(--charcoal);
}

.tabs__tab--active {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* ── Upload Zone ─────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  max-width: 640px;
}

.upload-zone:hover,
.upload-zone--active {
  border-color: var(--green);
  background: #EDF3ED;
}

.upload-zone__icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.upload-zone__text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--green);
  margin-bottom: var(--space-xs);
}

.upload-zone__hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Upload Success ──────────────────────── */
.upload-success {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: #EDF3ED;
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--green);
  max-width: 640px;
}

.upload-success__icon {
  font-weight: 700;
  font-size: 1.1rem;
}

/* ── Global Escalation Bar ───────────────── */
.upload-global-esc {
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* ── Review Table (Spreadsheet Layout) ───── */
.upload-review-table-wrap {
  max-width: calc(100vw - 80px);
  margin: 0 auto;
  overflow-x: auto;
}

@media (min-width: 1200px) {
  .upload-review-table-wrap {
    overflow-x: visible;
  }
}

.upload-review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
}

/* Column widths */
.upload-review-table .col-name      { width: 180px; }
.upload-review-table .col-prior     { width: 90px; }
.upload-review-table .col-esc       { width: 60px; }
.upload-review-table .col-projected { width: 90px; }
.upload-review-table .col-freq      { width: 85px; }
.upload-review-table .col-month     { width: 75px; }
.upload-review-table .col-rowtotal  { width: 80px; }
.upload-review-table .col-remove    { width: 30px; }

/* Header */
.upload-review-table thead th {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: var(--space-sm) var(--space-xs);
  border-bottom: 2px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.upload-review-table thead th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 2;
}

/* Data cells */
.upload-review-table tbody td {
  padding: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
  text-align: right;
  font-family: var(--font-mono);
  color: var(--charcoal);
  vertical-align: middle;
}

.upload-review-table tbody td:first-child {
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 1;
}

/* Editable input cells */
.upload-review-table input[type="number"] {
  width: 100%;
  padding: 2px 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: right;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  background: var(--white);
  color: var(--charcoal);
  -moz-appearance: textfield;
}

.upload-review-table input[type="number"]:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(26, 46, 26, 0.1);
}

.upload-review-table input::-webkit-outer-spin-button,
.upload-review-table input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Frequency dropdown */
.upload-review-table select {
  width: 100%;
  padding: 2px 4px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  background: var(--white);
  cursor: pointer;
}

/* Computed cells */
.upload-review-table .cell-computed {
  color: var(--charcoal);
}

.upload-review-table .cell-projected {
  color: var(--green);
  font-weight: 700;
}

/* Uneven warning icon */
.upload-review-table .uneven-flag {
  color: #92400E;
  font-size: 0.75rem;
  cursor: help;
  margin-left: 2px;
}

/* Row Total check/mismatch */
.upload-review-table .row-check { color: var(--green); }
.upload-review-table .row-mismatch { color: var(--error); font-weight: 700; }

/* Remove button */
.upload-review-table .btn-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  transition: color 0.15s;
}
.upload-review-table .btn-remove:hover { color: var(--error); }

/* Totals row */
.upload-review-table tfoot td {
  padding: var(--space-sm) var(--space-xs);
  border-top: 2px solid var(--border);
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: right;
  color: var(--green);
}

.upload-review-table tfoot td:first-child {
  text-align: left;
  font-family: var(--font-heading);
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 1;
}

/* Alternating row shading */
.upload-review-table tbody tr:nth-child(even) td {
  background: var(--off-white);
}
.upload-review-table tbody tr:nth-child(even) td:first-child {
  background: var(--off-white);
}

