/* =============================================================================
   BARBERÍA ICONIC · estilos
   App: blanco y negro limpio. Tarjeta del cliente: dorado metálico con tinta negra.
   ========================================================================== */
:root {
  --ink: #111111;
  --ink-2: #2b2b2b;
  --paper: #ffffff;
  --bg: #f6f5f2;
  --muted: #6d6a64;
  --line: #e4e1da;
  --gold-1: #b8892b;
  --gold-2: #e9c766;
  --gold-3: #a87a1f;
  --gold-ink: #7d5a12;
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --err: #b3261e;
  --err-soft: #fbe9e7;
  --warn-soft: #fbf3dc;
  --radius: 14px;
  --f-display: "Bodoni 72", "Bodoni MT", Didot, "Playfair Display", "Libre Bodoni", "Times New Roman", Georgia, serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--ink); }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold-1); outline-offset: 2px; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; flex-direction: column; line-height: 1; color: var(--ink); text-decoration: none; }
.brand .b1 { font-family: var(--f-body); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.42em; text-transform: uppercase; }
.brand .b2 { font-family: var(--f-display); font-weight: 700; font-size: 1.9rem; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }

.shell { max-width: 480px; margin: 0 auto; padding-block: 24px 48px; display: flex; flex-direction: column; gap: 20px; }
.shell.wide { max-width: 1180px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* ---------- Paneles y formularios ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #ecebe7; border-radius: 999px; padding: 4px; gap: 4px; }
.tabs button { border: 0; background: transparent; border-radius: 999px; padding: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 0.82rem; font-weight: 600; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row .shrink { flex: 0 0 auto; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; min-width: 0;
}
input:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--err); }
.pin { font-family: var(--f-mono); letter-spacing: 0.5em; font-size: 1.3rem; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; }
.check input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--ink); }
.hint { font-size: 0.8rem; color: var(--muted); }
.error-msg { color: var(--err); font-size: 0.82rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; border-radius: 12px; padding: 14px 18px; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; text-align: center;
}
.btn:hover { background: var(--ink-2); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: #efeee9; }
.btn.small { padding: 8px 12px; font-size: 0.86rem; border-radius: 9px; }
.btn.gold { background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3)); color: var(--ink); border-color: var(--gold-3); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

.alert { border-radius: 10px; padding: 12px 14px; font-size: 0.9rem; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--warn-soft); color: var(--gold-ink); }

/* =============================================================================
   TARJETA DORADA
   ========================================================================== */
.card-wrap { display: flex; flex-direction: column; gap: 14px; }
.gold-card {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 20px; padding: 20px 18px 18px;
  background: linear-gradient(135deg, #b8892b 0%, #d7ae55 28%, #e9c766 50%, #c99a3d 72%, #a87a1f 100%);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 18px 40px -18px rgba(90, 60, 10, 0.55), 0 2px 6px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; gap: 18px;
}
.gold-card::before {
  content: ""; position: absolute; inset: -40%; z-index: -1;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 248, 220, 0.55) 50%, transparent 58%);
  transform: translateX(-60%);
  animation: sheen 7s ease-in-out infinite;
}
.gold-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
}
@keyframes sheen { 0%, 55% { transform: translateX(-60%); } 85%, 100% { transform: translateX(60%); } }

.gc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gc-head .brand .b2 { font-size: 1.75rem; }
.gc-coins { text-align: right; }
.gc-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(17, 17, 17, 0.72); }
.gc-value { font-size: 1.5rem; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }

.stamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 12px; }
.stamp {
  position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid rgba(17, 17, 17, 0.2);
}
.stamp svg { width: 64%; height: 64%; }
.stamp svg * { fill: none; stroke: rgba(17, 17, 17, 0.2); }
.stamp.on { background: var(--ink); border-color: var(--ink); }
.stamp.on svg * { stroke: var(--gold-2); }
.stamp.free { border: 2px solid var(--ink); }
.stamp.free span { font-size: 0.56rem; font-weight: 800; letter-spacing: 0.06em; }
.stamp.free.next { background: var(--ink); color: var(--gold-2); animation: glow 1.6s ease-in-out infinite; }
.stamp.pop { animation: pop 0.7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(255, 244, 200, 0.55); transform: scale(1.06); } }
@keyframes pop { 0% { transform: scale(0.3); } 100% { transform: scale(1); } }

.gc-fields { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.gc-fields .left { flex: 1 1 auto; min-width: 0; }
.gc-fields .right { flex: 0 1 auto; max-width: 48%; text-align: right; min-width: 0; }
.gc-big { font-size: 2rem; font-weight: 300; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gc-qr { background: var(--paper); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-inline: auto; width: min(72%, 260px); }
.gc-qr img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; }
.gc-qr .code { font-family: var(--f-mono); font-size: 0.8rem; letter-spacing: 0.08em; }

.gift-banner {
  border-radius: 14px; padding: 14px 16px; background: var(--ink); color: var(--paper);
  display: flex; gap: 12px; align-items: center;
}
.gift-banner b { color: var(--gold-2); }
.gift-banner .emoji { font-size: 1.8rem; }

.wallet-btns { display: flex; flex-direction: column; gap: 10px; }
.wallet-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #000; color: #fff; border-radius: 12px; padding: 12px 16px; text-decoration: none; font-weight: 600; border: 0; font: inherit; cursor: pointer; }
.wallet-btn svg { width: 22px; height: 22px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 16px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); z-index: 50; max-width: calc(100% - 32px); text-align: center;
}

/* =============================================================================
   RECEPCIÓN
   ========================================================================== */
.scan-box { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 1; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-box .frame { position: absolute; inset: 18%; border: 3px solid var(--gold-2); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.mini-stamps { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.mini-stamps i { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); }
.mini-stamps i.on { background: var(--ink); border-color: var(--ink); }
.mini-stamps i.free { border-color: var(--gold-1); }
.mini-stamps i.free.next { background: var(--gold-2); border-color: var(--gold-3); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.choice { border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 12px; font: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.choice[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.choice small { color: inherit; opacity: 0.7; }
.success-big { text-align: center; padding: 24px 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.success-big .mark { width: 72px; height: 72px; border-radius: 50%; background: var(--ink); color: var(--gold-2); display: grid; place-items: center; font-size: 2.2rem; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.list li:last-child { border-bottom: 0; }

/* =============================================================================
   PANEL DEL DUEÑO
   ========================================================================== */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } }
.side-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
@media (max-width: 860px) { .side-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; } }
.side-nav button { border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.side-nav button[aria-current="page"] { background: var(--ink); color: var(--paper); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .v { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .k { font-size: 0.8rem; color: var(--muted); }
.kpi.accent { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.kpi.accent .k { color: rgba(255, 255, 255, 0.7); }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; background: #faf9f6; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #faf8f2; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; background: #efeee9; }
.pill.gold { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); color: var(--ink); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.dark { background: var(--ink); color: var(--paper); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr; } }
.bar-months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end; height: 120px; }
.bar-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: 0.72rem; color: var(--muted); }
.bar-col .b { width: 100%; max-width: 38px; background: var(--ink); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-col .n { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.detail-grid div { display: flex; flex-direction: column; }
.poster { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 32px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; max-width: 520px; }
.poster img { width: min(100%, 360px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  .no-print, .side-nav, .topbar { display: none !important; }
  .poster { border: 0; }
}

/* Utilidades (la CSP no permite estilos en línea) */
.title-lg { font-size: 1.5rem; }
.mt-6 { margin-top: 6px; }
.country { max-width: 9.5rem; }
.hint.tight { margin-top: -6px; }
.center { text-align: center; }
.center-row { display: flex; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Ajustes tras la revisión visual */
.admin-layout > * { min-width: 0; }
.topbar { flex-wrap: wrap; }
.pin::placeholder { letter-spacing: normal; font-size: 0.9rem; font-family: var(--f-body); }
.gc-fields .left { flex: 1 1 0; }
.gc-fields .right { flex: 0 0 auto; max-width: 52%; }
#name { font-size: 1.75rem; }

/* =============================================================================
   CITAS · reserva, mi cita y agenda
   ========================================================================== */
.block { display: block; }
.min0 { min-width: 0; }
.mono { font-family: var(--f-mono); }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
#booking { display: flex; flex-direction: column; gap: 16px; }
.booking-link { flex-direction: row; justify-content: space-between; align-items: center; text-decoration: none; color: var(--ink); }
.booking-link:hover { border-color: var(--ink); }
.step-title { font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--gold-2); display: grid; place-items: center; font-size: 0.8rem; flex: 0 0 auto; }
.day-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.day { flex: 0 0 64px; scroll-snap-align: center; border: 1.5px solid var(--line); background: var(--paper); border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; cursor: pointer; color: var(--ink); }
.day .dw, .day .dm { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.day .dd { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.day[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.day[aria-selected="true"] .dw, .day[aria-selected="true"] .dm { color: var(--gold-2); }
.day:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot { border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px; padding: 10px 0; font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; color: var(--ink); }
.slot:hover { border-color: var(--ink); }
.slot[aria-selected="true"] { background: var(--ink); color: var(--gold-2); border-color: var(--ink); }
.empty-slots { grid-column: 1 / -1; }
textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; resize: vertical; }
textarea:focus { border-color: var(--ink); outline: none; }
.has-bottom-bar { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08); padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.bottom-inner { max-width: 480px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.bottom-inner .btn { flex: 0 0 auto; }
.bar-main { font-weight: 700; overflow-wrap: anywhere; }
.bottom-msg { max-width: 480px; margin: 10px auto 0; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--err); border-color: var(--err); }
.st-pending { background: var(--warn-soft); color: var(--gold-ink); }
.st-confirmed { background: #e6eefc; color: #1e4fb3; }
.st-completed { background: var(--ok-soft); color: var(--ok); }
.st-cancelled { background: #efeee9; color: var(--muted); }
.agenda-shell { max-width: 720px; }
.agenda-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.day-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.day-nav input { width: auto; padding: 8px 10px; }
.agenda-head select { width: auto; padding: 8px 10px; }
.status-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.appt { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; background: var(--paper); border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius); padding: 14px; }
.appt.st-pending { border-left-color: #e0a800; background: var(--paper); color: var(--ink); }
.appt.st-confirmed { border-left-color: #2f6fe0; background: var(--paper); color: var(--ink); }
.appt.st-completed { border-left-color: var(--ok); background: var(--paper); color: var(--ink); }
.appt.st-cancelled { border-left-color: #c9c6be; background: #faf9f6; color: var(--muted); }
.appt-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.appt-time b { font-size: 1.25rem; }
.appt-body { display: flex; flex-direction: column; gap: 8px; }
.appt .note { font-style: italic; overflow-wrap: anywhere; }
.nav-link { padding: 10px 12px; border-radius: 10px; font-weight: 600; color: var(--gold-ink); text-decoration: none; white-space: nowrap; }

/* Cercanía y recordatorios */
.nearby-card { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.nearby-icon { font-size: 1.5rem; }
.nearby-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.reminder-banner { display: flex; flex-direction: column; gap: 10px; background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 16px; }
.reminder-banner .muted { color: rgba(255, 255, 255, 0.72); }
.reminder-banner .btn { background: var(--gold-2); color: var(--ink); border-color: var(--gold-2); }
.reminder-banner .btn.ghost { background: transparent; color: var(--paper); border-color: rgba(255, 255, 255, 0.5); }
.reminder-banner .link-btn { color: rgba(255, 255, 255, 0.72); }
.reminder-banner.done { flex-direction: row; justify-content: space-between; align-items: center; background: var(--ok-soft); color: var(--ok); }
.reminder-banner.done .link-btn { color: var(--ok); }
.st-noshow { background: #f8e3e1; color: #8f2f28; }
.appt.st-noshow { border-left-color: #b5564f; background: #faf9f6; color: var(--muted); }
