/* ───── GLOBAL ───── */
* {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  background: #f8f7f7;
  color: #141414;
}

#pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 10050;
  background: #0a3d62;
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

#pwa-banner-texto {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
}

#pwa-banner-estado {
  margin: 0 0 8px 0;
  font-size: 13px;
  opacity: 0.92;
}

#pwa-banner-acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#pwa-banner button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

#btn-instalar-app {
  background: #43c6ac;
  color: #04221b;
}

#btn-actualizar-app {
  background: #f7e330;
  color: #1d1a00;
}

#btn-cerrar-pwa-banner {
  background: #ffffff;
  color: #0a3d62;
}

/* ───── PORTADA ───── */
#portada {
  position: relative;
  text-align: center;
}

#imagen-portada {
  width: 100%;
  height: auto;
}

.texto-portada {
  position: absolute;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
}

/* ───── CALENDARIO ───── */
#calendario {
  padding: 28px 16px 80px;
}

.barra-mes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(248, 247, 247, 0.95);
  backdrop-filter: blur(4px);
  padding: 8px 0;
}

.barra-mes button {
  min-width: 44px;
  min-height: 44px;
  font-size: 24px;
  background: #ffffff;
  border: 1px solid #c6c6c6;
  border-radius: 10px;
  cursor: pointer;
}

.barra-mes h2 {
  margin: 0;
  flex: 1;
  text-align: center;
}

#dias-semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: bold;
}

#dias-mes {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 4px;
}

#dias-mes div {
  min-height: 72px;
  padding: 6px;
  border-radius: 8px;
  background: white;
  border: 1px solid #ccc;
  text-align: center;
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
}

#dias-mes .vacio {
  background: transparent;
  border: none;
  cursor: default;
}

/* ───── FINES DE SEMANA ───── */
#dias-mes div.sabado { background-color: orange; font-weight: bold; color: black; }
#dias-mes div.domingo { background-color: orange; font-weight: bold; color: black; }

/* ───── FESTIVOS ───── */
#dias-mes div.festivo-nacional { background-color: red !important; color: white !important; }
#dias-mes div.festivo-autonomico { background-color: green !important; color: white !important; }
#dias-mes div.festivo-local { background-color: blue !important; color: white !important; }
#dias-mes div.dia-sobrante{
  background-color: #ffd500 !important;
  color: #111 !important;
  font-weight: bold;
}

/* ───── DIA ACTUAL ───── */
#dias-mes div.dia-hoy {
  background-color: #43c6ac !important;
  color: #0b2a22 !important;
  font-weight: 700;
  border: 2px solid #1f8f79 !important;
  box-shadow: 0 0 0 2px rgba(67, 198, 172, 0.25);
}
/* Icono info para festivos */
.info-festivo {
  position: absolute;   /* flota dentro del div de día */
  top: 4px;             /* distancia desde arriba */
  right: 4px;           /* distancia desde la derecha */
  font-size: 20px;      /* tamaño más grande */
  cursor: pointer;      /* cambia cursor al pasar por encima */
  user-select: none;    /* no seleccionable */
  z-index: 3;           /* por encima del punto morado */
}

/* Prioridad festivos sobre fines de semana */
#dias-mes div.sabado.festivo-nacional,
#dias-mes div.domingo.festivo-nacional { background-color: red !important; color: white !important; }
#dias-mes div.sabado.festivo-autonomico,
#dias-mes div.domingo.festivo-autonomico { background-color: green !important; color: white !important; }
#dias-mes div.sabado.festivo-local,
#dias-mes div.domingo.festivo-local { background-color: blue !important; color: white !important; }

/* ───── BOTONES DE PORTADA ───── */
.botones-portada {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.btn-portada {
  display: block;
  text-decoration: none;
  text-align: center;
  background: #007bff;
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.btn-portada:hover {
  background: #80089e;
}

.btn-portada.whatsapp { background: #25d366; }
.btn-portada.whatsapp:hover { background: #01180a; }

.btn-portada.secundario { background: #6c757d; }
.btn-portada.secundario:hover { background: #8b07ac; }

/* Escritorio */
@media (min-width: 768px) {
  .botones-portada { flex-direction: row; justify-content: center; }
  .btn-portada { min-width: 200px; }
}

/* Móvil */
@media (max-width: 600px) {
  #portada {
  max-height: none;
  overflow: visible;
}

#imagen-portada {
  width: 88%;
  max-width: 360px;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

  .texto-portada { bottom: 10px; padding: 8px 14px; border-radius: 8px; }
  #titulo-organizacion { font-size: 18px; }
  #info-organizacion { font-size: 12px; }
  .btn-portada { font-size: 14px; padding: 10px; }
}

/* ───── LEYENDA FESTIVOS ───── */
#leyenda-festivos {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}

.item-leyenda {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.color.nacional { background: red; }
.color.autonomico { background: green; }
.color.local { background: blue; }
.color.sobrante { background: #ffd500; }
.color.fin-semana { background: rgb(218, 142, 2); }
.color.hoy { background: #43c6ac; }

/* ───── MARCA DE AGENDA ───── */
.marca-agenda {
  position: absolute;
  bottom: 4px;   /* distancia desde la parte inferior */
  left: 4px;     /* distancia desde la izquierda */
  width: 24px;   /* tamaño del punto */
  height: 24px;
  background-color: purple;
  border-radius: 50%; /* lo hace redondo */
  z-index: 2;     /* asegura que esté por encima del fondo y no tapado por otros elementos */
}


/* ───── POPUP DE FESTIVO ───── */
#popup-festivo {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

.popup-festivo-contenido {
  width: min(92vw, 420px);
  max-height: 78vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
}

#texto-popup-festivo {
  white-space: pre-wrap;
  margin: 0 0 12px 0;
  font-family: inherit;
}

#cerrar-popup-festivo {
  min-height: 44px;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  background: #0a3d62;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* ───── POPUP DE AGENDA ───── */
#popup-agenda {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

#popup-agenda .popup-contenido {
  background: rgb(247, 227, 48);
  padding: 16px;
  border-radius: 10px;
  width: min(92vw, 420px);
  max-height: 86vh;
  overflow: auto;
}

#agenda-fecha {
  margin: 0 0 10px 0;
}

.agenda-bloque {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

.agenda-subtitulo {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.plantillas-agenda {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#popup-agenda .plantillas-agenda .tpl {
  min-height: 40px;
  background: #0a3d62;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

#popup-agenda textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
  margin-top: 0;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
}

#popup-agenda label {
  display: block;
  margin-top: 2px;
  font-weight: 600;
}

#popup-agenda input[type="time"],
#popup-agenda select,
#popup-agenda input[type="file"] {
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  margin-bottom: 6px;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.botones-popup {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

#popup-agenda button,
.botones-popup button {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  background: #007bff;
  color: white;
}

#popup-agenda button:hover,
.botones-popup button:hover {
  background: #0056b3;
}

#guardar-agenda {
  background: #0a7a52;
}

#guardar-agenda:hover {
  background: #075f3f;
}

#cancelar-agenda {
  background: #7a1522;
}

#cancelar-agenda:hover {
  background: #5f0f1a;
}

/* ───── CLASE OCULTO ───── */
.oculto {
  display: none !important;
}
#vista-archivos {
  max-height: 200px; /* Altura máxima del recuadro */
  overflow-y: auto;  /* Scroll vertical si se supera la altura */
  border: 1px solid #ccc;
  padding: 5px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fafafa;
  border-radius: 4px;
}
#popup-alarma {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#popup-alarma.oculto {
  display: none;
}

.alarma-contenido {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  max-width: 300px;
  animation: parpadeo 1s infinite alternate;
}
#reloj-calendario {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  margin-bottom: 12px;
  font-family: inherit;
  background-color: rgba(255, 255, 255, 0.85);
  padding: 12px 18px;
  border-radius: 10px;
  color: #0a3d62;
  z-index: 10;
  width: fit-content;
}
@keyframes parpadeo {
  from { box-shadow: 0 0 10px #a855f7; }
  to   { box-shadow: 0 0 25px #a855f7; }
}

#hora-actual {
  font-size: 32px;
  font-weight: 700;
}

#fecha-actual {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}
/* ====== DERECHOS LABORALES ====== */

#derechos-laborales {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
}

#derechos-laborales h1 {
  text-align: center;
  margin-bottom: 25px;
}

.bloque-derecho {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 15px;
}
@media (orientation: portrait) {
  #calendario {
    padding: 18px 10px 80px;
  }
}
/* ===== CONTACTO + AFÍLIATE EN PORTADA ===== */
#contacto-portada{
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

#contacto-texto{
  font-size: 12px;
  line-height: 1.25;
}

#contacto-texto a{
  color: #ffffff;            /* dentro de la caja oscura de portada */
  text-decoration: underline;
}

#cta-afiliate{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* “igual de alta que dos renglones”: lo logramos con tamaño + padding */
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  padding: 10px 14px;

  border-radius: 12px;
  text-decoration: none;

  /* morado tirando a rojo, muy llamativo */
  color: #ffffff;
  background: #a21caf;       /* morado-rojizo */
  border: 2px solid rgba(255,255,255,0.35);
}

#cta-afiliate:hover{
  filter: brightness(1.05);
}

/* En pantallas estrechas, apilamos para que no se vea apretado */
@media (max-width: 600px){
  #contacto-portada{
    flex-direction: column;
    gap: 10px;
  }
  #cta-afiliate{
    width: 100%;
    max-width: 240px;
  }
}
/* ====== MARCAS DE TURNO (cuadrado abajo-izquierda) ====== */
.marca-turno {
  position: absolute;
 right: 3px;
bottom: 3px;

  width: 18px;
  height:18px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.25); /* borde normal */
}

/* Colores de turno (no coinciden con el morado ni con la campana) */
.turno-manana { background: #2ecc71; } /* verde */
.turno-tarde  { background: #f39c12; } /* naranja */
.turno-noche  { background: #3498db; } /* azul */

/* FIN DE SEMANA: siempre borde negro fuerte */
.sabado .marca-turno,
.domingo .marca-turno {
  border: 2px solid #000;
}

/* (Opcional recomendado) Festivos: también borde negro fuerte */
.festivo-nacional .marca-turno,
.festivo-autonomico .marca-turno,
.festivo-local .marca-turno {
  border: 2px solid #000;
}

@media (max-width: 700px) {
  #dias-mes div {
    min-height: 64px;
    font-size: 15px;
  }

  #dias-semana {
    font-size: 14px;
  }

  #hora-actual {
    font-size: 26px;
  }

  #fecha-actual {
    font-size: 15px;
  }



