:root {
  /* Colores de marca Gibrán López: oliva #535C26 y marfil #EDEBDB */
  --bg: #edebdb;
  --card: #fbfaf4;
  --ink: #2b2e1a;
  --muted: #6b6c55;
  --accent: #535c26;
  --accent-dark: #3e451b;
  --line: #dcd8c3;
  --danger: #b4533f;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-dark); }
.wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px 64px; }
header { text-align: center; margin-bottom: 28px; }
.logo { width: 96px; height: 96px; display: block; margin: 0 auto 14px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 2.2rem; margin: 0 0 4px; }
header p { color: var(--muted); margin: 0; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 18px 0 10px; }
.intro { color: var(--muted); margin: -6px 0 0; }
.muted { color: var(--muted); font-size: .92rem; }
.where { background: #e1e4cc; color: var(--accent-dark); border-radius: 10px; padding: 12px 14px; }
fieldset.locations { border: none; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
fieldset.locations legend { font-size: .9rem; color: var(--muted); margin-bottom: 6px; padding: 0; }
#locations { display: grid; gap: 8px; }
.loc { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; color: var(--ink); font-size: 1rem; }
.loc input { margin-top: 4px; accent-color: var(--accent); }
.loc small { display: block; color: var(--muted); }
.loc:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hotel-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
h2 { font-family: Georgia, serif; font-weight: 400; font-size: 1.35rem; margin: 0 0 14px; }

.steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; }
.steps span { width: 34px; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--accent); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.hidden { display: none !important; }

.services { display: grid; gap: 12px; }
.service {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, transform .15s;
}
.service:hover { border-color: var(--accent); transform: translateY(-1px); }
.service strong { display: block; }
.service small { color: var(--muted); }
.price { font-family: Georgia, serif; font-size: 1.2rem; white-space: nowrap; }

.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px; scroll-snap-type: x mandatory; }
.day {
  flex: 0 0 64px; scroll-snap-align: start; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; text-align: center; cursor: pointer; font: inherit; color: inherit;
}
.day b { display: block; font-size: 1.25rem; }
.day small { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.day.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.day.sel small { color: var(--bg); }
.day:disabled { opacity: .35; cursor: not-allowed; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; }
.slot:hover { border-color: var(--accent); }
.empty { color: var(--muted); text-align: center; padding: 18px 0; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 84px; resize: vertical; }
form input, form select, form textarea { width: 100%; min-width: 0; }
.loc input { width: auto; }

.summary { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: .95rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: none; background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.wa { background: #25d366; }
.btn.wa:hover { background: #1ebe5a; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.back { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0; margin-bottom: 14px; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: 0; }
.done { text-align: center; }
.done .check { font-size: 2.6rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* Admin */
.admin-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.admin-bar input, .admin-bar select { padding: 8px 10px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.tag { font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #e1e4cc; color: var(--accent-dark); }
.tag.cancelled { background: #f3dfd9; color: var(--danger); }
.tag.done { background: #ece6dd; color: var(--muted); }
.btn.mini { font-size: .8rem; padding: 6px 12px; }
td .mini { margin: 2px 0; }
.notes { color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px; background: #fff; }
  td { border: none; padding: 4px 8px; }
}

/* Pastilla de idioma ES / EN */
.lang-pill {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  display: flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(43, 46, 26, .08);
}
.lang-pill button {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font: 600 .8rem/1 system-ui, sans-serif; letter-spacing: .04em; padding: 7px 11px; border-radius: 999px;
}
.lang-pill button.on { background: var(--accent); color: #fff; }
.lang-pill button:not(.on):hover { color: var(--accent-dark); }

/* Enlace "Ver lugar" y pop-up de foto */
.see-place {
  background: none; border: none; padding: 0; margin-top: 6px; cursor: pointer;
  font: 600 .88rem/1.3 system-ui, sans-serif; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.see-place:hover { color: var(--accent-dark); }
.where .see-place { margin-top: 8px; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(30, 33, 17, .82); padding: 20px; animation: fade .2s ease;
}
.lightbox.hidden { display: none; }
.lightbox figure { position: relative; margin: 0; max-width: min(560px, 100%); }
.lightbox img { display: block; width: 100%; max-height: 80vh; object-fit: contain; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.lightbox figcaption { color: #fff; text-align: center; margin-top: 10px; font-family: Georgia, serif; }
.lb-close {
  position: absolute; top: -14px; right: -14px; width: 38px; height: 38px; border-radius: 50%;
  border: none; background: var(--card); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
@media (max-width: 640px) { .lb-close { top: 8px; right: 8px; } }
@keyframes fade { from { opacity: 0; } }

/* Notas privadas del admin */
.pnote { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #f4efd9; border: 1px dashed #d6cc9f; font-size: .85rem; color: var(--ink); }
.pnote.pnote-empty { background: none; border: none; padding: 0; }
.pnote textarea { width: 100%; min-height: 70px; font-size: .9rem; margin-bottom: 6px; }
.linkbtn { background: none; border: none; padding: 0; margin-left: 4px; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }
.pnote.pnote-empty .linkbtn { margin-left: 0; }
#newBooking { padding: 10px 16px; }

/* ================= Panel admin ================= */
.admin-wrap { max-width: 1240px; }
.admin header { margin-bottom: 20px; }
.login-panel { max-width: 420px; margin: 0 auto; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.month-panel { position: sticky; top: 16px; padding: 18px; }
.admin-bar .count { color: var(--muted); margin-left: auto; font-size: .9rem; }
#newBooking { padding: 9px 16px; }
#refresh { padding: 9px 16px; }
.admin-bar > .seg + #newBooking { margin-left: auto; }
.admin-bar select:disabled { opacity: .45; }

/* Selector Lista / Semana */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.seg button { border: none; background: none; padding: 7px 16px; border-radius: 999px; font: 600 .88rem/1 system-ui, sans-serif; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 6px; background: #e1e4cc; color: var(--accent-dark); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: .85rem; font-weight: 600; }
.chip button { border: none; background: var(--card); color: var(--accent-dark); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1; }

/* Contacto con iconos */
.client { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.contact { display: inline-flex; gap: 6px; margin-left: 4px; }
.ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--accent); }
.ic:hover { border-color: var(--accent); }
.ic.wa { color: #1f9e52; }

/* Estado */
.status-sel { font: 600 .8rem/1 system-ui, sans-serif; padding: 7px 26px 7px 10px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; }
.st-confirmed { background: #e1e4cc; color: var(--accent-dark); }
.st-paid { background: #cfe3c9; color: #2e5a26; }
.st-done { background: #ece6dd; color: var(--muted); }
.st-cancelled { background: #f3dfd9; color: var(--danger); }
tr.cancelled td { opacity: .6; }

/* Cabecera de calendarios */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head strong { font-family: Georgia, serif; font-weight: 400; font-size: 1.1rem; flex: 1; text-align: center; }
#weekView .cal-head strong { flex: 0 1 auto; min-width: 190px; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1.1rem; color: var(--ink); }
.icon-btn:hover { border-color: var(--accent); }

/* Mes */
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mh { text-align: center; font-size: .72rem; color: var(--muted); text-transform: uppercase; padding-bottom: 4px; }
.md { position: relative; aspect-ratio: 1; border: none; border-radius: 10px; background: none; cursor: pointer; font: 500 .9rem system-ui, sans-serif; color: var(--ink); }
.md:hover { background: var(--bg); }
.md.out { color: #b9b6a0; }
.md.closed { color: #b9b6a0; }
.md.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.md.sel { background: var(--accent); color: #fff; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.md .dot { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); }
.md.sel .dot { background: #fff; }
.legend { font-size: .82rem; color: var(--ink); margin: 12px 0 0; display: flex; align-items: center; gap: 6px; }
.legend.muted { color: var(--muted); margin-top: 4px; }

/* Semana */
.week-scroll { overflow-x: auto; }
.week { display: grid; grid-template-columns: 46px repeat(7, minmax(84px, 1fr)); min-width: 680px; }
.wk-col { border-left: 1px solid var(--line); }
.wk-hours { border-left: none; }
.wk-dh { height: 46px; text-align: center; border-bottom: 1px solid var(--line); }
.wk-dh small { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; padding-top: 4px; }
.wk-dh b { font-size: 1.05rem; }
.wk-col.is-today .wk-dh b { background: var(--accent); color: #fff; border-radius: 50%; display: inline-grid; place-items: center; width: 26px; height: 26px; font-size: .9rem; }
.wk-body { position: relative; }
.wk-body i { position: absolute; left: 0; right: 0; border-top: 1px dashed #e6e2cf; }
.wk-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: .7rem; color: var(--muted); }
.wk-hours span:first-child { transform: none; }
.wk-col.closed .wk-body { background: repeating-linear-gradient(45deg, transparent 0 8px, #f1eee0 8px 16px); }
.wk-col.closed em { position: absolute; top: 10px; width: 100%; text-align: center; font-size: .75rem; color: var(--muted); font-style: normal; }
.wk-ev {
  position: absolute; left: 3px; right: 3px; overflow: hidden; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  border: none; border-left: 3px solid var(--accent); border-radius: 6px; padding: 3px 6px;
  font: .74rem/1.25 system-ui, sans-serif; color: var(--ink); background: #e1e4cc;
}
.wk-ev.st-paid { background: #cfe3c9; border-left-color: #2e5a26; }
.wk-ev.st-done { background: #ece6dd; border-left-color: var(--muted); }
.wk-ev small { display: block; color: var(--muted); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ev:hover { filter: brightness(.97); }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .month-panel { position: static; order: -1; }
}

/* Semana en celular: los 7 días caben en pantalla, sin scroll lateral */
@media (max-width: 900px) {
  .admin-grid > * { min-width: 0; }
}
@media (max-width: 640px) {
  .admin .panel { padding: 16px 12px; }
  #weekView .cal-head strong { min-width: 0; font-size: .98rem; }
  .week { min-width: 0; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); }
  .wk-dh { height: 40px; }
  .wk-dh small { font-size: .62rem; padding-top: 3px; }
  .wk-dh b { font-size: .92rem; }
  .wk-col.is-today .wk-dh b { width: 22px; height: 22px; font-size: .8rem; }
  .wk-hours span { right: 3px; font-size: .6rem; }
  .wk-ev { left: 1px; right: 1px; padding: 2px 3px; font-size: .62rem; line-height: 1.2; border-left-width: 2px; border-radius: 4px; }
  .wk-ev b { display: block; }
  .wk-ev small { display: none; }
  .wk-ev .nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wk-col.closed em { font-size: .58rem; writing-mode: vertical-rl; top: 8px; left: 50%; width: auto; transform: translateX(-50%); }
}
@media (max-width: 640px) { .wk-ev .ln { display: none; } }
