:root {
  --purple: #7c5cff;
  --purple-dark: #5f3fd6;
  --purple-soft: #efeaff;
  --ink: #2b2b33;
  --muted: #6b6b76;
  --line: #e4e2ee;
  --bg: #f6f5fb;
  --card: #ffffff;
  --green: #2fbf71;
  --green-soft: #e3f7ec;
  --red: #d64545;
  --red-soft: #fbe7e7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

h1, h2, h3 { margin: 0 0 12px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Nav */
.topnav {
  background: var(--purple);
  color: #fff;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.nav-links a { color: #ece6ff; text-decoration: none; margin-left: 18px; font-size: 0.95rem; }
.nav-links a:hover { color: #fff; }
.nav-button { border: 0; padding: 0; margin-left: 18px; background: transparent; color: #ece6ff; font: inherit; font-size: 0.95rem; cursor: pointer; }
.nav-button:hover { color: #fff; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--purple); color: var(--purple-dark); }
.btn-primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); color: #fff; }
.btn-danger { background: var(--red-soft); border-color: var(--red-soft); color: var(--red); }
.btn-sm { padding: 4px 10px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Forms */
label { display: block; margin: 12px 0 4px; font-size: 0.9rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft);
}
textarea { font-family: inherit; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; align-items: end; }
.inline { display: inline; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.table th { background: #faf9fe; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.table a { color: var(--purple-dark); text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* Badges, chips, alerts */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--line); color: var(--ink); text-transform: capitalize; }
.badge-present { background: var(--green-soft); color: #1e7a49; }
.badge-future { background: var(--purple-soft); color: var(--purple-dark); }
.badge-past { background: var(--line); color: var(--muted); }
.badge-cancelled { background: var(--red-soft); color: var(--red); }
.chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 0.85rem; margin-right: 6px; }
.chip-active { background: var(--purple); border-color: var(--purple); color: #fff; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.search-form { display: flex; gap: 8px; margin-left: auto; }
.search-form input { width: 220px; }
.alert { padding: 12px 14px; border-radius: 8px; margin: 14px 0; font-size: 0.95rem; }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-success { background: var(--green-soft); color: #1e7a49; }
.error-card, .login-card, .calendar-card, .booking-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.login-card { max-width: 380px; margin: 8vh auto 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0 28px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--purple-dark); }
.stat-label { color: var(--muted); font-size: 0.85rem; }
section { margin: 28px 0; }

/* Booking */
.booking-hero { text-align: center; margin: 12px 0 24px; }
.booking-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .booking-layout { grid-template-columns: 1fr; } }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calendar-head h2 { margin: 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.75rem; color: var(--muted); padding: 6px 0; font-weight: 600; }
.cal-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px; font-size: 0.95rem; border: 1px solid var(--line); background: #fff; }
.cal-cell.empty { border: none; background: transparent; }
.cal-cell.available { background: var(--green-soft); border-color: var(--green); cursor: pointer; font-weight: 600; }
.cal-cell.available:hover { background: var(--green); color: #fff; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--purple); }
.cal-cell.selected { background: var(--purple); color: #fff; border-color: var(--purple); }
.cal-count { font-size: 0.65rem; font-weight: 500; opacity: 0.75; }
.time-slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.time-slot { border-color: var(--purple-soft); background: var(--purple-soft); color: var(--purple-dark); font-weight: 600; }
.time-slot:hover { border-color: var(--purple); }
.time-active { background: var(--purple); color: #fff; border-color: var(--purple); }
.hidden { display: none; }

/* Reviews */
.reviews { margin: 36px 0 12px; }
.review-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 16px 0; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.review-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stars { color: #f5a623; font-weight: 700; }
.review p { margin: 4px 0; }
