/*
 * Panel de administracion de CLOUDACCESO.
 *
 * Sin Vite y sin Tailwind, igual que la pantalla del terminal: el proyecto
 * entero se despliega sin paso de compilacion de assets.
 */

:root {
  --papel: #f3f5f9;
  --lienzo: #ffffff;
  --tinta: #141a23;
  --tinta-suave: #5b6676;
  --tinta-tenue: #8a94a3;
  --linea: #e5e9ef;
  --linea-fuerte: #d0d7e0;
  --acento: #1D6FF0;
  --acento-oscuro: #1559c9;
  --acento-claro: #E8F0FE;
  --cian: #22C3EE;
  --verde: #1f7a4d;
  --verde-claro: #e3f3ea;
  --ambar: #8a6410;
  --ambar-claro: #fbf0d6;
  --rojo: #a3302a;
  --rojo-claro: #fae5e3;
  --marino: #0B1F5C;
  --marino-hondo: #08163f;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --sombra-alta: 0 6px 16px rgba(16, 24, 40, .08), 0 14px 32px rgba(16, 24, 40, .06);
  --anillo: 0 0 0 3px rgba(29, 111, 240, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--papel);
  color: var(--tinta);
  font: 14.5px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--acento-claro); }
:focus-visible { outline: none; box-shadow: var(--anillo); border-radius: 8px; }

a { color: var(--acento); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ------------------------------------------------------------- armazon */

.disposicion { display: flex; min-height: 100vh; }

.lateral {
  width: 248px; flex: 0 0 auto;
  background: linear-gradient(180deg, var(--marino) 0%, var(--marino-hondo) 100%);
  color: #e9edf1;
  display: flex; flex-direction: column;

  /* Fijo a la altura de la ventana: el menu y el cierre de sesion tienen que
     estar siempre a la vista, por larga que sea la tabla que se esta mirando.
     align-self es imprescindible: dentro de un flex, sin el, el lateral se
     estira hasta el final de la pagina y el sticky no hace nada. */
  position: sticky; top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.lateral .marca { padding: 22px 22px 16px; }
.lateral .marca img { display: block; margin-bottom: 8px; }
.lateral .marca span {
  display: inline-block; font-size: 11.5px; color: #b9c4d6;
  background: rgba(255, 255, 255, .07); border-radius: 999px; padding: 2px 10px;
}

.lateral nav { padding: 6px 12px 12px; flex: 1; }
.lateral nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; margin-bottom: 1px;
  border-radius: 10px;
  color: #b9c4d6; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.lateral nav a .icono { flex: 0 0 auto; opacity: .75; transition: opacity .15s; }
.lateral nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.lateral nav a:hover .icono { opacity: 1; }
.lateral nav a[aria-current="page"] {
  background: rgba(255, 255, 255, .1); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.lateral nav a[aria-current="page"] .icono { opacity: 1; color: var(--cian); }
.lateral nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--cian);
}
.lateral nav a .contador { margin-left: auto; }
.lateral nav .grupo {
  margin: 18px 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #6f7f99;
}
.lateral nav .grupo:empty { margin: 14px 4px 10px; height: 1px; background: rgba(255, 255, 255, .08); }
.lateral .buscar-personal { position: relative; margin: 0 0 14px; }
.lateral .buscar-personal .icono { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #8494ad; pointer-events: none; }
.lateral .buscar-personal input {
  width: 100%; padding: 9px 12px 9px 34px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06);
  color: #fff; font-size: 13.5px; transition: background .15s, border-color .15s;
}
.lateral .buscar-personal input::placeholder { color: #8494ad; }
.lateral .buscar-personal input:focus { outline: none; background: rgba(255, 255, 255, .1); border-color: rgba(34, 195, 238, .6); }

.lateral .pie-lateral {
  margin: 0 12px 14px; padding: 12px;
  border-radius: 12px; background: rgba(255, 255, 255, .05);
  font-size: 13px; color: #9fadc2;
}
.lateral .usuario { display: flex; align-items: center; gap: 10px; }
.lateral .usuario strong { display: block; color: #fff; font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.lateral .usuario span:not(.avatar) { font-size: 12px; color: #9fadc2; }
.lateral .avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--acento), var(--cian));
  color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.lateral .enlaces-usuario { display: flex; gap: 6px; margin-top: 10px; }
.lateral .enlaces-usuario a, .lateral .enlaces-usuario button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 8px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .06); color: #c7d1df; font-size: 12.5px; text-decoration: none;
}
.lateral .enlaces-usuario a:hover, .lateral .enlaces-usuario button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.lateral .enlaces-usuario form { flex: 1; display: flex; }

.contenido { flex: 1; min-width: 0; padding: 30px 38px 56px; }

.cabecera { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.cabecera h1 { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.cabecera p { color: var(--tinta-suave); font-size: 14px; margin-top: 5px; max-width: 760px; }
.cabecera .hueco { flex: 1; }

/* ------------------------------------------------------------- piezas */

.tarjeta {
  background: var(--lienzo);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  margin-bottom: 22px;
  overflow: hidden;
}
.tarjeta > h2 {
  font-size: 15px; font-weight: 650; letter-spacing: -.005em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--linea);
}
.tarjeta .cuerpo { padding: 20px; }

.pestanas {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: #e9edf3; border-radius: 12px;
}
.pestanas a {
  padding: 7px 18px; border-radius: 9px; text-decoration: none;
  color: var(--tinta-suave); font-weight: 600; font-size: 14px;
}
.pestanas a:hover { color: var(--tinta); }
.pestanas a[aria-current="page"] { background: var(--lienzo); color: var(--tinta); box-shadow: var(--sombra); }

.seccion-config { margin-bottom: 30px; }
.seccion-config > h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--tinta-tenue); margin-bottom: 12px;
}
.atajos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.atajo {
  position: relative; display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 22px; border-radius: var(--radio); text-decoration: none;
  background: var(--lienzo); border: 1px solid var(--linea); color: var(--tinta);
  box-shadow: var(--sombra);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.atajo:hover { transform: translateY(-2px); box-shadow: var(--sombra-alta); border-color: #cfdcf3; }
.atajo .baldosa {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--acento-claro); color: var(--acento);
}
.atajo .baldosa.verde { background: #e2f5ec; color: #1c8a55; }
.atajo .baldosa.violeta { background: #efeafd; color: #6a45d6; }
.atajo .baldosa.ambar { background: #fdf2dc; color: #b07610; }
.atajo .baldosa.cian { background: #dff6fc; color: #0d8fb3; }
.atajo .baldosa.pizarra { background: #eceff4; color: #3c4a5e; }
.atajo strong { display: block; font-size: 15.5px; font-weight: 650; margin: 1px 0 4px; }
.atajo .texto { font-size: 13.5px; color: var(--tinta-suave); line-height: 1.5; }
.atajo .ir {
  position: absolute; right: 18px; top: 22px; color: var(--tinta-tenue);
  opacity: 0; transform: translateX(-4px); transition: opacity .18s, transform .18s;
}
.atajo:hover .ir { opacity: 1; transform: none; color: var(--acento); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.dato {
  background: var(--lienzo); border: 1px solid var(--linea); border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 18px 20px;
}
.dato .rotulo { font-size: 11.5px; font-weight: 600; color: var(--tinta-tenue); text-transform: uppercase; letter-spacing: .07em; }
.dato .cifra { font-size: 32px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.dato .nota { font-size: 13px; color: var(--tinta-suave); margin-top: 3px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 20px; text-align: left; border-bottom: 1px solid var(--linea); vertical-align: middle; }
thead th { background: #f8fafc; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--tinta-tenue); font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f7f9fc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.apagado { color: var(--tinta-suave); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.marca-estado {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em; line-height: 1.6;
}
.marca-estado.ok { background: var(--verde-claro); color: var(--verde); }
.marca-estado.aviso { background: var(--ambar-claro); color: var(--ambar); }
.marca-estado.mal { background: var(--rojo-claro); color: var(--rojo); }
.marca-estado.neutro { background: #eef1f4; color: var(--tinta-suave); }
.marca-estado.acento { background: var(--acento-claro); color: var(--acento); }

/* ----------------------------------------------------------- controles */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border: 1px solid var(--acento); border-radius: 10px;
  background: var(--acento); color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.3;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.boton:hover { background: var(--acento-oscuro); border-color: var(--acento-oscuro); }
.boton.suave { background: var(--lienzo); color: var(--tinta); border-color: var(--linea-fuerte); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.boton.suave:hover { background: #f5f7fa; border-color: #c2cad5; }
.boton.peligro { background: var(--lienzo); color: var(--rojo); border-color: #ecc3bf; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.boton.peligro:hover { background: #fdf3f2; }
.boton.pequeno { padding: 5px 11px; font-size: 13px; border-radius: 8px; font-weight: 500; }

.campos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.campo label { display: block; font-size: 13px; font-weight: 600; color: #3b4656; margin-bottom: 6px; }
.campo input, .campo select, .campo textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--linea-fuerte); border-radius: 10px;
  background: var(--lienzo);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .15s, box-shadow .15s;
}
.campo input:hover, .campo select:hover, .campo textarea:hover { border-color: #b8c2cf; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none; border-color: var(--acento); box-shadow: var(--anillo);
}
.campo .ayuda { font-size: 12.5px; color: var(--tinta-suave); margin-top: 4px; }
.campo .error { font-size: 12.5px; color: var(--rojo); margin-top: 4px; }

.filtros { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filtros .campo { min-width: 170px; }
.filtros > .boton { min-height: 41px; min-width: 41px; }

.acciones { display: flex; gap: 10px; align-items: center; margin-top: 18px; }

div.aviso {
  border: 1px solid var(--linea); border-left: 4px solid var(--acento);
  background: var(--lienzo); border-radius: 12px; box-shadow: var(--sombra);
  padding: 14px 18px; margin-bottom: 20px; font-size: 14px;
}
div.aviso.bien { border-left-color: var(--verde); }
div.aviso.mal { border-left-color: var(--rojo); }
div.aviso h3 { font-size: 14px; margin-bottom: 4px; }

.vacio { padding: 34px 18px; text-align: center; color: var(--tinta-suave); }

/* -------------------------------------------------------------- acceso */

.acceso { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.acceso .caja { width: 100%; max-width: 380px; }
.acceso .marca { text-align: center; margin-bottom: 22px; }
.acceso .marca img { display: inline-block; margin-bottom: 8px; }
.acceso .marca span { display: block; color: var(--tinta-suave); font-size: 14px; }
.acceso .tarjeta .cuerpo { padding: 22px; }
.acceso .boton { width: 100%; text-align: center; margin-top: 16px; }
.acceso .campos { grid-template-columns: 1fr; }

/* ------------------------------------------------------------- informes */

table.compacta th, table.compacta td { padding: 6px 14px; font-size: 14px; }
table.compacta tfoot th {
  border-top: 2px solid var(--linea-fuerte);
  color: var(--tinta); font-size: 14px; text-transform: none; letter-spacing: 0;
}
tr.festivo td { background: #fafbfc; }
tr.festivo td:first-child { color: var(--tinta-suave); }

.certificado {
  background: var(--lienzo);
  border: 1px solid var(--linea);
  border-left: 4px solid var(--acento);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 1.6;
}
.certificado h3 { font-size: 14px; margin-bottom: 8px; }
.certificado p { margin-bottom: 9px; }
.certificado table { margin-top: 12px; border-top: 1px solid var(--linea); }

/* ---------------------------------------------------------- cumplimiento */

/* El color nunca va solo: cada estado lleva tambien un simbolo, para quien no
   distingue el verde del rojo y para el papel en blanco y negro. */
.semaforo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px;
  font-size: 13px; font-weight: 700; line-height: 1;
  background: #eef1f4; color: var(--tinta-suave);
}
.semaforo.ok { background: var(--verde-claro); color: var(--verde); }
.semaforo.aviso { background: var(--ambar-claro); color: var(--ambar); }
.semaforo.mal { background: var(--rojo-claro); color: var(--rojo); }
.semaforo.info { background: var(--acento-claro); color: var(--acento); }
.semaforo.curso { box-shadow: 0 0 0 2px var(--acento); }
.semaforo.ancho { width: auto; min-width: 42px; padding: 0 6px; font-size: 11.5px; font-variant-numeric: tabular-nums; }

.barra-horas { height: 8px; border-radius: 4px; background: #e9edf1; overflow: hidden; min-width: 150px; }
.barra-horas span { display: block; height: 100%; background: var(--acento); border-radius: 4px; }
.barra-horas.ok span { background: #2f9e6a; }
.barra-horas.aviso span { background: #d9a02b; }
.barra-horas.mal span { background: #c4443d; }

.matriz { overflow-x: auto; }
.matriz table { border-collapse: separate; border-spacing: 0; width: auto; min-width: 100%; }
.matriz th, .matriz td { padding: 4px 3px; text-align: center; font-size: 12px; white-space: nowrap; }
.matriz th.nombre, .matriz td.nombre {
  text-align: left; position: sticky; left: 0; background: var(--lienzo);
  padding: 4px 14px 4px 14px; min-width: 190px; z-index: 1;
  border-right: 1px solid var(--linea);
}
.matriz th.hoy { color: var(--acento); }
.matriz th.fin, .matriz td.fin { background: #fafbfc; }
.matriz td.cifra-fila { padding: 4px 9px; font-variant-numeric: tabular-nums; }
.matriz .semaforo { width: 24px; height: 24px; font-size: 12px; text-decoration: none; }
.matriz a.semaforo:hover { filter: brightness(.94); }

.leyenda { display: flex; flex-wrap: wrap; gap: 14px 22px; font-size: 13px; color: var(--tinta-suave); }
.leyenda span { display: inline-flex; align-items: center; gap: 7px; }

.bloque-dia { border-bottom: 1px solid var(--linea); }
.bloque-dia:last-child { border-bottom: 0; }
.cabecera-dia { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.problema { border-left: 4px solid var(--ambar); background: #fffaf0; border-radius: 0 8px 8px 0; padding: 10px 14px; margin-bottom: 10px; }
.problema.mal { border-left-color: var(--rojo); background: #fff6f5; }
.problema.sin-fallo { border-left-color: var(--verde); background: var(--verde-claro); }
.problema .como { color: var(--tinta-suave); font-size: 13.5px; margin-top: 3px; }
tr.fila-problema td { background: var(--ambar-claro); }

.saldo-mas { color: var(--verde); }
.contador { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 19px; box-shadow: 0 0 0 2px rgba(229, 72, 77, .2); }
.saldo-menos { color: var(--rojo); }

/* Solo aparece en el papel. */
.encabezado-impreso { display: none; }

/* ------------------------------------------------------------- impresion */

@media print {
  @page { size: A4; margin: 14mm 12mm; }

  body { background: #fff; font-size: 10.5pt; }

  /* Ojo: aqui no se puede ocultar .aviso a secas. Las incidencias del informe
     son <span class="marca-estado aviso"> y son justo lo que hay que ver en
     el papel. Los mensajes de la sesion llevan su propio .sin-imprimir. */
  .lateral, .sin-imprimir, .cabecera { display: none !important; }
  .contenido { padding: 0; }
  .disposicion { display: block; }

  .encabezado-impreso {
    display: flex; justify-content: space-between; gap: 20px;
    padding-bottom: 10px; margin-bottom: 14px;
    border-bottom: 2px solid var(--tinta);
    font-size: 10pt;
  }

  .tarjeta, .certificado, .dato {
    border: 1px solid #c9ced5; border-radius: 0; box-shadow: none;
    break-inside: avoid;
  }
  .tarjeta { margin-bottom: 12px; }
  .tarjeta > h2 { background: #f2f4f7; }

  .rejilla { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .dato .cifra { font-size: 20pt; }

  table.compacta th, table.compacta td { padding: 3px 8px; font-size: 9pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }

  .marca-estado { border: 1px solid #c9ced5; background: none !important; color: var(--tinta) !important; }
  a { color: inherit; text-decoration: none; }
}

@media (max-width: 820px) {
  .disposicion { flex-direction: column; }
  .lateral { width: auto; position: static; height: auto; overflow: visible; }
  .lateral nav { display: flex; gap: 4px; overflow-x: auto; }
  .lateral nav a { white-space: nowrap; }
  .lateral nav .grupo, .lateral .buscar-personal, .lateral .pie-lateral .usuario { display: none; }
  .lateral nav a[aria-current="page"]::before { display: none; }
  .contenido { padding: 18px; }
}

/* Selector «Mi perfil / Gestion»: la misma persona, su lado de empleado y su lado de gestion. */
.selector-perfil { display: flex; gap: 4px; margin: 0 2px 12px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.lateral nav .selector-perfil a { flex: 1; justify-content: center; text-align: center; padding: 6px 8px; margin: 0; border-radius: 8px; font-size: 13px; }
.lateral nav .selector-perfil a[aria-current="page"] { background: #fff; color: #14202c; font-weight: 600; }
