:root {
  --bg: #f5f1e8;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffdf8;
  --text: #1e1a17;
  --muted: #645b55;
  --border: rgba(38, 26, 19, 0.08);
  --accent: #0e7a6d;
  --accent-strong: #0b5e54;
  --danger: #b42318;
  --shadow: 0 24px 60px rgba(41, 28, 19, 0.08);
}

body[data-theme="dark"] {
  --bg: #171717;
  --surface: rgba(32, 32, 32, 0.92);
  --surface-strong: #202020;
  --text: #f5f2ec;
  --muted: #b4aaa3;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #5fd3c4;
  --accent-strong: #90e4d8;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(14, 122, 109, 0.14), transparent 26%),
    radial-gradient(circle at bottom right, rgba(214, 157, 90, 0.18), transparent 24%),
    var(--bg);
  color: var(--text);
}

body[data-embed="true"] {
  background: transparent;
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden { display: none !important; }
.stack { display: grid; gap: 1rem; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 1.25rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--muted);
}
.muted, .message { color: var(--muted); }
.message[data-state="error"] { color: var(--danger); }
.message[data-state="success"] { color: var(--accent-strong); }
.primary, .ghost, .slot-btn, .nav-link, .tab {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  background: var(--surface-strong);
  color: var(--text);
}
.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border: none;
}
.auth-shell, .booking-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

body[data-embed="true"] .booking-shell {
  min-height: auto;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0;
}

body[data-embed="true"] .panel {
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(41, 28, 19, 0.08);
  backdrop-filter: none;
}
.hero-card h1 {
  font-size: clamp(2rem, 3vw, 4rem);
  line-height: 1;
  margin: 0.5rem 0 1rem;
}
.dashboard-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  gap: 1.5rem;
  padding: 1.25rem;
}
.sidebar, .dashboard-main, .sidebar-nav, .topbar-actions, .section-head, .meta-row, .booking-layout {
  display: grid;
  gap: 1rem;
}
.sidebar {
  align-content: space-between;
}
.sidebar-title, h1, h2 {
  margin: 0;
}
.dashboard-main {
  align-content: start;
}
.topbar, .section-head {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.stats-grid, .card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 0.75rem;
}
.grid-form, .availability-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.list, .sidebar-nav {
  display: grid;
  gap: 0.75rem;
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.nav-link.active, .tab.active {
  background: var(--accent);
  color: #fff;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 16px;
  padding: 0.85rem 1rem;
}
textarea {
  min-height: 120px;
  resize: vertical;
}
.event-card, .booking-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,255,255,0.34);
}
.profile-link-card {
  color: inherit;
  text-decoration: none;
  display: block;
}
.code-block {
  display: block;
  width: 100%;
  overflow-x: auto;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(20, 20, 20, 0.92);
  color: #f7f4ef;
  font-size: 0.9rem;
  line-height: 1.45;
}
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.slots-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.booking-summary,
.booking-panel {
  align-content: start;
}
.slot-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.slot-btn.selected {
  background: var(--accent);
  color: #fff;
}
label span {
  display: block;
  margin-bottom: 0.4rem;
}

@media (max-width: 900px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }
  .topbar, .section-head, .booking-layout {
    grid-template-columns: 1fr;
  }
}

body[data-page="dashboard"] {
  background: #0b0b0c;
}

.dashboard-sidebar {
  background: #111113;
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 1.25rem 1rem;
  min-height: 100vh;
  display: grid;
  gap: 1.25rem;
  align-content: space-between;
}

.sidebar-header {
  display: grid;
  gap: 1rem;
}

.workspace-badge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: center;
}

.workspace-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2f2f34, #1b1b1f);
  color: #fff;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.12);
}

.dashboard-main {
  padding: 1.5rem 2rem;
}

.dashboard-topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-header-copy h1 {
  font-size: 2.2rem;
}

.dashboard-surface {
  background: #121214;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 1.25rem;
}

.search-shell {
  min-width: 260px;
}

.search-shell input {
  background: #111113;
  border-radius: 14px;
}

.dashboard-primary {
  border: 1px solid rgba(255,255,255,0.14);
  background: #f4f4f5;
  color: #111113;
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  font-weight: 700;
}

.nav-link {
  justify-content: flex-start;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  color: #f4f4f5;
}

.nav-link.active {
  background: rgba(255,255,255,0.16);
}

.event-list-shell {
  padding: 0;
  overflow: hidden;
}

.event-type-rows {
  display: grid;
}

.event-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.35rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.event-row:first-child {
  border-top: none;
}

.event-row-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.event-row-path {
  color: var(--muted);
  font-size: 0.95rem;
  margin-left: 0.45rem;
}

.event-row-meta {
  display: inline-flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.duration-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 10px;
  background: #3a3a3f;
  color: #f4f4f5;
  font-size: 0.9rem;
}

.event-row-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-pill {
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: #2a2a2d;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}

.toggle-pill::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 27px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
}

.action-icon {
  border: 1px solid rgba(255,255,255,0.14);
  background: transparent;
  color: #f4f4f5;
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
}

.sidebar-footer-link {
  display: block;
  background: transparent;
  border: none;
  color: #f4f4f5;
  text-align: left;
  text-decoration: none;
  padding: 0.2rem 0;
}

.event-empty {
  padding: 1.25rem;
}

@media (max-width: 900px) {
  .dashboard-topbar,
  .event-row {
    grid-template-columns: 1fr;
  }

  .dashboard-main {
    padding: 1rem;
  }
}

body[data-page="booking"] {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.03), transparent 28%),
    #101010;
  color: #f5f5f5;
}

body[data-page="booking"][data-embed="true"] {
  background: transparent;
}

body[data-page="booking"] .booking-stage {
  min-height: 100vh;
  padding: 1.75rem;
  display: grid;
  place-items: center;
}

body[data-page="booking"][data-embed="true"] .booking-stage {
  min-height: auto;
  padding: 0;
}

.booking-card {
  width: min(1280px, 100%);
  display: grid;
  grid-template-columns: 320px 1fr 350px;
  background: #171717;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

body[data-page="booking"][data-embed="true"] .booking-card {
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.booking-sidebar,
.booking-calendar-panel,
.booking-times-panel {
  min-height: 640px;
  padding: 1.9rem 1.7rem;
  background: #171717;
}

.booking-sidebar,
.booking-calendar-panel {
  border-right: 1px solid rgba(255,255,255,0.08);
}

.booking-sidebar {
  display: grid;
  align-content: start;
  gap: 1.3rem;
}

.booking-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #373737, #1d1d1d);
  color: #fff;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.1);
}

.booking-copy {
  gap: 0.4rem;
}

.booking-host-name {
  margin: 0;
  color: #cfcfcf;
  font-size: 1rem;
  font-weight: 700;
}

body[data-page="booking"] #booking-title {
  margin: 0.2rem 0 0;
  font-size: clamp(2rem, 3vw, 2.65rem);
  line-height: 1.06;
}

.booking-description {
  margin: 0.65rem 0 0;
  line-height: 1.6;
}

.booking-selected-summary {
  margin-top: 0.15rem;
}

.booking-selected-date,
.booking-selected-time {
  color: #f2f2f2;
  font-weight: 800;
  line-height: 1.4;
}

.booking-selected-date {
  font-size: 0.95rem;
}

.booking-selected-time {
  font-size: 1.7rem;
}

.booking-meta-list {
  display: grid;
  gap: 0.95rem;
  margin-top: 0.35rem;
}

.booking-meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #f3f3f3;
  font-weight: 700;
}

.booking-meta-icon {
  width: 20px;
  text-align: center;
  color: #d6d6d6;
  font-size: 0.95rem;
}

.booking-calendar-panel {
  display: grid;
  align-content: start;
  gap: 1.55rem;
}

.booking-calendar-header,
.booking-times-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

body[data-page="booking"] .booking-calendar-header h2,
body[data-page="booking"] .booking-times-header h2 {
  margin: 0;
  font-size: 2rem;
  color: #fafafa;
}

.calendar-nav {
  display: flex;
  gap: 0.5rem;
}

.calendar-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #d5d5d5;
  font-size: 1.55rem;
  line-height: 1;
}

.booking-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.8rem;
  color: #f3f3f3;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.booking-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.38rem;
}

.calendar-day {
  min-height: 74px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #f5f5f5;
  text-align: left;
  padding: 0.75rem;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.calendar-day:hover {
  background: #2e2e2e;
}

.calendar-day.outside-month {
  opacity: 0.18;
}

.calendar-day.selected {
  background: #f2f2f2;
  color: #111;
  font-weight: 800;
}

.calendar-day.today:not(.selected) {
  position: relative;
}

.calendar-day.today:not(.selected)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
}

.calendar-day-number {
  font-size: 1.7rem;
  font-weight: 700;
}

.booking-times-panel {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.booking-card.booking-card-confirm {
  grid-template-columns: 430px 1fr;
}

.booking-card.booking-card-confirm .booking-calendar-panel {
  display: none;
}

.booking-card.booking-card-confirm .booking-times-panel {
  min-height: 640px;
  align-content: space-between;
  gap: 1.5rem;
}

.booking-card.booking-card-confirm .booking-times-header,
.booking-card.booking-card-confirm .booking-times-list {
  display: none;
}

.time-format-toggle {
  display: inline-flex;
  background: #1f1f1f;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 0.2rem;
}

.time-format-btn {
  border: none;
  background: transparent;
  color: #d6d6d6;
  padding: 0.45rem 0.75rem;
  border-radius: 11px;
  font-weight: 800;
}

.time-format-btn.active {
  background: #121212;
  color: #fff;
}

.booking-times-list {
  display: grid;
  gap: 0.75rem;
}

.booking-time-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: transparent;
  color: #f6f6f6;
  border-radius: 14px;
  padding: 1rem;
  font-weight: 800;
  font-size: 1rem;
}

.booking-time-btn:hover {
  background: #1f1f1f;
}

.booking-time-btn.selected {
  background: #f5f5f5;
  color: #111;
}

.booking-time-btn[disabled] {
  opacity: 0.35;
}

.booking-time-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #09d29c;
  display: inline-block;
}

.booking-form {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.35rem;
}

.booking-form-header {
  display: grid;
  gap: 1.1rem;
}

.field-stack {
  display: grid;
  gap: 0.45rem;
}

.field-stack label {
  color: #fafafa;
  font-size: 0.98rem;
  font-weight: 800;
}

body[data-page="booking"] .booking-form input {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #111;
  color: #fff;
}

body[data-page="booking"] .booking-form textarea {
  min-height: 120px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #111;
  color: #fff;
}

.booking-link-btn,
.booking-back-btn {
  width: fit-content;
  border: none;
  background: transparent;
  color: #d7d7d7;
  padding: 0;
  font-weight: 800;
}

.guest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.guest-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #101010;
  border: 1px solid rgba(255,255,255,0.12);
}

.guest-pill button {
  border: none;
  background: transparent;
  color: #d8d8d8;
  padding: 0;
}

.guest-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.booking-form-summary {
  color: #d8d8d8;
  font-weight: 600;
  line-height: 1.6;
  margin: 0;
}

.booking-submit {
  border-radius: 14px;
  min-width: 126px;
}

.booking-empty {
  margin: 0.5rem 0 0;
}

.booking-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  margin-top: 0.4rem;
}

@media (max-width: 1100px) {
  .booking-card {
    grid-template-columns: 1fr;
  }

  .booking-sidebar,
  .booking-calendar-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: auto;
  }

  .booking-card.booking-card-confirm {
    grid-template-columns: 1fr;
  }
}
