/* =========================================================
   Estilos base del sistema
   ========================================================= */
:root {
  --crema: #fbf6ee;
  --papel: #fffdf9;
  --arena: #f3e9da;
  --linea: #e7dac8;
  --tinta: #2a1d14;
  --tinta-2: #5c4a3d;
  --gris: #8a7a6c;
  --marca: #b4532a;
  --marca-osc: #8e3e1d;
  --marca-suave: #f7e4d8;
  --verde: #2f6b52;
  --verde-suave: #ddefe6;
  --ambar: #a86c12;
  --ambar-suave: #fbefd2;
  --rojo: #b83a2b;
  --rojo-suave: #fbe3de;
  --radio: 18px;
  --radio-s: 11px;
  --sombra: 0 1px 2px rgba(42, 29, 20, .05), 0 10px 30px rgba(42, 29, 20, .08);
  --sombra-s: 0 1px 2px rgba(42, 29, 20, .06), 0 2px 8px rgba(42, 29, 20, .05);
  --fuente: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.55;
  color: var(--tinta);
  background: var(--crema);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 600; }
h1, h2, .serif { font-family: var(--serif); letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.icon { flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--gris); }
.centro { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.25rem;
  border: 1.5px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: .97rem; line-height: 1.2; white-space: nowrap;
  background: var(--arena); color: var(--tinta);
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .pill input:focus-visible + span, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(180, 83, 42, .35); outline-offset: 2px;
}
.btn-primario { background: var(--marca); color: #fff; box-shadow: 0 6px 16px rgba(180, 83, 42, .28); }
.btn-primario:hover { background: var(--marca-osc); }
.btn-oscuro { background: var(--tinta); color: #fff; }
.btn-linea { background: transparent; border-color: var(--linea); }
.btn-linea:hover { border-color: var(--tinta-2); background: var(--papel); }
.btn-verde { background: var(--verde); color: #fff; }
.btn-peligro { background: var(--rojo-suave); color: var(--rojo); }
.btn-peligro:hover { background: var(--rojo); color: #fff; }
.btn-s { padding: .45rem .85rem; font-size: .86rem; }
.btn-l { padding: .95rem 1.6rem; font-size: 1.05rem; }
.btn-bloque { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Formularios ---------- */
.campo { display: grid; gap: .35rem; }
.campo > label, .etiqueta { font-weight: 600; font-size: .9rem; color: var(--tinta-2); }
.campo small { color: var(--gris); font-size: .82rem; }
.input, select.input, textarea.input {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid var(--linea); border-radius: var(--radio-s);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: var(--marca); box-shadow: 0 0 0 4px rgba(180, 83, 42, .12); outline: none; }
textarea.input { resize: vertical; min-height: 84px; }
.input.mal { border-color: var(--rojo); }
.error-campo { color: var(--rojo); font-size: .85rem; font-weight: 500; }
.fila { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--marca); }

/* Opciones tipo pastilla (radio) */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-width: 3rem; padding: .6rem 1rem;
  border: 1.5px solid var(--linea); border-radius: 999px;
  background: #fff; font-weight: 600; font-size: .95rem;
  transition: all .14s ease;
}
.pill:hover span { border-color: var(--marca); }
.pill input:checked + span { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.pill input:disabled + span { opacity: .4; text-decoration: line-through; cursor: not-allowed; background: var(--arena); }
.pill input:disabled { cursor: not-allowed; }

/* ---------- Etiquetas de estado ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .65rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .01em;
  background: var(--arena); color: var(--tinta-2);
}
.badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.badge.verde, .badge.confirmada, .badge.libre, .badge.pagada { background: var(--verde-suave); color: var(--verde); }
.badge.ambar, .badge.pendiente, .badge.reservada { background: var(--ambar-suave); color: var(--ambar); }
.badge.rojo, .badge.cancelada, .badge.no_show, .badge.ocupada { background: var(--rojo-suave); color: var(--rojo); }
.badge.sentada, .badge.abierta { background: var(--marca-suave); color: var(--marca-osc); }

/* ---------- Avisos ---------- */
.aviso {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: var(--radio-s);
  background: var(--verde-suave); color: #1f4a39; font-weight: 500;
}
.aviso.error { background: var(--rojo-suave); color: #8a2a1e; }
.aviso.info { background: var(--ambar-suave); color: #6f470a; }
.avisos { display: grid; gap: .5rem; margin-bottom: 1.25rem; }

/* ---------- Tarjeta ---------- */
.tarjeta {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra-s);
}

/* ---------- Ventanas (dialog) ---------- */
dialog {
  width: min(560px, calc(100vw - 2rem));
  padding: 0; border: 0; border-radius: var(--radio);
  background: var(--papel); color: var(--tinta);
  box-shadow: 0 30px 80px rgba(42, 29, 20, .35);
}
dialog::backdrop { background: rgba(42, 29, 20, .5); backdrop-filter: blur(3px); }
.dialogo-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.35rem; border-bottom: 1px solid var(--linea); }
.dialogo-cabeza h3 { font-family: var(--serif); font-size: 1.3rem; }
.dialogo-cuerpo { padding: 1.35rem; display: grid; gap: 1rem; }
.dialogo-pie { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; padding: 1rem 1.35rem; border-top: 1px solid var(--linea); background: var(--crema); border-radius: 0 0 var(--radio) var(--radio); }
.cerrar { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: var(--arena); }

/* ---------- Marca y precios ---------- */
.marca { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.marca-logo {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--tinta); color: var(--crema);
}
.precio { font-weight: 700; color: var(--marca-osc); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
