* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  line-height: 1.6;
  padding: 20px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  padding: 32px;
}

h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.6rem;
  color: #0a2463;
}

/* Info Panel */
.info-panel {
  background: #f8f9fb;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  margin-bottom: 24px;
  padding: 12px 16px;
}

.info-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: #0a2463;
  font-size: 0.95rem;
}

.info-content {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #333;
}

.info-content h3 {
  margin-top: 14px;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.info-content ol {
  margin-left: 24px;
  margin-bottom: 8px;
}

.disclaimer {
  margin-top: 16px;
  padding: 10px;
  background: #fff3cd;
  border-radius: 6px;
  border: 1px solid #ffc107;
  font-size: 0.85rem;
}

/* Input Section */
.input-section {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-section label {
  font-weight: 600;
  font-size: 0.95rem;
}

.input-section select {
  padding: 8px 12px;
  border: 2px solid #dae3f3;
  border-radius: 6px;
  background: #dae3f3;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

#calc-table th {
  background: #0a2463;
  color: #fff;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}

#calc-table th:first-child {
  text-align: left;
  min-width: 140px;
  position: sticky;
  left: 0;
  z-index: 2;
}

#calc-table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid #e8ecf1;
}

#calc-table td:first-child {
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.totals-row td:first-child {
  background: #f8f9fb !important;
}

.period-label .hint {
  color: #e67e22;
  font-weight: bold;
}

/* Earnings Inputs - the blue cells */
.earnings-input {
  width: 110px;
  padding: 7px 10px;
  border: 2px solid #b4c7e7;
  border-radius: 6px;
  background: #dae3f3;
  font-size: 0.9rem;
  text-align: right;
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.earnings-input:focus {
  outline: none;
  border-color: #4472c4;
  box-shadow: 0 0 0 3px rgba(68, 114, 196, 0.2);
}

/* Calculated cells */
.calc {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ta1-total {
  color: #27ae60;
}

.ta2-retro {
  color: #c0392b;
}

.ta1-retro {
  color: #666;
}

.ta1-payscale {
  color: #666;
}

/* Totals row */
.totals-row {
  border-top: 2px solid #0a2463;
  background: #f8f9fb;
}

.totals-row td {
  font-weight: 700 !important;
  padding: 10px 8px;
}

.footnote {
  font-size: 0.82rem;
  color: #e67e22;
  margin-bottom: 24px;
  font-style: italic;
}

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.summary-box {
  padding: 18px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.summary-box h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.summary-box p {
  margin-bottom: 4px;
}

.total-line {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.ta1-box {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}

.ta1-box h3 {
  color: #2e7d32;
}

.ta2-box {
  background: #fce4ec;
  border: 1px solid #ef9a9a;
}

.ta2-box h3 {
  color: #c62828;
}

.concession-box {
  grid-column: 1 / -1;
  background: #fff8e1;
  border: 1px solid #ffcc02;
  text-align: center;
  font-size: 1rem;
}

/* Earnings Totals */
.earnings-totals {
  max-width: 360px;
}

.earnings-totals table {
  border-collapse: collapse;
}

.earnings-totals td {
  padding: 8px 14px;
  border: 1px solid #d0d7e2;
}

.earnings-totals td:first-child {
  font-weight: 600;
  background: #f8f9fb;
}

.earnings-totals td:last-child {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 16px;
  }

  h1 {
    font-size: 1.2rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .earnings-input {
    width: 90px;
  }

  #calc-table {
    font-size: 0.78rem;
  }
}
