:root {
  --bg: #0c0b0a;
  --surface: #171411;
  --text: #f7f1e4;
  --muted: #c4b8a5;
  --line: #6f552c;
  --primary: #edbe62;
  --primary-dark: #f6d58d;
  --primary-soft: #302619;
  --danger: #ff9a9a;
  --accent: #850d1b;
  --ok: #15803d;
  --wa: #128c4b;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .3);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; font-size: 16px; }
a { color: var(--primary); }
h1 { font-size: 1.6rem; margin: 1.2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
code { background: var(--primary-soft); padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; min-height: 70vh; }
main.wrap:not(:has(> .hero)) { padding-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }

/* Barra superior */
.topbar { background: #000; border-bottom: 1px solid #b98a35; position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 90px; }
.brand { grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; width: 300px; height: 90px; }
.brand img { display: block; position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); width: 100%; height: auto; }
.header-action { grid-column: 3; grid-row: 1; justify-self: end; }
.header-action .btn { border-radius: 999px; padding: 9px 18px; }
.nav { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .linklike { color: #f8f6f0; text-decoration: none; padding: 8px 10px; border-radius: 0; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.nav a:hover, .linklike:hover { color: var(--primary); }
.nav a.active { color: var(--primary); box-shadow: inset 0 -2px 0 #b51627; font-weight: 600; }
.linklike { background: none; border: 0; cursor: pointer; font: inherit; }
.menu-toggle { display: none; position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; }
.menu-btn { display: none; }
.menu-toggle:focus-visible + .menu-btn { outline: 2px solid var(--primary); outline-offset: 2px; }
form.inline { display: inline; margin: 0; }

.topbar-staff .menu-toggle { display: block; }
.topbar-staff .menu-btn { display: block; grid-column: 1; grid-row: 1; justify-self: start; font-size: 1.5rem; cursor: pointer; padding: 4px 8px; }
.topbar-staff .nav { display: none; grid-column: 1 / -1; grid-row: 2; flex-direction: column; align-items: stretch; padding: 6px 0 12px; }
.topbar-staff .menu-toggle:checked ~ .nav { display: flex; }

@media (max-width: 1100px) {
  .topbar-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .topbar-inner { min-height: 66px; }
  .brand { width: 100%; height: 66px; }
  .brand img { width: calc(100% + 12px); max-width: 260px; bottom: -10px; }
  .menu-toggle { display: block; }
  .menu-btn { display: block; grid-column: 1; grid-row: 1; justify-self: start; font-size: 1.5rem; cursor: pointer; padding: 4px 8px; }
  .nav { display: none; grid-column: 1 / -1; grid-row: 2; flex-direction: column; align-items: stretch; padding: 6px 0 12px; }
  .menu-toggle:checked ~ .nav { display: flex; }
  .nav a, .linklike { padding: 10px; text-align: left; }
}
@media (max-width: 420px) {
  .header-action .btn { font-size: .65rem; padding: 7px 8px; }
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: 1px solid var(--primary);
  padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #ad1a2a; }
.btn-ghost { background: var(--surface); color: var(--primary-dark); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger-ghost { background: var(--surface); color: var(--danger); border-color: #a64b51; }
.btn-danger-ghost:hover { background: #431a1d; }
.btn-wa { background: var(--wa); border-color: var(--wa); }
.btn-wa:hover { background: #0d6e3a; }
.btn-sm { padding: 5px 10px; font-size: .85rem; border-radius: 7px; }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }

/* Tarjetas y grillas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 440px; margin: 32px auto; }
.narrow-left { max-width: 520px; }
.card.empty { text-align: center; color: var(--muted); padding: 32px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.grid.tight { gap: 8px; }
.grid .card { margin-bottom: 0; }
section { margin-bottom: 28px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.heading h1 { margin-bottom: 1rem; }
.list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.list .card { margin-bottom: 0; }
.inactive { opacity: .6; }

/* Portada */
.hero {
  width: 100vw; margin-left: calc(50% - 50vw); border-bottom: 1px solid var(--primary);
  background-color: #000;
  background-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .96) 25%, rgba(0, 0, 0, .18) 85%), url('barberia-fondo.jpg');
  background-size: 100% 100%, auto 100%; background-position: center, right center; background-repeat: no-repeat;
}
.hero-inner { max-width: 1040px; margin: 0 auto; padding: 56px 16px; }
.hero-name { color: var(--primary); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 12px; }
.hero h1 { max-width: 570px; font-family: Georgia, serif; font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1.1; text-transform: uppercase; color: var(--text); margin: 0 0 18px; }
.hero-tagline { display: table; border-top: 1px solid var(--primary); padding-top: 14px; letter-spacing: .16em; text-transform: uppercase; font-size: .85rem; }
.hero-tagline span { color: var(--primary); padding: 0 8px; }
.lead { font-size: 1rem; color: var(--text); max-width: 480px; margin: 0 0 1.5rem; }
.actions { display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
#servicios { scroll-margin-top: 110px; }
@media (max-width: 760px) {
  .hero { background-image: linear-gradient(90deg, rgba(0, 0, 0, .94), rgba(0, 0, 0, .72)), url('barberia-fondo.jpg'); }
  .hero-inner { padding: 44px 20px; }
  #servicios { scroll-margin-top: 75px; }
}
.service .meta { margin: .4rem 0 0; font-weight: 600; color: var(--primary-dark); }
main.wrap:has(> .service-icons) { padding-bottom: 0; min-height: 0; }
.service-icons { width: 100vw; margin: 0 0 0 calc(50% - 50vw); background: #741523; color: #fff7e8; border-top: 1px solid var(--primary); padding: 28px 16px; }
.service-icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.service-icon-list { max-width: 1040px; margin: 0 auto; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.service-icon-list li { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.service-icon-circle { display: grid; place-items: center; width: 68px; height: 68px; border: 2px solid #ba8732; border-radius: 50%; background: #111; color: #edbe62; box-shadow: inset 0 0 0 3px #111, inset 0 0 0 4px #ba8732; }
.service-icon-circle svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.service-icon-name { font-family: Georgia, serif; font-weight: 700; }
.hours { width: 100%; border-collapse: collapse; }
.hours th { text-align: left; font-weight: 500; padding: 5px 0; width: 40%; }
.hours td { padding: 5px 0; }
.steps { padding-left: 1.2rem; margin: 0 0 1rem; }
.steps li { margin-bottom: .4rem; }

/* Formularios */
.form label, form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 500; margin-bottom: 12px; }
input, select, textarea {
  font: inherit; font-size: 1rem; padding: 9px 11px; border: 1px solid #8a7350; border-radius: 8px;
  background: #211d18; color: var(--text); width: 100%;
}
input::placeholder, textarea::placeholder { color: #c4b8a5; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row label { margin-bottom: 0; }
.row input[type=email], .row input[type=search] { flex: 1; min-width: 200px; width: auto; }
.search { margin-bottom: 16px; }
fieldset.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin: 0 0 12px; }
fieldset.msg legend { font-weight: 600; padding: 0 6px; }
details summary { cursor: pointer; margin: 8px 0; color: var(--primary-dark); }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* Alertas */
.alert { padding: 12px 14px; border-radius: 10px; margin: 16px 0; border: 1px solid; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-ok { background: #ecfdf3; border-color: #abefc6; color: #085d3a; }
.alert-error { background: #fef3f2; border-color: #fecdca; color: #912018; }
.alert-info { background: #fbf6e9; border-color: #e4d3a9; color: #684b1a; }

/* Reserva */
.wizard { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: step; flex-wrap: wrap; }
.wizard li { counter-increment: step; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.wizard li::before { content: counter(step); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); font-weight: 700; font-size: .8rem; }
.wizard li.current { color: var(--text); font-weight: 600; }
.wizard li.current::before { background: var(--accent); color: #fff; }
.wizard li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.wizard li + li::after { content: none; }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choice { flex-direction: row !important; align-items: center; gap: 10px !important; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; margin: 0 !important; }
.choice input { width: auto; }
.choice span { display: flex; flex-direction: column; }
.choice small { color: var(--muted); font-weight: 400; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; text-decoration: none; color: var(--text); font-size: .9rem; background: var(--surface); }
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--accent); border-color: var(--primary); color: #fff; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 12px; }
.slot { font: inherit; font-weight: 600; padding: 10px 0; border: 1px solid var(--primary); color: var(--text); background: var(--surface); border-radius: 9px; cursor: pointer; text-align: center; }
.slot:hover { background: var(--accent); color: #fff; }
.radio-slots .slot { flex-direction: row; justify-content: center; margin: 0; }
.radio-slots .slot input { position: absolute; opacity: 0; width: 1px; }
.radio-slots .slot:has(input:checked) { background: var(--accent); color: #fff; }
.radio-slots .slot:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Turnos */
.appt { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; }
.appt.compact { grid-template-columns: 130px 1fr auto; padding: 10px 0; border-top: 1px solid var(--line); }
.appt-when { display: flex; flex-direction: column; }
.appt .time { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.appt.compact .time { font-size: 1rem; }
.appt-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.appt-actions form { margin: 0; }
.note { margin-top: 6px; font-size: .9rem; background: #302619; border-left: 3px solid #f5c451; padding: 4px 8px; border-radius: 4px; }
.st-row-cancelado, .st-row-ausente { opacity: .6; }
.st-row-pendiente { border-left: 4px solid #f59e0b; }
.st-row-confirmado { border-left: 4px solid var(--ok); }
@media (max-width: 760px) {
  .appt, .appt.compact { grid-template-columns: 1fr; gap: 6px; }
  .appt-actions { justify-content: flex-start; }
}
.pending summary { margin: 0; color: var(--text); }
.pending { border-color: #b98a35; background: #292016; }

.daynav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.daynav-title { flex: 1; display: flex; flex-direction: column; min-width: 180px; }
.daynav-pick { display: flex; align-items: center; gap: 8px; }
.daynav-pick input { width: auto; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.st-pendiente { background: #fef0c7; color: #93370d; }
.st-confirmado { background: #dcfae6; color: #085d3a; }
.st-completado { background: #e0eaff; color: #2d3282; }
.st-ausente { background: #f2f4f7; color: #475467; }
.st-cancelado { background: #fee4e2; color: #912018; }
.prof-tag { background: var(--primary-soft); color: var(--primary-dark); }

/* Colores de disponibilidad */
:root {
  --free-bg: #dcfae6; --free-line: #75e0a7; --free-text: #085d3a;
  --busy-bg: #fee4e2; --busy-line: #f97066; --busy-text: #912018;
  --pend-bg: #fef0c7; --pend-line: #fdb022; --pend-text: #93370d;
  --off-bg: #292725; --off-text: #bdb5a8;
}
.txt-ok { color: #87dda7; font-weight: 600; }
.txt-busy { color: #ffaaa3; font-weight: 600; }

/* Calendario mensual */
.cal-card { padding: 14px; }
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cal-head h2 { margin: 0; min-width: 170px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal-day {
  min-height: 96px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 7px;
  display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--text); background: var(--surface);
}
a.cal-day:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-num { font-weight: 700; font-size: .95rem; }
.cal-today { border: 2px solid var(--primary); }
.cal-today .cal-num { color: var(--primary-dark); }
.cal-out { background: transparent; border-style: dashed; border-color: #493b29; }
.cal-past { background: #211e1a; }
.cal-past .cal-num { color: var(--muted); }
.cal-closed { background: var(--off-bg); }
.cal-note { font-size: .75rem; color: var(--off-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-stat { font-size: .78rem; border-radius: 6px; padding: 1px 6px; border-left: 3px solid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-stat.ok { background: var(--free-bg); border-color: var(--free-line); color: var(--free-text); }
.cal-stat.busy { background: var(--busy-bg); border-color: var(--busy-line); color: var(--busy-text); }
.cal-stat.pend { background: var(--pend-bg); border-color: var(--pend-line); color: var(--pend-text); }
@media (max-width: 640px) {
  .cal { gap: 3px; }
  .cal-day { min-height: 64px; padding: 4px; border-radius: 7px; }
  .cal-stat { padding: 0 4px; font-size: .72rem; text-align: center; }
  .cal-stat .lbl, .cal-note { display: none; }
  .cal-head h2 { min-width: 0; flex: 1; font-size: 1rem; }
}

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid; }
.sw.ok { background: var(--free-bg); border-color: var(--free-line); }
.sw.busy { background: var(--busy-bg); border-color: var(--busy-line); }
.sw.pend { background: var(--pend-bg); border-color: var(--pend-line); }
.sw.off { background: var(--off-bg); border-color: #82796a; }
.sw.limit { background: #e8d6a5; border-color: #a77a1c; }

/* Grilla del día */
.daygrid { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 320px; }
.daygrid thead th { font-size: .85rem; text-align: left; padding: 4px 8px; vertical-align: bottom; min-width: 150px; }
.daygrid .dg-time { width: 60px; min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); padding-right: 6px; font-weight: 600; }
.cell { border-radius: 7px; padding: 0; height: 38px; font-size: .88rem; border-left: 4px solid transparent; }
.cell a { display: flex; flex-direction: column; justify-content: center; min-height: 38px; padding: 4px 9px; text-decoration: none; color: inherit; }
.cell.libre { background: var(--free-bg); border-left-color: var(--free-line); color: var(--free-text); }
.cell.libre a:hover { background: #b7f0cc; border-radius: 0 7px 7px 0; }
.cell.ocupado { background: var(--busy-bg); border-left-color: var(--busy-line); color: var(--busy-text); }
.cell.ocupado.pend { background: var(--pend-bg); border-left-color: var(--pend-line); color: var(--pend-text); }
.cell.ocupado a:hover { text-decoration: underline; }
.cell.pasado, .cell.off { background: var(--off-bg); color: var(--off-text); }
.cell.limitado { background: #e8d6a5; border-left-color: #a77a1c; color: #493300; padding: 4px 9px; }
.cell.pasado { padding: 4px 9px; }
.appt:target { box-shadow: 0 0 0 3px var(--primary); }

/* Tablas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-bottom: 16px; }
.card .table { border: 0; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #211c16; }
.table tr:last-child td { border-bottom: 0; }
.table form { margin: 0; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .9rem; }
.tabs a.on, .tabs a:hover { border-color: var(--primary); color: var(--primary-dark); }

.footer { border-top: 1px solid var(--line); background: #000; padding: 12px 0 14px; color: var(--muted); font-size: .9rem; text-align: center; }
.footer .wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer-brand { position: relative; margin-top: -20px; }
.footer-brand img { display: block; width: 180px; max-width: 100%; height: auto; }
.footer address { font-style: normal; }
