/* 계층형 수입 설계 엔진 */

.page-income {
  padding-bottom: 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.dashboard {
  border: 1px solid var(--border-default);
}

.dash-title {
  font-size: 1.125rem;
  font-weight: 900;
}

.dash-legend {
  margin-top: 10px;
  line-height: 1.55;
  max-width: 72ch;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dash-tile {
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border-default);
  background: var(--color-surface);
}

.dash-tile--confirmed {
  border-color: rgba(30, 58, 138, 0.35);
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.06), var(--color-surface));
}

.dash-tile--latent {
  border-color: rgba(124, 58, 237, 0.28);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.06), var(--color-surface));
}

.dash-tile--total {
  border-color: rgba(15, 23, 42, 0.12);
  background: var(--color-bg-soft);
}

.dash-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.dash-value {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.dash-sub {
  margin-top: 6px;
  color: var(--color-text-secondary);
}

.dash-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--color-text-muted) 24%, var(--color-surface));
}

.bar-seg {
  display: block;
  height: 100%;
  min-width: 0;
  transition: width 0.15s ease;
}

.bar-real {
  background: #1e3a8a;
}
.bar-scheduled {
  background: #38bdf8;
}
.bar-other {
  background: #059669;
}
.bar-hope {
  background: #7c3aed;
}

.tier-form {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tier {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  grid-template-areas:
    "main field"
    "hint hint";
  gap: 12px 16px;
  align-items: center;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border-default);
  background: var(--color-surface);
}

.tier-main {
  grid-area: main;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tier-field {
  grid-area: field;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.tier-hint {
  grid-area: hint;
}

.tier--real {
  border-left: 4px solid #1e3a8a;
}

.tier--scheduled {
  border-left: 4px solid #38bdf8;
}

.tier--other {
  border-left: 4px solid #059669;
}

.tier--hope {
  border-left: 4px solid #7c3aed;
  background: linear-gradient(180deg, var(--color-surface), color-mix(in srgb, #7c3aed 14%, var(--color-surface)));
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.08);
}

.tier-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.875rem;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.tier-badge--hope {
  background: linear-gradient(135deg, #ede9fe, #cffafe);
  color: #5b21b6;
  font-size: 1rem;
}

.tier-name {
  font-size: 1rem;
  font-weight: 800;
}

.money-input {
  max-width: 220px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.won {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.table-head {
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-default);
  text-align: left;
  font-size: 0.9375rem;
}

.data-table thead th {
  background: var(--color-bg-soft);
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.col-num {
  text-align: right;
  white-space: nowrap;
}

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

.swatch-dot--real {
  background: #1e3a8a;
}
.swatch-dot--scheduled {
  background: #38bdf8;
}
.swatch-dot--other {
  background: #059669;
}
.swatch-dot--hope {
  background: #7c3aed;
}

.row-strong td {
  font-weight: 800;
  background: var(--color-surface-2);
}

.page-foot {
  border-top: 1px solid var(--border-default);
  padding-top: 16px;
}

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

  .tier {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "field"
      "hint";
  }

  .tier-field {
    justify-content: stretch;
  }

  .money-input {
    max-width: none;
    width: 100%;
  }
}
