/* Talita Kum — Asistencia */
/* Colores institucionales: azul y rojo (del logo de Talita Kum) */
:root {
  --primario: #0c548a;
  --primario-claro: #1174b4;
  --acento: #d5433d;
  --fondo: #f1f5f9;
  --tarjeta: #ffffff;
  --texto: #0f172a;
  --texto-suave: #64748b;
  --linea: #e2e8f0;
  --verde: #16a34a;
  --rojo: #dc2626;
  --ambar: #d97706;
  --radio: 14px;
  --sombra: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 16px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  font-size: 16px;
  line-height: 1.5;
}
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.1rem; margin: .2rem 0 .8rem; color: var(--primario); }
a { color: var(--primario-claro); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: .78rem; word-break: break-all; }

/* ---------- barra superior ---------- */
.topbar { background: var(--primario); color: #fff; box-shadow: var(--sombra); }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: .5rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.marca { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; }
.marca:hover { text-decoration: none; }
.marca-logo {
  background: var(--acento); color: #fff; font-weight: 800;
  border-radius: 10px; padding: .25rem .5rem; font-size: .9rem; letter-spacing: .5px;
}
.marca-logo.grande { font-size: 1.6rem; padding: .5rem .9rem; border-radius: 16px; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.nav a {
  color: rgba(255,255,255,.85); padding: .35rem .6rem; border-radius: 8px;
  font-size: .92rem; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }

/* ---------- layout ---------- */
.contenido { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.tarjeta {
  background: var(--tarjeta); border-radius: var(--radio);
  box-shadow: var(--sombra); padding: 1.1rem 1.2rem; margin-bottom: 1rem;
}
.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .dos-columnas { grid-template-columns: 1fr; } }
.fila-titulo {
  display: flex; justify-content: space-between; align-items: center;
  gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem;
}
.centrado { text-align: center; }
.derecha { text-align: right; }

/* ---------- KPIs ---------- */
.tarjetas-kpi {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .8rem; margin-bottom: 1rem;
}
.kpi { text-align: center; padding: .9rem .6rem; }
.kpi .dato { display: block; font-size: 1.25rem; font-weight: 800; color: var(--primario); }
.kpi .etiqueta { display: block; font-size: .78rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .4px; }
.numero-grande { font-size: 2.4rem; font-weight: 800; color: var(--primario); margin: .3rem 0; }
.rojo { color: var(--rojo) !important; }
.verde-texto { color: var(--verde) !important; }

/* ---------- botones ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit;
  padding: .55rem 1rem; border-radius: 10px; font-weight: 600;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-primario { background: var(--primario-claro); color: #fff; }
.btn-secundario { background: #dbeafe; color: var(--primario); }
.btn-peligro { background: #fee2e2; color: var(--rojo); }
.btn-ghost { background: transparent; color: inherit; border: 1px solid var(--linea); }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.btn-bloque { width: 100%; }
.btn-chico { padding: .3rem .7rem; font-size: .85rem; }
.btn-enlace {
  background: none; border: 0; padding: 0; color: var(--primario-claro);
  cursor: pointer; font: inherit; font-size: .9rem;
}
.btn-enlace:hover { text-decoration: underline; }
.form-inline { display: inline; }

/* ---------- fichaje (pantalla del profesional) ---------- */
.panel-fichaje { max-width: 430px; margin: 0 auto; text-align: center; }
.fecha-hoy { color: var(--texto-suave); text-transform: capitalize; }
.estado {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: 1.15rem; font-weight: 800; letter-spacing: 1px;
  margin: .4rem 0 .6rem;
}
.punto { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.punto.verde { background: var(--verde); }
.punto.gris { background: #94a3b8; }
.parpadeo { animation: parpadeo 1.6s ease-in-out infinite; }
@keyframes parpadeo { 50% { opacity: .35; } }
.detalle-estado { color: var(--texto-suave); margin: .2rem 0 1rem; }
.detalle-estado strong { color: var(--texto); }
.boton-fichar {
  width: min(280px, 78vw); aspect-ratio: 1; border-radius: 50%;
  border: 0; cursor: pointer; font: inherit; font-size: 1.5rem; font-weight: 800;
  color: #fff; letter-spacing: 1px; line-height: 1.3;
  box-shadow: 0 10px 30px rgba(12, 84, 138, .35);
  transition: transform .1s ease;
  margin: .5rem 0 1.2rem;
}
.boton-fichar:active { transform: scale(.97); }
.boton-fichar.entrada { background: radial-gradient(circle at 30% 25%, #2b8fd0, #0c548a 70%); }
.boton-fichar.salida { background: radial-gradient(circle at 30% 25%, #e05a50, #b93830 70%); box-shadow: 0 10px 30px rgba(185, 56, 48, .35); }
.resumen-mini {
  display: flex; justify-content: space-around; gap: .5rem;
  background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: .8rem; margin-bottom: 1rem;
}
.resumen-mini .dato { display: block; font-weight: 700; color: var(--primario); font-size: .95rem; }
.resumen-mini .etiqueta { display: block; font-size: .75rem; color: var(--texto-suave); }
.aviso-responsabilidad {
  font-size: .85rem; color: var(--texto-suave);
  border-top: 1px dashed var(--linea); padding-top: .8rem;
}

/* ---------- login ---------- */
.login-caja { max-width: 380px; margin: 8vh auto 0; }
.login-marca { text-align: center; margin-bottom: 1.2rem; }
.login-marca h1 { margin: .6rem 0 0; }
.login-form label { display: block; margin-bottom: .9rem; }

/* ---------- formularios ---------- */
label { font-size: .9rem; font-weight: 600; color: var(--texto); }
input, select, textarea {
  width: 100%; padding: .55rem .7rem; margin-top: .25rem;
  border: 1px solid var(--linea); border-radius: 10px; font: inherit;
  background: #fff; color: var(--texto);
}
input:focus, select:focus { outline: 2px solid var(--primario-claro); border-color: transparent; }
.form-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.2rem; }
@media (max-width: 640px) { .form-columnas { grid-template-columns: 1fr; } }
.form-acciones { grid-column: 1 / -1; display: flex; gap: .6rem; }
.form-filtros { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.form-filtros input, .form-filtros select { width: auto; margin-top: 0; }
.form-filtros .ancho-2 { flex: 1; min-width: 200px; }
.form-filtros .check { display: flex; align-items: center; gap: .3rem; font-weight: 400; }
.form-filtros .check input { width: auto; }
.form-correccion { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0; }
.form-correccion input { width: auto; margin-top: 0; font-size: .85rem; }

/* ---------- tablas ---------- */
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th {
  text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .4px;
  color: var(--texto-suave); padding: .5rem .6rem; border-bottom: 2px solid var(--linea);
}
.tabla td { padding: .55rem .6rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .derecha { text-align: right; }
.tabla-chica { font-size: .82rem; }
.tabla-scroll { overflow-x: auto; }
.fila-inactiva { opacity: .55; }
.fila-alerta td { background: #fffbeb; }
.fila-total td { font-weight: 800; border-top: 2px solid var(--primario); }
.celda-json { max-width: 340px; }
.acciones { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---------- pastillas y avisos ---------- */
.pastilla {
  display: inline-block; padding: .1rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
}
.pastilla.ok { background: #dcfce7; color: #166534; }
.pastilla.verde { background: #dcfce7; color: #166534; }
.pastilla.alerta { background: #fef3c7; color: #92400e; }
.pastilla.info { background: #e0f2fe; color: #075985; }
.pastilla.gris { background: #e2e8f0; color: #475569; }

.flash {
  padding: .7rem 1rem; border-radius: 10px; margin-bottom: .8rem; font-weight: 600;
}
.flash-ok { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #e0f2fe; color: #075985; }

.alertas { border-left: 5px solid var(--ambar); }
.alertas ul { margin: .2rem 0 0; padding-left: 1.2rem; }
.alertas li { margin-bottom: .35rem; }

.texto-suave { color: var(--texto-suave); }
.etiqueta { font-size: .78rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .4px; }
.monto { font-weight: 800; color: var(--primario); font-size: 1.05rem; display: block; }

.lista-datos { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; margin: 0; }
.lista-datos dt { font-weight: 600; color: var(--texto-suave); }
.lista-datos dd { margin: 0; }

.liquidacion-item { display: flex; justify-content: space-between; align-items: center; }
.desplegable summary { cursor: pointer; }
.desplegable-fila summary { cursor: pointer; list-style: none; }
.paginacion { display: flex; gap: .8rem; align-items: center; justify-content: center; }
.interruptor { display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem; }
.interruptor input { width: 1.15rem; height: 1.15rem; margin: 0; }
form.tarjeta > label { display: block; margin-bottom: .9rem; }
.form-filtros label { display: flex; align-items: center; gap: .4rem; margin-bottom: 0; }
