:root {
  --negro: #120e0b;
  --carbon: #1b1612;
  --madera: #5b3a24;
  --cobre: #c58a4a;
  --dorado: #d9a95b;
  --crema: #f3e9dc;
  --crema-suave: #cdbfae;
  --error: #ff9a8a;
  --fuente-titulo: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --fuente-texto: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--fuente-texto);
  color: var(--crema);
  background: var(--negro);
  line-height: 1.5;
}
[hidden] { display: none !important; }

/* ---------- LOGIN ---------- */
.login-fondo {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(24px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background:
    linear-gradient(rgba(12, 8, 5, 0.5), rgba(12, 8, 5, 0.68)),
    url('/img/fondo-login.jpg') center / cover no-repeat,
    var(--negro);
}

.tarjeta {
  width: min(100%, 400px);
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: rgba(24, 18, 13, 0.58);
  border: 1px solid rgba(217, 169, 91, 0.28);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.marca { text-align: center; margin-bottom: 18px; }
.corona { width: 52px; height: auto; color: var(--dorado); }
.monograma {
  font-family: var(--fuente-titulo);
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--dorado);
}
.marca-nombre {
  margin: 2px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--crema);
}
.lema { margin: 6px 0 0; font-size: 0.72rem; color: var(--crema-suave); letter-spacing: 0.06em; }

h1 {
  margin: 0 0 18px;
  text-align: center;
  font-family: var(--fuente-titulo);
  font-weight: 600;
  font-size: 1.3rem;
}

.campo { margin-bottom: 14px; }
.campo label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--crema-suave); }
.entrada { position: relative; display: flex; align-items: center; }
.icono {
  position: absolute; left: 14px;
  width: 18px; height: 18px;
  color: var(--crema-suave);
  pointer-events: none;
}
.entrada input {
  width: 100%;
  height: 48px;
  padding: 0 46px 0 42px;
  font: inherit;
  font-size: 16px; /* evita el zoom automático en iPhone */
  color: var(--crema);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(243, 233, 220, 0.18);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.entrada input::placeholder { color: rgba(205, 191, 174, 0.55); }
.entrada input:focus {
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(217, 169, 91, 0.22);
}

.ver {
  position: absolute; right: 4px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 10px;
  color: var(--crema-suave);
  cursor: pointer;
}
.ver svg { width: 20px; height: 20px; }
.ver:hover, .ver:focus-visible { color: var(--dorado); }
.ver .ojo-cerrado { display: none; }
.ver.activo .ojo-abierto { display: none; }
.ver.activo .ojo-cerrado { display: block; }

.mensaje {
  margin: 4px 0 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--error);
  background: rgba(255, 138, 122, 0.1);
  border: 1px solid rgba(255, 138, 122, 0.3);
  border-radius: 10px;
}

.boton {
  width: 100%;
  height: 50px;
  margin-top: 4px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  color: #1b1209;
  background: linear-gradient(135deg, var(--dorado), var(--cobre));
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}
.boton:hover { filter: brightness(1.08); }
.boton:active { transform: translateY(1px); }
.boton:disabled { opacity: 0.6; cursor: wait; }
.boton:focus-visible, .enlace:focus-visible {
  outline: 2px solid var(--crema);
  outline-offset: 2px;
}

.enlace {
  display: block;
  margin: 14px auto 0;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--crema-suave);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.enlace:hover { color: var(--dorado); }
.nota { margin: 8px 0 0; font-size: 0.8rem; text-align: center; color: var(--crema-suave); }

/* ---------- PANEL (base) ---------- */
.pagina-panel { background: linear-gradient(160deg, var(--carbon), var(--madera) 160%); }
.panel-cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  border-bottom: 1px solid rgba(217, 169, 91, 0.25);
}
.panel-marca { font-family: var(--fuente-titulo); font-weight: 700; font-size: 1.15rem; color: var(--dorado); }
.panel-cuerpo { max-width: 720px; margin: 0 auto; padding: 28px 18px 40px; }
.tarjeta-panel {
  padding: 22px;
  background: rgba(24, 18, 13, 0.6);
  border: 1px solid rgba(217, 169, 91, 0.25);
  border-radius: 16px;
}
.tarjeta-panel h1 { text-align: left; margin-bottom: 8px; }
.boton-sec {
  height: 40px; padding: 0 16px;
  font: inherit; font-size: 0.9rem; color: var(--crema);
  background: transparent;
  border: 1px solid rgba(243, 233, 220, 0.3);
  border-radius: 10px;
  cursor: pointer;
}
.boton-sec:hover { border-color: var(--dorado); color: var(--dorado); }

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

/* ---------- PANEL: Fase 2 ---------- */
.solo-lectores {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.panel-usuario { display: flex; align-items: center; gap: 10px; min-width: 0; }
.usuario-nombre {
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--crema-suave);
}

.pestanas {
  display: flex;
  gap: 6px;
  padding: 10px 18px 0;
  overflow-x: auto;
  border-bottom: 1px solid rgba(217, 169, 91, 0.18);
}
.pestana {
  flex: 0 0 auto;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--crema-suave);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.pestana:hover { color: var(--crema); }
.pestana[aria-current="true"] {
  color: var(--dorado);
  border-bottom-color: var(--dorado);
  font-weight: 600;
}
.pestana:focus-visible { outline: 2px solid var(--crema); outline-offset: -2px; }

.panel-cuerpo h2 {
  margin: 0 0 4px;
  font-family: var(--fuente-titulo);
  font-size: 1.3rem;
}
.panel-cuerpo h3 { margin: 24px 0 4px; font-size: 1rem; }
.ayuda { margin: 0 0 16px; font-size: 0.88rem; color: var(--crema-suave); }
.panel-cuerpo .nota { text-align: left; }

.control {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  color: var(--crema);
  color-scheme: dark;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(243, 233, 220, 0.18);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.control::placeholder { color: rgba(205, 191, 174, 0.55); }
.control:focus {
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(217, 169, 91, 0.22);
}
.control:disabled { opacity: 0.45; }

.fila-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.acciones .boton { width: auto; min-width: 170px; margin-top: 0; padding: 0 22px; }
.acciones .boton-sec { height: 50px; }

.boton-sec.chico { height: 34px; padding: 0 12px; font-size: 0.82rem; }
.boton-sec.peligro { color: var(--error); border-color: rgba(255, 154, 138, 0.45); }
.boton-sec.peligro:hover { color: #ffc2b8; border-color: var(--error); }

.mensaje.ok {
  color: #9be3a8;
  background: rgba(155, 227, 168, 0.1);
  border-color: rgba(155, 227, 168, 0.3);
}
.panel-cuerpo .mensaje { margin-top: 14px; }

.lista { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(243, 233, 220, 0.12);
  border-radius: 12px;
}
.item.inactivo { opacity: 0.6; }
.item-info { display: grid; gap: 2px; min-width: 0; }
.item-titulo { font-weight: 600; overflow-wrap: anywhere; }
.item-sub { font-size: 0.85rem; color: var(--crema-suave); }
.item-acciones { display: flex; flex-wrap: wrap; gap: 8px; }

.dias { display: grid; gap: 10px; margin-top: 14px; }
.dia {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(243, 233, 220, 0.12);
  border-radius: 12px;
}
.dia-cabecera { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.dia-cabecera input { width: 20px; height: 20px; accent-color: var(--dorado); }
.dia-horas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dia.cerrado .dia-horas { opacity: 0.45; }
.mini label { display: block; }
.mini span { display: block; margin-bottom: 4px; font-size: 0.75rem; color: var(--crema-suave); }
.campo-intervalo { max-width: 320px; margin-top: 18px; }

.opciones { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 14px; padding: 0; border: 0; }
.opciones label { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; cursor: pointer; }
.opciones input { width: 18px; height: 18px; accent-color: var(--dorado); }

@media (min-width: 720px) {
  .dia-horas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Ajuste: campos de fecha y hora en iPhone ---------- */
.campo,
.mini,
.fila-form > * {
  min-width: 0;
}

.control {
  min-width: 0;
  max-width: 100%;
}

input[type="date"].control,
input[type="time"].control {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}

input[type="date"].control::-webkit-date-and-time-value,
input[type="time"].control::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.4em;
  margin: 0;
}

/* ---------- PANEL: Fase 5 (turnos) ---------- */
.etiqueta { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--crema-suave); }
.alerta { color: #ffd08a; }

.turnos-barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.turnos-barra h2 { margin: 0; }
.turnos-barra .boton { width: auto; min-width: 150px; height: 44px; margin: 0; padding: 0 18px; }

.segmento {
  display: inline-flex;
  margin: 10px 0 12px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(243, 233, 220, 0.16);
  border-radius: 12px;
}
.segmento-btn {
  min-width: 84px;
  height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--crema-suave);
  background: none;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.segmento-btn[aria-pressed="true"] {
  color: #1b1209;
  font-weight: 600;
  background: linear-gradient(135deg, var(--dorado), var(--cobre));
}

.navegacion { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.nav-centro { display: grid; justify-items: center; text-align: center; min-width: 0; }
.nav-centro strong { font-family: var(--fuente-titulo); font-size: 1.05rem; }
.nav-centro .nota { margin: 0; text-align: center; }
.boton-sec.nav-flecha { width: 44px; height: 44px; padding: 0; font-size: 1.4rem; line-height: 1; }

.navegacion-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 4px; }
.campo-fecha { flex: 1 1 150px; min-width: 0; }
.check-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--crema-suave);
  cursor: pointer;
}
.check-mini input { width: 18px; height: 18px; accent-color: var(--dorado); }

.resumen-dia {
  margin: 10px 0 0;
  padding: 10px 14px;
  font-size: 0.9rem;
  background: rgba(217, 169, 91, 0.1);
  border: 1px solid rgba(217, 169, 91, 0.3);
  border-radius: 12px;
}

.grupo-dia { margin: 18px 0 0; }
.grupo-dia h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--dorado);
}
.grupo-dia h3 small { font-size: 0.78rem; font-weight: 400; color: var(--crema-suave); }

.lista-turnos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.turno {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(243, 233, 220, 0.12);
  border-radius: 12px;
}
.turno.cancelado { opacity: 0.55; }
.turno-hora { font-weight: 600; font-size: 0.95rem; color: var(--dorado); }
.turno-info { display: grid; gap: 2px; min-width: 0; }
.turno-nombre { font-weight: 600; overflow-wrap: anywhere; }
.turno-tel {
  width: fit-content;
  font-size: 0.88rem;
  color: var(--crema);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.turno-meta { font-size: 0.75rem; color: var(--crema-suave); }
.turno-pie {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--dorado);
  background: rgba(217, 169, 91, 0.14);
  border: 1px solid rgba(217, 169, 91, 0.4);
  border-radius: 999px;
}
.badge.estado-pendiente_pago { color: #ffd08a; background: rgba(255, 208, 138, 0.12); border-color: rgba(255, 208, 138, 0.4); }
.badge.estado-completado { color: #9be3a8; background: rgba(155, 227, 168, 0.1); border-color: rgba(155, 227, 168, 0.35); }
.badge.estado-no_asistio { color: #ffb48a; background: rgba(255, 180, 138, 0.1); border-color: rgba(255, 180, 138, 0.4); }
.badge.estado-cancelado,
.badge.estado-expirado { color: var(--error); background: rgba(255, 138, 122, 0.1); border-color: rgba(255, 138, 122, 0.4); }

/* Ventana de nuevo turno / mover turno */
.dialogo {
  width: min(92vw, 460px);
  max-height: 90vh;
  max-height: 90dvh;
  margin: auto;
  padding: 20px 18px;
  overflow: auto;
  color: var(--crema);
  background: #1b1612;
  border: 1px solid rgba(217, 169, 91, 0.4);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.dialogo::backdrop { background: rgba(8, 5, 3, 0.75); }
.dialogo h2 { margin: 0 0 14px; }

.horas-dueno { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.hora-op {
  display: grid;
  gap: 1px;
  padding: 9px 6px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  color: var(--crema);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(243, 233, 220, 0.18);
  border-radius: 12px;
  cursor: pointer;
}
.hora-op small { font-size: 0.68rem; font-weight: 400; color: var(--crema-suave); }
.hora-op:hover:not(:disabled) { border-color: var(--dorado); }
.hora-op:disabled { opacity: 0.4; cursor: default; }
.hora-op[aria-pressed="true"] {
  color: #1b1209;
  background: linear-gradient(135deg, var(--dorado), var(--cobre));
  border-color: transparent;
}
.hora-op[aria-pressed="true"] small { color: #3a2a14; }
.hora-op:focus-visible,
.segmento-btn:focus-visible { outline: 2px solid var(--crema); outline-offset: 2px; }

/* ---------- PANEL: Fase 6 (premium) ---------- */
.fila-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.badge.p-vigente { color: #9be3a8; background: rgba(155, 227, 168, 0.1); border-color: rgba(155, 227, 168, 0.35); }
.badge.p-agotado { color: #ffd08a; background: rgba(255, 208, 138, 0.12); border-color: rgba(255, 208, 138, 0.4); }
.badge.p-vencido { color: var(--error); background: rgba(255, 138, 122, 0.1); border-color: rgba(255, 138, 122, 0.4); }
.badge.p-retirado { color: var(--crema-suave); background: rgba(255, 255, 255, 0.06); border-color: rgba(243, 233, 220, 0.25); }

.historial { margin-top: 22px; font-size: 0.9rem; color: var(--crema-suave); }
.historial summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.historial .lista { margin-top: 12px; }

/* ---------- PANEL: Fase 8 (avisos) ---------- */
.campana {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--crema);
  background: transparent;
  border: 1px solid rgba(243, 233, 220, 0.3);
  border-radius: 10px;
  cursor: pointer;
}
.campana svg { width: 20px; height: 20px; }
.campana:hover,
.campana:focus-visible { color: var(--dorado); border-color: var(--dorado); }
.campana-contador {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  color: #1b1209;
  background: var(--dorado);
  border-radius: 999px;
}

.bloque { margin: 0 0 26px; }
.bloque h3 { margin: 0 0 8px; }
.avisos-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.item.aviso.noleida { border-color: rgba(217, 169, 91, 0.6); background: rgba(217, 169, 91, 0.08); }

/* ---------- Ajuste: fondo completo del panel (sin zonas blancas) ---------- */
html { background: var(--negro); }

.pagina-panel { background: transparent; }

.pagina-panel::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, var(--carbon), var(--madera) 160%);
}

/* Que el último contenido no quede tapado por la barra inferior del celular */
.panel-cuerpo {
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

/* Fecha y hora: el texto quedaba pegado arriba en iPhone */
input[type="date"].control,
input[type="time"].control {
  display: flex;
  align-items: center;
  line-height: 1.2;
}

/* ---------- Fase 8B: recordatorios ---------- */
.check-fila {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  font-size: 0.92rem;
  cursor: pointer;
}
.check-fila input { flex: none; width: 20px; height: 20px; accent-color: var(--dorado); }
.campo-corto { max-width: 260px; }

.recordatorios { margin: 0 0 14px; }
.recordatorios .nota { margin: 0 0 10px; text-align: left; }

/* ---------- Fase 9: estadísticas y ajustes finales de diseño ---------- */
.est-filtros .campo { max-width: 260px; }
.est-rango { margin: 14px 0 0; font-weight: 600; color: var(--dorado); }

.aviso-panel {
  margin: 14px 0 0;
  padding: 12px 14px;
  font-size: 0.9rem;
  background: rgba(255, 208, 138, 0.1);
  border-left: 3px solid #ffd08a;
  border-radius: 8px;
}

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.kpi {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(243, 233, 220, 0.12);
  border-radius: 12px;
}
.kpi-etq { font-size: 0.78rem; color: var(--crema-suave); }
.kpi-valor { font-family: var(--fuente-titulo); font-size: 1.2rem; overflow-wrap: anywhere; }
.kpi-sub { font-size: 0.74rem; color: var(--crema-suave); }
.kpi-sub.sube { color: #9be3a8; }
.kpi-sub.baja { color: var(--error); }

.est-bloque { margin: 22px 0 0; }
.est-bloque h3 { margin: 0 0 10px; }
.est-doble { display: grid; gap: 4px 28px; }

/* Gráfica de barras */
.grafica { display: flex; align-items: flex-end; gap: 3px; margin-top: 8px; }
.grafica .col {
  flex: 1 1 0;
  min-width: 0;
  max-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.barra-zona { display: flex; align-items: flex-end; height: 120px; }
.barra {
  display: block;
  width: 100%;
  min-width: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--dorado), var(--cobre));
  opacity: 0.85;
}
.barra.vacia { background: rgba(243, 233, 220, 0.18); opacity: 1; }
.col:hover .barra,
.col[aria-pressed="true"] .barra { opacity: 1; }
.col[aria-pressed="true"] .barra { box-shadow: 0 0 0 2px rgba(243, 233, 220, 0.6); }
.col-etq { display: flex; justify-content: center; height: 18px; margin-top: 4px; }
.col-etq span { font-size: 0.66rem; white-space: nowrap; color: var(--crema-suave); }
.col:focus-visible { outline: 2px solid var(--crema); outline-offset: 2px; }

/* Barras horizontales */
.hbarras { list-style: none; margin: 0; padding: 0; }
.hb { display: grid; gap: 4px; margin: 0 0 12px; }
.hb-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; }
.hb-nombre { min-width: 0; overflow-wrap: anywhere; }
.hb-valor { flex: none; font-weight: 600; color: var(--dorado); }
.hb-pista { height: 8px; overflow: hidden; background: rgba(255, 255, 255, 0.08); border-radius: 999px; }
.hb-relleno { height: 100%; background: linear-gradient(90deg, var(--dorado), var(--cobre)); border-radius: 999px; }
.hb-sub { font-size: 0.78rem; color: var(--crema-suave); }

.enlace-boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

/* Cabecera y pestañas en celular */
.panel-marca { white-space: nowrap; }
.pestanas {
  padding-right: 40px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.pestanas::-webkit-scrollbar { display: none; }

@media (max-width: 520px) {
  .panel-cabecera { gap: 8px; padding-left: 14px; padding-right: 14px; }
  .panel-marca { font-size: 1rem; }
  .usuario-nombre { display: none; }
  .panel-usuario { gap: 8px; }
  .panel-usuario .boton-sec { padding: 0 12px; font-size: 0.82rem; white-space: nowrap; }
}

@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .est-doble { grid-template-columns: 1fr 1fr; }
}

/* ---------- Entrega final: recuperación de acceso, ajustes y diagnóstico ---------- */
.entrada input.sin-icono { padding-left: 14px; padding-right: 14px; }
.tarjeta code {
  padding: 1px 6px;
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.codigo-recuperacion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  background: rgba(217, 169, 91, 0.1);
  border: 1px dashed rgba(217, 169, 91, 0.6);
  border-radius: 14px;
}
.tarjeta .codigo-recuperacion { justify-content: center; }
.codigo-grande {
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: var(--dorado);
  overflow-wrap: anywhere;
}
.boton-sec.grande-login { width: 100%; height: 46px; margin-bottom: 4px; }

.diagnostico {
  margin: 14px 0 0;
  padding: 12px 14px;
  font: 0.8rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--crema);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(243, 233, 220, 0.14);
  border-radius: 12px;
}
.panel-cuerpo a { color: var(--dorado); }
.panel-cuerpo a.boton-sec { color: var(--crema); }
.panel-cuerpo a.boton-sec:hover { color: var(--dorado); }

.tarjeta h1 + .nota { margin: -6px 0 18px; }

/* ---------- Compartir: enlace, código QR y cartel ---------- */
.enlace-url { margin: 4px 0 0; text-overflow: ellipsis; }
.qr-caja {
  width: fit-content;
  margin: 14px auto;
  padding: 14px;
  background: #fff;
  border-radius: 16px;
}
.qr-imagen { display: block; width: min(260px, 70vw); height: auto; aspect-ratio: 1; }

/* El cartel solo existe al imprimir */
.cartel { display: none; }
@page { margin: 14mm; }
@media print {
  html, body { background: #fff !important; }
  .pagina-panel::before { display: none !important; }
  body > *:not(#cartel) { display: none !important; }
  .cartel {
    display: grid !important;
    justify-items: center;
    gap: 7mm;
    padding-top: 10mm;
    text-align: center;
    color: #111;
    font-family: var(--fuente-texto);
  }
  .cartel-corona { width: 26mm; height: auto; color: #111; }
  .cartel-marca { font-size: 13pt; letter-spacing: 0.3em; text-transform: uppercase; }
  .cartel h2 { margin: 0; font-family: var(--fuente-titulo); font-size: 30pt; line-height: 1.15; }
  .cartel-qr { width: 105mm; height: 105mm; }
  .cartel p { margin: 0; font-size: 14pt; }
  .cartel .cartel-url { font-size: 16pt; font-weight: 600; overflow-wrap: anywhere; }
}
[data-seccion="compartir"] .aviso-panel { margin: 0 0 20px; }