/* Identidad institucional argentina.ar: azul, celeste y amarillo. */
:root {
  --azul: #114F9C;
  --azul-oscuro: #0d3d78;
  --celeste: #37BBED;
  --amarillo: #FDC72C;
  --tinta: #1a1a1a;
  --tinta-suave: #5c5c5c;
  --tinta-tenue: #8a8a8a;
  --papel: #ffffff;
  --fondo: #f4f5f7;
  --linea: #dcdfe4;
  --linea-fuerte: #b9bec7;
  --alerta: #b3261e;
  --ok-fondo: #e8f1fb;
  --radio: 6px;
}

* { box-sizing: border-box; }

/* Sin esto, cualquier display de más abajo le gana al atributo hidden
   y el diálogo aparece abierto sobre la pantalla de ingreso. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.oculto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- barra superior ---------- */
.barra {
  background: var(--azul);
  color: #fff;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 3px solid var(--celeste);
}
.barra-marca { display: flex; flex-direction: column; }
.barra-titulo { font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.barra-sub { font-size: 12px; color: #d6e4f5; }
.barra-cuenta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #e7eefa; }
.barra .boton-plano { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.barra .boton-plano:hover { background: rgba(255,255,255,.12); }

/* ---------- botones y campos ---------- */
button, input { font: inherit; }
.boton-principal {
  background: var(--azul); color: #fff; border: 1px solid var(--azul);
  border-radius: var(--radio); padding: 10px 18px; cursor: pointer; font-weight: 600;
}
.boton-principal:hover { background: var(--azul-oscuro); }
.boton-principal:disabled { opacity: .55; cursor: progress; }
.boton-plano {
  background: var(--papel); color: var(--azul); border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio); padding: 8px 14px; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.boton-plano:hover { background: #eef2f8; }
:focus-visible { outline: 2px solid var(--celeste); outline-offset: 2px; }

label { display: block; margin: 14px 0 5px; font-size: 13px; color: var(--tinta-suave); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=tel] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio); background: var(--papel); color: var(--tinta);
}
input:focus { border-color: var(--azul); }
.campo-clave { display: flex; gap: 6px; }
.boton-ojo {
  border: 1px solid var(--linea-fuerte); background: var(--papel); color: var(--tinta-suave);
  border-radius: var(--radio); padding: 0 12px; cursor: pointer; font-size: 13px;
}
.error { color: var(--alerta); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.ayuda { color: var(--tinta-suave); font-size: 14px; }
.ayuda-chica { color: var(--tinta-tenue); font-size: 12px; margin: 8px 0 0; }
.opcional { color: var(--tinta-tenue); font-weight: 400; }

/* ---------- ingreso ---------- */
.ingreso { display: flex; justify-content: center; padding: 32px 16px 48px; }
.tarjeta-ingreso {
  background: var(--papel); border: 1px solid var(--linea); border-radius: 10px;
  padding: 24px; width: 100%; max-width: 420px;
}
.tarjeta-ingreso h1 { font-size: 20px; margin: 0 0 8px; }
.tarjeta-ingreso h2 { font-size: 17px; margin: 0 0 8px; }
.tarjeta-ingreso .boton-principal { width: 100%; margin-top: 16px; }
.tarjeta-ingreso .boton-plano { width: 100%; margin-top: 8px; }

/* ---------- días ---------- */
.dias { display: flex; gap: 8px; padding: 16px 16px 0; flex-wrap: wrap; }
.dia {
  background: var(--papel); border: 1px solid var(--linea-fuerte); color: var(--tinta-suave);
  border-radius: var(--radio); padding: 8px 14px; cursor: pointer; font-size: 14px;
}
.dia[aria-pressed="true"] { background: var(--azul); border-color: var(--azul); color: #fff; font-weight: 600; }

/* ---------- referencias ---------- */
.referencias {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px 0; font-size: 13px; color: var(--tinta-suave);
}
.ref { display: inline-flex; align-items: center; gap: 6px; }
.ref-derecha { margin-left: auto; color: var(--tinta); }
.cuadro { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--linea-fuerte); }
.cuadro.libre { background: var(--papel); }
.cuadro.ocupada { background: #e3e5e9; border-color: #e3e5e9; }
.cuadro.propia { background: var(--ok-fondo); border-color: var(--azul); }

/* ---------- grilla ---------- */
.grilla-envoltorio { padding: 12px 16px 0; }
.grilla { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.grilla th {
  font-size: 12px; color: var(--tinta-suave); font-weight: 600; text-align: center;
  padding-bottom: 4px; border-bottom: 1px solid var(--linea);
}
.grilla th.col-hora { width: 62px; }
.grilla td.hora {
  font-size: 12px; color: var(--tinta-tenue); text-align: right; padding-right: 6px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.celda {
  width: 100%; height: 40px; border-radius: var(--radio); border: 1px solid var(--linea);
  background: var(--papel); color: var(--tinta-tenue); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px;
}
.celda:hover:not(:disabled) { border-color: var(--azul); color: var(--azul); background: #f7faff; }
.celda:disabled { cursor: default; }
.celda.ocupada { background: #e3e5e9; border-color: #e3e5e9; color: var(--tinta-suave); }
.celda.propia {
  background: var(--ok-fondo); border: 1px solid var(--azul); color: var(--azul-oscuro); font-weight: 600;
}
.celda.pasada { background: #f0f0f0; border-style: dashed; color: #b0b0b0; }

/* ---------- mis turnos y organización ---------- */
.mios, .admin { padding: 24px 16px 0; }
.mios h2, .admin h2 { font-size: 16px; margin: 0 0 10px; }
.turno {
  background: var(--papel); border: 1px solid var(--linea); border-left: 3px solid var(--celeste);
  border-radius: var(--radio); padding: 10px 12px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.turno-cuando { font-weight: 600; }
.turno-detalle { font-size: 13px; color: var(--tinta-suave); }
.vacio { color: var(--tinta-tenue); font-size: 14px; }
.admin-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sub-admin { font-size: 14px; margin: 26px 0 4px; color: var(--tinta); }
.sin-margen { margin-top: 0; }
/* Alta de cuenta: primero de la empresa o sumarse con el código de equipo. */
.eleccion { border: 0; padding: 0; margin: 16px 0 0; }
.eleccion legend { font-size: 13px; color: var(--tinta-suave); font-weight: 600; padding: 0; margin-bottom: 2px; }
.eleccion .opcion {
  display: flex; align-items: center; gap: 8px; margin: 8px 0 0;
  font-size: 14px; font-weight: 400; color: var(--tinta); cursor: pointer;
}
.aviso-equipo {
  background: var(--ok-fondo); border: 1px solid var(--azul); border-radius: var(--radio);
  padding: 10px 12px; font-size: 14px; color: var(--azul-oscuro); margin: 0 0 12px;
}
.form-padron { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.form-padron input { width: auto; flex: 1 1 200px; }
.ficha-empresa { margin-bottom: 14px; }
.ficha-empresa .pendiente { border-left-color: var(--azul); margin-bottom: 0; border-radius: var(--radio) var(--radio) 0 0; }
.ficha-cabeza { display: grid; gap: 2px; }
.personas {
  list-style: none; margin: 0; padding: 8px 12px; background: var(--papel);
  border: 1px solid var(--linea); border-top: 0; border-radius: 0 0 var(--radio) var(--radio);
  display: grid; gap: 6px; font-size: 13px;
}
.personas li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.personas .boton-plano { padding: 4px 10px; font-size: 13px; }
.mover { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.mover select { width: auto; flex: 1 1 180px; }
.mover .boton-principal { padding: 6px 14px; }
.ficha-empresa.baja { opacity: .6; }
.tabla-padron { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--papel); }
.tabla-padron th, .tabla-padron td { border: 1px solid var(--linea); padding: 6px 8px; text-align: left; }
.tabla-padron th { background: #eef1f5; font-weight: 600; }
.codigo { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.baja { color: var(--tinta-tenue); }

/* ---------- vista de la organización ---------- */
select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio); background: var(--papel); color: var(--tinta); font: inherit;
}
.dialogo-ancho { max-width: 460px; }
.cuando { border: 1px solid var(--linea); border-radius: var(--radio); padding: 8px 12px 12px; margin-top: 16px; }
.cuando legend { font-size: 13px; color: var(--tinta-suave); font-weight: 600; padding: 0 6px; }
.cuando-campos { display: flex; gap: 10px; }
.cuando-campos > div { flex: 1; }
.cuando-campos label { margin-top: 4px; }
.boton-borrar {
  background: var(--papel); color: var(--alerta); border: 1px solid var(--alerta);
  border-radius: var(--radio); padding: 8px 14px; cursor: pointer; margin-right: auto;
}
.boton-borrar:hover { background: #fdeceb; }
/* Dos líneas por casillero, cada una recortada: si un nombre es largo,
   se corta con puntos suspensivos en vez de desbordar el recuadro. */
.grilla-organizacion .celda {
  height: 54px; flex-direction: column; justify-content: center; gap: 1px;
  line-height: 1.2; padding: 2px 5px;
}
.empresa-linea, .empresa-chica {
  display: block; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.empresa-linea { font-size: 11px; font-weight: 600; }
.empresa-chica { font-size: 10px; font-weight: 400; opacity: .75; }
.aviso-limite {
  background: #fff8e6; border: 1px solid var(--amarillo); border-radius: var(--radio);
  padding: 8px 12px; font-size: 13px; color: #6b4c00; margin: 12px 16px 0;
}

/* ---------- diálogo ---------- */
.fondo-dialogo {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10;
}
.dialogo {
  background: var(--papel); border-radius: 10px; padding: 20px; width: 100%; max-width: 400px;
  max-height: 90vh; overflow: auto;
}
.dialogo h2 { font-size: 18px; margin: 0 0 4px; }
.dlg-cuando { color: var(--tinta-suave); font-size: 14px; margin: 0; }
.dlg-botones { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

main { padding-bottom: 48px; }

@media (max-width: 480px) {
  .grilla-envoltorio { padding: 12px 8px 0; }
  .grilla { border-spacing: 3px; }
  .grilla th.col-hora { width: 48px; }
  .celda { height: 44px; font-size: 11px; }
  .barra-sub { display: none; }
}
