:root {
  --green: #0d4f36;
  --green-dark: #083a28;
  --orange: #d26e2f;
  --paper: #f6f2ea;
  --text: #101411;
  --muted: #68736d;
  --line: #e6ddd1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  background: var(--paper);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 10px max(9vw, calc((100vw - 1180px) / 2));
  background: #2f5029;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 34px rgba(13, 38, 24, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffad3b;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}
.brand img { width: 54px; height: 54px; object-fit: contain; }

nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: 700;
}
nav a, .small-link {
  color: #fffaf3;
  text-decoration: none;
  transition: color .18s ease, transform .18s ease;
}
nav a:hover {
  color: #ffad3b;
  transform: translateY(-1px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 178px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  color: #24411f;
  background: #ffad3b;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255, 173, 59, 0.18);
}
.button:hover {
  color: #fffaf3;
  background: var(--orange);
  transform: translateY(-1px);
}
.link-button {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  min-height: 680px;
  padding: 80px 9vw;
}
.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.95;
}
.hero p {
  max-width: 620px;
  font-size: 20px;
  line-height: 1.6;
}
.hero-card {
  overflow: hidden;
  border-radius: 22px;
  background: white;
  box-shadow: 0 24px 70px rgba(13, 79, 54, 0.14);
}
.hero-card img { width: 100%; display: block; }

.eyebrow {
  color: var(--orange);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.actions { display: flex; gap: 18px; align-items: center; margin-top: 32px; }

.section {
  padding: 80px 9vw;
}
.section h2, .dashboard h1 {
  margin: 0 0 28px;
  font-size: clamp(34px, 4vw, 58px);
}
.cards, .dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.card, .auth-card, .balance-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 50px rgba(13, 79, 54, 0.08);
}
.card h3 { margin-top: 0; color: var(--green); font-size: 26px; }
.card p, .muted { color: var(--muted); line-height: 1.55; }

.request {
  background: var(--green);
  color: white;
}
.request p { color: rgba(255,255,255,0.78); }

.auth-card {
  width: min(460px, calc(100% - 32px));
  margin: 90px auto;
}
.auth-card h1 { text-align: center; }
.auth-card label { display: block; margin-bottom: 8px; color: var(--green); font-weight: 700; }
.auth-card input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #d8cfc4;
  border-radius: 12px;
  background: #fffaf3;
}
.auth-card .button { width: 100%; margin: 14px 0; }
.legal {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.legal a { color: var(--green); }

.dashboard {
  padding: 70px 9vw;
}
.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.dashboard-head form {
  flex: 0 0 auto;
}
.logout-button {
  min-width: 230px;
  color: #fffaf3;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(13, 79, 54, 0.16);
}
.logout-button:hover {
  background: var(--orange);
}
.balance-card {
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.balance-card span { color: var(--muted); }
.balance-card strong { color: var(--green); font-size: 36px; }
.balance-card em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}
.balance-card-actions {
  gap: 24px;
}
.balance-topup:disabled {
  cursor: default;
  opacity: 0.86;
}
.dashboard-alert {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 900;
}
.dashboard-alert-success {
  color: #0d4f36;
  background: #e2f7e7;
}
.dashboard-alert-error {
  color: #8f2f1e;
  background: #fff0ea;
}
.dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.subscription-shop {
  margin-top: 28px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 50px rgba(13, 79, 54, 0.08);
}
.subscription-shop-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.subscription-shop-head h2 {
  margin: 4px 0 0;
  color: var(--green);
  font-size: 34px;
}
.subscription-shop-head span {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.5;
}
.subscription-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.subscription-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(13, 79, 54, 0.18);
  border-radius: 16px;
  background: #fffaf3;
}
.subscription-card h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 25px;
}
.subscription-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.subscription-card strong {
  color: var(--green);
  font-size: 34px;
}
.subscription-card small {
  color: var(--text);
  font-weight: 900;
}
.subscription-card form {
  margin: 0;
}
.subscription-card .button {
  width: 100%;
  justify-content: center;
}
.subscription-card .button:disabled {
  cursor: default;
  opacity: 0.55;
}
.staff-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.staff-stats .balance-card {
  margin: 0;
  display: block;
}
.staff-stats .balance-card strong {
  display: block;
  margin-top: 12px;
}
.staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0 34px;
}
.staff-action-badge {
  position: relative;
  gap: 10px;
}
.staff-action-badge span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fffaf3;
  background: #a13722;
  font-size: 13px;
  line-height: 1;
}
.staff-panel {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 50px rgba(13, 79, 54, 0.08);
}
.staff-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.staff-panel h2 {
  margin: 0;
  color: var(--green);
  font-size: 30px;
}
.staff-panel-note {
  margin: 8px 0 0;
  color: #a13722;
  font-weight: 900;
}
.staff-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}
.staff-search input {
  min-width: 280px;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3;
  font: inherit;
}
.staff-search input:focus {
  outline: 3px solid rgba(255, 173, 59, 0.24);
  border-color: var(--orange);
}
.staff-table-wrap {
  overflow-x: auto;
}
.staff-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1220px;
}
.staff-table th,
.staff-table td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.staff-table th {
  color: var(--green);
  font-size: 13px;
  text-transform: uppercase;
}
.staff-table td {
  color: var(--text);
}
.staff-table td a {
  display: inline-block;
  margin-right: 12px;
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}
.subscriptions-table {
  min-width: 980px;
}
.subscription-ending-row {
  background: #fff7f3;
}
.subscription-ending-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #8f2f1e;
  background: #fff0ea;
  font-weight: 900;
}
.subscription-free-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: #e2f7e7;
  font-weight: 900;
}
.inline-field {
  width: 100%;
  min-width: 130px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  font: inherit;
}
.inline-field:hover {
  border-color: var(--line);
  background: #fffaf3;
}
.inline-field:focus {
  outline: 3px solid rgba(255, 173, 59, 0.24);
  border-color: var(--orange);
  background: #fffaf3;
}
.inline-field--money {
  max-width: 120px;
}
.subscription-state {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
}
.inline-check input[type="checkbox"] {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  accent-color: var(--green);
}
.inline-field.is-saving {
  opacity: 0.58;
}
.inline-field.is-saved {
  border-color: rgba(13, 79, 54, 0.34);
}
.inline-field.is-error {
  border-color: #a13722;
  background: #fff3ee;
}
.staff-form-panel {
  width: min(920px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(13, 79, 54, 0.08);
}
.staff-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.staff-form label {
  display: block;
}
.staff-form label span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-weight: 900;
}
.staff-form input,
.staff-form select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #d8cfc4;
  border-radius: 12px;
  color: var(--text);
  background: #fffaf3;
  font: inherit;
}
.staff-form input:focus,
.staff-form select:focus {
  outline: 3px solid rgba(255, 173, 59, 0.28);
  border-color: var(--orange);
}
.staff-form-wide,
.staff-form-actions,
.form-errors {
  grid-column: 1 / -1;
}
.staff-form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
}
.staff-form ul.errorlist {
  margin: 8px 0 0;
  padding: 0;
  color: #a13722;
  font-size: 14px;
  list-style: none;
}
.schedule-page {
  background: var(--paper);
}
.schedule-hint {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}
.schedule-board {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 50px rgba(13, 79, 54, 0.08);
}
.schedule-board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.schedule-board h2 {
  margin: 0;
  color: var(--green);
  font-size: 28px;
}
.schedule-note {
  color: var(--muted);
  font-weight: 800;
}
.week-switcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid rgba(13, 79, 54, 0.14);
  border-radius: 999px;
  background: #fffaf3;
}
.week-switcher a {
  min-width: 86px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #fffaf3;
  background: var(--green);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}
.week-switcher a:hover {
  background: var(--orange);
}
.week-switcher span {
  min-width: 178px;
  color: var(--green);
  font-weight: 900;
  text-align: center;
}
.schedule-table-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}
.schedule-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 8px;
}
.schedule-table th {
  color: var(--green);
  font-size: 14px;
  text-align: center;
}
.schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px;
  border-radius: 12px;
  background: #fffaf3;
}
.schedule-table thead th span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}
.schedule-table tbody th {
  width: 76px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 250, 243, 0.8);
  vertical-align: middle;
}
.schedule-table td {
  width: 12.5%;
  min-width: 118px;
  vertical-align: top;
}
.slot-cell {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.slot-cell span {
  font-weight: 900;
}
.slot-cell em {
  font-style: normal;
  line-height: 1.25;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.slot-card {
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  color: var(--text);
  background: #fffaf3;
}
.slot-card strong {
  color: var(--green);
}
.slot-card span {
  font-weight: 900;
}
.slot-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
}
.slot-button {
  width: 100%;
  font: inherit;
  cursor: pointer;
}
.slot-button:hover {
  transform: translateY(-1px);
}
.slot-closed {
  border-color: rgba(161, 55, 34, 0.3);
  background: #fff0ea;
}
.slot-closed strong,
.slot-closed span {
  color: #8f2f1e;
}
.slot-open {
  border-color: rgba(11, 125, 76, 0.4);
  background: #e2f7e7;
  box-shadow: inset 0 0 0 1px rgba(11, 125, 76, 0.08);
}
.slot-open strong,
.slot-open span {
  color: var(--green);
}
.slot-booked {
  border-color: rgba(48, 69, 88, 0.24);
  background: #eef1f4;
}
.slot-booked strong,
.slot-booked span {
  color: #304558;
}
.slot-cell.slot-open {
  background: #d7f4df;
}
.slot-cell.slot-open em {
  color: #0a6d43;
  font-weight: 800;
}
.slot-cell.slot-closed {
  background: #fff0ea;
}
.slot-cell.slot-booked {
  background: #eef1f4;
}
.slot-button:disabled {
  cursor: default;
  opacity: 0.82;
}
.slot-actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.slot-actions form {
  margin: 0;
}
.slot-action,
.lesson-cancel {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  color: #fffaf3;
  background: var(--green);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.slot-action:hover,
.lesson-cancel:hover {
  background: var(--orange);
}
.slot-action-secondary {
  color: var(--green);
  background: rgba(255, 171, 55, 0.35);
}
.lesson-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.lesson-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(13, 79, 54, 0.18);
  border-radius: 14px;
  background: #fffaf3;
}
.lesson-card div {
  display: grid;
  gap: 2px;
}
.lesson-card strong {
  color: var(--green);
  font-size: 15px;
}
.lesson-card b {
  color: var(--text);
  font-size: 22px;
}
.lesson-card span {
  color: var(--muted);
}
.lesson-card form {
  flex: 0 0 98px;
  margin: 0;
}
.lesson-cancel {
  min-height: 34px;
  color: #8f2f1e;
  background: #fff0ea;
}
.lesson-lock {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}
.booking-modal[hidden] {
  display: none;
}
.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.booking-modal-card {
  position: absolute;
  padding: 22px;
  border: 1px solid rgba(255, 250, 243, 0.34);
  border-radius: 18px;
  color: #fffaf3;
  background: #0d4f36;
  box-shadow: 0 22px 60px rgba(13, 79, 54, 0.28);
  pointer-events: auto;
}
.booking-modal-card::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 28px;
  width: 16px;
  height: 16px;
  border-left: 1px solid rgba(255, 250, 243, 0.34);
  border-top: 1px solid rgba(255, 250, 243, 0.34);
  background: #0d4f36;
  transform: rotate(45deg);
}
.booking-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: #fffaf3;
  background: rgba(255, 250, 243, 0.16);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.booking-modal-card .eyebrow {
  color: #ffb347;
}
.booking-modal-card h2 {
  margin: 8px 0 8px;
  color: #fffaf3;
  font-size: 25px;
  line-height: 1.12;
}
.booking-modal-card p[data-booking-details] {
  margin: 0 0 22px;
  color: rgba(255, 250, 243, 0.78);
}
.booking-warning {
  margin: -8px 0 18px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #8f2f1e;
  background: #fff0ea;
  font-weight: 900;
  line-height: 1.35;
}
.booking-modal-actions {
  display: grid;
  gap: 10px;
}
.booking-modal-actions form {
  margin: 0;
}
.booking-modal-actions .button {
  width: 100%;
  justify-content: center;
  background: #ffad3b;
}
.booking-month-button {
  color: #fffaf3;
  background: rgba(255, 250, 243, 0.16) !important;
}
.booking-modal-actions .button:disabled {
  cursor: default;
  opacity: 0.48;
}

@media (max-width: 900px) {
  .site-header { align-items: flex-start; gap: 16px; flex-direction: column; }
  nav { flex-wrap: wrap; gap: 14px; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .cards, .dashboard-grid, .staff-stats { grid-template-columns: 1fr; }
  .dashboard-head { align-items: flex-start; flex-direction: column; }
  .balance-card-actions { align-items: flex-start; flex-direction: column; }
  .subscription-shop-head { align-items: flex-start; flex-direction: column; }
  .subscription-grid { grid-template-columns: 1fr; }
  .staff-panel-head { align-items: flex-start; flex-direction: column; }
  .staff-form { grid-template-columns: 1fr; }
  .staff-form-panel { padding: 24px; }
  .schedule-board { padding: 20px; }
  .week-switcher { width: 100%; justify-content: space-between; }
  .week-switcher span { min-width: 0; }
  .lesson-card { align-items: flex-start; flex-direction: column; }
  .lesson-card form { width: 100%; }
}
