/*
 * PicarHorario — estilos propios de la aplicación (se cargan después de tabler.min.css y marca.css).
 */

body { -webkit-font-smoothing: antialiased; }

/* Letra un poco más grande y con más aire que la de Tabler (14 px e interlineado 1,43), en todo el programa:
   cambiando sus valores base, sin tocar las plantillas. */
:root { --tblr-body-font-size: .9375rem; --tblr-body-line-height: 1.5; --tblr-btn-input-font-size: .9375rem; --tblr-btn-input-line-height: 1.375rem; --tblr-font-size-h2: 1.375rem; --tblr-line-height-h2: 1.875rem; }
.form-label { font-size: inherit; }
.card-title { font-size: 1.0625rem; }
.badge { line-height: 1.25; vertical-align: .1em; }
/* Una línea pequeña debajo de otra (subtítulo de un nombre, «Último acceso», una dirección, un aviso): un poco de aire.
   No cuando van una al lado de la otra (filas flexibles, columnas y cabeceras de tarjeta). */
:not(.d-flex):not(.row):not(.card-header) > div.small:not(:first-child) { margin-top: .3rem; }
/* En el móvil, campos a 16 px: con menos, el iPhone se acerca solo al tocarlos y hay que alejar a mano. */
@media (max-width: 767.98px) { :root { --tblr-btn-input-font-size: 1rem; } }
.ph-marca-linea { height: 4px; background: var(--ph-degradado); }
.ph-hora { font-variant-numeric: tabular-nums; }
.navbar-brand img { height: 30px; width: auto; }

/* Pantallas sueltas (instalador, acceso) */
.ph-pantalla-suelta { min-height: 100vh; background: radial-gradient(60vmax 60vmax at 110% -10%, rgba(198, 89, 248, .10), transparent 60%), radial-gradient(50vmax 50vmax at -10% 110%, rgba(0, 234, 251, .10), transparent 60%), var(--tblr-body-bg, #f6f8fb); }
.ph-tarjeta-suelta { border-radius: 1rem; box-shadow: 0 20px 50px -25px rgba(3, 3, 36, .35); border: 0; }

/* Pasos del instalador */
.ph-pasos { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: paso; }
.ph-pasos li { flex: 1; font-size: .8125rem; color: var(--tblr-secondary); counter-increment: paso; }
.ph-pasos li::before { content: counter(paso); display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; margin-right: .4rem; font-weight: 700; font-size: .75rem; background: rgba(3, 3, 36, .08); color: var(--ph-noche); }
.ph-pasos li.hecho::before { content: "✓"; background: #2fb344; color: #fff; }
.ph-pasos li.actual { color: var(--tblr-body-color); font-weight: 600; }
.ph-pasos li.actual::before { background: var(--ph-azul); color: #fff; }
.ph-pasos li > span { display: inline; }
@media (max-width: 576px) { .ph-pasos li:not(.actual) > span { display: none; } }

.ph-comprobacion { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--tblr-border-color); }
.ph-comprobacion:last-child { border-bottom: 0; }
.ph-comprobacion .ti { font-size: 1.25rem; flex-shrink: 0; margin-top: .05rem; }

.ph-condiciones { max-height: 220px; overflow: auto; background: rgba(3, 3, 36, .03); border-radius: .5rem; padding: .75rem 1rem; font-size: .8125rem; }
.ph-condiciones p:last-child { margin-bottom: 0; }

.ph-boton-principal { background: var(--ph-degradado-boton); color: #fff; border: 0; font-weight: 600; }
.ph-boton-principal:hover, .ph-boton-principal:focus-visible { color: #fff; filter: brightness(1.08); }

/* Panel */
.ph-reloj-grande { font-size: 2.25rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }

.ph-icono-paso { width: 2.25rem; height: 2.25rem; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--ph-degradado-boton); color: #fff; font-weight: 700; }
[hidden] { display: none !important; }

/* Hoja de bienvenida: al imprimir, solo la hoja. */
@media print {
  body { background: #fff !important; }
  .ph-hoja { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ---------- Web app del trabajador (móvil) ---------- */
.ph-app-body { background: #eef1fb; }
.ph-app { max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--tblr-body-bg, #f6f8fb); display: flex; flex-direction: column; }
@media (min-width: 520px) { .ph-app { box-shadow: 0 0 40px -20px rgba(3, 3, 36, .35); } }
.ph-movil-cabecera { padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 4.5rem; background: var(--ph-noche); color: #fff; }
.ph-movil-cabecera a { color: #fff; }
.ph-movil-cuerpo { padding: 0 1rem 1rem; margin-top: -3.5rem; flex: 1; position: relative; z-index: 1; }
/* Avatar: azul con letras blancas, también al pasar el ratón (Tabler pinta de azul el texto de «a.avatar» al pasar el ratón). */
.ph-avatar, a.ph-avatar:hover, a.ph-avatar:focus { background: var(--ph-azul); color: #fff; text-decoration: none; }
.ph-tarjeta-app { border-radius: 1.25rem; }
.ph-reloj { font-size: 3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.ph-btn-fichar { border-radius: 1rem; padding: 1.15rem 1rem; width: 100%; font-weight: 700; font-size: 1.25rem; box-shadow: 0 12px 24px -10px rgba(18, 65, 249, .6); }
.ph-btn-fichar .ti { font-size: 1.5rem; vertical-align: -4px; margin-right: .35rem; }
/* Botón oscuro: se le dan a Tabler sus colores y él pinta el reposo, el ratón encima y el pulsado. */
.ph-btn-finalizar { --tblr-btn-bg: var(--ph-noche); --tblr-btn-color: #fff; --tblr-btn-border-color: var(--ph-noche); --tblr-btn-hover-bg: #1c1c52; --tblr-btn-hover-color: #fff; --tblr-btn-hover-border-color: #1c1c52; --tblr-btn-active-bg: #000; --tblr-btn-active-color: #fff; --tblr-btn-active-border-color: #000; border-radius: 1rem; padding: 1.15rem 1rem; width: 100%; font-weight: 700; font-size: 1.25rem; }
.modal .ph-btn-finalizar { padding: .75rem 1rem; font-size: 1.0625rem; }
.ph-btn-secundario { border-radius: 1rem; padding: .9rem 1rem; width: 100%; font-weight: 600; }
.ph-estado { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .875rem; }
.ph-punto { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--tblr-orange, #f76707); }
.ph-punto.trabajando { background: #2fb344; box-shadow: 0 0 0 4px rgba(47, 179, 68, .2); }
.ph-punto.pausa { background: #f59f00; box-shadow: 0 0 0 4px rgba(245, 159, 0, .2); }
.ph-punto.fuera { background: #9ba9be; }
.ph-linea-tiempo { list-style: none; padding: 0; margin: 0; }
.ph-linea-tiempo li { display: flex; gap: .75rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--tblr-border-color); }
.ph-linea-tiempo li:last-child { border-bottom: 0; }
.ph-linea-tiempo .hora { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3rem; }
.ph-icono-redondo { width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(18, 65, 249, .1); color: var(--ph-azul); flex-shrink: 0; }
.ph-icono-redondo.pausa { background: rgba(245, 159, 0, .12); color: #c27c00; }
.ph-icono-redondo.fin { background: rgba(3, 3, 36, .08); color: var(--ph-noche); }
.modal .ph-icono-redondo { width: 3rem; height: 3rem; font-size: 1.5rem; }
.ph-nav-inferior { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-around; border-top: 1px solid var(--tblr-border-color); background: #fff; padding: .4rem 0 calc(.6rem + env(safe-area-inset-bottom)); }
.ph-nav-inferior a { display: flex; flex-direction: column; align-items: center; font-size: .6875rem; color: var(--tblr-secondary); text-decoration: none; gap: .1rem; min-width: 4rem; }
.ph-nav-inferior a .ti { font-size: 1.4rem; }
.ph-nav-inferior a.activo { color: var(--ph-azul); font-weight: 600; }
.ph-tarjeta-app .modal-footer { background: transparent; border-top: 0; display: grid; grid-template-columns: 1fr; }
.ph-codigo-input { font-size: 2rem; letter-spacing: .5em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: .5em; }
.ph-enviando { position: fixed; inset: 0; z-index: 2000; background: rgba(3, 3, 36, .55); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }

/* ---------- Pantalla del centro ---------- */
.ph-centro-body { background: var(--ph-noche); }
.ph-centro { min-height: 100vh; background: var(--ph-noche); color: #fff; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.ph-centro::before { content: ""; position: absolute; width: 70vmax; height: 70vmax; right: -25vmax; top: -30vmax; background: radial-gradient(circle, rgba(198, 89, 248, .35) 0%, rgba(18, 65, 249, .18) 40%, transparent 70%); pointer-events: none; }
.ph-centro::after { content: ""; position: absolute; width: 60vmax; height: 60vmax; left: -25vmax; bottom: -35vmax; background: radial-gradient(circle, rgba(0, 234, 251, .18) 0%, transparent 65%); pointer-events: none; }
.ph-centro > * { position: relative; z-index: 1; }
.ph-centro-codigo { font-size: clamp(4rem, 13vw, 11rem); font-weight: 800; letter-spacing: .08em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-centro-codigo .sep { display: inline-block; width: .35em; }
.ph-centro-reloj { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 600; font-variant-numeric: tabular-nums; opacity: .9; }
.ph-cuenta { width: min(520px, 80vw); height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.ph-cuenta > div { height: 100%; background: linear-gradient(90deg, #C659F8, #1241F9, #00EAFB); border-radius: 99px; transition: width 1s linear; }
.ph-paso-centro { background: #1241F9; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .875rem; }
.ph-codigo-viejo { opacity: .35; }

/* ---------- Quiosco ---------- */
.ph-quiosco-body { background: #eef1fb; }
.ph-quiosco { min-height: 100vh; display: flex; flex-direction: column; }
.ph-quiosco-cabecera { background: var(--ph-noche); color: #fff; }
.ph-quiosco-reloj { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.ph-quiosco-paso { flex: 1; padding: 0 1rem 1rem; }
.ph-quiosco-nombres { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; max-width: 1100px; margin: 0 auto; }
.ph-quiosco-persona { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem .5rem; border: 0; border-radius: 1rem; background: #fff; box-shadow: 0 6px 18px -12px rgba(3, 3, 36, .35); font-weight: 600; font-size: 1rem; max-width: 100%; }
.ph-quiosco-persona .avatar { background: #1241F9; color: #fff; }
.ph-quiosco-persona:active { transform: scale(.98); }
.ph-quiosco-persona.sin-pin { opacity: .55; }
.ph-quiosco-tarjeta { max-width: 420px; margin: 2rem auto; background: #fff; border-radius: 1.5rem; padding: 2rem 1.5rem; box-shadow: 0 20px 50px -25px rgba(3, 3, 36, .35); }
.ph-pin-puntos { display: flex; justify-content: center; gap: .75rem; min-height: 1.25rem; }
.ph-pin-puntos span { width: 1rem; height: 1rem; border-radius: 50%; background: var(--ph-noche); }
.ph-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.ph-teclado button { font-size: 1.75rem; font-weight: 600; padding: .9rem 0; border-radius: 1rem; border: 0; background: rgba(3, 3, 36, .06); font-variant-numeric: tabular-nums; }
.ph-teclado button:active { background: rgba(18, 65, 249, .18); }
.ph-teclado button.ok { background: #1241F9; color: #fff; }

/* ---------- Correcciones ---------- */
.ph-nota-correccion { font-size: .875em; color: var(--tblr-azure, #4299e1); margin-top: .15rem; }
.ph-anulado .hora, .ph-anulado .ph-tipo { text-decoration: line-through; color: var(--tblr-secondary); }
.ph-anulado .ph-nota-correccion { color: var(--tblr-danger, #d63939); }
.ph-mapa { height: 220px; border-radius: .5rem; z-index: 0; }
.modal .ph-mapa { height: min(65vh, 480px); border-radius: 0; }

/* ---------- Turnos y cuadrante ---------- */
.ph-turno { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 1.6rem; padding: 0 .35rem;
  border-radius: .35rem; font-weight: 600; font-size: .8125rem; color: #fff; background: var(--ph-color, #1241F9); font-variant-numeric: tabular-nums; }
.ph-turno-fijo { background: transparent; color: var(--ph-color, #667382); border: 1px dashed var(--ph-color, #667382); font-weight: 500; }
.ph-turno-vacio { background: transparent; color: var(--tblr-secondary); }
.ph-casilla { border: 0; background: transparent; padding: .15rem; border-radius: .4rem; cursor: pointer; position: relative; }
.ph-casilla:hover, .ph-casilla:focus-visible { outline: 2px solid var(--tblr-primary); }
.ph-casilla.ph-pendiente::after { content: ''; display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: var(--tblr-orange, #f76707); }
.ph-casilla.ph-pendiente::after { position: absolute; top: 0; right: 0; }
.ph-dia-festivo { background: rgba(214, 57, 57, .06); }
.ph-cuadrante th, .ph-cuadrante td { white-space: nowrap; }
.ph-cuadrante { user-select: none; }
.ph-pincel.active { outline: 2px solid var(--tblr-primary); }

/* Cabeceras de tarjeta: lo de la derecha (subtítulo o botón) baja debajo del título si no cabe, y entonces a la
   izquierda, no pegado a la derecha (con space-between, lo que queda solo en una línea va al principio). */
.card-header { flex-wrap: wrap; justify-content: space-between; row-gap: .25rem; column-gap: 1rem; }
.card-header > .card-actions { margin-left: 0; }

/* Móvil (desde 360 px de ancho, los móviles de hoy): nada se sale de la pantalla. */
/* En Safari (iPhone), el texto largo de un desplegable no se recorta y ensancha la página: se corta con «…». */
.form-select { overflow: hidden; text-overflow: ellipsis; }
.ph-nota { width: 10rem; }
@media (max-width: 767.98px) {
  /* Filas de aviso con acciones (Incidencias): el texto arriba y las acciones debajo, a todo el ancho. */
  .ph-fila { flex-direction: column; align-items: stretch !important; }
  .ph-fila > .ph-acciones { flex-wrap: wrap; }
  .ph-fila .ph-acciones > form { flex: 1 1 100%; min-width: 0; }
  /* Como en los input-group de Bootstrap: el campo ocupa lo que quede junto al botón. */
  .ph-fila .ph-nota { width: 1%; flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 575.98px) {
  /* Etiquetas y avisos con un botón: pueden partirse en dos líneas en lugar de salirse. */
  .badge { white-space: normal; text-align: left; }
  .alert.d-flex { flex-wrap: wrap; }
  .alert .btn { white-space: normal; }
}
@media (max-width: 399.98px) {
  /* Móviles muy estrechos (320 px): los botones a todo el ancho parten el texto en dos líneas en vez de salirse. */
  .btn.w-100, .d-grid > .btn, .d-grid .btn { white-space: normal; }
}
