[hidden] { display: none !important; }

/* ---------- Base ---------- */
:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #e7ebf3;
  --muted: #8a93a6;
  --accent: #5dd39e;
  --accent-dim: #2d6a52;
  --danger: #f06d6d;
  --warn: #f0c36d;
  --radius: 10px;
  --radius-sm: 6px;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 15px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 600; letter-spacing: -0.01em; font-size: 16px; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 12px; border-radius: 6px; font-size: 14px; color: var(--muted); text-decoration: none; }
.topnav a:hover { background: var(--surface-2); }
.topnav a.is-active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.topnav a.is-active { color: var(--text); }
.pill {
  font-size: 11px; padding: 4px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.pill--on { background: var(--accent-dim); color: #eafff3; border-color: transparent; }

/* ---------- Book page ---------- */
.book-main { max-width: 640px; margin: 0 auto; padding: 16px; }
.lead-panel { margin-bottom: 16px; }
.lead-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.lead-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.lead-row:last-child { border-bottom: 0; }
.lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.val { color: var(--text); text-align: right; max-width: 70%; }

.walkin {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.walkin summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.walkin summary::marker { color: var(--muted); }

.day-tabs {
  display: flex; overflow-x: auto; gap: 8px; padding-bottom: 12px;
  scrollbar-width: none;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex-shrink: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px;
}
.day-tab.is-active { background: var(--accent-dim); border-color: transparent; }
.day-count { font-size: 11px; color: var(--muted); }
.day-tab.is-active .day-count { color: #d4f5e4; }

.slots {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px; margin-top: 8px;
}
.slot {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text);
  transition: border-color 0.1s, background 0.1s;
  text-align: left;
}
.slot:hover { border-color: var(--accent); }
.slot:active { background: var(--surface-2); }
.slot-time { font-size: 16px; font-weight: 600; }
.slot-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.empty, .loading {
  padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px;
}

/* ---------- Confirm sheet ---------- */
.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
}
.sheet-inner {
  background: var(--surface); width: 100%; max-width: 520px;
  border-radius: 16px 16px 0 0; padding: 20px 20px 24px;
  border-top: 1px solid var(--border);
}
.sheet-inner h2 { margin: 0 0 16px; font-size: 18px; }
.confirm-details > div {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.confirm-details > div:last-child { border-bottom: 0; }
.confirm-details select { width: auto; min-width: 160px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Buttons ---------- */
.btn {
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 15px;
  border: 1px solid transparent; font-weight: 500;
}
.btn--primary { background: var(--accent); color: #0a1f15; flex: 1; }
.btn--primary:hover { background: #6de0ab; }
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); flex: 1; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { padding: 6px 10px; font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent-dim); color: #eafff3;
  padding: 10px 16px; border-radius: var(--radius-sm); font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 200;
}

/* ---------- Calendar ---------- */
.cal-main { max-width: 1200px; margin: 0 auto; padding: 20px; }
.cal-controls { display: flex; justify-content: center; align-items: center; gap: 16px; margin-bottom: 18px; }
.cal-controls h2 { margin: 0; font-size: 18px; font-weight: 500; min-width: 200px; text-align: center; }
.cal-controls button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: var(--radius-sm); font-size: 14px;
}
.cal-controls button:hover { background: var(--surface-2); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.col { background: var(--surface); min-height: 400px; display: flex; flex-direction: column; }
.col-head {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; background: var(--surface-2);
}
.col-wd { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.col-date { font-size: 18px; font-weight: 600; }
.col-body { padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 20px 0; }
.appt {
  background: var(--surface-2); border-left: 3px solid var(--accent);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12px;
}
.appt-time { font-weight: 600; }
.appt-closer { color: var(--muted); font-size: 11px; margin-top: 2px; }
.appt-customer { margin-top: 2px; }
.appt-setter { font-size: 11px; color: var(--muted); margin-top: 2px; font-style: italic; }

@media (max-width: 720px) {
  .cal-grid { grid-template-columns: 1fr; }
  .col { min-height: auto; }
}

/* ---------- Admin ---------- */
.admin-main { max-width: 900px; margin: 0 auto; padding: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.muted.small { font-size: 12px; }
.muted code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; gap: 12px; flex-wrap: wrap;
}
.toggle-row .btn--primary { flex: 0 0 auto; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.tbl th { font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

.status { font-size: 11px; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.status--scheduled { background: var(--accent-dim); color: #eafff3; }
.status--cancelled { background: #3a1f1f; color: var(--danger); }
