:root {
  --brand: #7c2d12;
  --brand-2: #b45309;
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e7e2d9;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b91c1c;
  --warn-bg: #fee2e2;
  --pend: #b45309;
  --pend-bg: #fef3c7;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 20px rgba(124,45,18,.05);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand-2); }

/* Header */
.site-header { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark { font-size: 1.8rem; }
.brand-text { display: flex; flex-direction: column; font-weight: 700; line-height: 1.1; }
.brand-text small { font-weight: 400; font-size: .72rem; opacity: .85; }
.nav { display: flex; gap: 6px; }
.nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.15); }

main.container { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }

/* Hero */
.hero h1 { margin: .2em 0 .1em; font-size: 1.8rem; color: var(--brand); }
.hero p { color: var(--muted); margin-top: 0; max-width: 640px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.form-card { max-width: 560px; }
.narrow { max-width: 420px; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.flash ul { margin: 0; padding-left: 18px; }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.flash-error { background: var(--warn-bg); color: var(--warn); border-color: #fecaca; }

/* Picker */
.picker { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin: 16px 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field .req { color: var(--warn); }
.field small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: var(--brand-2); }
.studio-desc { color: var(--muted); margin: 0 0 8px; }
.day-title { margin: 18px 0 8px; color: var(--brand); }

/* Legend */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-bottom: 14px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.dot.available { background: #fff; border: 2px solid var(--ok); }
.dot.pending { background: var(--pend); }
.dot.booked { background: #9ca3af; }
.dot.closed { background: #e5e7eb; }

/* Slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.slot { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 8px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; text-align: center; gap: 2px; }
.slot-time { font-weight: 700; font-size: 1rem; }
.slot-state { font-size: .75rem; }
.slot-available { background: #fff; border-color: var(--ok); color: var(--ok); cursor: pointer; transition: transform .05s, background .15s; }
.slot-available:hover { background: var(--ok-bg); transform: translateY(-1px); }
.slot-available .slot-time { color: var(--ink); }
.slot-pending { background: var(--pend-bg); color: var(--pend); border-color: #fde68a; }
.slot-booked { background: #f3f4f6; color: #6b7280; }
.slot-closed { background: #f9fafb; color: #c0c4cc; }

/* Buttons */
.btn { display: inline-block; padding: 10px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: #f6f3ee; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: #6b2410; }
.btn-block { display: block; width: 100%; }
.btn-small { padding: 7px 12px; font-size: .88rem; }
.btn-xs { padding: 5px 10px; font-size: .8rem; }
.btn-ghost { background: transparent; }
.btn-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-ok:hover { background: #126b32; }
.btn-warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn-warn:hover { background: #991717; }
.back-link { display: inline-block; margin-bottom: 12px; text-decoration: none; }

/* Summary */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 16px 0; padding: 14px; background: #faf7f2; border-radius: 10px; }
.summary > div { display: flex; flex-direction: column; }
.summary span { font-size: .75rem; color: var(--muted); }
.summary strong { font-size: .98rem; }
.form .field { margin-bottom: 14px; }
.form input, .form textarea, .form select { width: 100%; }
.hint { font-size: .82rem; color: var(--muted); }

/* Status card */
.status-card { text-align: center; }
.status-badge { display: inline-block; padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.status-pending .status-badge { background: var(--pend-bg); color: var(--pend); }
.status-confirmed .status-badge { background: var(--ok-bg); color: var(--ok); }
.status-rejected .status-badge, .status-cancelled .status-badge { background: var(--warn-bg); color: var(--warn); }
.status-card .summary { text-align: left; }
.status-msg { color: var(--ink); }
.admin-note { background: #faf7f2; padding: 10px; border-radius: 8px; font-size: .9rem; }

/* Admin */
.admin-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.admin-actions { display: flex; gap: 8px; align-items: center; }
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .8rem; }
.stat-n { font-size: 1.5rem; font-weight: 800; }
.stat.on { outline: 2px solid var(--brand); }
.stat-pending .stat-n { color: var(--pend); }
.stat-confirmed .stat-n { color: var(--ok); }
.stat-rejected .stat-n, .stat-cancelled .stat-n { color: var(--warn); }
.admin-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #faf7f2; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table .muted { color: var(--muted); }
.row-pending { background: #fffdf6; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.badge-pending { background: var(--pend-bg); color: var(--pend); }
.badge-confirmed { background: var(--ok-bg); color: var(--ok); }
.badge-rejected, .badge-cancelled { background: var(--warn-bg); color: var(--warn); }
.action-form { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.action-form input[type=text] { font-size: .82rem; padding: 6px 8px; }
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }

.inline-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; }
.inline-form input { width: auto; }
.studio-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.studio-name { flex: 1 1 140px; }
.studio-desc-input { flex: 2 1 200px; }
.studio-order { width: 70px; }
.chk { display: flex; align-items: center; gap: 4px; font-size: .85rem; white-space: nowrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: .85rem; text-align: center; }

@media (max-width: 600px) {
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .summary { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
}
