/* ESTILOS MODERNOS Y RESPONSIVOS - CAMPAÑA DE PREDICACIÓN SANTIAGO */

:root {
  --primary: #1e3a8a;          /* Azul marino profundo */
  --primary-light: #3b82f6;    /* Azul brillante */
  --primary-dark: #172554;
  --primary-subtle: #eff6ff;   /* Fondo azul muy suave */
  
  --accent: #0284c7;           /* Celeste zafiro */
  --accent-light: #e0f2fe;

  --success: #16a34a;          /* Verde WhatsApp / Confirmación */
  --success-dark: #15803d;
  --success-light: #dcfce7;

  --warning: #f59e0b;
  --warning-light: #fef3c7;

  --danger: #dc2626;
  --danger-light: #fee2e2;

  --bg-body: #f8fafc;          /* Gris muy claro, limpio */
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  --text-main: #0f172a;        /* Casi negro para alta legibilidad */
  --text-muted: #64748b;       /* Gris medio para descripciones */
  --text-light: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --bottom-nav-height: 64px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: calc(var(--bottom-nav-height) + 20px + env(safe-area-inset-bottom));
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ENCABEZADO */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  /* Notch/barra de estado (iPhone y Android con recorte) */
  padding-top: env(safe-area-inset-top);
}

.header-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 26px;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  transition: transform 0.15s, opacity 0.15s;
}

.brand-logo:hover {
  transform: scale(1.05);
  opacity: 0.92;
}

.brand-logo:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Logo principal en la pantalla de bienvenida */
.hero-logo {
  display: block;
  width: 150px;
  max-width: 55%;
  height: auto;
  margin: 0 auto 14px;
}

/* Minilogo en el estado vacío (sin participante seleccionado) */
.empty-illustration img {
  width: 92px;
  height: auto;
  margin: 0 auto;
  opacity: 0.9;
}

.brand-title {
  display: flex;
  flex-direction: column;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.08;
}
.brand-title .brand-line { display: block; }

.brand-subtitle {
  font-size: 0.78rem;
  opacity: 0.9;
  font-weight: 400;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Nombre del usuario en el encabezado, en mayúsculas */
.header-user-name {
  text-transform: uppercase;
}

/* Botón de cerrar sesión con texto "Salir" */
.btn-logout {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-logout-text {
  line-height: 1;
}

/* Pin GPS junto a direcciones (reemplaza el emoji 📍) */
.gps-pin { vertical-align: text-bottom; margin-right: 3px; flex-shrink: 0; }

/* ===== Teléfonos pequeños: encabezado compacto y barra solo-iconos ===== */
@media (max-width: 480px) {
  .header-container { padding: 8px 12px; }
  .header-brand { gap: 8px; }
  .brand-logo { height: 30px; }
  .brand-title { font-size: 0.85rem; line-height: 1.05; }
  .brand-subtitle { display: none; } /* ahorra alto: evita 2-3 líneas */
  .header-user { gap: 6px; }
  .header-user-name { font-size: 0.7rem; }
  .btn-logout { height: 34px; padding: 0 10px; font-size: 0.8rem; }
  .btn-logout svg { width: 16px; height: 16px; }

  /* Barra inferior: solo iconos (sin texto).
     Se prefija con .bottom-nav para ganar en especificidad a la regla base
     de .nav-item span (que aparece más abajo en el archivo). */
  .bottom-nav .nav-item span { display: none; }
  .bottom-nav .nav-item svg { width: 24px; height: 24px; }
  .bottom-nav .nav-item { padding: 6px 0; }
}

/* CONTENEDOR PRINCIPAL */
.app-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HÉROE DEL BUSCADOR */
.search-hero {
  background: var(--bg-card);
  padding: 20px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  position: relative;
}

.search-hero-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.search-hero-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 14px 44px 14px 44px;
  font-size: 1rem;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: #e2e8f0;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* DROPDOWN DE BÚSQUEDA */
.search-dropdown {
  position: absolute;
  top: calc(100% - 10px);
  left: 18px;
  right: 18px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  max-height: 280px;
  overflow-y: auto;
  z-index: 40;
}

.search-dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item:hover,
.search-dropdown-item:active {
  background: var(--primary-subtle);
}

.dropdown-name {
  font-weight: 600;
  color: var(--text-main);
}

.dropdown-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* TEXTO GUÍA DE BÚSQUEDA */
.quick-pick {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* TARJETA DEL PERFIL */
.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 24px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-avatar {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.profile-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-city {
  background: var(--accent-light);
  color: #0369a1;
}

.badge-group {
  background: var(--primary-subtle);
  color: var(--primary);
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.profile-contact {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* GRID DE EQUIPO */
.team-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}

@media (min-width: 480px) {
  .team-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.team-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.team-value {
  font-size: 0.95rem;
  color: var(--text-main);
}

.team-captain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-whatsapp-mini {
  background: var(--success-light);
  color: var(--success-dark);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
}

.btn-whatsapp-mini:hover {
  background: #bbf7d0;
}

/* Íconos dentro de los botones (WhatsApp y llamada) */
.wa-icon,
.call-icon {
  flex-shrink: 0;
  vertical-align: middle;
}

/* Botones solo-icono (itinerario: capitán de grupo) */
.btn-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.12s, filter 0.12s;
}
.btn-contact-icon:active { transform: scale(0.94); }
.btn-contact-icon:hover { filter: brightness(0.96); }
.btn-wa-icon { background: var(--success-light); color: var(--success-dark); }
.btn-call-icon { background: #e0f2fe; color: #0369a1; }
.captain-contact-actions { display: inline-flex; gap: 8px; flex-shrink: 0; }

/* ===== ADMINISTRACIÓN DE USUARIOS ===== */
.btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-admin:hover { background: rgba(255, 255, 255, 0.28); }
.btn-admin.hidden { display: none; }

body.modal-open { overflow: hidden; }

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  padding-top: calc(24px + env(safe-area-inset-top));
  overflow-y: auto;
}
.admin-modal.hidden { display: none; }

.admin-dialog {
  width: 100%;
  max-width: 640px;
  background: var(--bg-card, #fff);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  margin: auto;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-head h2 { margin: 0; font-size: 1.15rem; color: var(--primary); }
.admin-close {
  background: none;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 6px;
}

.admin-search {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px;
  padding: 11px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.admin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.admin-msg {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  background: #f1f5f9;
  color: var(--text-main);
}
.admin-msg.ok { background: var(--success-light); color: var(--success-dark); }
.admin-msg.error { background: var(--danger-light); color: var(--danger); }
.admin-msg.hidden { display: none; }

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.admin-empty { color: var(--text-muted); text-align: center; padding: 20px; }

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #f8fafc;
  flex-wrap: wrap;
}
.admin-row-info { flex: 1 1 180px; min-width: 0; }
.admin-row-name { font-weight: 700; color: var(--text-main); font-size: 0.95rem; }
.admin-row-meta { font-size: 0.78rem; color: var(--text-muted); word-break: break-word; }

.admin-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.estado-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.estado-registrado   { background: #dcfce7; color: #166534; }
.estado-sin_registrar{ background: #e2e8f0; color: #475569; }
.estado-restablecida { background: #fef9c3; color: #854d0e; }
.estado-bloqueado    { background: #fee2e2; color: #b91c1c; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin-btn {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
}
.admin-btn.a-reset  { background: #e0f2fe; color: #0369a1; }
.admin-btn.a-block  { background: #fef3c7; color: #92400e; }
.admin-btn.a-unblock{ background: #dcfce7; color: #166534; }
.admin-btn.a-delete { background: #fee2e2; color: #b91c1c; }
.admin-btn:hover { filter: brightness(0.96); }

@media (max-width: 480px) {
  .admin-row-right { align-items: flex-start; width: 100%; }
  .admin-actions { justify-content: flex-start; }
}

/* Diálogo de confirmación propio (reemplaza al confirm del navegador) */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: confirmFade 0.12s ease;
}
@keyframes confirmFade { from { opacity: 0; } to { opacity: 1; } }

.confirm-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card, #fff);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  animation: confirmPop 0.14s ease;
}
@keyframes confirmPop { from { transform: scale(0.96); opacity: 0.6; } to { transform: scale(1); opacity: 1; } }

.confirm-msg {
  margin: 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-main);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-btn {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  background: #fff;
  color: var(--text-main);
}
.confirm-cancel:hover { background: #f1f5f9; }
.confirm-ok {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.confirm-ok.danger { background: var(--danger, #dc2626); border-color: var(--danger, #dc2626); }
.confirm-ok:hover { filter: brightness(0.95); }

/* ACCIONES DE PERFIL */
.profile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

@media (min-width: 480px) {
  .profile-actions {
    grid-template-columns: 1fr 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-whatsapp {
  background: var(--success);
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: var(--success-dark);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-light);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-subtle);
}

.btn-text {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px;
}

.btn-text:hover {
  color: var(--danger);
}

/* ASIGNACIONES */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.assignments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.assignment-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assignment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-day {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.assignment-time {
  font-size: 0.8rem;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.assignment-detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.detail-val {
  font-size: 0.92rem;
  color: var(--text-main);
  font-weight: 500;
}

.assignment-maps-btn {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
  margin-top: 4px;
}

.assignment-maps-btn:hover {
  background: #dcfce7;
}

/* Contenedor de los botones de mapa (punto de encuentro + territorios) */
.assignment-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.assignment-map-actions .assignment-maps-btn {
  flex: 1 1 160px;
  margin-top: 0;
}

/* Variante azul: enlace al mapa personalizado de territorios */
.assignment-maps-btn.territory {
  background: var(--primary-subtle);
  border-color: #93c5fd;
  color: var(--primary);
}

.assignment-maps-btn.territory:hover {
  background: #dbeafe;
}

.assignment-notes {
  font-size: 0.8rem;
  color: #b45309;
  background: #fffbeb;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid #f59e0b;
}

/* ESTADO VACÍO */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed #cbd5e1;
}

.empty-illustration {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto;
}

/* PESTAÑA PROGRAMA GENERAL */
.content-header {
  margin-bottom: 18px;
}

.content-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.content-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.days-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.days-nav::-webkit-scrollbar { display: none; }

/* En PC/tablet (sin swipe táctil) los días y semanas se acomodan en varias
   filas para verlos todos; en celular se mantiene el desplazamiento horizontal. */
@media (min-width: 640px) {
  .days-nav, .week-nav { flex-wrap: wrap; overflow-x: visible; }
}

.day-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 7px 13px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  scroll-snap-align: center;
  flex: 0 0 auto;
}

.day-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.timeline-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
}

.timeline-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 2px 0 4px;
}

.timeline-location {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== Tarjeta de salida del Programa (rediseño) ===== */
.sched-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sched-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.sched-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
}
.sched-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.sched-tag.tag-terr { background: #eff6ff; color: #1d4ed8; }
.sched-tag.tag-pub  { background: #ecfdf5; color: #047857; }

.sched-terr {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.sched-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.86rem;
  color: var(--text-main);
}
.sched-cong-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.sched-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}
.sched-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.sched-ico { flex-shrink: 0; color: var(--text-muted); }
.sched-row-label { font-weight: 700; color: var(--text-main); }

/* Asegura que el atributo [hidden] oculte estos elementos (el display de clase lo tapaba) */
.team-cards-grid[hidden], .badge[hidden] { display: none !important; }

/* Toggle de días pasados en el itinerario */
.past-toggle-bar { display: flex; justify-content: center; margin-bottom: 12px; }
.past-toggle {
  background: var(--primary-subtle, #eff6ff);
  color: var(--primary, #1d4ed8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
}
.past-toggle:hover { filter: brightness(0.97); }
.assignment-empty-done {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  font-weight: 600;
}

/* Territorio dentro del itinerario personal */
.detail-territorio strong { color: #1d4ed8; }

/* TERRITORIOS Y MAPAS */
.filter-box {
  margin-bottom: 16px;
}

.filter-box input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.92rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background: #ffffff;
}

.territories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.territory-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.territory-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.territory-card-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* GUÍA Y CONTACTOS */
.card-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 16px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .contacts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Selector de contacto + tarjeta de datos */
.contacts-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-select-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Desplegable personalizado */
.contact-dd {
  position: relative;
  width: 100%;
}

.contact-dd-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  padding: 13px 14px 13px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-dd-toggle:hover { border-color: #94a3b8; }
.contact-dd.open .contact-dd-toggle {
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.contact-dd-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.contact-dd-chevron {
  flex-shrink: 0;
  color: #2563eb;
  transition: transform 0.2s ease;
}
.contact-dd.open .contact-dd-chevron { transform: rotate(180deg); }

.contact-dd-menu {
  list-style: none;
  margin: 6px 0 0;
  padding: 6px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: ddFade 0.14s ease;
}
@keyframes ddFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.contact-dd-option {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.1s;
}
.contact-dd-option:hover { background: #f1f5f9; }
.contact-dd-option[aria-selected="true"] {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.contacts-picker .contact-card {
  margin-top: 4px;
}

.contact-phone {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0.3px;
}

.btn-call {
  background: #e0f2fe !important;
  color: #0369a1 !important;
}
.btn-call:hover { background: #bae6fd !important; }

.contact-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* El texto (rol + nombre) toma todo el ancho disponible */
.contact-info { flex: 1 1 auto; min-width: 0; }

/* Botones apilados: Llamar arriba, WhatsApp abajo */
.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
.contact-actions .btn-whatsapp-mini {
  justify-content: center;
  min-width: 108px;
  padding: 6px 10px;
}

.contact-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.2;
}

.contact-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.tips-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.tip-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.tip-item-body {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding-left: 28px;
}

.emergency-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.emergency-pill {
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  display: block;
}

.emergency-pill.red {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fca5a5;
}

.emergency-pill.green {
  background: var(--success-light);
  color: var(--success-dark);
  border: 1px solid #86efac;
}

.emergency-pill.blue {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid #93c5fd;
}

/* NAVEGACIÓN INFERIOR (MÓVIL) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* Reserva la barra de inicio (iPhone) y bordes laterales con recorte */
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  max-width: 680px;
  margin: 0 auto;
}

.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 2px;
  flex: 1 1 0;
  min-width: 0;
  transition: all 0.15s;
}

/* Etiquetas: celdas iguales, texto centrado que ajusta en 2 líneas si es largo */
.nav-item span {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1.05;
  word-break: break-word;
}

.nav-item svg { flex-shrink: 0; }

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active svg {
  stroke: var(--primary);
  transform: translateY(-2px);
  transition: transform 0.2s;
}

/* MODAL DE ADMINISTRACIÓN */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.btn-close-modal {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.drop-zone {
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
  background: #dbeafe;
  border-color: var(--primary-light);
}

.drop-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.drop-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

.upload-feedback.success {
  background: var(--success-light);
  color: var(--success-dark);
}

.upload-feedback.error {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.columns-help {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.columns-help summary {
  cursor: pointer;
  color: var(--primary);
  margin-bottom: 8px;
}

.columns-table-wrap {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.columns-table-wrap ul {
  padding-left: 18px;
  margin-top: 6px;
}

.columns-table-wrap li {
  margin-bottom: 4px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hidden {
  display: none !important;
}

/* MEJORAS DE SEMANA Y DISTINCIÓN DE REUNIÓN */
.week-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.week-nav::-webkit-scrollbar { display: none; }

.week-tab-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  scroll-snap-align: center;
  flex: 0 0 auto;
}

.week-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.week-group-header {
  margin: 18px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.week-group-header span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.week-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.assignment-item.is-meeting {
  border-left-color: #8b5cf6;
  background: #faf5ff;
}

.assignment-item.is-meeting .assignment-day {
  color: #6d28d9;
}

.badge-meeting {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-preaching {
  background: #e0f2fe;
  color: #0369a1;
}

.assignment-tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}


/* ===== Formulario Registrar visita ===== */
.registro-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.registro-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.registro-field input,
.registro-field select,
.registro-field textarea {
  font: inherit;
  font-weight: 400;
  font-size: 1rem; /* evita zoom en iOS */
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-body);
  color: var(--text-main);
  width: 100%;
  box-sizing: border-box;
}
.registro-field textarea { resize: vertical; }
.registro-field input:focus,
.registro-field select:focus,
.registro-field textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.registro-msg {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.registro-msg.hidden { display: none; }
.registro-msg.ok { background: var(--success-light); color: var(--success-dark); }
.registro-msg.error { background: var(--danger-light); color: var(--danger); }
.registro-form .btn { width: 100%; }


/* ===== Panel de capitanes ===== */
#navPanel[hidden], #tab-panel[hidden] { display: none !important; }
.panel-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.panel-filters .registro-field { flex: 1 1 140px; min-width: 128px; margin: 0; }
.panel-filters .registro-field input,
.panel-filters .registro-field select { padding: 10px; font-size: 16px; } /* 16px evita zoom en iOS */
.panel-actions { display: flex; gap: 8px; flex: 1 1 100%; flex-wrap: wrap; }
.panel-actions .btn { flex: 1 1 auto; min-width: 120px; padding: 10px 14px; }
.panel-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (min-width: 760px) {
  .panel-actions { flex: 0 0 auto; margin-left: auto; width: auto; }
  .panel-actions .btn { flex: 0 0 auto; }
}
.panel-resumen { font-size: 0.85rem; color: var(--text-muted); margin: 8px 0; }
.panel-resumen.hidden, .panel-table.hidden { display: none; }
.panel-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.panel-table { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 0.82rem; }
.panel-table th, .panel-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.panel-table th { background: var(--primary-subtle); color: var(--primary); font-weight: 700; white-space: nowrap; }
.panel-table td { color: var(--text-main); word-break: break-word; }

.registro-help { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--text-muted, #64748b); font-weight: 400; }
#regRegistradoPor[readonly],
#regTipo[readonly] { background: #f1f5f9; color: var(--text-muted, #475569); cursor: not-allowed; }
.mis-registros { margin-top: 24px; }
.mis-registros[hidden] { display: none; }
.mis-registros-lista { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.mis-registros-lista li { padding: 10px 12px; border: 1px solid var(--border, #ddd); border-radius: 8px; font-size: 0.9rem; word-break: break-word; }
.mis-reg-desc { margin-top: 6px; white-space: pre-wrap; }
.mis-reg-desc:empty { display: none; }
.mis-reg-derivado { margin-top: 6px; font-size: 0.85rem; font-weight: 600; }
.mis-reg-derivado.si { color: #15803d; }
.mis-reg-derivado.no { color: var(--text-muted, #64748b); }
.mis-reg-editor-label { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.mis-reg-editor-label select { font: inherit; padding: 8px; border: 1px solid var(--border, #ddd); border-radius: 8px; }
.mis-reg-actualizado { margin-top: 4px; font-size: 0.78rem; color: var(--text-muted, #64748b); }
.mis-reg-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mis-reg-main { flex: 1 1 auto; min-width: 0; }
.mis-reg-edit-btn {
  flex: 0 0 auto;
  background: none;
  border: none;
  padding: 6px;
  margin: 0;
  border-radius: var(--radius-md, 8px);
  color: var(--primary, #1e3a8a);
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s, transform 0.15s;
}
.mis-reg-edit-btn:hover { background: var(--primary-light, #eef2ff); transform: scale(1.08); }
.mis-reg-edit-btn:active { transform: scale(0.95); }
.mis-reg-edit-btn.hidden { display: none; }
.mis-reg-editor { margin-top: 8px; display: grid; gap: 8px; }
.mis-reg-editor.hidden { display: none; }
.mis-reg-editor textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; border: 1px solid var(--border, #ddd); border-radius: 8px; resize: vertical; }
.mis-reg-editor-acciones { display: flex; gap: 8px; }
.mis-reg-editor-acciones .btn { padding: 6px 14px; font-size: 0.85rem; }
.export-icon-btn {
  background: none;
  border: none;
  padding: 3px;
  margin: 0;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-self: center;
  line-height: 0;
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.export-icon-btn svg { display: block; width: 100%; height: 100%; }
.export-icon-btn:disabled { filter: grayscale(1) opacity(0.35); cursor: not-allowed; }
/* Hover solo en dispositivos con puntero (PC) */
@media (hover: hover) {
  .export-icon-btn:not(:disabled):hover { transform: scale(1.12); background: rgba(0, 0, 0, 0.06); }
}
/* Feedback al presionar: funciona con mouse y con tap en celular */
.export-icon-btn:not(:disabled):active,
.export-icon-btn.tapped { transform: scale(0.85); background: rgba(0, 0, 0, 0.12); }

/* ===== Edición de encargado en el Programa (solo admin) ===== */
.sched-admin-edit { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-color); }
.sched-edit-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-subtle); color: var(--primary);
  border: 1px solid var(--border-color); border-radius: 8px;
  padding: 7px 12px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.sched-edit-btn:active { transform: scale(0.96); }
@media (hover: hover) { .sched-edit-btn:hover { background: var(--accent-light); } }
.sched-edit-btn svg { display: block; }

.sched-editor { margin-top: 8px; }
.sched-editor-acciones { display: flex; gap: 8px; margin-top: 10px; }
.sched-editor-acciones .btn { flex: 1; padding: 9px 10px; font-size: 0.85rem; }
.sched-editor-msg { margin-top: 8px; font-size: 0.82rem; }
.sched-editor-msg.error { color: #b91c1c; }
.sched-editor-msg.ok { color: #15803d; }

/* Autocompletado de nombres */
.name-ac { position: relative; }
.name-ac-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 36px 10px 12px; font-size: 0.9rem;
  border: 1px solid var(--border-color); border-radius: 8px;
  background: var(--bg-card); color: var(--text-main);
}
.name-ac-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-subtle); }
/* Indicador ▾ para dejar claro que es un selector con sugerencias. */
.name-ac::after {
  content: ""; position: absolute; right: 13px; top: 18px; pointer-events: none;
  width: 8px; height: 8px; border-right: 2px solid var(--text-soft, #94a3b8);
  border-bottom: 2px solid var(--text-soft, #94a3b8); transform: rotate(45deg);
}
/* Con texto, la X reemplaza al indicador ▾. */
.name-ac.has-text::after { display: none; }
.name-ac-clear { right: 10px; top: 50%; transform: translateY(-50%); }
.name-ac-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  max-height: 320px; overflow-y: auto; padding: 4px; overscroll-behavior: contain;
}
.name-ac-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 12px; font-size: 0.9rem; color: var(--text-main); line-height: 1.2;
  background: transparent; border: none; border-radius: 7px; cursor: pointer;
  transition: background 0.12s ease;
}
.name-ac-item + .name-ac-item { border-top: 1px solid var(--border-color); }
.name-ac-item:active { background: var(--primary-subtle); }
.name-ac-item.is-active { background: var(--accent-light); }
@media (hover: hover) { .name-ac-item:hover { background: var(--accent-light); } }
