:root {
  color-scheme: light;
  --background: #f7f3ee;
  --panel: #fffdf9;
  --text: #221f1b;
  --muted: #756d64;
  --line: #ded4c7;
  --accent: #8f6a3d;
  --blue: #2563eb;
  --red: #e11d48;
  --gray: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dashboard-body {
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(247, 243, 238, 0.96)),
    var(--background);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: clamp(28px, 6vw, 56px);
  box-shadow: 0 22px 70px rgba(58, 45, 31, 0.12);
}

.topbar {
  width: min(100%, 1400px);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 42px) 12px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

p {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.6;
}

.muted {
  color: var(--muted);
}

.auth-panel {
  width: min(100%, 440px);
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  resize: vertical;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(143, 106, 61, 0.18);
}

textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(143, 106, 61, 0.18);
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 12px 16px;
}

button:hover {
  background: #3a332b;
}

.alert {
  margin-top: 22px;
  border: 1px solid #e0b4a8;
  border-radius: 8px;
  background: #fff1ed;
  color: #7d2e20;
  padding: 12px 14px;
  font-size: 0.95rem;
}

.alert.success {
  border-color: #a8cbb6;
  background: #effaf2;
  color: #24553a;
}

.text-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.user-pill {
  max-width: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.84);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 10px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.84);
  color: var(--text);
}

.button.danger {
  background: #8f1d1d;
}

.button.danger:hover {
  background: #6f1717;
}

.dashboard {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 12px clamp(18px, 4vw, 42px) 38px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.84);
  padding: 16px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.summary-card.booking {
  border-top: 4px solid var(--blue);
}

.summary-card.airbnb {
  border-top: 4px solid var(--red);
}

.summary-card.manual {
  border-top: 4px solid var(--gray);
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: start;
}

.calendar-panel,
.details-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: 0 18px 56px rgba(58, 45, 31, 0.1);
}

.calendar-panel {
  min-width: 0;
  padding: clamp(14px, 2vw, 22px);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.calendar-shell {
  min-width: 0;
}

.integration-panel {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 243, 238, 0.72);
  margin-bottom: 18px;
  padding: 16px;
}

.inline-form {
  display: grid;
  gap: 12px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.details-panel {
  position: sticky;
  top: 18px;
  padding: 22px;
}

.details-panel h2 {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.details-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.status-text {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 243, 238, 0.78);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.details-list div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.details-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.details-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.details-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 31, 27, 0.46);
}

.modal-panel {
  position: relative;
  width: min(calc(100% - 32px), 560px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: 16px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: clamp(20px, 4vw, 30px);
  box-shadow: 0 24px 90px rgba(34, 31, 27, 0.28);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.icon-button {
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
}

.compact-form {
  margin-top: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-error {
  margin: 0;
  border: 1px solid #e0b4a8;
  border-radius: 8px;
  background: #fff1ed;
  color: #7d2e20;
  padding: 10px 12px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.fc {
  --fc-border-color: #ded4c7;
  --fc-today-bg-color: rgba(143, 106, 61, 0.1);
  --fc-button-bg-color: #221f1b;
  --fc-button-border-color: #221f1b;
  --fc-button-hover-bg-color: #3a332b;
  --fc-button-hover-border-color: #3a332b;
  --fc-button-active-bg-color: #8f6a3d;
  --fc-button-active-border-color: #8f6a3d;
  font-size: 0.92rem;
}

.fc .fc-toolbar {
  align-items: center;
  gap: 10px;
}

.fc .fc-toolbar-title {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  letter-spacing: 0;
}

.fc .fc-button {
  border-radius: 8px;
  font-weight: 800;
  text-transform: none;
}

.fc .fc-event {
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  padding: 2px 4px;
}

@media (max-width: 980px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .details-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    padding-top: 22px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .heading-actions {
    flex-direction: column;
  }

  .integration-panel {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    flex-direction: column;
  }

  .fc .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }

  .fc .fc-button {
    padding: 0.36em 0.52em;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }
}
