/* 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);
}

/* ══════════════════════════════════════════════════════════════ */
/* PWM UPLOAD FEATURE                                            */
/* ══════════════════════════════════════════════════════════════ */

/* ── 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;
}
.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 Required Message ─────────────── */
.upload-required-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  color: var(--muted);
  min-height: 300px;
}
.upload-required-msg__icon {
  font-size: 3rem;
  opacity: 0.4;
}
.upload-required-msg p {
  font-size: 1.05rem;
  max-width: 400px;
}

/* ── Upload Success ──────────────────────── */
.upload-success {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--success-bg); border-left: 4px solid var(--success);
  border-radius: var(--radius); font-size: 0.9rem; color: var(--success);
}
.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);
}

/* ── Review Table (Spreadsheet Layout) ───── */
/*
 * Column order (19 total):
 *   1: Name  |  2: 2025  |  3: Change%  |  4: 2026  |  5: Freq
 *   6-17: Jan–Dec (12 month columns)
 *   18: Row Total  |  19: Remove
 *
 * Sticky: cols 1-5 pinned left, cols 18-19 pinned right.
 * Scrollable: only the 12 month columns (6-17).
 */

.upload-review-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.upload-review-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

/* ---- All cells baseline ---- */
.upload-review-table th,
.upload-review-table td {
  padding: 6px 6px;
  white-space: nowrap;
  font-size: 0.9rem;
  vertical-align: middle;
}

/* ---- Header row ---- */
.upload-review-table thead th {
  font-family: var(--font-heading); font-weight: 700; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  border-bottom: 2px solid var(--border);
  text-align: center; background: var(--white);
}

/* ---- Body cells ---- */
.upload-review-table tbody td {
  border-bottom: 1px solid var(--border-light);
  text-align: right; font-family: var(--font-mono); color: var(--charcoal);
  background: var(--white);
}
.upload-review-table tbody td:first-child {
  text-align: left; font-family: var(--font-heading); font-weight: 700;
  color: var(--green); overflow: hidden; text-overflow: ellipsis;
  min-width: 110px; max-width: 140px;
}

/* ---- Tfoot cells ---- */
.upload-review-table tfoot td {
  border-top: 2px solid var(--border);
  font-weight: 700; font-family: var(--font-mono); text-align: right;
  color: var(--green); background: var(--white);
}
.upload-review-table tfoot td:first-child {
  text-align: left; font-family: var(--font-heading);
}

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

/* ===== STICKY LEFT: cols 1–5 (fixed widths) ===== */
.upload-review-table th:nth-child(1),
.upload-review-table td:nth-child(1) { position: sticky; left: 0; z-index: 3; width: 140px; min-width: 140px; max-width: 140px; }

.upload-review-table th:nth-child(2),
.upload-review-table td:nth-child(2) { position: sticky; left: 140px; z-index: 3; width: 80px; min-width: 80px; max-width: 80px; }

.upload-review-table th:nth-child(3),
.upload-review-table td:nth-child(3) { position: sticky; left: 220px; z-index: 3; width: 56px; min-width: 56px; max-width: 56px; }

.upload-review-table th:nth-child(4),
.upload-review-table td:nth-child(4) { position: sticky; left: 276px; z-index: 3; width: 80px; min-width: 80px; max-width: 80px; }

.upload-review-table th:nth-child(5),
.upload-review-table td:nth-child(5) { position: sticky; left: 356px; z-index: 3; width: 52px; min-width: 52px; max-width: 52px; }

/* Shadow edge after last left-sticky column */
.upload-review-table th:nth-child(5)::after,
.upload-review-table td:nth-child(5)::after {
  content: ''; position: absolute; top: 0; right: -6px; bottom: 0; width: 6px;
  background: linear-gradient(to right, rgba(0,0,0,0.06), transparent);
  pointer-events: none;
}

/* ===== STICKY RIGHT: cols 18–19 (fixed widths) ===== */
.upload-review-table th:nth-last-child(2),
.upload-review-table td:nth-last-child(2) { position: sticky; right: 36px; z-index: 3; width: 80px; min-width: 80px; max-width: 80px; }

.upload-review-table th:last-child,
.upload-review-table td:last-child { position: sticky; right: 0; z-index: 3; width: 36px; min-width: 36px; max-width: 36px; }

/* Shadow edge before first right-sticky column */
.upload-review-table th:nth-last-child(2)::before,
.upload-review-table td:nth-last-child(2)::before {
  content: ''; position: absolute; top: 0; left: -6px; bottom: 0; width: 6px;
  background: linear-gradient(to left, rgba(0,0,0,0.06), transparent);
  pointer-events: none;
}

/* Sticky cells need explicit backgrounds (separate border-collapse) */
.upload-review-table thead th:nth-child(-n+5),
.upload-review-table thead th:nth-last-child(-n+2) { background: var(--white); }

.upload-review-table tbody td:nth-child(-n+5),
.upload-review-table tbody td:nth-last-child(-n+2) { background: var(--white); }

.upload-review-table tbody tr:nth-child(even) td:nth-child(-n+5),
.upload-review-table tbody tr:nth-child(even) td:nth-last-child(-n+2) { background: var(--off-white); }
.upload-review-table tbody:nth-of-type(even) tr:first-child td:nth-child(-n+5),
.upload-review-table tbody:nth-of-type(even) tr:first-child td:nth-last-child(-n+2) { background: var(--off-white); }

.upload-review-table tfoot td:nth-child(-n+5),
.upload-review-table tfoot td:nth-last-child(-n+2) { background: var(--white); }

/* ===== MONTH COLUMNS (6–17): centered ===== */
.upload-review-table th:nth-child(n+6):nth-last-child(n+3),
.upload-review-table td:nth-child(n+6):nth-last-child(n+3) {
  text-align: center; min-width: 72px;
}

/* ---- Name input (text, col 1) ---- */
.upload-review-table .cell-name-input {
  width: 100%; max-width: 140px; padding: 4px 6px;
  font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem;
  color: var(--green); border: 1px solid transparent; border-radius: 3px;
  background: transparent; text-align: left;
}
.upload-review-table .cell-name-input:focus {
  outline: none; border-color: var(--green); background: var(--white);
  box-shadow: 0 0 0 1px rgba(26,46,26,0.1);
}
.upload-review-table .cell-name-input::placeholder {
  color: var(--border); font-weight: 400; font-style: italic;
}

/* ---- 2025 Total input (col 2) ---- */
.upload-review-table .cell-prior-input {
  width: 100%; max-width: 80px; padding: 4px 4px; font-family: var(--font-mono); font-size: 0.9rem;
  text-align: right; border: 1px solid var(--border-light); border-radius: 3px;
  background: var(--white); color: var(--charcoal); -moz-appearance: textfield;
}
.upload-review-table .cell-prior-input:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 1px rgba(26,46,26,0.1);
}

/* ---- Change % input (col 3) ---- */
.upload-review-table .cell-esc-input {
  width: 100%; max-width: 56px; padding: 4px 4px; font-family: var(--font-mono); font-size: 0.9rem;
  text-align: center; border: 1px solid var(--border-light); border-radius: 3px;
  background: var(--white); color: var(--charcoal);
}
.upload-review-table .cell-esc-input:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 1px rgba(26,46,26,0.1);
}

/* ---- Hide spinners on all number inputs ---- */
.upload-review-table input[type="number"]::-webkit-outer-spin-button,
.upload-review-table input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.upload-review-table input[type="number"] { -moz-appearance: textfield; }

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

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

/* ---- Editable projected (2026) input ---- */
.upload-review-table .cell-projected-input {
  width: 100%; max-width: 80px; padding: 4px 4px; font-family: var(--font-mono); font-size: 0.9rem;
  text-align: right; border: 1px solid var(--border-light); border-radius: 3px;
  background: var(--white); color: var(--green); font-weight: 700;
}
.upload-review-table .cell-projected-input:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 1px rgba(26,46,26,0.1);
}

/* ---- Editable month cell inputs ---- */
.upload-review-table .cell-month-input {
  width: 100%; max-width: 72px; padding: 3px 2px; font-family: var(--font-mono); font-size: 0.85rem;
  text-align: right; border: 1px solid transparent; border-radius: 3px;
  background: transparent; color: var(--charcoal);
}
.upload-review-table .cell-month-input:focus {
  outline: none; border-color: var(--green); background: var(--white);
  box-shadow: 0 0 0 1px rgba(26,46,26,0.1);
}
.upload-review-table .cell-month-input--zero { color: var(--border); }
.upload-review-table .cell-month-input--active { color: var(--charcoal); }
.upload-review-table .cell-total { font-weight: 700; }

/* ---- Month selector row (quarterly/annual radio) ---- */
.upload-review-table .month-selector-row td {
  padding: 2px 4px; border-top: none; background: var(--cream) !important;
}
.upload-review-table .month-selector-row .month-check {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.upload-review-table .month-selector-row .month-check--auto {
  opacity: 0.4; pointer-events: none;
}
.upload-review-table .month-selector-row input[type="checkbox"],
.upload-review-table .month-selector-row input[type="radio"] {
  width: 14px; height: 14px; cursor: pointer; accent-color: var(--green);
}
.upload-review-table .btn-month-save {
  padding: 2px 12px; font-size: 0.75rem; font-weight: 600;
  background: var(--green); color: var(--white); border: none; border-radius: 3px;
  cursor: pointer; transition: background 0.15s;
}
.upload-review-table .btn-month-save:hover { background: var(--green-light); }

/* ---- Weighting row ---- */
.upload-review-table .cell-weight-input {
  width: 100%; max-width: 52px; padding: 2px 2px; font-family: var(--font-mono); font-size: 0.8rem;
  text-align: center; border: 1px solid var(--border-light); border-radius: 3px;
  background: var(--white); color: var(--charcoal); -moz-appearance: textfield;
}
.upload-review-table .cell-weight-input:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 1px rgba(26,46,26,0.1);
}
.upload-review-table .cell-weight-input::-webkit-outer-spin-button,
.upload-review-table .cell-weight-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.weight-total { font-family: var(--font-mono); margin-left: 4px; }
.weight-total--warn { color: var(--error); font-weight: 700; }

/* ---- Negative escalation (red + inherits parenthesis formatting from JS) ---- */
.upload-review-table .cell-esc-input--neg { color: var(--error); }

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

/* ══════════════════════════════════════════════════════════════ */
/* STAFF TABLE (5-column, no horizontal scroll)                    */
/* ══════════════════════════════════════════════════════════════ */

.staff-table { width: 100%; table-layout: fixed; }

/* Reset sticky positioning from generic upload-review-table */
.staff-table th,
.staff-table td {
  position: static !important;
  padding: 4px 6px;
  white-space: nowrap;
}
.staff-table th::before, .staff-table td::before,
.staff-table th::after,  .staff-table td::after { display: none !important; }

/* Column widths: Name & Title wider, Salary & Bonus narrower, remove tiny */
.staff-table th:nth-child(1), .staff-table td:nth-child(1) { width: 30%; min-width: 0; max-width: none; }
.staff-table th:nth-child(2), .staff-table td:nth-child(2) { width: 30%; min-width: 0; max-width: none; }
.staff-table th:nth-child(3), .staff-table td:nth-child(3) { width: 18%; min-width: 0; max-width: none; }
.staff-table th:nth-child(4), .staff-table td:nth-child(4) { width: 18%; min-width: 0; max-width: none; }
.staff-table th:nth-child(5), .staff-table td:nth-child(5) { width: 4%; min-width: 28px; max-width: 36px; }

/* All inputs: visible bordered boxes, uniform style */
.staff-table input[type="text"],
.staff-table input[type="number"] {
  width: 100%; max-width: none;
  padding: 6px 8px;
  font-family: var(--font-body); font-size: 0.9rem;
  color: var(--charcoal);
  border: 1px solid var(--border); border-radius: 3px;
  background: var(--white);
  -moz-appearance: textfield;
}
.staff-table input[type="text"]:focus,
.staff-table input[type="number"]:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(26,46,26,0.1);
}
.staff-table input::placeholder { color: var(--border); font-style: italic; }
.staff-table input[type="number"]::-webkit-outer-spin-button,
.staff-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Body text columns left-aligned */
.staff-table tbody td:nth-child(1),
.staff-table tbody td:nth-child(2) { text-align: left; }

/* ══════════════════════════════════════════════════════════════ */
/* BALANCE TABLE — Assets & Liabilities (4-column, no scroll)      */
/* ══════════════════════════════════════════════════════════════ */

.balance-table { width: 100%; table-layout: fixed; }

/* Reset sticky positioning */
.balance-table th,
.balance-table td {
  position: static !important;
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 1.05rem;
}
.balance-table th::before, .balance-table td::before,
.balance-table th::after,  .balance-table td::after { display: none !important; }

/* Header: larger to match */
.balance-table thead th { font-size: 0.9rem; text-align: left; }

/* Column widths: Category + Item wide, Value compact, remove tiny */
.balance-table th:nth-child(1), .balance-table td:nth-child(1) { width: 22%; min-width: 0; max-width: none; }
.balance-table th:nth-child(2), .balance-table td:nth-child(2) { width: 48%; min-width: 0; max-width: none; }
.balance-table th:nth-child(3), .balance-table td:nth-child(3) { width: 26%; min-width: 0; max-width: none; }
.balance-table th:nth-child(4), .balance-table td:nth-child(4) { width: 4%; min-width: 28px; max-width: 36px; }

/* All body cells left-aligned */
.balance-table tbody td { text-align: left; }

/* Category cell styling */
.balance-table tbody td:first-child {
  font-family: var(--font-heading); font-weight: 700;
  color: var(--green); min-width: 0; max-width: none;
}

/* Inputs fill cells, visible borders — double-class for specificity over generic */
.upload-review-table.balance-table .cell-name-input {
  width: 100%; max-width: none; box-sizing: border-box;
  padding: 6px 8px; font-size: 1.05rem;
  border: 1px solid var(--border); border-radius: 3px;
  background: var(--white); color: var(--charcoal);
  font-family: var(--font-body); font-weight: 400; text-align: left;
}
.upload-review-table.balance-table .cell-prior-input {
  width: 100%; max-width: none; box-sizing: border-box;
  padding: 6px 8px; font-size: 1.05rem;
  border: 1px solid var(--border); border-radius: 3px;
  background: var(--white); color: var(--charcoal);
  font-family: var(--font-mono); text-align: right;
  -moz-appearance: textfield;
}
.upload-review-table.balance-table .cell-name-input:focus,
.upload-review-table.balance-table .cell-prior-input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(26,46,26,0.1);
  background: var(--white);
}
.upload-review-table.balance-table .cell-name-input::placeholder { color: var(--border); font-weight: 400; font-style: italic; }
.upload-review-table.balance-table input[type="number"]::-webkit-outer-spin-button,
.upload-review-table.balance-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.upload-review-table.balance-table input[type="number"] { -moz-appearance: textfield; }

/* Category select for uncategorized items */
.balance-table .cell-category-select {
  width: 100%; padding: 4px 6px; font-size: 0.9rem;
  font-family: var(--font-heading); font-weight: 700; color: var(--gold);
  border: 1px solid var(--gold); border-radius: 3px;
  background: var(--white); cursor: pointer;
}
.balance-table .cell-category-select:focus {
  outline: none; box-shadow: 0 0 0 1px var(--gold);
}

/* Tfoot */
.balance-table tfoot td { font-size: 1.05rem; text-align: left; }

/* ══════════════════════════════════════════════════════════════ */
/* EXPENSE MAPPING (Drag-and-Drop Categorization)                 */
/* ══════════════════════════════════════════════════════════════ */

/* ── Legend ─────────────────────────────── */
.mapping-legend {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.mapping-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--charcoal);
}

.mapping-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mapping-legend__item--maint .mapping-legend__dot { background: var(--green); }
.mapping-legend__item--life .mapping-legend__dot { background: var(--gold); }

/* ── Two-Column Layout ─────────────────── */
.mapping-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 768px) {
  .mapping-columns { grid-template-columns: 1fr; }
}

/* ── Column ────────────────────────────── */
.mapping-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mapping-column__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
  border-radius: var(--radius);
}

.mapping-column__header--maint {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
}

.mapping-column__header--life {
  background: linear-gradient(135deg, var(--gold) 0%, #D4B85A 100%);
  color: var(--charcoal);
}

.mapping-column__header span:last-child {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ── Category Bucket ───────────────────── */
.mapping-bucket {
  background: var(--white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  min-height: 56px;
}

.mapping-bucket--hover {
  border-color: var(--gold);
  background: rgba(197, 165, 90, 0.06);
  box-shadow: 0 0 0 3px rgba(197, 165, 90, 0.12);
}

.mapping-bucket__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mapping-bucket__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.mapping-bucket__total {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--green);
  text-transform: none;
  letter-spacing: 0;
}

.mapping-bucket__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--space-sm) var(--space-sm);
  min-height: 32px;
}

.mapping-bucket__empty {
  font-size: 0.75rem;
  color: var(--border);
  font-style: italic;
  padding: 2px 4px;
}

/* ── Expense Pill (Draggable Chip) ──────── */
.expense-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--off-white);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  cursor: grab;
  user-select: none;
  position: relative;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s;
}

.expense-pill:hover {
  background: var(--white);
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.expense-pill:active {
  cursor: grabbing;
}

.expense-pill--dragging {
  opacity: 0.3;
  transform: scale(0.95);
}

.expense-pill--drop-target::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 2px;
  bottom: 2px;
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(197, 165, 90, 0.5);
}

.expense-pill__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--charcoal);
  white-space: nowrap;
}

.expense-pill__amt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Uncategorized Bucket (top warning) ── */
.mapping-uncategorized {
  background: #FFF8E6;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.mapping-uncategorized.mapping-bucket--hover {
  border-color: var(--gold);
  background: rgba(197, 165, 90, 0.12);
  box-shadow: 0 0 0 3px rgba(197, 165, 90, 0.15);
}

.mapping-uncategorized__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(197, 165, 90, 0.3);
}

.mapping-uncategorized__icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1.3;
}

.mapping-uncategorized__header strong {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--charcoal);
  display: block;
  margin-bottom: 2px;
}

.mapping-uncategorized__header p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.mapping-uncategorized__total {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

.mapping-uncategorized .mapping-bucket__pills {
  padding: var(--space-sm) var(--space-lg);
}

/* ── Uncategorized Pill Variant ────────── */
.expense-pill--uncat {
  border-color: var(--gold);
  background: #FFFCF0;
}

.expense-pill--uncat:hover {
  border-color: var(--gold);
  background: var(--white);
}

/* ── Custom Category Controls ──────────── */
.mapping-bucket__name-input {
  flex: 1;
  min-width: 0;
  padding: 2px 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--charcoal);
  border: 1px solid var(--gold);
  border-radius: 3px;
  background: var(--white);
  outline: none;
}

.mapping-bucket__name-input:focus {
  box-shadow: 0 0 0 2px rgba(197, 165, 90, 0.25);
}

.mapping-bucket__name-input::placeholder {
  color: var(--border);
  font-weight: 400;
  font-style: italic;
  text-transform: none;
}

.mapping-bucket__name--editable {
  cursor: pointer;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1px;
}

.mapping-bucket__remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.mapping-bucket__remove:hover {
  color: var(--error);
}

/* ── Add Category Button ─────────────── */
.mapping-add-btn {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
  background: none;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
  text-align: center;
}

.mapping-add-btn:hover {
  color: var(--green);
  border-color: var(--green);
  background: rgba(26, 46, 26, 0.03);
}

/* ── Grand Total Bar ───────────────────── */
.mapping-grand-total {
  margin-top: var(--space-xl);
  border-top: 2px solid var(--border);
  padding-top: var(--space-md);
}

.mapping-grand-total__row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  font-size: 0.9rem;
  color: var(--charcoal);
}

.mapping-grand-total__row span:last-child {
  font-family: var(--font-mono);
  font-weight: 700;
}

.mapping-grand-total__row--total {
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-xs);
  padding-top: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--green);
}
