.guests-page,
.guest-profile-page {
  --guest-ivory: #e7e2d6;
  --guest-linen: #f7f3ea;
  --guest-ink: #1f2a24;
  --guest-green: #2f3d34;
  --guest-sage: #7d877e;
  --guest-muted: #6f766f;
  --guest-border: #d8d2c4;
  --guest-wine: #8d4a43;
  display: grid;
  gap: 1.5rem;
  color: var(--guest-ink);
  font-family: "Sora", system-ui, sans-serif;
}

.guests-page__head,
.guest-profile-page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--guest-border);
}

.guests-page__eyebrow,
.guest-profile-page__eyebrow {
  margin-bottom: .4rem;
  color: var(--guest-muted);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.guests-page__title,
.guest-profile-page__title {
  margin: 0;
  color: var(--guest-ink);
  font: 600 clamp(1.7rem, 3vw, 2.35rem)/1.2 "Sora", system-ui, sans-serif;
}

.guests-page__subtitle,
.guest-profile-page__subtitle {
  margin: .45rem 0 0;
  color: var(--guest-muted);
  font: 1rem/1.6 "Lora", Georgia, serif;
}

.guests-search-panel {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--guest-border);
  border-radius: .75rem;
  background: var(--guest-linen);
}

.guests-search-panel__field { flex: 1 1 22rem; }

.guests-search-panel input[type="search"],
.guest-profile-field input {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--guest-border);
  border-radius: .45rem;
  outline: 0;
  background: #fffaf1;
  color: var(--guest-ink);
  font: .95rem "Sora", system-ui, sans-serif;
}

.guests-search-panel input[type="search"] { padding: .65rem .85rem; }

.guests-search-panel input[type="search"]:focus,
.guest-profile-field input:focus {
  border-color: var(--guest-green);
  box-shadow: 0 0 0 3px rgba(47, 61, 52, .12);
}

.guests-button,
.guest-profile-save {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--guest-border);
  border-radius: .45rem;
  background: transparent;
  color: var(--guest-ink);
  padding: .6rem 1rem;
  font: 500 .86rem "Sora", system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.guests-button:hover { border-color: var(--guest-sage); background: rgba(125, 135, 126, .1); color: var(--guest-ink); }
.guests-button--primary,
.guest-profile-save { border-color: var(--guest-green); background: var(--guest-green); color: var(--guest-linen); }
.guests-button--primary:hover,
.guest-profile-save:hover { border-color: var(--guest-ink); background: var(--guest-ink); color: var(--guest-linen); }
.guests-button.is-disabled { opacity: .48; cursor: not-allowed; }

.guests-table-card,
.guest-profile-card {
  overflow: hidden;
  border: 1px solid var(--guest-border);
  border-radius: .75rem;
  background: var(--guest-linen);
}

.guests-table-card__head,
.guest-profile-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
}

.guests-table-card__head h3,
.guest-profile-card__head h3 {
  margin: 0;
  font: 600 1.1rem "Sora", system-ui, sans-serif;
}

.guest-profile-card__head h3 span { color: var(--guest-muted); font-weight: 400; }

.guests-table-card__count,
.guest-profile-page__visit-count {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border: 1px solid var(--guest-border);
  border-radius: 999px;
  padding: .3rem .65rem;
  color: var(--guest-muted);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
}

.guests-table { width: 100%; min-width: 58rem; border-collapse: collapse; }
.guests-table th,
.guests-table td {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--guest-border);
  color: var(--guest-ink);
  font-size: .88rem;
  vertical-align: middle;
}
.guests-table th {
  background: rgba(231, 226, 214, .55);
  color: var(--guest-muted);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.guests-table th a { color: inherit; text-decoration: none; }
.guests-table th a:hover { color: var(--guest-green); }
.guests-table tr:last-child td { border-bottom: 0; }
.guests-table__row { cursor: pointer; transition: background-color 150ms ease; }
.guests-table__row:hover { background: rgba(125, 135, 126, .09); }
.guests-table__row:focus-visible { outline: 2px solid var(--guest-green); outline-offset: -2px; }
.guests-table__name { color: var(--guest-green); font-weight: 600; text-decoration: none; }
.guests-table__name:hover { color: var(--guest-ink); text-decoration: underline; }
.guests-table__empty { padding: 3rem !important; color: var(--guest-muted) !important; text-align: center; font-family: "Lora", Georgia, serif; }

.guests-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--guest-muted);
  font-size: .85rem;
}
.guests-pagination__actions { display: flex; gap: .5rem; }

.guest-profile-page__back {
  display: inline-flex;
  margin-bottom: 1.15rem;
  color: var(--guest-muted);
  font-size: .82rem;
  text-decoration: none;
}
.guest-profile-page__back:hover { color: var(--guest-green); text-decoration: underline; }
.guest-profile-page__grid { display: grid; grid-template-columns: minmax(18rem, .72fr) minmax(0, 1.28fr); gap: 1.5rem; align-items: start; }
.guest-profile-card { padding: 0; }
.guest-profile-card--visits { min-width: 0; }

.guest-profile-form { display: grid; gap: 1rem; padding: 0 1.25rem 1.25rem; }
.guest-profile-field,
.guest-profile-readonly { display: grid; gap: .4rem; }
.guest-profile-field > span,
.guest-profile-field__label,
.guest-profile-readonly > span { color: var(--guest-muted); font-size: .76rem; font-weight: 500; letter-spacing: .04em; }
.guest-profile-field input { padding: .65rem .8rem; }
.guest-profile-readonly { padding-top: .2rem; }
.guest-profile-readonly p { margin: 0; color: var(--guest-ink); font: .95rem/1.55 "Lora", Georgia, serif; }

.guest-profile-switch { display: flex; align-items: center; gap: .7rem; cursor: pointer; color: var(--guest-ink); font-size: .88rem; }
.guest-profile-switch input { position: absolute; opacity: 0; pointer-events: none; }
.guest-profile-switch__control { position: relative; width: 2.35rem; height: 1.35rem; border: 1px solid var(--guest-border); border-radius: 999px; background: var(--guest-ivory); transition: background 150ms ease, border-color 150ms ease; }
.guest-profile-switch__control::after { position: absolute; top: .17rem; left: .18rem; width: .88rem; height: .88rem; border-radius: 50%; background: var(--guest-muted); content: ""; transition: transform 150ms ease, background 150ms ease; }
.guest-profile-switch input:checked + .guest-profile-switch__control { border-color: var(--guest-green); background: var(--guest-green); }
.guest-profile-switch input:checked + .guest-profile-switch__control::after { background: var(--guest-linen); transform: translateX(.98rem); }
.guest-profile-switch input:focus-visible + .guest-profile-switch__control { outline: 2px solid var(--guest-green); outline-offset: 3px; }

.guest-profile-mailing-lists { display: grid; gap: .5rem; margin-top: .55rem; }
.guest-profile-mailing-list { display: flex; align-items: flex-start; gap: .65rem; padding: .7rem .8rem; border: 1px solid var(--guest-border); border-radius: .45rem; background: #fffaf1; cursor: pointer; }
.guest-profile-mailing-list input { margin-top: .2rem; accent-color: var(--guest-green); }
.guest-profile-mailing-list span { display: grid; gap: .15rem; }
.guest-profile-mailing-list strong { font-size: .86rem; font-weight: 500; }
.guest-profile-mailing-list small { color: var(--guest-muted); font: .84rem/1.4 "Lora", Georgia, serif; }

.guest-profile-visits-wrap { overflow-x: auto; }
.guest-profile-visits { width: 100%; min-width: 38rem; border-collapse: collapse; }
.guest-profile-visits th,
.guest-profile-visits td { padding: .9rem 1.1rem; border-bottom: 1px solid var(--guest-border); color: var(--guest-ink); font-size: .86rem; text-align: left; vertical-align: top; }
.guest-profile-visits th { background: rgba(231, 226, 214, .55); color: var(--guest-muted); font-size: .72rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.guest-profile-visits tr:last-child td { border-bottom: 0; }
.guest-profile-visits__empty { padding: 3rem !important; color: var(--guest-muted) !important; text-align: center; font-family: "Lora", Georgia, serif; }

@media (max-width: 900px) {
  .guest-profile-page__grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .guests-page,
  .guest-profile-page { gap: 1rem; }
  .guests-page__head,
  .guest-profile-page__head,
  .guests-search-panel,
  .guests-pagination { align-items: stretch; flex-direction: column; }
  .guests-search-panel { padding: .8rem; }
  .guests-search-panel__field { flex-basis: auto; }
  .guests-button { width: 100%; }
  .guests-pagination__actions { width: 100%; }
  .guests-pagination__actions .guests-button { flex: 1; }
  .guests-table { min-width: 0; }
  .guests-table thead { display: none; }
  .guests-table,
  .guests-table tbody,
  .guests-table tr,
  .guests-table td { display: block; width: 100%; }
  .guests-table__row { padding: .8rem 1rem; border-bottom: 1px solid var(--guest-border); }
  .guests-table__row:last-child { border-bottom: 0; }
  .guests-table td { border-bottom: 0; padding: .28rem 0; overflow-wrap: anywhere; }
  .guests-table td:not([colspan])::before { display: block; margin-bottom: .1rem; color: var(--guest-muted); content: attr(data-label); font-size: .67rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; }
  .guests-table__empty { text-align: center; }
  .guest-profile-visits { min-width: 34rem; }
}
