/* Estilos principales para el Cuadrante de Turnos */
:root {
  --color-weekend: #fef08a; /* Amarillo suave para fin de semana */
  --color-holiday: #fed7aa; /* Naranja/salmón para festivo */
  --color-m-bg: #bae6fd;    /* Azul Mañana */
  --color-m-text: #0369a1;
  --color-t-bg: #bbf7d0;    /* Verde Tarde */
  --color-t-text: #15803d;
  --color-p17-bg: #fed7aa;  /* Ámbar Partido 17 */
  --color-p17-text: #c2410c;
  --color-p19-bg: #fde68a;  /* Amarillo/oro Partido 19 */
  --color-p19-text: #b45309;
  --color-v-bg: #e9d5ff;    /* Morado Vacaciones */
  --color-v-text: #7e22ce;
  --color-p-bg: #fecdd3;    /* Marrón/Rojo Permiso */
  --color-p-text: #9f1239;
  --color-l-bg: #fecaca;    /* Rojo claro / vino descanso compensatorio */
  --color-l-text: #991b1b;
  --color-ex-bg: #f3f4f6;   /* Gris Excedencia */
  --color-ex-text: #374151;
}

/* Tipografía y reset básico */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  background-color: #f8fafc;
}

/* Scroll táctil fluido en iOS Safari */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

/* Tabla del cuadrante con fijación sticky */
.grid-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 11px;
}

.grid-table th, .grid-table td {
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  text-align: center;
  padding: 3px 2px;
  min-width: 28px;
  height: 28px;
  user-select: none;
}

.grid-table tr:first-child th {
  border-top: 1px solid #000;
}

.grid-table th:first-child, .grid-table td:first-child {
  border-left: 1px solid #000;
}

/* Columna de nombres fija a la izquierda */
.grid-table th.emp-header, .grid-table td.emp-name {
  position: sticky;
  left: 0;
  z-index: 10;
  background-color: #ffffff;
  box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.25);
  text-align: left;
  padding-left: 8px;
  min-width: 175px;
  max-width: 200px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-table th.emp-header {
  z-index: 25;
  background-color: #f1f5f9;
}

/* En móviles: columna de nombres compacta */
@media (max-width: 640px) {
  .grid-table th.emp-header, .grid-table td.emp-name {
    min-width: 95px !important;
    max-width: 110px !important;
    font-size: 11px;
    padding-left: 4px;
    padding-right: 4px;
  }
  .grid-table th, .grid-table td {
    min-width: 32px;
    height: 32px;
    font-size: 11.5px;
  }
}

/* Cabeceras de días */
.header-weekend {
  background-color: #ffff00 !important;
  font-weight: 700;
}

.header-holiday {
  background-color: #f8cbad !important;
  font-weight: 700;
  cursor: pointer;
}

.header-weekday {
  background-color: #ffffff;
  font-weight: 600;
}

/* Celdas de turnos con los colores fieles a la plantilla original */
.cell-shift {
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.cell-shift:hover {
  outline: 2px solid #2563eb;
  z-index: 10;
  position: relative;
}

/* Clases de estilos de turnos */
.shift-M {
  background-color: #00b0f0 !important;
  color: #002060 !important;
}

.shift-T {
  background-color: #92d050 !important;
  color: #004d00 !important;
}

.shift-P17 {
  background-color: #ffc000 !important;
  color: #7f3f00 !important;
}

.shift-P19 {
  background-color: #ff9900 !important;
  color: #ffffff !important;
}

.shift-V {
  background-color: #7030a0 !important;
  color: #ffffff !important;
}

.shift-P, .shift-PE {
  background-color: #833c0c !important;
  color: #ffffff !important;
}

.shift-L {
  background-color: #c00000 !important;
  color: #ffffff !important;
  font-size: 10px;
}

.shift-EX {
  background-color: #ffffff !important;
  color: #000000 !important;
  font-weight: 700;
}

.shift-weekend-empty {
  background-color: #ffff00 !important;
}

.shift-holiday-empty {
  background-color: #f8cbad !important;
}

/* Paleta de pintura flotante/fija */
.palette-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.palette-btn.active {
  border-color: #1e3a8a;
  transform: scale(1.06);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Estilos de Impresión A4 Horizontal */
@media print {
  @page {
    size: landscape;
    margin: 6mm 6mm 6mm 6mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .print-container {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .grid-table {
    border: 2px solid #000000 !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .grid-table th, .grid-table td {
    border: 1px solid #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .grid-table th.emp-header, .grid-table td.emp-name {
    font-size: 10px !important;
    min-width: 180px !important;
    max-width: 200px !important;
  }
}

/* ==========================================
   ESTILOS CALENDARIO ANUAL PÓSTER (12 MESES)
   ========================================== */
.cal-month-card {
  background: #ffffff;
  border-radius: 1rem;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.cal-month-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.cal-month-header {
  padding: 8px 12px;
  font-weight: 900;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.06);
}

/* Tonos pastel fieles a la imagen de referencia */
.month-hdr-1  { background-color: #fce7f3; color: #9d174d; border-color: #fbcfe8; } /* Ene: Rosa */
.month-hdr-2  { background-color: #ffe4e6; color: #9f1239; border-color: #fecdd3; } /* Feb: Salmón */
.month-hdr-3  { background-color: #ffedd5; color: #9a3412; border-color: #fed7aa; } /* Mar: Melocotón */
.month-hdr-4  { background-color: #fef9c3; color: #854d0e; border-color: #fef08a; } /* Abr: Amarillo */
.month-hdr-5  { background-color: #ecfccb; color: #3f6212; border-color: #d9f99d; } /* May: Verde lima */
.month-hdr-6  { background-color: #dcfce7; color: #166534; border-color: #bbf7d0; } /* Jun: Menta */
.month-hdr-7  { background-color: #e0f2fe; color: #075985; border-color: #bae6fd; } /* Jul: Azul cielo */
.month-hdr-8  { background-color: #e0e7ff; color: #3730a3; border-color: #c7d2fe; } /* Ago: Añil / Periwinkle */
.month-hdr-9  { background-color: #ede9fe; color: #5b21b6; border-color: #ddd6fe; } /* Sep: Lavanda */
.month-hdr-10 { background-color: #fae8ff; color: #86198f; border-color: #f5d0fe; } /* Oct: Malva */
.month-hdr-11 { background-color: #ffe4e6; color: #9f1239; border-color: #fecdd3; } /* Nov: Rosa pastel */
.month-hdr-12 { background-color: #f1f5f9; color: #334155; border-color: #e2e8f0; } /* Dic: Gris cálido */

.cal-table {
  width: 100% !important;
  table-layout: fixed !important; /* IMPRESCINDIBLE: garantiza que las columnas NUNCA se desborden ni empujen el domingo */
  border-collapse: collapse !important;
  font-size: 11px;
}

.cal-table th,
.cal-table td {
  padding: 1px 0 !important;
  text-align: center;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
}

/* Columna 1: Sem (ancho fijo exacto de 28px) */
.cal-table th:first-child,
.cal-table td:first-child {
  width: 28px !important;
  max-width: 28px !important;
  min-width: 28px !important;
}

/* Columnas 2 a 8: L, M, X, J, V, S, D (reparto exacto idéntico) */
.cal-table th:not(:first-child),
.cal-table td:not(:first-child) {
  width: calc((100% - 28px) / 7) !important;
  max-width: calc((100% - 28px) / 7) !important;
}

.cal-table th {
  padding: 5px 0 !important;
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  color: #64748b;
  border-bottom: 1.5px solid #f1f5f9;
}

/* Botón selector de semana completa */
.cal-week-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92%;
  height: 34px;
  margin: 0 auto;
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cal-week-btn:hover {
  background-color: #ede9fe;
  color: #6d28d9;
  border-color: #c4b5fd;
}

.cal-week-btn.active-worker-week {
  background-color: #7c3aed !important;
  color: #ffffff !important;
  border-color: #6d28d9 !important;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.35);
}

/* Celda de día individual (cuadrada y proporcionada) */
.cal-day-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 94%;
  height: 36px;
  margin: 1px auto;
  border-radius: 6px;
  cursor: pointer;
  padding: 1px 0;
  transition: transform 0.1s ease, background-color 0.1s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.cal-day-box:hover {
  background-color: #f3e8ff;
  border-color: #d8b4fe;
  transform: scale(1.05);
  z-index: 10;
}

.cal-day-num {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  color: #1e293b;
}

.cal-day-weekend .cal-day-num {
  color: #b45309;
}

.cal-day-weekend {
  background-color: #fefce8;
  border-color: #fef08a;
}

/* Píldoras de trabajadoras en el día */
.worker-tag-pill {
  font-size: 8px;
  font-weight: 900;
  padding: 0.5px 2px;
  border-radius: 3px;
  margin-top: 1px;
  white-space: nowrap;
  width: 94%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.08);
}

.overlap-warning-ring {
  box-shadow: 0 0 0 2px #ef4444 inset !important;
  background-color: #fef2f2 !important;
}

/* Utilidad para barra horizontal en móvil */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

