:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --text: #1a1f1c;
  --muted: #5f6b64;
  --line: #dfe3e0;
  --brand: #15803d;
  --brand-dark: #116932;
  --brand-soft: #e7f4ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff4e0;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.5rem; }
a { color: var(--brand); }
[hidden] { display: none !important; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.section { padding: 40px 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* nav */
.nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.logo span { color: var(--brand); }
.logo small { font-weight: 500; color: var(--muted); font-size: 0.875rem; margin-left: 4px; }
.nav nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav nav a, .nav nav button {
  padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.nav nav a:hover, .nav nav button:hover { background: var(--bg); }
.nav nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* hero */
.hero { background: var(--brand); color: #fff; padding: 64px 0; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); max-width: 640px; }
.hero p { font-size: 1.125rem; max-width: 560px; opacity: 0.92; margin: 0 0 24px; }
.hero .btn { background: #fff; color: var(--brand-dark); }
.hero .btn:hover { background: var(--brand-soft); }

/* buttons & forms */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f1c13; }
.btn-sm { padding: 6px 12px; font-size: 0.875rem; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
input, select, textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .slot:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px;
}
textarea { min-height: 90px; resize: vertical; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar label { flex: 1 1 160px; }
.toolbar .btn { flex: 0 0 auto; }

.msg { padding: 12px 14px; border-radius: 8px; }
.msg-ok { background: var(--brand-soft); color: var(--brand-dark); }
.msg-err { background: var(--danger-soft); color: var(--danger); }
.err { color: var(--danger); margin: 0; min-height: 1.5em; }

/* ground cards */
.ground h3 { margin-bottom: 4px; }
.ground .price { font-size: 1.25rem; font-weight: 700; margin: 12px 0; }
.ground .price span { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); }

/* slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.slot {
  padding: 10px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: inherit; font-size: 0.9rem; cursor: pointer; color: var(--text);
}
.slot:hover:not(:disabled) { border-color: var(--brand); }
.slot:disabled { background: #eef0ee; color: #a3aba6; cursor: not-allowed; text-decoration: line-through; }
.slot.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 0.8rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line); }
.summary { background: var(--brand-soft); border-radius: 8px; padding: 12px 14px; font-weight: 600; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fafbfa; font-weight: 600; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafbfa; }
td select { width: auto; padding: 4px 8px; }
.empty { text-align: center; color: var(--muted); padding: 28px; }

.pill { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.pill-confirmed { background: var(--brand-soft); color: var(--brand-dark); }
.pill-completed { background: #e8eefc; color: #2446a8; }
.pill-cancelled, .pill-no-show { background: var(--danger-soft); color: var(--danger); }
.pill-unpaid { background: var(--warn-soft); color: #9a5b00; }
.pill-paid { background: var(--brand-soft); color: var(--brand-dark); }

/* admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat .label { color: var(--muted); font-size: 0.85rem; }
.stat .value { font-size: 1.6rem; font-weight: 700; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.center .card { width: 100%; max-width: 360px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head h2 { margin: 0; }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog .card { border: 0; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; }

.footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 0.875rem; background: var(--surface); }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
