/* LivinIn — shared design system (category standard) */
/* Bar: Airbnb, Booking.com, Agoda. Clean grid, photography-led, soft elevation. */

:root {
  --bg: #fafafa;
  --ink: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --accent: #e8543f;
  --accent-hover: #e07a5f;
  --accent-text: #111827;
  --accent-soft: rgba(232, 84, 63, 0.1);
  --success: #16a34a;
  --warn: #d97706;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --grid: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Type tokens (purpose-named, not values) */
  --font-body:
    "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --font-display:
    "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --fw-display: 700;
  --fw-heading: 600;
  --fw-body: 400;
  --fw-label: 500;
  --fw-data: 500;
  --fs-display: 2.5rem;
  --fs-heading: 1.25rem;
  --fs-body: 1rem;
  --fs-label: 0.875rem;
  --fs-caption: 0.75rem;
  --fs-data: 1rem;
  --lh-display: 1.05;
  --lh-heading: 1.2;
  --lh-body: 1.6;
  --lh-data: 1.25;
  --tracking-label: 0.12em;
  --tracking-display: -0.02em;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 calc(var(--grid) + env(safe-area-inset-right)) 0
    max(12px, calc(var(--grid) * 3 + env(safe-area-inset-left)));
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 0;
}

.brand .mark,
.auth-brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent-text);
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 4px var(--accent-soft);
}

.nav-links {
  display: none;
  gap: 28px;
  align-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.active {
  color: var(--ink);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.05s;
}

/* Booking step rail */
.steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
}
@media (max-width: 480px) {
  .steps {
    font-size: 11.5px;
    gap: 5px;
  }
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  padding: 10px 20px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
  padding: 8px 16px;
}

.btn-ghost:hover {
  background: #f3f4f6;
  border-color: var(--border);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.btn-icon:hover {
  background: #f3f4f6;
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
}

/* ---------- Search pill ---------- */
.search-hero {
  position: relative;
  padding: calc(var(--grid) * 6) var(--grid) calc(var(--grid) * 8);
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  border-bottom: 1px solid var(--border);
}

.search-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding-bottom: var(--space-5);
}

.search-pill {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  overflow: visible;
  width: 100%;
}

.search-fields {
  display: flex;
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--border);
}

.search-field {
  flex: 1;
  padding: 14px 20px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.search-field:last-child {
  border-right: none;
}

.search-field label {
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}

.search-field input,
.search-field select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  width: 100%;
  min-width: 0;
}

.search-field input::placeholder {
  color: var(--muted);
}

.search-submit {
  flex: 0 0 auto;
  padding: 0 28px;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  font-weight: 700;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}

.search-submit:hover {
  background: var(--accent-hover);
}

.search-submit:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.search-submit:active {
  transform: translateY(1px);
}

.search-submit span {
  font-size: 15px;
  line-height: 1;
  transition: transform 0.15s;
}

.search-submit:hover span {
  transform: translateX(2px);
}

.search-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  max-width: 720px;
}

/* ---------- Category chips ---------- */
.chip-bar {
  display: flex;
  gap: 8px;
  padding: calc(var(--grid) * 4) var(--grid);
  overflow-x: auto;
  scrollbar-width: none;
  top: 64px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
}

.chip-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.chip .icon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.7;
}

/* ---------- Section header ---------- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: calc(var(--grid) * 5) var(--grid) calc(var(--grid) * 4);
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-heading);
  font-weight: var(--fw-heading);
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

.section-sub {
  font-size: var(--fs-caption);
  color: var(--muted);
  font-weight: var(--fw-body);
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 24px;
  padding: 0 var(--grid) calc(var(--grid) * 6);
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.property-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}

.card-photo {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #e5e7eb;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.property-card:hover .card-photo img {
  transform: scale(1.03);
}

.card-heart {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  z-index: 3;
  transition:
    transform 0.1s,
    color 0.15s,
    background 0.15s;
  padding: 8px;
}

.card-heart:active {
  transform: scale(0.9);
}
.card-heart.liked {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.card-location {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.card-price {
  font-size: var(--fs-data);
  font-weight: var(--fw-data);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.card-price .per-night {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

/* ---------- Honesty band ---------- */
.honesty-band {
  max-width: 1080px;
  margin: 0 auto calc(var(--grid) * 8);
  padding: calc(var(--grid) * 4) var(--grid);
  text-align: center;
}

.honesty-text {
  font-size: 13px;
  color: var(--muted);
}

.honesty-text strong {
  color: var(--ink);
}

/* ---------- Mobile drawer ---------- */
.mobile-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: 280px;
  transform: translateX(100%);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.25s ease;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-right: auto;
  font-size: 20px;
  line-height: 1;
}

.drawer-body {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}

.drawer-item:hover {
  background: #f3f4f6;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Empty state ---------- */
.empty-state {
  max-width: 480px;
  margin: 40px auto;
  text-align: center;
  padding: 40px var(--grid);
}

.empty-state h2 {
  font-size: var(--fs-heading);
  font-weight: var(--fw-heading);
  margin-bottom: var(--space-2);
  text-wrap: balance;
}
.empty-state p {
  color: var(--muted);
  font-size: var(--fs-caption);
  margin-bottom: var(--space-3);
  text-wrap: pretty;
}

/* ---------- Type roles ---------- */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}
.val {
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-data);
  font-size: var(--fs-data);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 100px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 60;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.25s,
    opacity 0.25s;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 420px;
  transform: translateY(20px);
  transition: transform 0.2s;
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.modal p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Stat grid & Dashboard Utilities ---------- */
.dash-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.data-table thead tr {
  border-bottom: 1px solid var(--border);
  background: #f9fafb;
}

.data-table th {
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #fdfdfd;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active,
.badge.active,
.badge.confirmed,
.badge.paid {
  background: #dcfce7;
  color: #166534;
}
.badge-pending,
.badge.pending,
.badge.pending_payment {
  background: #fef3c7;
  color: #92400e;
}
.badge-rejected,
.badge.rejected,
.badge.cancelled,
.badge.failed,
.badge.inactive {
  background: #fee2e2;
  color: #991b1b;
}
.badge-completed {
  background: #d1fae5;
  color: #065f46;
}
.badge-draft {
  background: #f3f4f6;
  color: #4b5563;
}

/* ---------- Account pages (profile / trips / wishlist) ---------- */
.account-wrap {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.account-nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.account-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #e5e7eb;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 auto 12px;
  border: 3px solid var(--border);
}

.account-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.account-role-badge {
  margin-bottom: 20px;
}

.account-nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.account-nav-links a,
.account-nav-links button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-nav-links a:hover,
.account-nav-links button:hover {
  background: #f3f4f6;
}

.account-nav-links a.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.account-nav-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.account-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.account-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.account-card-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.account-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.account-field:last-child {
  border-bottom: none;
}
.account-field .key {
  color: var(--muted);
}
.account-field .val {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

/* Form blocks inside account cards */
.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 6px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.form-section-sub {
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
}
.form-note {
  margin: 2px 0 18px;
  font-size: 12px;
  color: var(--muted);
}
.form-note strong {
  color: var(--ink);
  font-weight: 600;
}

.form-error {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #dc2626;
}

.auth-field.is-invalid input {
  border-color: #dc2626;
}
.auth-field.is-invalid input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Tables sit flush inside an account card */
.account-card .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

@media (min-width: 1024px) {
  .account-card .data-table th {
    white-space: nowrap;
  }
  .account-card .data-table th,
  .account-card .data-table td {
    padding-left: 12px;
    padding-right: 12px;
  }
  .account-card .data-table th:first-child,
  .account-card .data-table td:first-child {
    padding-left: 0;
  }
  .account-card .data-table th:last-child,
  .account-card .data-table td:last-child {
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  .account-wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .account-nav-card {
    padding: 18px 16px;
  }
  .account-avatar {
    width: 64px;
    height: 64px;
    font-size: 24px;
    margin-bottom: 8px;
  }
  .account-role-badge {
    margin-bottom: 12px;
  }
  .account-nav-links a,
  .account-nav-links button {
    padding: 9px 12px;
    font-size: 13px;
  }
  .account-card {
    padding: 20px 16px;
  }
  .account-card-title {
    font-size: 18px;
  }
  .account-field {
    font-size: 13px;
  }
}

/* ---------- User Menu Topbar ---------- */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
}
.user-menu-btn:hover {
  box-shadow: var(--shadow-sm);
  border-color: #d1d5db;
}
.user-menu-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 50;
  display: none;
}
.user-dropdown.show {
  display: block;
}
.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.user-dropdown a:hover,
.user-dropdown button:hover {
  background: #f3f4f6;
}
.user-dropdown .divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* ---------- Auth Pages ---------- */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 12px;
  text-decoration: none;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
  background: #ffffff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.auth-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  cursor: pointer;
}

.auth-row a {
  color: var(--accent);
  font-weight: 500;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.auth-submit-btn:hover {
  background: var(--accent-hover);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-login-btn {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}

.google-login-btn:hover {
  border-color: #d1d5db;
  background: #fafafa;
  box-shadow: var(--shadow-sm);
}

.google-login-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.google-logo {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.quick-login-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-login-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.quick-login-btn:hover {
  border-color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.quick-login-btn .role-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.quick-login-btn.guest .role-tag {
  background: #fee2e2;
  color: #b91c1c;
}
.quick-login-btn.host .role-tag {
  background: #dcfce7;
  color: #166534;
}
.quick-login-btn.admin .role-tag {
  background: #dbeafe;
  color: #1e40af;
}

.quick-login-btn .name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 24px;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- Site footer (guest pages) ---------- */
.site-footer {
  margin-top: 48px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 44px 0 28px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--grid);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.footer-col h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-note {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 34ch;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

@media (max-width: 1023.98px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
  }
}

@media (max-width: 767.98px) {
  .site-footer {
    padding: 32px 0 88px;
  }
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

/* ---------- Mobile shell: bottom navigation ---------- */
.bottom-nav {
  display: none;
}

@media (max-width: 1023.98px) {
  .bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 55;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(17, 24, 39, 0.06);
  }

  .bottom-nav .bn-item {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    max-width: 104px;
    min-width: 44px;
    min-height: 48px;
    padding: 4px 4px 3px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.005em;
    line-height: 1.2;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition:
      color 0.15s ease,
      background 0.15s ease;
  }

  .bottom-nav .bn-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bottom-nav .bn-item.is-active {
    color: var(--role-accent, var(--accent));
    font-weight: 700;
  }

  .bottom-nav .bn-item.is-active .bn-icon {
    stroke-width: 2;
  }

  .bottom-nav .bn-item:active {
    background: #f3f4f6;
  }

  .bottom-nav .bn-item:focus-visible {
    outline: 2px solid var(--role-accent, var(--accent));
    outline-offset: -2px;
  }

  body.has-bottom-nav {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .bottom-nav {
    padding-left: 2px;
    padding-right: 2px;
  }
  .bottom-nav .bn-item {
    font-size: 9.5px;
    letter-spacing: 0;
    padding: 4px 2px 3px;
  }
  .bottom-nav .bn-icon {
    width: 20px;
    height: 20px;
  }
}

/* ---------- Tablet: tables become stacked cards ---------- */
@media (max-width: 1023.98px) {
  .data-table thead {
    display: none;
  }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table {
    font-size: 13px;
  }
  .table-wrap {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .data-table tbody tr {
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .data-table tbody tr:last-child {
    margin-bottom: 0;
  }
  .data-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    text-align: right;
    white-space: normal;
  }
  .data-table td:last-child {
    border-bottom: 0;
  }
  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
  }
  .data-table td:first-child {
    display: block;
    padding: 12px 14px;
    text-align: left;
    background: #fafafa;
  }
  .data-table td:first-child::before {
    display: none;
  }
  .data-table td[colspan] {
    display: block;
    text-align: center;
  }
  .data-table td[colspan]::before {
    display: none;
  }
}

/* ---------- Tablet: compact search instrument ---------- */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .search-field {
    padding: 12px 14px;
  }
  .search-field label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .search-field input,
  .search-field select {
    font-size: 14px;
  }
  .search-submit {
    padding: 0 18px;
    font-size: 12.5px;
  }
}

/* ---------- Narrow desktop: keep wide tables from clipping ---------- */
@media (min-width: 1024px) and (max-width: 1300px) {
  .data-table {
    font-size: 13px;
  }
  .data-table th,
  .data-table td {
    padding: 12px;
  }
  .data-table th {
    white-space: normal;
  }

  /* dashboards already have a sidebar; the duplicate top links do not fit */
  body:has(.sidebar) .topbar .nav-links {
    display: none;
  }
}

/* ---------- Mobile refinements ---------- */
@media (max-width: 767.98px) {
  .topbar {
    gap: 10px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .brand {
    font-size: 17px;
  }
  .topbar-actions {
    gap: 8px;
    margin-left: auto;
  }
  .topbar-actions > div > span {
    display: none;
  }
  .topbar-actions .btn {
    padding: 8px 12px !important;
    font-size: 12.5px !important;
  }

  /* Search instrument: one stacked sheet instead of a clipped row */
  .search-pill {
    display: block;
    border-radius: 16px;
  }
  .search-fields {
    display: block;
    border-right: 0;
  }
  .search-field {
    width: 100%;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .search-field:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .search-field label {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .search-field input,
  .search-field select {
    width: 100%;
    font-size: 16px;
    min-height: 26px;
    padding: 0;
  }
  .search-submit {
    width: 100%;
    padding: 14px 16px;
    justify-content: center;
    font-size: 13px;
    letter-spacing: 0.08em;
  }

  .section-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 20px var(--grid) 16px;
  }
  .section-header > div {
    min-width: 0;
  }
  .section-title {
    font-size: 21px;
  }

  .chip-bar {
    padding: 14px var(--grid);
  }

  .dash-inner {
    padding: 20px 16px 28px !important;
  }
  .dashboard-main {
    min-height: 100dvh;
  }

  .stat-grid {
    gap: 12px;
    margin-bottom: 20px;
  }
  .stat-grid > div {
    padding: 18px !important;
  }

  .dashboard-main
    div[style*="display:flex"][style*="justify-content:space-between"][style*="align-items:center"] {
    flex-wrap: wrap;
    gap: 10px;
  }
  .dashboard-main
    div[style*="display:flex"][style*="justify-content:space-between"][style*="align-items:center"]
    > div {
    min-width: 0;
  }

  .form-group input,
  .form-group select,
  .auth-field input,
  .auth-field select,
  .form-group textarea {
    font-size: 16px;
  }

  .auth-card {
    padding: 28px 20px;
  }
  .auth-page {
    padding: 24px 16px;
  }

  .modal {
    width: calc(100% - 32px);
    padding: 20px;
  }
}
