:root {
  --primary: #66ddff;
  --primary-dark: #4db8cc;
  --secondary: #4caf50;
  --bg-dark: #061018;
  --bg-surface: #0a1822;
  --card: #112233;
  --text: #ffffff;
  --text-secondary: #b0bec5;
  --text-hint: #78909c;
  --divider: #1e3a4c;
  --error: #cf6679;
  --success: #4caf50;
  --warning: #ffb74d;
  --nav-h: 64px;
  --max-w: 960px;
  --radius: 12px;
  --radius-sm: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-dark);
  color: var(--text);
}

body {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

a { color: var(--primary); }

.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
}

.panel { display: none; padding: 1rem 1rem 1.5rem; animation: fadeIn .2s ease; }
.panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.hero {
  background: linear-gradient(135deg, #0a1822 0%, #112233 45%, #1a3350 100%);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
}

.hero-logo {
  display: block;
  max-width: min(280px, 78vw);
  height: auto;
  margin: 0 auto .15rem;
}

.hero .tagline {
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85rem;
  letter-spacing: .01em;
  line-height: 1.4;
  margin: 0;
  padding: 0 .5rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin: 1rem 0;
}

.chip {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .35rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: rgba(102, 221, 255, .08);
  color: var(--primary);
}

.chip.success { background: rgba(76, 175, 80, .15); color: var(--success); border-color: rgba(76, 175, 80, .35); }
.chip.warning { background: rgba(255, 183, 77, .2); color: #061018; border-color: var(--warning); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: .75rem 0 1rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: .7rem 1.1rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}

.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--bg-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--divider);
}

.btn-sm { padding: .45rem .75rem; font-size: .85rem; }

.card {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: .85rem;
}

.card h2, .card h3 {
  margin: 0 0 .65rem;
  font-size: 1.1rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 .35rem;
}

.section-sub {
  color: var(--text-secondary);
  font-size: .9rem;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .85rem;
}

.room-card {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.room-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: linear-gradient(135deg, #0a1822, #1a3350);
}

.room-card .body { padding: .85rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; }

.room-card h3 { margin: 0; font-size: 1rem; }

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  color: var(--text-secondary);
  font-size: .85rem;
}

.room-desc {
  color: var(--text-hint);
  font-size: .85rem;
  line-height: 1.4;
  margin: .25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.room-card .actions { margin-top: auto; padding-top: .5rem; }

.price { color: var(--primary); font-weight: 700; }

.field { margin-bottom: .85rem; }

.field label {
  display: block;
  font-size: .85rem;
  color: var(--text-secondary);
  margin-bottom: .35rem;
}

.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .65rem .75rem;
  font-size: 1rem;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(102, 221, 255, .15);
}

.field input:read-only {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, .04);
  cursor: default;
}

.field-hint { font-size: .8rem; color: var(--text-hint); margin-top: .25rem; }

.field-error { font-size: .8rem; color: var(--error); margin-top: .25rem; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.filter-row .btn.active {
  background: rgba(102, 221, 255, .15);
  border-color: var(--primary);
  color: var(--primary);
}

.search-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.search-row input { flex: 1; min-width: 180px; }

.inline-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-secondary);
  font-size: .9rem;
  margin: .5rem 0;
}

.radio-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: .35rem 0 .75rem;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.empty, .loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 1rem;
}

.loading::after {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: .5rem;
  border: 2px solid var(--divider);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-surface);
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  background: none;
  border: none;
  color: var(--text-hint);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  padding: .35rem;
  max-width: 5.5rem;
}

.nav-item svg { width: 22px; height: 22px; }

.nav-item.active { color: var(--primary); }

.toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  pointer-events: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: min(100%, 420px);
  max-height: 90vh;
  overflow: auto;
}

.modal h3 { margin: 0 0 .75rem; }

.modal-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.booking-item {
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: .85rem;
  margin-bottom: .65rem;
}

.booking-item h4 { margin: 0 0 .35rem; font-size: 1rem; }

.status { font-size: .85rem; font-weight: 600; }
.status.confirmed { color: var(--success); }
.status.pending { color: var(--warning); }
.status.cancelled { color: var(--error); }

.booking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .65rem;
}

.crypto-box {
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: .75rem;
  margin: .65rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  word-break: break-all;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem .75rem;
  font-size: .9rem;
  margin: .75rem 0;
}

.summary-grid .total {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
}

.hidden { display: none !important; }

#qr-reader { width: 100%; border-radius: var(--radius-sm); overflow: hidden; }

#pickup-qr-canvas { display: block; margin: 0 auto; background: #fff; padding: .5rem; border-radius: var(--radius-sm); }

@media (min-width: 768px) {
  .bottom-nav {
    max-width: var(--max-w);
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--divider);
    border-right: 1px solid var(--divider);
    border-radius: var(--radius) var(--radius) 0 0;
  }
}
