:root {
  /* Paleta Grupo CSI (grupocsi.com): marino a azul rey, turquesa del logo */
  --fondo: #edf2fb;
  --superficie: #ffffff;
  --superficie-2: #f3f7fe;
  --borde: #d9e3f5;
  --borde-fuerte: #c3d1ec;
  --texto: #0f1d3d;
  --texto-2: #46577a;
  --texto-3: #7887a6;
  --acento: #1d5fd1;
  --acento-hover: #2f74e6;
  --acento-suave: #e7eefc;
  --turquesa: #3ccad3;
  --marino: #07153d;
  --marino-2: #0e2d7a;
  --radio: 12px;
  --sombra: 0 1px 2px rgba(10, 40, 80, .05), 0 4px 14px rgba(10, 40, 80, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--fondo); color: var(--texto); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
b { font-weight: 600; }
h1, h2, p { margin: 0; }
h1 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; }
.sub { color: var(--texto-3); font-size: 12.5px; }
.tenue { color: var(--texto-3); font-size: 12.5px; }

/* Estructura */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.lateral {
  background: linear-gradient(165deg, var(--marino-2) 0%, #0a2160 45%, var(--marino) 100%); border-right: 0; color: #c9d7ef;
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.marca { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.01em; padding: 4px 10px 18px; }
.logo {
  width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--turquesa), var(--acento)); border: 0;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff;
}
.lateral .marca { color: #fff; }
.grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7f95ab; padding: 10px 10px 6px; border-top: 1px solid rgba(255,255,255,.08); }
.lateral nav { display: flex; flex-direction: column; gap: 2px; }
.lateral nav a, .lateral .enlace {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #b3c4e6;
  font-size: 13.5px; position: relative;
}
.lateral nav a:hover, .lateral .enlace:hover { background: rgba(255,255,255,.06); color: #fff; }
.lateral nav a.activo { background: rgba(47,116,230,.28); color: #fff; font-weight: 550; }
.lateral nav a.activo::before { content: ""; position: absolute; left: -14px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--turquesa); }
.salir { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; }
.enlace { background: none; border: 0; width: 100%; font: inherit; cursor: pointer; }
.ico { width: 17px; height: 17px; flex: none; }
.ico.grande { width: 26px; height: 26px; color: var(--texto-3); }

.principal { min-width: 0; }
.superior {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px; background: var(--superficie); border-bottom: 1px solid var(--borde);
  box-shadow: inset 0 3px 0 var(--acento);
}
.perfil { display: flex; align-items: center; gap: 10px; color: var(--texto-2); font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--acento-suave); border: 1px solid var(--borde-fuerte); display: grid; place-items: center; font-weight: 600; color: var(--acento); }
main { padding: 24px 28px 48px; max-width: 1280px; }

/* Tarjetas */
.tarjeta {
  background: linear-gradient(180deg, var(--superficie-2) 0, var(--superficie) 64px);
  border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--sombra);
}
.cabeza { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.cabeza .sub { margin-top: 2px; }
.barra { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
/* Asistencia: barra de filtros y pestañas */
.filtros-asistencia { padding-bottom: 14px; }
.barra-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.barra-filtros label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--texto-2); font-weight: 500; }
.barra-filtros input[type=date] { width: 160px; }
.barra-filtros select { min-width: 170px; }
.barra-filtros input[type=date], .barra-filtros select, .barra-filtros .boton, .barra-filtros button { height: 40px; }
.barra-filtros .boton.secundario { margin-left: auto; }
.barra-inferior { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0; }
.filtros-asistencia .buscador { margin: 0; }
.pestanas { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--borde-fuerte); }
.pestanas a { padding: 10px 16px; font-size: 14px; font-weight: 550; color: var(--texto-2); text-decoration: none;
  border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pestanas a:hover { color: var(--texto); }
.pestanas a.activa { color: var(--acento); border-bottom-color: var(--acento); }
.envio summary { cursor: pointer; list-style: none; }
.envio summary::-webkit-details-marker { display: none; }
.envio[open] summary { margin-bottom: 12px; }
td.resaltado { background: var(--acento-suave); font-weight: 600; }
.etiqueta-filtro { font-size: 12.5px; color: var(--texto-3); padding: 5px 4px 5px 8px; }
.atajos-area a { color: var(--acento); font-weight: 550; }
.nota-regla { margin-top: 12px; line-height: 1.6; }
.acciones-carga { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tablero */
.tablero { margin-bottom: 16px; }
.tablero > .cabeza { margin-bottom: 10px; }
.grupos { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.grupo-tarjeta { display: flex; flex-direction: column; gap: 12px; margin: 0; color: var(--texto); text-decoration: none;
  transition: border-color .15s, box-shadow .15s; }
.grupo-tarjeta:hover { border-color: var(--acento); box-shadow: 0 6px 20px rgba(29, 95, 209, .12); }
.grupo-tarjeta.activa { border-color: var(--acento); box-shadow: inset 0 0 0 1px var(--acento); }
.grupo-tarjeta.total { background: linear-gradient(160deg, var(--marino-2), var(--marino)); color: #fff; border-color: transparent; }
.grupo-tarjeta.total .sub, .grupo-tarjeta.total .medidor-fila span, .grupo-tarjeta.total .grupo-cifras span { color: #b3c4e6; }
.grupo-tarjeta.total .pista { fill: rgba(255, 255, 255, .16); }
.grupo-tarjeta.total .relleno { fill: var(--turquesa); }
.grupo-tarjeta.total .grupo-cifras { border-top-color: rgba(255, 255, 255, .12); }
.grupo-tarjeta { padding: 16px; }
.grupo-cabeza { display: flex; flex-direction: column; gap: 1px; }
.grupo-cabeza h3 { margin: 0; font-size: 15px; font-weight: 650; }
.medidor-fila { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.medidor-fila span { color: var(--texto-2); }
.medidor-fila b { font-variant-numeric: tabular-nums; }
.medidor-pista { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; }
.pista { fill: var(--acento-suave); }
.relleno { fill: var(--acento); }
.grupo-cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-top: 1px solid var(--borde); padding-top: 10px; }
.grupo-cifras b { display: block; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.grupo-cifras span { font-size: 11.5px; color: var(--texto-3); white-space: nowrap; }

.grafica { overflow-x: auto; }
.grafica svg { display: block; width: 100%; min-width: 420px; height: auto; }
.grafica .rejilla { stroke: var(--borde); stroke-width: 1; }
.grafica .rejilla.eje { stroke: var(--borde-fuerte); }
.grafica .eje-texto { font-size: 11px; fill: var(--texto-3); }
.grafica .valor { font-size: 11px; fill: var(--texto-2); font-weight: 600; opacity: 0; transition: opacity .12s; }
.grafica .barra { fill: var(--acento); transition: fill .12s; }
.grafica .zona { fill: transparent; }
.grafica .columna { cursor: default; outline: none; }
.grafica .columna:hover .barra, .grafica .columna:focus .barra { fill: var(--acento-hover); }
.grafica .columna:hover .valor, .grafica .columna:focus .valor, .grafica .rotulada .valor { opacity: 1; }

.col-barra { min-width: 150px; }
.barra-celda { display: flex; align-items: center; gap: 8px; }
.barra-celda svg { flex: 1; height: 8px; border-radius: 4px; overflow: hidden; }
.barra-celda b { min-width: 38px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
a.nombre { color: var(--texto); text-decoration: none; }
a.nombre:hover b { color: var(--acento); text-decoration: underline; }
.ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.ficha > div { background: var(--superficie-2); border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px; }
.ficha b { display: block; font-size: 20px; font-weight: 650; color: var(--marino-2); font-variant-numeric: tabular-nums; }
.ficha span { font-size: 12px; color: var(--texto-3); }
.tabla-areas tr.seleccionada td { background: var(--acento-suave); }
.tabla-areas a { color: var(--texto); text-decoration: none; }
.tabla-areas a:hover b { color: var(--acento); text-decoration: underline; }

.empresas { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { margin: 0; position: relative; overflow: hidden; background: linear-gradient(135deg, #ffffff 0%, #eaf1fd 100%); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--acento); }
.kpi:nth-child(1)::before { background: #c2413b; }
.kpi:nth-child(2)::before { background: #d48a2a; }
.kpi:nth-child(3)::before { background: #c9b037; }
.kpi-titulo { font-size: 13px; font-weight: 550; color: var(--texto-2); }
.kpi-valor { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; color: var(--marino-2); }
.vacio { color: var(--texto-3); padding: 18px 0 6px; }

/* Avisos */
.aviso { background: var(--superficie); border: 1px solid var(--borde); border-left: 3px solid var(--acento); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; color: var(--texto-2); }
.aviso.error { border-left-color: #c2413b; }

/* Tablas */
.tabla { overflow-x: auto; border: 1px solid var(--borde); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--borde); }
tbody tr:last-child td { border-bottom: 0; }
th { background: #e9f0fc; font-size: 12px; font-weight: 550; color: var(--texto-2); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.acciones { text-align: right; width: 1%; white-space: nowrap; }
tbody tr:hover { background: #f3f7fe; }
tr.inactivo td { opacity: .5; }

/* Estados: texto neutro con un punto de color */
.estado { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--texto-2); margin-right: 12px; white-space: nowrap; }
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--texto-3); }
.estado.falta::before { background: #c2413b; }
.estado.jornada-incompleta::before, .estado.salida-anticipada::before { background: #d48a2a; }
.estado.retardo::before, .estado.checada-incompleta::before { background: #c9b037; }
.estado.presente::before { background: #3f9a6b; }
.paginador { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.paginador label { display: flex; align-items: center; gap: 6px; }
.paginador select { width: auto; padding: 4px 8px; }
.paginador .botones { display: flex; gap: 6px; }
button:disabled { opacity: .45; cursor: default; }
.estado.hora-extra::before, .estado.descanso-trabajado::before { background: var(--acento); }
.insignia { font-size: 12px; color: var(--acento); background: var(--acento-suave); padding: 3px 10px; border-radius: 999px; }

/* Filtros */
.filtros { display: flex; flex-wrap: wrap; gap: 4px; background: var(--fondo); border: 1px solid var(--borde); border-radius: 9px; padding: 3px; }
.filtros a { padding: 5px 10px; border-radius: 6px; font-size: 12.5px; color: var(--texto-2); }
.filtros a span { color: var(--texto-3); margin-left: 3px; }
.filtros a:hover { color: var(--texto); }
.filtros a.activo { background: var(--superficie); color: var(--texto); box-shadow: 0 1px 2px rgba(16,24,40,.08); }

/* Botones y campos */
button, .boton {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13.5px; font-weight: 550;
  border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.primario { background: var(--acento); color: #fff; }
.primario:hover { background: var(--acento-hover); }
.secundario { background: var(--superficie); color: var(--texto); border-color: var(--borde-fuerte); }
.secundario:hover { background: var(--fondo); }
.chico { padding: 5px 10px; font-size: 12.5px; }
.ancho { width: 100%; justify-content: center; }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=date], select {
  font: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--borde-fuerte); border-radius: 8px;
  background: var(--superficie); color: var(--texto); width: 100%; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--acento-suave); border-color: var(--acento); }
td input[type=text], td select { padding: 6px 8px; min-width: 140px; }
.buscador { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.buscador input { max-width: 420px; }
.sugeridor { position: relative; flex: 1; max-width: 480px; }
.sugeridor input { max-width: none; }
.sugerencias { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--superficie); border: 1px solid var(--borde-fuerte); border-radius: 10px;
  box-shadow: 0 14px 40px rgba(10, 30, 80, .16); max-height: 360px; overflow-y: auto; }
.sugerencias a { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; padding: 8px 10px; border-radius: 7px;
  color: var(--texto); text-decoration: none; }
.sugerencias a b { font-weight: 600; font-size: 13.5px; }
.sugerencias a span { grid-column: 1; font-size: 12px; color: var(--texto-3); }
.sugerencias a em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: 12px;
  color: var(--acento); opacity: 0; }
.sugerencias li.activa a { background: var(--acento-suave); }
.sugerencias li.activa em { opacity: 1; }
input[type=search] {
  font: inherit; font-size: 13.5px; padding: 8px 10px 8px 34px; border: 1px solid var(--borde-fuerte); border-radius: 8px;
  background: var(--superficie) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b92a0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center / 16px;
  color: var(--texto); width: 100%;
}
[hidden] { display: none !important; }
.en-linea { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.en-linea input { flex: 1; min-width: 200px; width: auto; }
.en-linea input[type=date] { flex: 0 0 180px; }
.periodo { align-items: flex-end; margin: 0; }
.periodo label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--texto-2); font-weight: 500; }
.periodo label input[type=date] { width: 170px; flex: none; }
.periodo .filtros { margin-left: auto; }

.zona { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; }
.soltar {
  flex: 1; min-width: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--borde-fuerte); border-radius: 10px; padding: 26px; cursor: pointer; position: relative; text-align: center;
}
.soltar:hover { border-color: var(--acento); background: #f3f7fe; }
.soltar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.soltar-texto { color: var(--texto-2); font-weight: 550; }
.zona .primario { align-self: center; }

.formulario { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; align-items: end; }
.formulario label, .caja-acceso label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--texto-2); font-weight: 500; }
.formulario .amplio { grid-column: span 2; }
.formulario .dias { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.formulario button { justify-self: start; }
.etiqueta-campo { font-size: 12.5px; color: var(--texto-2); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 5px 12px; border: 1px solid var(--borde-fuerte); border-radius: 999px; font-size: 12.5px; color: var(--texto-2); cursor: pointer; }
.chip input:checked + span { background: var(--acento-suave); border-color: var(--acento); color: var(--acento); }
.chip input:focus-visible + span { outline: 2px solid var(--acento); }

.interruptor { position: relative; display: inline-block; width: 34px; height: 20px; }
.interruptor input { opacity: 0; width: 0; height: 0; }
.interruptor span { position: absolute; inset: 0; background: var(--borde-fuerte); border-radius: 999px; transition: .15s; cursor: pointer; }
.interruptor span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.interruptor input:checked + span { background: var(--acento); }
.interruptor input:checked + span::after { transform: translateX(14px); }

fieldset.solo-lectura { border: 0; padding: 0; margin: 0; min-width: 0; display: block; }
fieldset.solo-lectura:disabled button, fieldset.solo-lectura:disabled .acciones { display: none; }
.perfil .tenue { font-size: 11.5px; }
td.invitar { white-space: nowrap; }
td.invitar .boton, td.invitar button { margin-right: 4px; }
td.invitar .ico { width: 14px; height: 14px; }
.perfiles { margin-top: 14px; line-height: 1.7; }
.centro { text-align: center; margin-top: -6px; }
.boton.microsoft { background: #fff; color: #1d2230; border: 1px solid var(--borde-fuerte); justify-content: center; gap: 10px; }
.boton.microsoft:hover { background: var(--fondo); }
.boton.microsoft svg { width: 18px; height: 18px; }
.acceso-local summary { cursor: pointer; text-align: center; margin: 4px 0 10px; }
.acceso-local form { display: flex; flex-direction: column; gap: 12px; }
input[type=email] { font: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--borde-fuerte); border-radius: 8px; background: var(--superficie); color: var(--texto); width: 100%; }

/* Acceso */
body.acceso {
  min-height: 100vh; display: grid; align-items: center; justify-items: start; padding: 16px 16px 16px 9vw;
  background: #07153d url("fondo-login.svg") center / cover no-repeat;
}
.caja-acceso {
  width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 32px;
  background: rgba(255, 255, 255, .94); border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 20px 60px rgba(0, 10, 30, .45); backdrop-filter: blur(10px);
}
.titulo-acceso { font-size: 22px; font-weight: 650; letter-spacing: -.01em; color: var(--marino); }
.caja-acceso .sub { margin-top: -8px; margin-bottom: 6px; }
@media (max-width: 820px) { body.acceso { justify-items: center; padding: 16px; } }
.caja-acceso .marca { padding: 0; }

/* Móvil */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 6px; border-right: 0; border-bottom: 1px solid var(--borde); }
  .marca { padding: 0 8px 0 0; }
  .grupo { display: none; }
  .lateral nav { flex-direction: row; flex-wrap: wrap; }
  .lateral nav a.activo::before { display: none; }
  .salir { margin: 0 0 0 auto; border: 0; padding: 0; }
  .salir span, .lateral nav a span { display: none; }
  .superior { padding: 14px 16px; }
  .perfil span:last-child { display: none; }
  main { padding: 16px 16px 40px; }
  .formulario .amplio { grid-column: 1 / -1; }
}
