/* ===========================================================
   STAYBEE DESIGN SYSTEM
   Brand: Dark navy + Bee yellow accent
   Company: StayBee — Stay Easy. Stay Happy.
   Display: Fraunces (editorial serif)
   Body/UI: Inter
   =========================================================== */

:root {
  /* StayBee Brand Colors */
  --ink: #1a2440;          /* Dark navy — primary text + sidebar */
  --ink-soft: #526070;     /* Muted slate */
  --teal: #1e6f8e;         /* Blue-teal — primary buttons & accents */
  --teal-dark: #145a75;
  --teal-pale: #e3f2f8;
  --coral: #f5a623;        /* Bee yellow — CTAs, highlights */
  --coral-dark: #d4880e;
  --coral-pale: #fff8e8;
  --sand: #f8f6f2;         /* Warm page background */
  --paper: #ffffff;
  --line: #e5e0d8;
  --success: #1f9254;
  --success-pale: #e4f5ea;
  --danger: #d6432f;
  --danger-pale: #fbe9e6;
  --warning: #c98a1e;
  --warning-pale: #faf0dc;

  /* Type */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(17, 48, 46, 0.08);
  --shadow-md: 0 8px 24px rgba(17, 48, 46, 0.10);
  --shadow-lg: 0 16px 40px rgba(17, 48, 46, 0.16);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--sand);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
.text-muted { color: var(--ink-soft); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--coral-dark); }
.btn-secondary { background: var(--teal); color: #fff; }
.btn-secondary:hover { background: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-outline { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-outline:hover { background: var(--teal-pale); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b8351f; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field .hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-pale);
}
textarea { resize: vertical; min-height: 90px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 600px) { .checkbox-grid { grid-template-columns: repeat(2, 1fr); } }
.error-text { color: var(--danger); font-size: 0.8rem; margin-top: 4px; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-success { background: var(--success-pale); color: var(--success); }
.badge-danger { background: var(--danger-pale); color: var(--danger); }
.badge-warning { background: var(--warning-pale); color: var(--warning); }
.badge-teal { background: var(--teal-pale); color: var(--teal-dark); }
.badge-coral { background: var(--coral-pale); color: var(--coral-dark); }

/* ---------- Top Nav (user) ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: #fff;
}
.topnav .container { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.brand { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); display: inline-block; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 0.9rem; }
.nav-links a { color: rgba(255,255,255,0.82); }
.nav-links a:hover { color: #fff; }
.nav-cta { display: flex; gap: 10px; align-items: center; }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(255,255,255,0.7); padding: 40px 0 28px; margin-top: 64px; }
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: #fff; }

/* ---------- Star rating ---------- */
.stars { color: var(--coral); font-size: 0.95rem; letter-spacing: 1px; }
.rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  max-width: 320px;
  animation: toast-in 0.2s ease;
}
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Loader / Empty / Skeleton ---------- */
.loader-row { display: flex; align-items: center; justify-content: center; padding: 40px 0; color: var(--ink-soft); gap: 10px; }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state .icon { font-size: 2.4rem; margin-bottom: 12px; }

/* ---------- Signature element: boarding-pass ticket stub ---------- */
.ticket {
  display: grid;
  grid-template-columns: 1fr 200px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}
.ticket-main { padding: 28px; }
.ticket-stub {
  background: var(--ink);
  color: #fff;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  position: relative;
}
.ticket-perforation {
  position: absolute;
  top: 0; bottom: 0; left: -1px;
  width: 24px;
  background-image: radial-gradient(circle at 12px 0, transparent 11px, var(--sand) 12px);
  background-size: 24px 24px;
  background-repeat: repeat-y;
}
.ticket-stub .code { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.02em; }
.ticket-stub .label { text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.08em; color: rgba(255,255,255,0.6); }
@media (max-width: 640px) {
  .ticket { grid-template-columns: 1fr; }
  .ticket-perforation { display: none; }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.divider { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.pagination button {
  width: auto; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 600; font-size: 0.85rem;
}
.pagination button.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--teal-pale); }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17,48,46,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal {
  background: var(--paper); border-radius: var(--radius-lg); max-width: 560px; width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 28px; box-shadow: var(--shadow-lg);
}

/* ---------- StayBee Extended Utilities ---------- */

/* Auth pages */
.auth-page { background: var(--ink); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-shell { width: 100%; max-width: 460px; padding: 24px; }
.auth-card { background: var(--paper); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo img { max-width: 160px; margin: 0 auto 8px; }
.auth-title { font-size: 1.5rem; margin-bottom: 4px; text-align: center; }
.auth-subtitle { text-align: center; color: var(--ink-soft); margin-bottom: 24px; font-size: 0.9rem; }
.auth-links { margin-top: 20px; text-align: center; font-size: 0.88rem; color: var(--ink-soft); }
.auth-links a { color: var(--teal); font-weight: 500; }
.auth-links .sep { margin: 0 8px; }

/* Form system (admin + owner forms) */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.form-input { width: 100%; font-family: var(--font-body); font-size: 0.95rem; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); }
.form-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-pale); }
.form-stack { display: flex; flex-direction: column; gap: 0; }
.form-stack .form-group { margin-bottom: 14px; }
.btn-full { width: 100%; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: auto; margin: 0; }

/* Alert variants */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 12px; }
.alert-success { background: var(--success-pale); color: var(--success); }
.alert-danger { background: var(--danger-pale); color: var(--danger); }
.alert-warning { background: var(--warning-pale); color: var(--warning); }
.alert-info { background: var(--teal-pale); color: var(--teal-dark); }

/* Card header/title for admin+owner pages */
.card { background: var(--paper); border-radius: var(--radius-md); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; font-family: var(--font-body); }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); padding: 10px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-body); font-weight: 600; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--sand); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty-state p { margin: 0; }
.empty-state a { color: var(--teal); font-weight: 500; }

/* Modal backdrop */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(26,36,64,0.55);
  display: none; align-items: center; justify-content: center; z-index: 300; padding: 20px;
}
.modal-backdrop[style*="flex"] { display: flex !important; }
.modal { background: var(--paper); border-radius: var(--radius-lg); width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-soft); padding: 0; line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { display: flex; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); }

/* Sidebar brand */
.sidebar-brand { margin-bottom: 24px; padding: 0 8px; }
.sidebar-brand .sidebar-logo { max-width: 130px; margin-bottom: 4px; }
.sidebar-brand-sub { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.45); margin-top: 4px; }

/* Brand logo in nav */
.brand-logo { height: 36px; width: auto; }
.brand-logo-sm { height: 28px; width: auto; }

/* Pagination (page-btn alias) */
.page-btn { width: auto; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.page-btn.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.page-btn:hover:not(.active) { background: var(--sand); }

/* Amenities and facilities grids */
.amenities-check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 20px; }
@media (max-width: 700px) { .amenities-check-grid { grid-template-columns: repeat(2, 1fr); } }
.facilities-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px 20px; }

/* Quick actions grid */
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px 20px; }
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 20px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--sand);
  font-size: 0.85rem; font-weight: 600; color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}
.quick-action-btn:hover { background: var(--teal-pale); border-color: var(--teal); color: var(--teal); }
.quick-action-btn .qa-ico { font-size: 1.4rem; }

/* Detail grid for modal detail views */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.detail-grid .label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); font-weight: 600; }
@media (max-width: 500px) { .detail-grid { grid-template-columns: 1fr; } }
