:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #16233b;
  --muted: #70798c;
  --primary: #0d2a4a;
  --primary-dark: #081b30;
  --primary-soft: #e8edf3;
  --accent: #fd6e35;
  --accent-dark: #e0551f;
  --accent-soft: #ffe9de;
  --sky: #49b0dc;
  --sky-soft: #e6f5fb;
  --cream: #f6f0ea;
  --border: #e8e9ee;
  --danger: #e0405a;
  --danger-soft: #fde8ec;
  --success: #17ab6b;
  --success-soft: #e5f9f0;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(13, 42, 74, .05), 0 2px 6px rgba(13, 42, 74, .06);
  --shadow-lg: 0 12px 28px rgba(13, 42, 74, .18);
  --tabbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: clamp(15px, 0.95rem + 0.15vw, 16px);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand {
  font-weight: 800;
  font-size: 19px;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.topbar .brand .accent { color: var(--accent); }
.topbar nav { display: none; align-items: center; gap: 4px; }
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
}
.topbar nav a.active, .topbar nav a:hover { color: var(--accent); background: var(--accent-soft); }
.topbar .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.topbar .icon-btn:hover { background: var(--bg); color: var(--primary); }

.lang-switch { display: flex; gap: 2px; margin-left: 8px; }
.lang-switch a {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-decoration: none; padding: 4px 7px; border-radius: 7px;
}
.lang-switch a.active { background: var(--primary-soft); color: var(--primary); }

@media (min-width: 768px) {
  .topbar { padding: 14px 24px; }
  .topbar nav { display: flex; }
  .topbar .icon-btn.mobile-only { display: none; }
}

/* ---------- Bottom tab bar (mobile app style) ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 30;
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  min-height: 44px;
}
.tabbar a.active { color: var(--accent); }
.tabbar a svg { width: 22px; height: 22px; }

@media (min-width: 768px) {
  .tabbar { display: none; }
}

.page-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px);
}
@media (min-width: 768px) {
  .page-shell { padding: 24px; padding-bottom: 32px; }
}

.container { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.page-head .back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}
.page-head h1 { margin: 0; color: var(--primary); }

h1 { font-size: clamp(20px, 1.1rem + 0.8vw, 26px); font-weight: 800; letter-spacing: -0.02em; color: var(--primary); }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; color: var(--primary); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; margin-top: 14px; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { min-height: 80px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: scale(0.98); }
.btn.secondary { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary-soft); }
.btn.secondary:hover { background: var(--primary-soft); }
.btn.danger { background: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn.icon-only { width: 44px; height: 44px; padding: 0; min-height: 44px; border-radius: 999px; }

.icon-tap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: none;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.icon-tap.danger { color: var(--danger); background: var(--danger-soft); }
.icon-tap:hover { filter: brightness(0.96); }

/* Floating action button */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  width: 58px; height: 58px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  z-index: 25;
}
@media (min-width: 768px) {
  .fab { display: none; }
}

/* Sticky bottom action bar (mobile save/search CTA) */
.sticky-cta {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(247,248,250,0) 0%, var(--bg) 40%);
  z-index: 24;
}
.sticky-cta .btn { box-shadow: var(--shadow-lg); }
@media (min-width: 768px) {
  .sticky-cta { position: static; background: none; padding: 0; margin-top: 12px; }
  .sticky-cta .btn { box-shadow: none; width: auto; }
}

.desktop-only { display: none; }
@media (min-width: 768px) { .desktop-only { display: inline-flex; } }
.mobile-only { display: inline-flex; }
@media (min-width: 768px) { .mobile-only { display: none; } }

/* ---------- Hero / summary card ---------- */
.hero-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
}
.hero-card .hero-label { font-size: 13px; opacity: .78; font-weight: 600; }
.hero-card .hero-value { font-size: clamp(28px, 5vw, 36px); font-weight: 800; margin-top: 4px; letter-spacing: -0.02em; }
.hero-card .hero-value .accent { color: var(--accent); }
.hero-card .hero-sub { display: flex; gap: 16px; margin-top: 14px; font-size: 13px; opacity: .9; }
.hero-card .hero-sub b { font-size: 14px; }

/* ---------- Quick action tiles ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.quick-actions a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--primary);
  font-size: 11.5px; font-weight: 600; text-align: center;
}
.quick-actions .tile {
  width: 48px; height: 48px;
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
}
.quick-actions .tile.a1 { background: var(--accent-soft); color: var(--accent); }
.quick-actions .tile.a2 { background: var(--primary-soft); color: var(--primary); }
.quick-actions .tile.a3 { background: var(--sky-soft); color: var(--sky); }
.quick-actions .tile.a4 { background: var(--primary-soft); color: var(--primary); }

/* ---------- Settings-style row list (icon chip + label + value + chevron) ---------- */
.row-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.row-list a, .row-list .row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.row-list a:last-child, .row-list .row:last-child { border-bottom: none; }
.row-list a:hover { background: var(--bg); }
.row-list .row-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
}
.row-list .row-icon.danger { background: var(--danger-soft); color: var(--danger); }
.row-list .row-body { flex: 1; min-width: 0; }
.row-list .row-title { font-weight: 700; font-size: 14.5px; color: var(--primary); }
.row-list .row-value { font-size: 13px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-list .row-chevron { color: var(--border); flex-shrink: 0; }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--success-soft); color: var(--success); }
.badge.inactive { background: var(--danger-soft); color: var(--danger); }
.pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.pill.selected { background: var(--accent); color: #fff; }

/* ---------- Icon-stat row (bed / guests / amenity icons with label) ---------- */
.icon-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.icon-stats .stat { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.icon-stats .stat svg { color: var(--primary); flex-shrink: 0; }

/* ---------- Property list (card style, replaces table) ---------- */
.list-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .list-grid { grid-template-columns: 1fr 1fr; } }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
}
.list-item:hover { border-color: var(--accent); }
.list-item .thumb {
  width: 50px; height: 50px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 20px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.list-item .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info .title { font-weight: 700; font-size: 15px; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .info .meta { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.list-item .price { font-weight: 700; font-size: 14px; color: var(--primary); text-align: right; white-space: nowrap; }
.list-item .chevron { color: var(--border); flex-shrink: 0; }

/* ---------- Photo grid ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 10px; }
.photo-grid .photo-tile { position: relative; border-radius: var(--radius-sm); overflow: hidden; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-grid .photo-tile button {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px;
  border-radius: 999px; border: none;
  background: rgba(13,42,74,.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  min-height: 110px;
}
.upload-zone:hover { border-color: var(--accent); color: var(--accent); }
.upload-zone input { display: none; }

/* ---------- Season rows ---------- */
.season-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
}
@media (max-width: 700px) {
  .season-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Search results ---------- */
.result-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--surface);
}
.result-card .photo-wrap { position: relative; flex-shrink: 0; }
.result-card img, .result-card .ph-placeholder {
  width: 96px; height: 88px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.result-card .source-badge {
  position: absolute; top: 4px; left: 4px;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(13,42,74,.85); color: #fff;
}
.result-card .fav-btn {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px;
  border-radius: 999px; border: none;
  background: rgba(255,255,255,.9); color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.result-card .fav-btn svg { width: 15px; height: 15px; }
.result-card .body { flex: 1; min-width: 0; }
.result-card .title { font-weight: 700; font-size: 15.5px; color: var(--primary); }
.result-card .region { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.result-card .pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.result-card .price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.result-card .price { font-weight: 800; font-size: 17px; color: var(--primary); }
.result-card .nights { font-size: 12.5px; color: var(--muted); }
.result-card a.view-link { font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; }
@media (max-width: 420px) {
  .result-card { flex-direction: column; }
  .result-card .photo-wrap { width: 100%; }
  .result-card img, .result-card .ph-placeholder { width: 100%; height: 150px; }
}

.error { color: var(--danger); font-size: 13px; margin-top: 8px; font-weight: 600; }
.success { color: var(--success); font-size: 13px; margin-top: 8px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 85vh; padding: 16px; }
.login-box { width: 100%; max-width: 380px; text-align: center; }
.login-box .logo { font-size: 30px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.login-box .logo .accent { color: var(--accent); }
.login-box .card { text-align: left; }
