:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --line: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.brand h1 { margin: 0; font-size: 20px; font-weight: 900; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.nav-cta { padding: 10px 16px; border-radius: 999px; background: #eef2ff; color: var(--primary-dark); font-weight: 800; }

.hero-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 22px 32px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 38px;
  align-items: center;
}
.eyebrow { display: inline-block; color: var(--primary); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.eyebrow.white { color: #c7d2fe; }
.hero-content h2, .section-heading h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 950;
}
.hero-content p { margin: 20px 0 0; max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-card { position: relative; min-height: 430px; border-radius: 34px; overflow: hidden; box-shadow: var(--shadow); background: white; }
.hero-card img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.floating-price { position: absolute; left: 22px; bottom: 22px; padding: 18px 20px; border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.floating-price span, .floating-price small { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.floating-price strong { display: block; color: var(--primary); font-size: 28px; font-weight: 950; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 13px 22px; border-radius: 16px; font-weight: 900; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 14px 32px rgba(79, 70, 229, .28); }
.btn-secondary { background: white; color: var(--primary-dark); border: 1px solid var(--line); }
.btn-outline { background: white; color: var(--text); border: 2px solid var(--line); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.section-wrap { max-width: 1180px; margin: 0 auto; padding: 46px 22px; }
.small-section { padding-top: 20px; }
.section-heading { text-align: center; margin-bottom: 28px; }
.section-heading.left { text-align: left; margin-bottom: 26px; }
.section-heading.left h2 { font-size: 34px; }
.section-heading p { color: var(--muted); margin: 10px 0 0; line-height: 1.6; }
.room-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.room-card { background: var(--card); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: 0 20px 60px rgba(15, 23, 42, .08); }
.room-card img { width: 100%; height: 260px; object-fit: cover; }
.room-card-body { padding: 24px; }
.room-card h3 { margin: 0; font-size: 26px; font-weight: 950; }
.room-card p { color: var(--muted); line-height: 1.6; }
.room-facilities { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.room-facilities span { padding: 7px 10px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 12px; font-weight: 800; }
.room-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 20px; }
.room-price strong { display: block; color: var(--primary); font-size: 24px; font-weight: 950; }
.room-price small { color: var(--muted); font-weight: 700; }

.booking-layout { max-width: 1180px; margin: 0 auto; padding: 44px 22px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.booking-card, .summary-card, .invoice-search-card { background: var(--card); border: 1px solid var(--line); border-radius: 30px; padding: 28px; box-shadow: 0 18px 55px rgba(15, 23, 42, .07); }
form { display: grid; gap: 18px; }
.form-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label, .input-title { display: grid; gap: 8px; color: #334155; font-size: 14px; font-weight: 900; }
input, select, textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 16px; padding: 13px 14px; background: white; color: var(--text); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.payment-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.payment-options label { display: flex; align-items: center; gap: 8px; padding: 13px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; background: #fff; }
.payment-options input { width: auto; accent-color: var(--primary); }
.summary-card { position: sticky; top: 94px; }
.summary-card h3 { margin: 0 0 18px; font-size: 24px; font-weight: 950; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #f1f5f9; color: var(--muted); }
.summary-row strong { color: var(--text); text-align: right; }
.summary-total { margin-top: 18px; padding: 18px; border-radius: 20px; background: #eef2ff; display: flex; justify-content: space-between; align-items: center; font-weight: 950; }
.summary-total strong { color: var(--primary); font-size: 26px; }
.summary-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.invoice-search-card { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; }
.invoice-search-card h2 { margin: 0; font-size: 28px; font-weight: 950; }
.invoice-search-card p { color: var(--muted); margin: 8px 0 0; }
.invoice-search-box { display: flex; gap: 10px; min-width: 430px; }
.invoice-search-box input { min-width: 260px; }

.modal { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .62); backdrop-filter: blur(8px); }
.modal.hidden { display: none !important; }
.modal-box { width: min(560px, 100%); border-radius: 30px; background: white; overflow: hidden; box-shadow: 0 34px 90px rgba(0,0,0,.28); }
.modal-head { padding: 28px; color: white; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.modal-head h2 { margin: 0; font-size: 30px; font-weight: 950; }
.modal-head p { margin: 8px 0 0; color: #e0e7ff; }
.modal-body { padding: 24px; display: grid; gap: 12px; }
.modal-row { display: flex; justify-content: space-between; gap: 18px; padding: 12px 14px; border-radius: 14px; background: #f8fafc; color: var(--muted); }
.modal-row strong { color: var(--text); text-align: right; }
.modal-total { background: #eef2ff; color: var(--text); font-size: 20px; }
.modal-total strong { color: var(--primary); font-size: 28px; }
.modal-actions { display: flex; gap: 12px; padding: 0 24px 24px; }
.modal-actions .btn { flex: 1; }
.modal-actions.vertical { display: grid; padding: 0; margin-top: 22px; }
.success-box { padding: 30px; text-align: center; }
.success-icon { margin: 0 auto 16px; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: #dcfce7; color: #16a34a; }
.success-icon svg { width: 38px; height: 38px; }
.success-box h2 { margin: 0; font-size: 30px; font-weight: 950; }
.success-box p { color: var(--muted); line-height: 1.6; }
.success-code { margin: 18px auto 10px; padding: 16px 18px; border-radius: 18px; background: #eef2ff; color: var(--primary); font-size: 28px; font-weight: 950; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.success-status { padding: 10px 12px; border-radius: 14px; background: #f1f5f9; color: #475569; font-size: 13px; font-weight: 800; }
.success-status.ok { background: #dcfce7; color: #166534; }
.success-status.warn { background: #fef3c7; color: #92400e; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10000; max-width: 360px; padding: 14px 16px; border-radius: 16px; background: #0f172a; color: white; box-shadow: var(--shadow); font-weight: 800; }
.toast.hidden { display: none; }

@media (max-width: 920px) {
  .hero-section, .booking-layout, .invoice-search-card { grid-template-columns: 1fr; }
  .hero-card { min-height: 340px; }
  .room-grid { grid-template-columns: 1fr; }
  .summary-card { position: relative; top: auto; }
  .invoice-search-box { min-width: 0; }
}
@media (max-width: 640px) {
  .nav-cta { display: none; }
  .hero-section { padding-top: 40px; }
  .form-grid.two, .payment-options { grid-template-columns: 1fr; }
  .invoice-search-box { flex-direction: column; }
  .modal-actions { flex-direction: column; }
  .room-footer { flex-direction: column; align-items: stretch; }
}

/* === Global Dashboard Sidebar Collapse === */
#app-container:not(.hidden) {
  display: flex;
  min-width: 0;
}

#main-sidebar {
  width: 17rem;
  transition: width 0.28s ease;
  overflow: hidden;
}

#app-container > .flex-1 {
  min-width: 0;
  transition: width 0.28s ease;
}

.sidebar-top,
.sidebar-brand,
.sidebar-btn,
#logout-btn,
.sidebar-user-wrap,
.sidebar-brand-text,
.sidebar-user-text,
.sidebar-section-title,
.sidebar-category {
  transition: all 0.25s ease;
}

.sidebar-category {
  pointer-events: none;
}

.sidebar-collapsed #main-sidebar {
  width: 76px;
}

.sidebar-collapsed .sidebar-top {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
  padding-right: 6px;
  height: 88px;
}

.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .sidebar-category,
.sidebar-collapsed .sidebar-btn span,
.sidebar-collapsed .sidebar-user-text,
.sidebar-collapsed .logout-label {
  opacity: 0;
  width: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-collapsed .sidebar-btn,
.sidebar-collapsed #logout-btn {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed .sidebar-btn {
  width: 100%;
}

.sidebar-collapsed .sidebar-user-wrap {
  justify-content: center;
}

.sidebar-collapsed #logout-btn {
  width: 42px;
  margin-left: auto;
  margin-right: auto;
}

.sidebar-collapsed #logout-btn i {
  margin: 0;
}

@media (max-width: 1024px) {
  .sidebar-collapsed #main-sidebar {
    width: 72px;
  }
}

/* Top-bar alignment stays stable across role/menu when search is toggled. */
#topbar-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

#topbar-search-slot {
  flex: 1 1 32rem;
  max-width: 32rem;
}

#topbar-meta-group {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding-left: 0;
  margin-left: auto;
}

