/* ── Rancho Palma Santa ─────────────────────────────────── */
:root {
  --green-900: #1d3a2a;
  --green-700: #2e5d40;
  --green-500: #4a8a5f;
  --green-100: #e3f0e7;
  --sand: #f6f1e7;
  --sand-dark: #e8dfcd;
  --earth: #8a6240;
  --ink: #25301f;
  --muted: #6b7a64;
  --white: #ffffff;
  --red: #b03a2e;
  --red-bg: #fbe9e7;
  --amber: #a8731c;
  --amber-bg: #fdf3df;
  --ok-bg: #e3f0e7;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(29, 58, 42, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--sand);
  color: var(--ink);
}
.hidden { display: none !important; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }

/* ── Botones ── */
.btn {
  border: none; border-radius: 8px; padding: 10px 18px;
  font-size: 15px; cursor: pointer; font-family: inherit;
  transition: filter .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--green-700); color: var(--white); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-ghost { background: transparent; color: var(--green-700); }
.btn-ghost:hover { background: var(--green-100); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Login ── */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--green-900) 0%, var(--green-700) 60%, var(--green-500) 100%);
  padding: 20px;
}
.login-card {
  background: var(--white); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
  padding: 40px 36px; width: 100%; max-width: 400px;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo { font-size: 52px; display: block; }
.login-brand h1 { margin: 8px 0 4px; color: var(--green-900); letter-spacing: 1px; }
.login-brand p { margin: 0; color: var(--muted); font-size: 14px; }
.login-card label { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 600; color: var(--green-900); }
.login-card input {
  width: 100%; margin-top: 6px; padding: 11px 12px; border: 1.5px solid var(--sand-dark);
  border-radius: 8px; font-size: 15px;
}
.login-card input:focus { outline: none; border-color: var(--green-500); }

.form-error {
  background: var(--red-bg); color: var(--red); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; margin-bottom: 14px;
}

/* ── Topbar ── */
.topbar {
  background: var(--green-900); color: var(--white);
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.topbar-brand { font-size: 18px; padding: 14px 0; white-space: nowrap; }
.topbar-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar-nav a {
  color: rgba(255,255,255,.78); text-decoration: none; padding: 16px 14px;
  font-size: 14.5px; border-bottom: 3px solid transparent;
}
.topbar-nav a:hover { color: var(--white); }
.topbar-nav a.active { color: var(--white); border-bottom-color: #d9b961; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.topbar-user .btn-ghost { color: rgba(255,255,255,.85); }
.topbar-user .btn-ghost:hover { background: rgba(255,255,255,.12); }
.badge-count {
  background: #d9b961; color: var(--green-900); border-radius: 99px;
  font-size: 11.5px; font-weight: 700; padding: 1px 7px; margin-left: 4px;
}

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.view-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.view-header h2 { margin: 0; color: var(--green-900); }

/* ── Calendario ── */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .btn { font-size: 20px; padding: 4px 14px; }
.cal-title { font-weight: 700; min-width: 170px; text-align: center; text-transform: capitalize; color: var(--green-900); }
.cal-legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 99px; margin-right: 5px; }
.dot-free { background: var(--green-500); }
.dot-partial { background: #d9b961; }
.dot-full { background: var(--red); }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  background: var(--white); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.cal-dow { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 6px 0; text-transform: uppercase; }
.cal-day {
  min-height: 74px; border-radius: 8px; border: 1.5px solid var(--sand-dark);
  padding: 6px 8px; font-size: 13px; cursor: pointer; position: relative;
  display: flex; flex-direction: column; gap: 4px; background: var(--white);
}
.cal-day:hover { border-color: var(--green-500); }
.cal-day.empty { border: none; cursor: default; background: transparent; }
.cal-day.past { opacity: .45; }
.cal-day.today .cal-daynum { background: var(--green-700); color: var(--white); }
.cal-daynum {
  font-weight: 700; width: 24px; height: 24px; display: flex;
  align-items: center; justify-content: center; border-radius: 99px;
}
.cal-occ { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 6px; width: fit-content; }
.cal-occ.free { background: var(--ok-bg); color: var(--green-700); }
.cal-occ.partial { background: var(--amber-bg); color: var(--amber); }
.cal-occ.full { background: var(--red-bg); color: var(--red); }

.day-detail {
  margin-top: 16px; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 22px;
}
.day-detail h3 { margin: 0 0 10px; color: var(--green-900); }
.day-detail ul { margin: 0; padding-left: 18px; }
.day-detail li { margin-bottom: 5px; font-size: 14.5px; }

/* ── Wizard ── */
.wizard-steps {
  display: flex; list-style: none; padding: 0; margin: 0 0 22px; gap: 8px; flex-wrap: wrap;
  counter-reset: step;
}
.wizard-steps li {
  counter-increment: step; font-size: 14px; color: var(--muted);
  padding: 8px 14px; border-radius: 99px; background: var(--sand-dark);
  display: flex; align-items: center; gap: 8px;
}
.wizard-steps li::before {
  content: counter(step);
  background: var(--muted); color: var(--white); width: 21px; height: 21px;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.wizard-steps li.active { background: var(--green-700); color: var(--white); font-weight: 600; }
.wizard-steps li.active::before { background: #d9b961; color: var(--green-900); }
.wizard-steps li.done { background: var(--green-100); color: var(--green-700); }
.wizard-steps li.done::before { background: var(--green-500); content: "✓"; }

.wizard-content { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.wizard-actions { display: flex; justify-content: space-between; margin-top: 18px; }
.wizard-actions .btn-primary { margin-left: auto; }

.date-row { display: flex; gap: 22px; flex-wrap: wrap; }
.date-row label { font-weight: 600; font-size: 14px; color: var(--green-900); }
.date-row input {
  display: block; margin-top: 6px; padding: 10px 12px; font-size: 15px;
  border: 1.5px solid var(--sand-dark); border-radius: 8px; font-family: inherit;
}
.nights-hint { margin-top: 14px; font-size: 14.5px; color: var(--muted); }

.area-block { margin-bottom: 22px; }
.area-block h3 {
  margin: 0 0 10px; color: var(--earth); font-size: 17px;
  border-bottom: 2px solid var(--sand-dark); padding-bottom: 6px;
}
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.room-card {
  border: 2px solid var(--sand-dark); border-radius: 10px; padding: 14px;
  cursor: pointer; transition: border-color .15s, background .15s; position: relative;
}
.room-card:hover:not(.occupied) { border-color: var(--green-500); }
.room-card.selected { border-color: var(--green-700); background: var(--green-100); }
.room-card.selected::after {
  content: "✓"; position: absolute; top: 10px; right: 12px;
  background: var(--green-700); color: var(--white); width: 22px; height: 22px;
  border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.room-card.occupied { opacity: .55; cursor: not-allowed; background: repeating-linear-gradient(45deg, #f3efe6, #f3efe6 8px, #ece6d8 8px, #ece6d8 16px); }
.room-card h4 { margin: 0 0 6px; font-size: 15.5px; color: var(--green-900); }
.room-meta { font-size: 13px; color: var(--muted); line-height: 1.5; }
.room-price { margin-top: 8px; font-weight: 700; color: var(--green-700); font-size: 15px; }
.room-price small { font-weight: 400; color: var(--muted); }
.room-tag {
  display: inline-block; font-size: 11px; font-weight: 700; border-radius: 5px;
  padding: 2px 6px; background: var(--red-bg); color: var(--red); margin-top: 6px;
}

.guest-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1.5px solid var(--sand-dark); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
  flex-wrap: wrap;
}
.guest-row select { padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--sand-dark); font-size: 15px; }
.guest-room-name { font-weight: 700; color: var(--green-900); }
.guest-room-sub { font-size: 13px; color: var(--muted); }

/* ── Cotización ── */
.quote-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.quote-table th { text-align: left; color: var(--muted); font-size: 12.5px; text-transform: uppercase; padding: 8px 10px; border-bottom: 2px solid var(--sand-dark); }
.quote-table td { padding: 10px; border-bottom: 1px solid var(--sand-dark); }
.quote-table .num { text-align: right; }
.quote-total td { font-weight: 800; font-size: 17px; color: var(--green-900); border-bottom: none; padding-top: 14px; }
.quote-dates { font-size: 14.5px; color: var(--muted); margin-bottom: 14px; }
.quote-notes textarea {
  width: 100%; min-height: 70px; margin-top: 6px; padding: 10px;
  border: 1.5px solid var(--sand-dark); border-radius: 8px; font-family: inherit; font-size: 14px; resize: vertical;
}

/* ── Reservas ── */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--sand-dark); background: var(--white); border-radius: 99px;
  padding: 6px 14px; font-size: 13.5px; cursor: pointer; color: var(--muted); font-family: inherit;
}
.chip.active { background: var(--green-700); color: var(--white); border-color: var(--green-700); }

.res-list { display: flex; flex-direction: column; gap: 14px; }
.res-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; }
.res-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.res-card-head h3 { margin: 0; font-size: 17px; color: var(--green-900); }
.res-dates { color: var(--muted); font-size: 14px; margin-top: 3px; }
.status-pill { border-radius: 99px; padding: 5px 14px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status-pendiente { background: var(--amber-bg); color: var(--amber); }
.status-aprobada { background: var(--ok-bg); color: var(--green-700); }
.status-rechazada { background: var(--red-bg); color: var(--red); }
.status-cancelada { background: var(--sand-dark); color: var(--muted); }
.res-rooms { margin: 12px 0 4px; font-size: 14px; }
.res-rooms li { margin-bottom: 3px; }
.res-total { font-weight: 800; color: var(--green-900); font-size: 16px; margin-top: 8px; }
.res-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.res-note { background: var(--sand); border-left: 4px solid var(--earth); border-radius: 6px; padding: 9px 12px; font-size: 13.5px; margin-top: 10px; }
.proof-ok { font-size: 13.5px; color: var(--green-700); font-weight: 600; }

/* ── Galería ── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.gallery-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--white); }
.gallery-img {
  height: 160px; display: flex; align-items: center; justify-content: center;
  font-size: 56px; background-size: cover; background-position: center;
}
.gallery-body { padding: 14px 16px; }
.gallery-body h3 { margin: 0 0 4px; font-size: 16px; color: var(--green-900); }
.gallery-body p { margin: 0; font-size: 13.5px; color: var(--muted); }

.gallery-img[data-full], .photo-tile { cursor: zoom-in; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.photo-tile {
  aspect-ratio: 4 / 3; border-radius: 10px; background-size: cover; background-position: center;
  box-shadow: var(--shadow); transition: transform .12s;
}
.photo-tile:hover { transform: scale(1.03); }

/* ── Admin ── */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 2px solid var(--sand-dark); flex-wrap: wrap; }
.tab {
  border: none; background: transparent; padding: 10px 18px; font-size: 15px;
  cursor: pointer; color: var(--muted); font-family: inherit; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--green-900); font-weight: 700; border-bottom-color: var(--green-700); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
.admin-table th { background: var(--green-100); text-align: left; padding: 11px 14px; font-size: 12.5px; text-transform: uppercase; color: var(--green-700); }
.admin-table td { padding: 11px 14px; border-top: 1px solid var(--sand-dark); vertical-align: middle; }
.admin-table tr:hover td { background: var(--sand); }
.empty-state { text-align: center; color: var(--muted); padding: 50px 20px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-state .big { font-size: 42px; display: block; margin-bottom: 10px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 30, 22, .55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--white); border-radius: 14px; padding: 26px; width: 100%;
  max-width: 480px; max-height: 88vh; overflow-y: auto; box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.modal h3 { margin: 0 0 16px; color: var(--green-900); }
.modal label { display: block; margin-bottom: 13px; font-size: 14px; font-weight: 600; color: var(--green-900); }
.modal input, .modal select, .modal textarea {
  width: 100%; margin-top: 5px; padding: 10px 12px; border: 1.5px solid var(--sand-dark);
  border-radius: 8px; font-size: 14.5px; font-family: inherit;
}
.modal textarea { min-height: 70px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--green-900); color: var(--white); border-radius: 10px;
  padding: 13px 22px; font-size: 14.5px; box-shadow: 0 8px 30px rgba(0,0,0,.3); z-index: 200;
  animation: toast-in .25s ease;
}
.toast.error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar-nav a { padding: 12px 8px; font-size: 13px; }
  .cal-day { min-height: 56px; font-size: 11px; padding: 4px; }
  .cal-occ { font-size: 9.5px; padding: 1px 4px; }
  main { padding: 18px 12px 50px; }
}
