@media (max-width: 600px) {
  .task .left,
  .task:not(.completed) .left,
  .task.completed .left {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .task .task-description {
    max-width: 100% !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
  }
}
.task:not(.completed) .left {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  display: block;
}
.pending-actions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 18px;
  gap: 10px;
}
.task:not(.completed) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.task.completed .left {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  display: block;
}
@media (max-width: 600px) {
  .completed-delete-btn {
    display: flex !important;
    margin: 12px auto 0 auto !important;
    width: fit-content !important;
    justify-content: center !important;
    float: none !important;
    position: static !important;
  }
  .task-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
}
.completed-delete-btn {
  display: block !important;
  width: 100% !important;
  margin: 18px 0 0 0 !important;
  text-align: center !important;
  float: none !important;
  position: static !important;
}
@media (max-width: 600px) {
  .month-content,
  .client-content-nested,
  .sede-content-nested {
    padding: 6px 2px 6px 2px !important;
    font-size: 12px;
  }
  .month-content.expanded,
  .client-content-nested.expanded,
  .sede-content-nested.expanded {
    padding: 8px 2px 8px 2px !important;
  }
  .task {
    font-size: 12px;
    padding: 7px;
  }
  .task .task-description {
    font-size: 12px;
  }
  .task .meta {
    font-size: 10px;
  }
}
/* === Estilos globales === */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

body { 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333; 
  padding: 20px 0;
}

/* === Contenedor principal === */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  position: relative;
}

/* === Marca SIMA === */
.header-brand {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 3px solid #f8f9fa;
  padding-bottom: 20px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 8px;
}

.logo i {
  font-size: 2.5rem;
  color: #2c5aa0;
  background: linear-gradient(45deg, #2c5aa0, #1e3a8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo span {
  font-size: 2.8rem;
  font-weight: 800;
  color: #2c5aa0;
  letter-spacing: 2px;
}

.brand-subtitle {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* === Sección de bienvenida === */
.welcome-section {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-section h1 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 15px;
  font-weight: 600;
}

.welcome-section p {
  color: #6c757d;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  font-weight: 500;
  color: #495057;
}

.feature i {
  color: #2c5aa0;
  font-size: 1.2rem;
}

/* === Header de tareas === */
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f8f9fa;
}

.top-row h1 { 
  font-size: 1.8rem; 
  color: #2c3e50; 
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* === Secciones con tarjetas === */
.section-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  border-left: 4px solid #2c5aa0;
}

.section-card h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.4rem;
  font-weight: 600;
}

.section-card h2 i {
  color: #2c5aa0;
  margin-right: 8px;
}

/* === Sección de autenticación === */
.auth-section {
  max-width: 400px;
  margin: 0 auto;
}

.auth-section h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 25px;
  font-size: 1.8rem;
  font-weight: 600;
}

.auth-section h1 i {
  color: #2c5aa0;
  margin-right: 10px;
}

/* === Formularios === */
form { 
  display: flex; 
  flex-direction: column; 
  gap: 15px; 
  margin-bottom: 20px; 
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group i {
  position: absolute;
  left: 15px;
  color: #6c757d;
  z-index: 1;
}

input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="month"],
textarea, 
select {
  padding: 12px 15px 12px 45px;
  border-radius: 8px;
  border: 2px solid #e9ecef;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: white;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #2c5aa0;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

textarea { 
  min-height: 80px; 
  resize: vertical; 
  font-family: inherit;
}

/* === Estilos para fotos === */
/* === Estilos para fotos === */
.photo-section {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.photo-section h4 {
  color: #2c5aa0;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.photo-section h4 i {
  margin-right: 8px;
}

.photo-help {
  color: #6c757d;
  font-size: 12px;
  margin-bottom: 12px;
  font-style: italic;
}

.photo-btn {
  margin-right: 8px;
  margin-bottom: 5px;
  padding: 8px 12px;
  font-size: 13px;
}

.photo-preview {
  margin-top: 12px;
  text-align: center;
  max-height: 180px;
  overflow: hidden;
}

.photo-preview img {
  max-width: 180px;
  max-height: 140px;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  object-fit: cover;
}

.task-photo {
  margin-top: 8px;
  text-align: left;
}

.task-photo img {
  max-width: 150px;
  max-height: 100px;
  border-radius: 6px;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.task-photo img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.photo-indicator {
  color: #28a745;
  font-weight: 500;
}

.photo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  cursor: pointer;
}

.photo-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* === Estilos para reportes === */
.report-format-info {
  margin: 20px 0;
  padding: 15px;
  background: #e3f2fd;
  border-radius: 8px;
  border-left: 4px solid #2196f3;
}

.report-format-info h4 {
  color: #1976d2;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.report-format-info h4 i {
  margin-right: 8px;
}

.report-format-info p {
  color: #424242;
  font-size: 14px;
  margin: 0;
}

.report-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.report-actions .btn {
  min-width: 140px;
}

/* === Botones === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  transition: all 0.3s ease;
  text-align: left;
}

.month-toggle-btn:hover {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  transform: translateY(-1px);
}

.month-toggle-btn:active {
  transform: translateY(1px);
}

.month-arrow {
  font-size: 14px;
  transition: transform 0.3s ease;
  color: rgba(255,255,255,0.8);
}

.month-content {
  transition: all 0.3s ease;
  overflow: hidden;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.month-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

.month-content.expanded {
  max-height: none;
  opacity: 1;
  padding: 15px;
}

/* === Contenedores de cliente === */

/* Cliente en tareas pendientes (nivel 1) */
.client-container {
  margin: 15px 0;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 3px 6px rgba(0,0,0,0.06);
}

.client-toggle-btn {
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  transition: all 0.3s ease;
  text-align: left;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.client-toggle-btn:hover {
  background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
}

.client-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.client-content {
  transition: all 0.3s ease;
  overflow: hidden;
  background: #fafafa;
  border-top: 1px solid #e9ecef;
}

.client-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

.client-content.expanded {
  max-height: none;
  opacity: 1;
  padding: 15px;
}

/* Cliente anidado en jerarquía (nivel 2 dentro de mes) */
.client-container-nested {
  margin: 10px 0;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.client-toggle-btn-nested {
  width: 100%;
  padding: 10px 15px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  transition: all 0.3s ease;
  text-align: left;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.client-toggle-btn-nested:hover {
  background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
}

.client-content-nested {
  transition: all 0.3s ease;
  overflow: hidden;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.client-content-nested.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

.client-content-nested.expanded {
  max-height: none;
  opacity: 1;
  padding: 10px 12px 12px 12px;
}

/* === Contenedores de sede anidados === */

/* Sede anidada en jerarquía (nivel 3 dentro de cliente) */
.sede-container-nested {
  margin: 8px 0;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  overflow: hidden;
}

.sede-toggle-btn-nested {
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #2c5aa0;
  transition: all 0.3s ease;
  text-align: left;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.sede-toggle-btn-nested:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  color: #1e3a8a;
}

.sede-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  color: #6c757d;
  flex-shrink: 0;
}

.sede-content-nested {
  transition: all 0.3s ease;
  overflow: hidden;
  background: #fafafa;
  border-top: 1px solid #e9ecef;
}

.sede-content-nested.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

.sede-content-nested.expanded {
  max-height: none;
  opacity: 1;
  padding: 8px 10px 10px 10px;
}

/* Contenedor de sede (nivel 2 - versión original) */
.sede-container {
  margin: 10px 0;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.sede-toggle-btn {
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #2c5aa0;
  transition: all 0.3s ease;
  text-align: left;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.sede-toggle-btn:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  color: #1e3a8a;
}

.sede-content {
  transition: all 0.3s ease;
  overflow: hidden;
  background: #fafafa;
  border-top: 1px solid #e9ecef;
}

.sede-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

.sede-content.expanded {
  max-height: none;
  opacity: 1;
  padding: 12px 15px 15px 15px;
}

/* Badges para contadores */
.badge {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.badge-small {
  background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  margin-left: auto;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* === Tareas - ARREGLO PRINCIPAL PARA DESCRIPCIONES LARGAS === */
.task {
  display: flex; 
  justify-content: space-between; 
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  margin: 8px 0;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.task:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.task .left { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 120px);
}

.task .task-description {
  font-weight: 500;
  color: #2c3e50;
  line-height: 1.4;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: pre-wrap;
  max-width: 100%;
  display: block;
  overflow-wrap: anywhere; /* Fuerza el quiebre en cualquier punto */
}

.task .meta { 
  font-size: 12px; 
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 5px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: anywhere; /* Fuerza el quiebre en cualquier punto */
  flex-wrap: wrap; /* Permite que el contenido se ajuste en múltiples líneas */
}

.task .meta i {
  font-size: 11px;
  flex-shrink: 0;
}

.task.completed {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  display: flex;
  flex-direction: column !important;
  align-items: stretch !important;
}

.task.completed .task-description {
  color: #155724;
}

.task .task-actions { 
  display: flex; 
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-start;
}

.complete-btn { 
  padding: 8px 12px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.3s;
  white-space: nowrap;
}

.complete-btn:hover {
  background: #218838;
}

.delete-btn { 
  padding: 8px 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.3s;
  white-space: nowrap;
}

.delete-btn:hover {
  background: #c82333;
}

.complete-btn:disabled { 
  opacity: 0.6; 
  cursor: not-allowed;
  background: #6c757d;
}

/* === Modales === */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fff;
  margin: 3% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: modalSlideIn 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.modal-header h3 {
  color: #2c3e50;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-header h3 i {
  color: #2c5aa0;
  margin-right: 8px;
}

.close {
  color: #aaa;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
  max-height: calc(90vh - 140px);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: white;
}

/* Arreglo para texto en modales */
.modal-body p {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.4;
}

#modalTaskDesc {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  font-weight: normal;
  color: #2c3e50;
}

/* === Alertas y estados === */
.no-tasks {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 10px 0;
}

.loading {
  text-align: center;
  color: #6c757d;
  padding: 20px;
}

.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === Animaciones adicionales === */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Animaciones para contenido expandible === */
.month-content.expanded {
  animation: expandContent 0.3s ease;
}

@keyframes expandContent {
  from {
    max-height: 0;
    opacity: 0;
    padding: 0;
  }
  to {
    max-height: 1000px;
    opacity: 1;
    padding: 15px;
  }
}

.client-content.expanded,
.client-content-nested.expanded {
  animation: expandClientContent 0.3s ease;
}

@keyframes expandClientContent {
  from {
    max-height: 0;
    opacity: 0;
    padding: 0;
  }
  to {
    max-height: 800px;
    opacity: 1;
    padding: 15px;
  }
}

.sede-content.expanded {
  animation: expandSedeContent 0.3s ease;
}

@keyframes expandSedeContent {
  from {
    max-height: 0;
    opacity: 0;
    padding: 0;
  }
  to {
    max-height: 800px;
    opacity: 1;
    padding: 12px 15px 15px 15px;
  }
}

.sede-content-nested.expanded {
  animation: expandSedeContentNested 0.3s ease;
}

@keyframes expandSedeContentNested {
  from {
    max-height: 0;
    opacity: 0;
    padding: 0;
  }
  to {
    max-height: 600px;
    opacity: 1;
    padding: 8px 10px 10px 10px;
  }
}

/* === Efectos de hover mejorados === */
.btn:hover {
  transform: translateY(-2px);
}

.sede:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* === Estados de focus para accesibilidad === */
.month-toggle-btn:focus,
.client-toggle-btn:focus,
.client-toggle-btn-nested:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.2);
}

.sede-toggle-btn:focus,
.sede-toggle-btn-nested:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

/* === Estilos específicos para tareas dentro de contenedores colapsibles === */
.sede-content .task,
.sede-content-nested .task,
.client-content .task {
  margin: 6px 0;
  background: #fff;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sede-content .task:hover,
.sede-content-nested .task:hover,
.client-content .task:hover {
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* === Indicadores visuales para diferentes estados === */
.month-toggle-btn.high-activity {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.month-toggle-btn.high-activity .badge {
  background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* === Transiciones suaves para las flechas === */
.month-arrow, .client-arrow, .sede-arrow {
  transform-origin: center;
}

.month-toggle-btn .month-arrow.fa-chevron-down,
.client-toggle-btn .client-arrow.fa-chevron-down,
.client-toggle-btn-nested .client-arrow.fa-chevron-down,
.sede-toggle-btn .sede-arrow.fa-chevron-down,
.sede-toggle-btn-nested .sede-arrow.fa-chevron-down {
  transform: rotate(0deg);
}

.month-toggle-btn .month-arrow.fa-chevron-right,
.client-toggle-btn .client-arrow.fa-chevron-right,
.client-toggle-btn-nested .client-arrow.fa-chevron-right,
.sede-toggle-btn .sede-arrow.fa-chevron-right,
.sede-toggle-btn-nested .sede-arrow.fa-chevron-right {
  transform: rotate(-90deg);
}

/* === Efectos de selección y estado activo === */
.month-toggle-btn:active,
.client-toggle-btn:active,
.client-toggle-btn-nested:active {
  transform: scale(0.98);
}

.sede-toggle-btn:active,
.sede-toggle-btn-nested:active {
  transform: scale(0.98);
}

/* === Estados de carga específicos para contenedores === */
.month-content.loading,
.client-content.loading,
.client-content-nested.loading,
.sede-content.loading,
.sede-content-nested.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  color: #6c757d;
  font-style: italic;
}

/* === Indicadores visuales para contenido vacío === */
.month-content .no-tasks,
.client-content .no-tasks,
.client-content-nested .no-tasks,
.sede-content .no-tasks,
.sede-content-nested .no-tasks {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
  margin: 10px 0;
  background: transparent;
}

/* === Estilos para evitar el solapamiento de elementos === */
.month-container + .month-container {
  margin-top: 20px;
}

.client-container + .client-container {
  margin-top: 15px;
}

.client-container-nested + .client-container-nested {
  margin-top: 12px;
}

.sede-container + .sede-container,
.sede-container-nested + .sede-container-nested {
  margin-top: 10px;
}

/* === Estados de hover específicos para la jerarquía === */
.month-container:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.client-container:hover,
.client-container-nested:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sede-container:hover,
.sede-container-nested:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* === Responsive === */
@media (max-width: 768px) {
  .modal-content {
    margin: 2% auto;
    width: 95%;
    max-height: 92vh;
  }
  
  .modal-body {
    padding: 15px;
    max-height: calc(92vh - 120px);
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .photo-preview img {
    max-width: 140px;
    max-height: 110px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    margin: 1% auto;
    width: 98%;
    max-height: 95vh;
  }
  
  .modal-body {
    padding: 12px;
    max-height: calc(95vh - 100px);
  }
  
  .photo-section {
    padding: 12px;
    margin: 12px 0;
  }
  
  .photo-preview img {
    max-width: 120px;
    max-height: 90px;
  }
  
  .photo-btn {
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: 12px;
    padding: 6px 10px;
  }
}
/* === Mejoras adicionales para la experiencia de usuario === */

/* Mejoras en los contrastes para mejor accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.btn-primary {
  background: linear-gradient(135deg, #2c5aa0 0%, #1e3a8a 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(44, 90, 160, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-report {
  background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
  color: white;
}

.btn-report:hover {
  background: linear-gradient(135deg, #e83e8c 0%, #fd7e14 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.logout-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: #c82333;
  transform: translateY(-1px);
}

/* === Botones de autenticación === */
.auth-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.auth-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2c5aa0;
  text-decoration: none;
  text-align: center;
  margin-top: 15px;
  font-weight: 500;
  transition: color 0.3s;
}

.auth-link:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

/* === Clientes === */
.client-list { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}

.client-item {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: 15px 20px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.client-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.client-item .client-name { 
  font-weight: 600; 
  color: #2c3e50;
  font-size: 15px;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  max-width: 70%;
}

.client-item .client-actions { 
  display: flex; 
  gap: 10px; 
  flex-shrink: 0;
}

.delete-client-btn {
  padding: 8px 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.3s;
}

.delete-client-btn:hover { 
  background: #c82333; 
}

/* === Agrupación de sedes por cliente === */
.client-sede-group {
  margin-bottom: 20px;
  background: white;
  border-radius: 10px;
  padding: 15px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.client-header {
  color: #2c5aa0;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f8f9fa;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === Sedes === */
.sede-list { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}

.sede-item {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  margin-left: 20px;
}

.sede-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.sede-item .sede-name { 
  font-weight: 500; 
  color: #2c3e50;
  font-size: 14px;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  max-width: 70%;
}

.sede-item .sede-actions { 
  display: flex; 
  gap: 10px; 
  flex-shrink: 0;
}

.delete-sede-btn {
  padding: 8px 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.3s;
}

.delete-sede-btn:hover { 
  background: #c82333; 
}

/* === Lista de tareas por sede === */
.sede {
  border-radius: 12px;
  padding: 20px;
  background: white;
  border: 1px solid #e9ecef;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sede h3 { 
  margin-bottom: 15px; 
  color: #2c5aa0;
  font-weight: 600;
  font-size: 1.1rem;
  border-bottom: 2px solid #f8f9fa;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.section-title { 
  margin: 15px 0 10px 0; 
  color: #495057; 
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === Estilos para estructura jerárquica: Mes > Cliente > Sede > Tareas === */

/* Contenedor de mes (nivel 1) */
.month-container {
  margin: 15px 0;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.month-toggle-btn {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, #2c5aa0 0%, #1e3a8a 100%);
  border: none;
  cursor: pointer;
  color: #fff !important;
}

/* Forzar quiebre de texto largo sin espacios */
.task .task-description,
.task .meta,
.modal-body p,
#modalTaskDesc {
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  hyphens: auto !important;
}

/* Asegurar que los materiales largos también se quiebren */
.task .meta:has(i.fa-tools) {
  max-width: 100%;
  white-space: normal;
}