:root {
  --bg: #f6f7f6;
  --surface: #ffffff;
  --surface-2: #f2f4f4;
  --text: #18242b;
  --muted: #5f6f77;
  --teal: #1fc6bb;
  --teal-deep: #139fa5;
  --blue: #48a8e8;
  --line: rgba(24, 36, 43, 0.08);
  --danger: #f3c9c9;
  --success: #d8f5e5;
  --mine: #d9ebff;
  --shadow: 0 20px 50px rgba(22, 54, 64, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Helvetica Neue", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  background: #ececeb;
  color: #222;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.compact {
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-note,
.topbar-link,
.link-button {
  color: #3a474f;
}

.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - 52px);
  padding: 28px 18px 40px;
  background:
    linear-gradient(rgba(20, 121, 135, 0.74), rgba(24, 194, 184, 0.72)),
    linear-gradient(135deg, #194858 0%, #25879d 42%, #2dbbb6 100%);
}

.hero-home::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(10, 30, 37, 0.22), rgba(10, 30, 37, 0.22)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.25), transparent 30%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 32px
    );
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding-top: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
}

.brand-block-home {
  display: grid;
  gap: 18px;
  align-items: start;
}

.hero-logo-image {
  display: block;
  width: min(100%, 195px);
  height: auto;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.84);
}

.hero h1,
.panel h1,
.panel h2 {
  margin: 0;
  line-height: 1.08;
}

.hero h1 {
  margin-top: 0;
  color: #fff;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  font-family: Georgia, "Times New Roman", serif;
}

.hero-copy {
  margin: 24px 0 28px;
  max-width: 26rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  line-height: 1.7;
}

.stack-buttons {
  display: grid;
  gap: 14px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 14px 20px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.action-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
}

.action-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
}

.page-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.hero-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 249, 0.98)),
    linear-gradient(135deg, rgba(31, 198, 187, 0.18), rgba(72, 168, 232, 0.16));
}

.panel-header {
  margin-bottom: 16px;
}

.panel .eyebrow {
  color: var(--teal-deep);
}

.soft-text {
  margin: 8px 0 0;
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.tab {
  padding: 14px 16px;
  border-radius: 16px;
  text-align: center;
  background: var(--surface-2);
  font-weight: 700;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
}

.form-card,
.filters-form {
  display: grid;
  gap: 10px;
}

label {
  font-size: 0.94rem;
  font-weight: 600;
}

input,
select {
  min-height: 50px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(24, 36, 43, 0.1);
  border-radius: 14px;
  background: #fff;
}

.flash {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 600;
}

.flash-error {
  background: #fde8e8;
  color: #8c3636;
}

.flash-success {
  background: #e5faee;
  color: #1d6e46;
}

.list-cards,
.date-strip,
.slot-grid {
  display: grid;
  gap: 12px;
}

.teacher-card,
.empty-card,
.notice-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-2);
}

.teacher-card-stacked {
  align-items: flex-start;
}

.teacher-card p {
  margin: 6px 0 0;
}

.small-danger {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 8px 14px;
  background: #f6dada;
  color: #8c2f2f;
  cursor: pointer;
}

.booking-link-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #eef7f7;
}

.booking-link-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-row {
  display: grid;
  gap: 10px;
}

.copy-button {
  min-height: 42px;
  width: fit-content;
  border: 0;
  border-radius: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.date-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.date-pill {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  text-align: center;
  font-weight: 700;
}

.date-pill.active {
  color: #fff;
  background: linear-gradient(135deg, var(--teal-deep), var(--blue));
}

.pill-weekday {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.82;
}

.slot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-grid form,
.slot-grid > button {
  width: 100%;
}

.slot-button {
  min-height: 64px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 12px 8px;
  font-weight: 700;
  cursor: pointer;
}

.slot-open {
  background: var(--success);
  color: #20623f;
}

.slot-locked {
  background: var(--danger);
  color: #934444;
}

.slot-mine {
  background: var(--mine);
  color: #225786;
}

.slot-button:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 35, 41, 0.5);
  z-index: 100;
}

.modal-card {
  width: min(100%, 420px);
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 0 0 8px;
}

.modal-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.modal-actions {
  display: grid;
  gap: 12px;
}

.hidden {
  display: none;
}

@media (min-width: 720px) {
  .page-shell {
    padding: 30px 24px 72px;
  }

  .panel {
    padding: 26px;
  }

  .hero-logo-image {
    width: min(100%, 260px);
  }

  .date-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
