:root {
  --bg: #eef7f7;
  --card: rgba(255, 255, 255, .92);
  --ink: #142326;
  --muted: #5f7478;
  --line: #d6e5e6;
  --primary: #006b6b;
  --primary-2: #20bdbe;
  --soft: #e1f7f7;
  --yellow: #ffff00;
  --green: #c5e0b4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(32, 189, 190, .25), transparent 32rem),
    radial-gradient(circle at 90% 15%, rgba(0, 107, 107, .18), transparent 34rem),
    var(--bg);
  color: var(--ink);
}

main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(0, 107, 107, .96), rgba(32, 189, 190, .82));
  color: white;
  box-shadow: 0 20px 60px rgba(0, 80, 80, .22);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.05em;
}

.hero p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, .85);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.autosave-status {
  font-size: .9rem;
  opacity: .85;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  font-weight: 800;
}

.panel {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 16px 45px rgba(30, 70, 80, .08);
  backdrop-filter: blur(8px);
}

h2 {
  margin: 0 0 16px;
  letter-spacing: -0.03em;
}

.helper,
.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .94rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.date-range-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.date-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f7fcfc);
}

.date-card h3 {
  margin: 0 0 12px;
  color: var(--primary);
}

label {
  display: grid;
  gap: 7px;
  font-size: .86rem;
  font-weight: 750;
  color: #29484d;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #bfd2d5;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--primary);
  color: white;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 107, 107, .18);
}

button:hover {
  filter: brightness(.96);
}

.secondary {
  background: #e6f8f8;
  color: var(--primary);
  box-shadow: none;
}

.ghost {
  background: #f3f7f8;
  color: #426166;
  box-shadow: none;
}

.section-title,
.section-top,
.schedule-head,
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.section-title {
  align-items: start;
  margin-bottom: 16px;
}

.section-title h2 {
  margin-bottom: 4px;
}

.price-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.price-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f7fcfc);
  box-shadow: 0 10px 26px rgba(20, 80, 90, .06);
}

.price-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-weight: 900;
  font-size: .9rem;
}

.price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.schedule {
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fcfc);
}

.schedule-registration {
  max-width: 320px;
  margin-top: 12px;
}

.days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-weight: 800;
}

.pill input {
  width: auto;
}

.class-row {
  display: grid;
  grid-template-columns: 1.25fr .75fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.class-row:not(.has-stage) {
  grid-template-columns: 1.25fr 1fr 1fr auto;
}

.stage-wrap[hidden] {
  display: none;
}

.closure-range-row {
  display: grid;
  grid-template-columns: 180px 180px minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--primary);
}

.closure-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.closure-item {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 14px;
  background: #f5fbfb;
  border: 1px solid var(--line);
}

.closure-item span {
  font-weight: 800;
}

.closure-item em {
  color: var(--muted);
  font-style: normal;
  font-size: .85rem;
}

.output-panel {
  padding-bottom: 10px;
}

#tableWrap {
  overflow: auto;
  max-height: 72vh;
  border-radius: 16px;
  border: 1px solid #b9caca;
  background: white;
}

table,
.sheet-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  background: white;
}

th,
td {
  border: 1px solid #aab7c4;
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 13px;
}

th {
  font-weight: 900;
}

.sheet-table th.sheet-green {
  background: var(--green);
}

.sheet-table th.sheet-yellow {
  background: var(--yellow);
}

.sheet-table td {
  cursor: cell;
  user-select: none;
}

.sheet-table td.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: rgba(32, 189, 190, .18);
}

@media (max-width: 850px) {
  main {
    padding: 14px;
  }

  .hero,
  .section-title,
  .section-top,
  .schedule-head,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    flex-direction: column;
  }

  .class-row,
  .class-row:not(.has-stage),
  .closure-range-row {
    grid-template-columns: 1fr;
  }

  .price-inputs {
    grid-template-columns: 1fr;
  }
}
