:root {
  --bg: #f5f0eb;
  --surface: #ffffff;
  --ink: #2c241b;
  --ink-secondary: #6b5d4f;
  --ink-tertiary: #9c8e7e;
  --border: #d9cfc4;
  --border-light: #e8e0d6;
  --accent: #b45f3a;
  --accent-hover: #9a4f2e;
  --accent-subtle: #f7ede6;
  --green: #5a8a5a;
  --green-subtle: #eef5ee;
  --amber: #b8863a;
  --amber-subtle: #faf0e0;
  --red: #b84a3a;
  --red-subtle: #f8ecea;
  --clay: #c4835a;
  --clay-light: #e8d5c4;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(44,36,27,0.06);
  --shadow: 0 1px 3px rgba(44,36,27,0.08), 0 1px 2px rgba(44,36,27,0.04);
  --shadow-md: 0 4px 6px -1px rgba(44,36,27,0.08), 0 2px 4px -2px rgba(44,36,27,0.04);
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1612;
    --surface: #26211c;
    --ink: #e6ddd4;
    --ink-secondary: #a89888;
    --ink-tertiary: #7a6e60;
    --border: #3d352e;
    --border-light: #2f2822;
    --accent: #d48a6a;
    --accent-hover: #e09e80;
    --accent-subtle: #3d2a20;
    --green: #7ab87a;
    --green-subtle: #1e2e1e;
    --amber: #d4a84a;
    --amber-subtle: #3d2e18;
    --red: #d47a6a;
    --red-subtle: #3d221e;
    --clay: #d49a7a;
    --clay-light: #3d352e;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
    --shadow: 0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.35), 0 2px 4px -2px rgba(0,0,0,0.25);
  }
}

.dark {
  --bg: #1a1612;
  --surface: #26211c;
  --ink: #e6ddd4;
  --ink-secondary: #a89888;
  --ink-tertiary: #7a6e60;
  --border: #3d352e;
  --border-light: #2f2822;
  --accent: #d48a6a;
  --accent-hover: #e09e80;
  --accent-subtle: #3d2a20;
  --green: #7ab87a;
  --green-subtle: #1e2e1e;
  --amber: #d4a84a;
  --amber-subtle: #3d2e18;
  --red: #d47a6a;
  --red-subtle: #3d221e;
  --clay: #d49a7a;
  --clay-light: #3d352e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
  --shadow: 0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.35), 0 2px 4px -2px rgba(0,0,0,0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Topbar */
.topbar {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(245,240,235,0.92);
}
@media (prefers-color-scheme: dark) {
  .topbar { background: rgba(26,22,18,0.92); }
}
.dark .topbar { background: rgba(26,22,18,0.92); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: var(--font-serif);
  font-style: italic;
}
.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current] {
  background: var(--accent-subtle);
  color: var(--accent);
}
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-secondary);
  font-size: 1rem;
  transition: background 0.15s;
}
.theme-toggle:hover { background: var(--border-light); }

/* Hero */
.hero {
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--ink);
}
.hero p {
  font-size: 1.1rem;
  color: var(--ink-secondary);
  max-width: 600px;
  margin: 0 auto 1.75rem;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--border-light);
  border-color: var(--ink-tertiary);
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
}
.section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}
.section-header .badge {
  font-size: 0.75rem;
  background: var(--border-light);
  color: var(--ink-secondary);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 500;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--ink-tertiary);
  transform: translateY(-2px);
}
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.85rem;
}
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}
.card p {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}
.card-meta {
  font-size: 0.8rem;
  color: var(--ink-tertiary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-meta .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }
.dot-clay { background: var(--clay); }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat-card .stat-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.2rem;
  color: var(--accent);
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--ink-tertiary);
  font-weight: 500;
}
.stat-card .stat-trend {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  font-weight: 500;
}
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }

/* Page sections */
.page-section {
  padding: 2.5rem 0;
}
.page-section h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.page-section .section-desc {
  color: var(--ink-secondary);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 0 1.5rem;
}

/* Membership plans */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.plan-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.plan-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.plan-card.featured {
  border-color: var(--accent);
  position: relative;
}
.plan-card.featured::before {
  content: "Popular";
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plan-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
}
.plan-card .plan-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.5rem 0;
}
.plan-card .plan-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-tertiary);
}
.plan-card ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 1.25rem;
  flex: 1;
}
.plan-card ul li {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  padding: 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.plan-card ul li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
}
.plan-card .btn {
  width: 100%;
  justify-content: center;
}

/* Studio time / ordering */
.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.time-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.time-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--ink-tertiary);
}
.time-card .time-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
.time-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.time-card .time-duration {
  font-size: 0.8rem;
  color: var(--ink-tertiary);
  margin-bottom: 0.5rem;
}
.time-card .time-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* Table */
.table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}
.table-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}
.table-header .btn-sm {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  color: var(--accent);
  border: none;
  font-weight: 500;
  cursor: pointer;
}
.table-header .btn-sm:hover {
  background: var(--accent);
  color: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th {
  text-align: left;
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  color: var(--ink-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
td {
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink);
}
tr:last-child td { border-bottom: none; }
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-active { background: var(--green-subtle); color: var(--green); }
.status-pending { background: var(--amber-subtle); color: var(--amber); }
.status-off { background: var(--red-subtle); color: var(--red); }
.status-clocked { background: var(--accent-subtle); color: var(--accent); }

/* Member table */
.member-role {
  font-size: 0.75rem;
  color: var(--ink-tertiary);
}
.member-name {
  font-weight: 600;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel {
  display: none;
}
.tab-panel[aria-hidden="false"] {
  display: block;
}

/* Form elements */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 1rem;
}
.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--ink-tertiary);
  padding: 0.25rem;
}
.modal-close:hover { color: var(--ink); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-tertiary);
}
.footer-inner a {
  color: var(--ink-secondary);
  text-decoration: none;
}
.footer-inner a:hover { color: var(--accent); }
.attribution {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .card-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
  .time-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { gap: 0; overflow-x: auto; }
  .nav-links a { padding: 0.35rem 0.5rem; font-size: 0.78rem; }
  .topbar-inner { padding: 0 1rem; }
  .wrapper { padding: 0 1rem; }
  .table-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  th, td { padding: 0.5rem 0.75rem; }
}
@media (max-width: 480px) {
  body { font-size: 14px; }
  .hero h1 { font-size: 1.6rem; }
  .time-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
