* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #233033;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(247, 205, 105, 0.28), transparent 28%),
    radial-gradient(circle at 100% 8%, rgba(66, 153, 129, 0.20), transparent 24%),
    #f5f7f8;
}

.page {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 20px 14px 40px;
}

.panel {
  background: #fff;
  border: 1px solid #dfe5e8;
  border-radius: 8px;
  padding: 18px;
}

.title {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.35;
}

.lead {
  margin: 0 0 18px;
  color: #4b5960;
  line-height: 1.7;
}

.menu-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #2d6cdf;
  border-radius: 6px;
  color: #fff;
  background: #2d6cdf;
  font-weight: 700;
  text-decoration: none;
}

.menu-link {
  width: 100%;
  justify-content: space-between;
  background: #fff;
  color: #1d4f9c;
}

.menu-link .menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 24px;
  margin-left: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #d93025;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.notice {
  padding: 12px;
  border: 1px solid #e4b83f;
  border-radius: 6px;
  background: #fff8df;
}

.public-hero {
  position: relative;
  margin: 0 0 14px;
  padding: 30px 20px 34px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(27, 115, 119, 0.96), rgba(41, 103, 63, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='120' viewBox='0 0 220 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.22' stroke-width='2'%3E%3Cpath d='M7 86c28-42 60-42 88 0s60 42 88 0'/%3E%3Cpath d='M25 38c20-30 44-30 64 0s44 30 64 0'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: 0 14px 32px rgba(40, 68, 78, 0.18);
}

.public-hero.compact {
  padding: 24px 20px 28px;
}

.hero-mark {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.86);
}

.hero-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 640px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.90);
  line-height: 1.8;
}

.public-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(198, 213, 215, 0.86);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 26px rgba(50, 74, 86, 0.08);
}

.section-head {
  margin: 0 0 14px;
}

.section-kicker {
  margin: 0 0 4px;
  color: #2f7b68;
  font-size: 12px;
  font-weight: 800;
}

.section-head h2,
.form-section h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.program-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.program-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  min-height: 96px;
  padding: 16px;
  border: 1px solid #d7e3e3;
  border-radius: 8px;
  color: #233033;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(50, 74, 86, 0.07);
}

.program-card:active {
  transform: translateY(1px);
}

.program-badge {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #27624f;
  background: #e6f3ee;
  font-size: 12px;
  font-weight: 800;
}

.program-name {
  grid-column: 1;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.program-desc {
  grid-column: 1 / -1;
  color: #5c6a70;
  line-height: 1.6;
}

.program-arrow {
  grid-row: 1 / 3;
  grid-column: 2;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: #2d6cdf;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.reserve-form {
  margin-top: 18px;
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dfe8e8;
  border-radius: 8px;
  background: #fbfcfc;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-grid .wide {
  grid-column: 1 / -1;
}

.primary-action {
  width: 100%;
  min-height: 52px;
  border-color: #2464ca;
  background: linear-gradient(135deg, #2d6cdf, #1f7a68);
  box-shadow: 0 10px 20px rgba(45, 108, 223, 0.20);
  font-size: 16px;
}

.small-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.table-action {
  display: block;
  margin: 0;
}

.error-text {
  color: #b33535;
  line-height: 1.5;
}

.chat-timeline {
  display: grid;
  gap: 12px;
  margin: 16px 0 20px;
}

.chat-bubble {
  max-width: 760px;
  padding: 12px;
  border: 1px solid #dfe5e8;
  border-radius: 8px;
  background: #fff;
  line-height: 1.7;
}

.chat-bubble.from-admin {
  margin-left: auto;
  border-color: #b7d0ff;
  background: #eef5ff;
}

.chat-bubble.from-user {
  margin-right: auto;
  border-color: #bfe1d3;
  background: #f1fbf6;
}

.chat-meta {
  margin: 0 0 6px;
  color: #65727a;
  font-size: 12px;
  font-weight: 700;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.mini-card {
  padding: 12px;
  border: 1px solid #d9e5e4;
  border-radius: 8px;
  background: #fff;
}

.mini-card.is-full {
  color: #6e777b;
  background: #f0f2f3;
}

.mini-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mini-card-head span {
  padding: 3px 7px;
  border-radius: 999px;
  color: #27624f;
  background: #e6f3ee;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-card.is-full .mini-card-head span {
  color: #6e777b;
  background: #dde2e4;
}

.mini-card p {
  margin: 8px 0;
  color: #5c6a70;
  line-height: 1.55;
}

.mini-card small {
  color: #68767c;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #c8d2d8;
  border-radius: 6px;
  font: inherit;
  background: #fff;
}

select option:disabled {
  color: #888;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #dfe5e8;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f6;
  font-size: 14px;
}

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

.admin-panel {
  max-width: 520px;
  margin: 0 auto;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.head-links,
.head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.text-link {
  color: #1d4f9c;
  font-weight: 700;
}

.is-disabled {
  border-color: #ccd5da;
  color: #65727a;
  background: #eef2f4;
  pointer-events: none;
}

.inline-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.inline-form label {
  min-width: 180px;
}

.print-section {
  break-inside: avoid;
  margin: 0 0 28px;
}

.print-section h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

@media print {
  body {
    background: #fff;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .panel {
    border: 0;
    padding: 0;
  }

  .no-print {
    display: none;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 12px 10px 28px;
  }

  .public-hero {
    padding: 24px 16px 28px;
  }

  .hero-title {
    font-size: 28px;
  }

  .public-panel {
    padding: 14px;
  }

  .program-card {
    grid-template-columns: 1fr;
  }

  .program-arrow {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }

  .field-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .admin-head {
    display: grid;
  }
}
