/* busquedas-apple.css — [BÚSQUEDAS APPLE OCT 2026] Look & feel Apple de «📊 Historial búsquedas» (#historial) y
   «⏰ Programar búsqueda» (#programarBusqueda), con los mismos tokens --ad-* (admin-apple-redesign.css) que Unidad Pública,
   Organización, Comunicaciones y Planes de negocio. Solo CSS + dos retoques de marcado (subtítulos y cabecera de la lista):
   todos los ids/clases/names que usan historial.js, schedule.js y search-unified.js se mantienen (la prueba
   scripts/pruebas-busquedas-apple/test-busquedas-apple.js tiene la lista dorada). Se carga DESPUÉS de historial.css,
   search-unified.css y search-results-apple.css (gana la cascada) y con !important donde la regla global `.section button`
   de style.css (especificidad 0,4,1) o las reglas con !important anteriores lo exigen. Las tarjetas de resultado
   (.result-card) siguen con search-results-apple.css. */

/* ── Base y reset de la regla global `.section button` ───────────────────────────────────────────────────────────── */
#historial, #programarBusqueda {
  font-family: var(--ad-font, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif);
  color: var(--ad-text, #1d1d1f);
}
#historial button, #programarBusqueda button {
  margin: 0 !important; position: static !important; overflow: visible !important; box-shadow: none !important;
  background-image: none !important; transform: none !important; font-family: inherit !important; line-height: 1.2 !important;
}
#historial button::before, #programarBusqueda button::before { content: none !important; display: none !important; }
#historial button:hover, #programarBusqueda button:hover { transform: none !important; }
#historial .hidden, #programarBusqueda .hidden { display: none !important; }

/* ── Piezas comunes: botones pastilla, inputs, etiquetas ─────────────────────────────────────────────────────────── */
#historial .historial-config-btn, #historial .btn-config-save, #historial .btn-config-danger,
#historial .btn-primary, #historial .btn-secondary, #historial .btn-danger,
#programarBusqueda .btn-select-all, #programarBusqueda .btn-schedule-pro, #programarBusqueda #btnRepartoEquitativo,
#programarBusqueda .schedule-list-btn, #programarBusqueda #scheduledList button {
  display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important;
  padding: 9px 16px !important; border-radius: var(--ad-r-pill, 980px) !important; border: 1px solid var(--ad-border-2, rgba(0,0,0,.14)) !important;
  background: var(--ad-card, #fff) !important; color: var(--ad-text, #1d1d1f) !important;
  font-size: 13px !important; font-weight: 600 !important; cursor: pointer !important; white-space: nowrap !important; text-decoration: none !important;
  transition: transform .1s ease, filter .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease !important;
}
#historial .historial-config-btn:hover, #historial .btn-secondary:hover, #programarBusqueda .btn-select-all:hover,
#programarBusqueda #btnRepartoEquitativo:hover, #programarBusqueda .schedule-list-btn:hover, #programarBusqueda #scheduledList button:hover {
  background: color-mix(in srgb, var(--ad-text-2, #6e6e73) 8%, var(--ad-card, #fff)) !important;
  border-color: var(--ad-text-3, #a1a1a6) !important; transform: translateY(-1px) !important;
}
#historial .historial-config-btn svg, #historial .btn-primary svg, #historial .btn-secondary svg, #historial .btn-danger svg,
#historial .btn-config-save svg, #historial .btn-config-danger svg { width: 16px; height: 16px; color: currentColor !important; flex: 0 0 auto; }
/* primario naranja (degradado como .up-btn.primario) */
#historial .btn-primary, #historial .btn-config-save, #programarBusqueda .btn-schedule-pro {
  background: linear-gradient(135deg, #f0974a 0%, var(--ad-accent, #e88732) 100%) !important;
  background-image: linear-gradient(135deg, #f0974a 0%, var(--ad-accent, #e88732) 100%) !important;
  color: #fff !important; border-color: transparent !important; box-shadow: 0 6px 18px rgba(232,135,50,.28) !important;
}
#historial .btn-primary:hover, #historial .btn-config-save:hover, #programarBusqueda .btn-schedule-pro:hover {
  filter: saturate(1.08) !important; box-shadow: 0 8px 22px rgba(232,135,50,.38) !important; transform: translateY(-1px) !important;
}
/* peligro rojo tenue */
#historial .btn-danger, #historial .btn-config-danger, #programarBusqueda .schedule-list-btn.delete, #programarBusqueda #scheduledList button.delete {
  background: color-mix(in srgb, var(--ad-red, #ff3b30) 10%, var(--ad-card, #fff)) !important; color: var(--ad-red, #ff3b30) !important;
  border-color: color-mix(in srgb, var(--ad-red, #ff3b30) 34%, transparent) !important;
}
#historial .btn-danger:hover, #historial .btn-config-danger:hover, #programarBusqueda .schedule-list-btn.delete:hover, #programarBusqueda #scheduledList button.delete:hover {
  background: color-mix(in srgb, var(--ad-red, #ff3b30) 18%, var(--ad-card, #fff)) !important; transform: translateY(-1px) !important;
}
#historial button[disabled], #programarBusqueda button[disabled] { opacity: .55 !important; cursor: default !important; transform: none !important; }

#historial .filter-input, #historial .date-input, #historial .config-input,
#programarBusqueda .form-control-modern input, #programarBusqueda .multi-select-modern, #programarBusqueda .reparto-user-pct {
  background: var(--ad-card-2, #fbfbfd) !important; border: 1px solid var(--ad-border-2, rgba(0,0,0,.14)) !important;
  border-radius: var(--ad-r-el, 12px) !important; color: var(--ad-text, #1d1d1f) !important; font-family: inherit !important;
  font-size: 14px !important; padding: 9px 12px !important; outline: none !important; box-shadow: none !important;
  transition: border-color .15s ease, box-shadow .15s ease !important;
}
#historial .filter-input:focus, #historial .date-input:focus, #historial .config-input:focus,
#programarBusqueda .form-control-modern input:focus, #programarBusqueda .multi-select-modern:focus, #programarBusqueda .reparto-user-pct:focus {
  border-color: var(--ad-accent, #e88732) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ad-accent, #e88732) 18%, transparent) !important;
}
#historial .filter-input::placeholder { color: var(--ad-text-3, #a1a1a6); }
#historial .filter-label, #historial .filter-label-small, #historial .config-row label,
#programarBusqueda .form-label, #programarBusqueda .form-label-modern, #programarBusqueda .form-control-modern label,
#programarBusqueda .ted-country-selector > label:first-child {
  display: block; margin: 0 0 6px !important; font-size: 11.5px !important; font-weight: 600 !important; text-transform: uppercase !important;
  letter-spacing: .04em !important; color: var(--ad-text-3, #a1a1a6) !important;
}
#historial input[type="checkbox"], #programarBusqueda input[type="checkbox"], #programarBusqueda input[type="radio"] { accent-color: var(--ad-accent, #e88732); }

/* ── Tarjeta base (misma que .up-card / .org-card) ───────────────────────────────────────────────────────────────── */
#historial .historial-filters, #historial .historial-config-panel, #historial .empty-state,
#programarBusqueda .schedule-section, #programarBusqueda .schedule-list-item, #programarBusqueda #scheduledList > div,
#programarBusqueda .schedule-list-empty {
  background: var(--ad-card, #fff) !important; border: 1px solid var(--ad-border, rgba(0,0,0,.08)) !important;
  border-radius: var(--ad-r-card, 18px) !important; box-shadow: var(--ad-sh, 0 1px 3px rgba(0,0,0,.05)) !important;
}

/* ═══════════════════════════════════════════════ HISTORIAL ══════════════════════════════════════════════════════ */
#historial .historial-container { max-width: 1320px; margin: 0 auto; padding: 4px 4px 48px; display: flex; flex-direction: column; gap: 16px; }
#historial .historial-header { margin: 0; display: flex; flex-direction: column; gap: 12px; }
#historial .historial-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0; }
#historial .historial-title-wrap { display: flex; flex-direction: column; min-width: 0; }
#historial .historial-title {
  margin: 0 !important; font-size: 1.9rem !important; font-weight: 700 !important; letter-spacing: -.025em !important; line-height: 1.15 !important;
  color: var(--ad-text, #1d1d1f) !important; display: flex; align-items: center; gap: 10px;
}
#historial .historial-title::before { content: '📊'; font-size: 1.5rem; }
#historial .historial-sub { margin: 6px 0 0; font-size: 13.5px; color: var(--ad-text-2, #6e6e73); line-height: 1.45; max-width: 760px; }
#historial .historial-config-btn { align-self: flex-start; }
#historial .historial-config-btn[aria-expanded="true"] { border-color: var(--ad-accent, #e88732) !important; color: var(--ad-accent, #e88732) !important; }

/* panel de borrado automático */
#historial .historial-config-panel { margin: 0 !important; padding: 16px 18px !important; animation: none !important; }
#historial .config-panel-content { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; }
#historial .config-row { display: flex; flex-direction: column; gap: 0; margin: 0; }
#historial .config-input-group { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ad-text-2, #6e6e73); }
#historial .config-input { width: 86px !important; font-variant-numeric: tabular-nums; text-align: center; }
#historial .config-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
#historial .config-status { font-size: 12.5px; color: var(--ad-text-2, #6e6e73); }

/* filtros */
#historial .historial-filters { padding: 18px 20px !important; margin: 0 !important; display: flex; flex-direction: column; gap: 16px; }
#historial .filter-section { margin: 0 !important; padding: 0 !important; border: 0 !important; display: flex; flex-direction: column; gap: 4px; }
#historial .filter-section-row { flex-direction: row; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
#historial .filter-input-group { display: flex; flex-direction: column; flex: 1 1 260px; min-width: 200px; margin: 0; }
#historial .filter-input-small { flex: 0 1 180px; min-width: 150px; }
#historial .input-with-icon { position: relative; display: flex; align-items: center; }
#historial .input-with-icon > svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--ad-text-3, #a1a1a6); pointer-events: none; }
#historial .input-with-icon .input-icon-text { position: absolute; left: 12px; font-size: 13px; color: var(--ad-text-3, #a1a1a6); font-weight: 600; pointer-events: none; }
#historial .input-with-icon .filter-input { width: 100%; padding-left: 34px !important; }
#historial .filter-chips, #historial .quick-date-options { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#historial .filter-chips-divider { color: var(--ad-border-2, rgba(0,0,0,.14)); font-size: 18px; line-height: 1; padding: 0 4px; user-select: none; }
#historial .filter-chip, #historial .quick-date-btn {
  display: inline-flex !important; align-items: center !important; gap: 6px !important; padding: 7px 14px !important;
  border-radius: var(--ad-r-pill, 980px) !important; border: 1px solid var(--ad-border-2, rgba(0,0,0,.14)) !important;
  background: var(--ad-card, #fff) !important; color: var(--ad-text-2, #6e6e73) !important; font-size: 13px !important; font-weight: 600 !important;
  cursor: pointer !important; white-space: nowrap !important; transition: background .15s ease, border-color .15s ease, color .15s ease !important;
}
#historial .filter-chip:hover, #historial .quick-date-btn:hover { border-color: var(--ad-accent, #e88732) !important; color: var(--ad-accent, #e88732) !important; background: var(--ad-card, #fff) !important; }
#historial .filter-chip.active, #historial .quick-date-btn.active {
  background: color-mix(in srgb, var(--ad-accent, #e88732) 14%, var(--ad-card, #fff)) !important; color: #9a4a12 !important;
  border-color: color-mix(in srgb, var(--ad-accent, #e88732) 55%, transparent) !important;
}
#historial .filter-chip.ted-chip.active { background: color-mix(in srgb, var(--ad-blue, #0a84ff) 14%, var(--ad-card, #fff)) !important; color: #0a5fcc !important; border-color: color-mix(in srgb, var(--ad-blue, #0a84ff) 50%, transparent) !important; }
#historial .quick-date-btn.custom { border-style: dashed !important; }
#historial .chip-icon { font-size: 14px; position: static !important; width: auto !important; height: auto !important; background: none !important; transform: none !important; }
#historial .custom-date-inputs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 0; background: none; border: 0; }
#historial .custom-date-inputs .date-separator { color: var(--ad-text-3, #a1a1a6); font-size: 13px; }
#historial .historial-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--ad-border, rgba(0,0,0,.08)); }

/* resumen de resultados (chips KPI) */
#historial .results-info { display: flex !important; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; padding: 0; background: none !important; border: 0 !important; }
#historial .results-info.hidden { display: none !important; }
#historial #historialResultsCount, #historial #historialResultsImporte:not(:empty) {
  display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--ad-r-pill, 980px); font-size: 12.5px !important; font-weight: 700 !important;
  background: color-mix(in srgb, var(--ad-accent, #e88732) 14%, var(--ad-card, #fff)); color: #9a4a12 !important;
}
#historial #historialResultsImporte:not(:empty) { background: color-mix(in srgb, var(--ad-green, #34c759) 16%, var(--ad-card, #fff)); color: #1f8a3d !important; }

/* resultados, vacío y carga */
#historial .historial-results { margin: 0; }
#historial .empty-state { padding: 40px 24px !important; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; }
#historial .empty-state.hidden { display: none !important; }
#historial .empty-state-icon { font-size: 40px; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: color-mix(in srgb, var(--ad-accent, #e88732) 12%, transparent); margin-bottom: 6px; }
#historial .empty-state h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ad-text, #1d1d1f); }
#historial .empty-state p { margin: 0; font-size: 13.5px; color: var(--ad-text-2, #6e6e73); max-width: 480px; }
#historial .historial-loading { grid-column: 1 / -1; display: flex; justify-content: center; padding: 40px 0; }
#historial .historial-loading::after { content: ''; width: 28px; height: 28px; border: 3px solid color-mix(in srgb, var(--ad-accent, #e88732) 22%, transparent); border-top-color: var(--ad-accent, #e88732); border-radius: 50%; animation: bq-spin .8s linear infinite; }
@keyframes bq-spin { to { transform: rotate(360deg); } }

/* ═════════════════════════════════════════ PROGRAMAR BÚSQUEDA ═══════════════════════════════════════════════════ */
#programarBusqueda { max-width: 1320px; margin: 0 auto; padding: 4px 4px 48px; }
#programarBusqueda .search-unified-header { padding: 0 0 16px !important; text-align: left !important; display: flex; flex-direction: column; }
#programarBusqueda .search-unified-header h2 {
  margin: 0 !important; font-size: 1.9rem !important; font-weight: 700 !important; letter-spacing: -.025em !important; line-height: 1.15 !important;
  color: var(--ad-text, #1d1d1f) !important; display: flex; align-items: center; gap: 10px;
}
#programarBusqueda .search-unified-header h2::before { content: '⏰'; font-size: 1.5rem; }
#programarBusqueda .search-unified-header p { margin: 6px 0 0 !important; font-size: 13.5px !important; color: var(--ad-text-2, #6e6e73) !important; line-height: 1.45; max-width: 760px; }
#programarBusqueda .schedule-unified-form { padding: 0 !important; display: flex; flex-direction: column; gap: 14px; counter-reset: bq-paso; }
#programarBusqueda .user-info-badge {
  align-self: flex-start; display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; padding: 6px 12px 6px 8px !important;
  border-radius: var(--ad-r-pill, 980px) !important; background: color-mix(in srgb, var(--ad-text, #1d1d1f) 6%, transparent) !important; border: 0 !important;
  font-size: 12.5px !important; color: var(--ad-text-2, #6e6e73) !important;
}
#programarBusqueda .user-info-badge::before { content: '👤'; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ad-card, #fff); font-size: 12px; }
#programarBusqueda .user-info-badge strong { color: var(--ad-text, #1d1d1f) !important; font-weight: 700; }

/* bloques numerados */
#programarBusqueda .schedule-section { padding: 18px 20px !important; margin: 0 !important; display: flex; flex-direction: column; gap: 12px; }
#programarBusqueda .schedule-section-title {
  margin: 0 !important; display: flex !important; align-items: center; gap: 10px; font-size: 15px !important; font-weight: 700 !important;
  letter-spacing: -.01em; color: var(--ad-text, #1d1d1f) !important; counter-increment: bq-paso;
}
#programarBusqueda .schedule-section-title::before {
  content: counter(bq-paso); width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #f0974a 0%, var(--ad-accent, #e88732) 100%); flex: 0 0 auto;
}
#programarBusqueda .schedule-section-icon { font-size: 16px; }
#programarBusqueda .form-group { margin: 0; }
#programarBusqueda .form-help { font-size: 12.5px !important; color: var(--ad-text-2, #6e6e73) !important; line-height: 1.45; }

/* fichas seleccionables (fuente y tipo) */
#programarBusqueda .schedule-source-grid, #programarBusqueda .schedule-categories-grid { display: grid; gap: 10px; margin: 0; }
#programarBusqueda .schedule-source-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
#programarBusqueda .schedule-categories-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
#programarBusqueda .schedule-source-card, #programarBusqueda .schedule-category-card { position: relative; margin: 0; cursor: pointer; display: block; }
#programarBusqueda .schedule-source-card input, #programarBusqueda .schedule-category-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
#programarBusqueda .schedule-source-content, #programarBusqueda .schedule-category-content {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 10px !important; min-height: 78px;
  border: 1px solid var(--ad-border-2, rgba(0,0,0,.14)) !important; border-radius: 14px !important; background: var(--ad-card-2, #fbfbfd) !important;
  color: var(--ad-text-2, #6e6e73) !important; box-shadow: none !important; transition: border-color .15s ease, background .15s ease, transform .1s ease, box-shadow .15s ease !important;
}
#programarBusqueda .schedule-source-card:hover .schedule-source-content, #programarBusqueda .schedule-category-card:hover .schedule-category-content {
  border-color: var(--ad-accent, #e88732) !important; transform: translateY(-1px); background: var(--ad-card, #fff) !important;
}
#programarBusqueda .schedule-source-card input:checked ~ .schedule-source-content, #programarBusqueda .schedule-source-card.selected .schedule-source-content,
#programarBusqueda .schedule-category-card input:checked ~ .schedule-category-content, #programarBusqueda .schedule-category-card.selected .schedule-category-content {
  background: color-mix(in srgb, var(--ad-accent, #e88732) 12%, var(--ad-card, #fff)) !important; border-color: var(--ad-accent, #e88732) !important;
  color: var(--ad-text, #1d1d1f) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ad-accent, #e88732) 18%, transparent) !important;
}
#programarBusqueda .schedule-source-card input:checked ~ .schedule-source-content::after, #programarBusqueda .schedule-category-card input:checked ~ .schedule-category-content::after {
  content: '✓'; position: absolute; top: 8px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--ad-accent, #e88732); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
#programarBusqueda .schedule-source-content, #programarBusqueda .schedule-category-content { position: relative; }
#programarBusqueda .schedule-source-icon, #programarBusqueda .schedule-category-icon { font-size: 24px !important; line-height: 1; }
#programarBusqueda .schedule-source-name, #programarBusqueda .schedule-category-name { font-size: 13px !important; font-weight: 600 !important; color: inherit !important; text-align: center; }

/* chips de países TED y de días */
#programarBusqueda .ted-country-selector { margin: 4px 0 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ad-blue, #0a84ff) 6%, var(--ad-card, #fff)); border: 1px dashed color-mix(in srgb, var(--ad-blue, #0a84ff) 35%, transparent); }
#programarBusqueda .ted-country-chips, #programarBusqueda .days-selector { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#programarBusqueda .ted-country-chip, #programarBusqueda .schedule-day-chip label {
  display: inline-flex !important; align-items: center; gap: 6px; padding: 7px 14px !important; border-radius: var(--ad-r-pill, 980px) !important;
  border: 1px solid var(--ad-border-2, rgba(0,0,0,.14)) !important; background: var(--ad-card, #fff) !important; color: var(--ad-text-2, #6e6e73) !important;
  font-size: 13px !important; font-weight: 600 !important; cursor: pointer; margin: 0 !important; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
#programarBusqueda .ted-country-chip input, #programarBusqueda .schedule-day-chip input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
#programarBusqueda .schedule-day-chip { position: relative; display: inline-block; }
#programarBusqueda .ted-country-chip:hover, #programarBusqueda .schedule-day-chip label:hover { border-color: var(--ad-accent, #e88732) !important; color: var(--ad-accent, #e88732) !important; }
#programarBusqueda .ted-country-chip.selected, #programarBusqueda .ted-country-chip:has(input:checked) {
  background: color-mix(in srgb, var(--ad-blue, #0a84ff) 14%, var(--ad-card, #fff)) !important; color: #0a5fcc !important; border-color: color-mix(in srgb, var(--ad-blue, #0a84ff) 50%, transparent) !important;
}
#programarBusqueda .ted-country-chip.selected span, #programarBusqueda .ted-country-chip:has(input:checked) span { color: inherit !important; }
#programarBusqueda .schedule-day-chip input:checked + label {
  background: color-mix(in srgb, var(--ad-accent, #e88732) 14%, var(--ad-card, #fff)) !important; color: #9a4a12 !important; border-color: color-mix(in srgb, var(--ad-accent, #e88732) 55%, transparent) !important;
}
#programarBusqueda .btn-select-all { padding: 7px 14px !important; font-size: 12.5px !important; margin-right: 4px !important; }

/* CPV y horarios */
#programarBusqueda .schedule-cpv-container { margin: 4px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--ad-card-2, #fbfbfd); border: 1px dashed var(--ad-border-2, rgba(0,0,0,.14)); }
#programarBusqueda .multi-select-modern { width: 100%; min-height: 160px; padding: 6px !important; }
#programarBusqueda .multi-select-modern option { padding: 6px 8px; border-radius: 8px; }
#programarBusqueda .time-input-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0; }
#programarBusqueda .form-control-modern { display: flex; flex-direction: column; margin: 0; }
#programarBusqueda .form-control-modern input { width: 100%; font-variant-numeric: tabular-nums; }

/* reparto entre comerciales */
#programarBusqueda .reparto-form-grid { display: flex; flex-direction: column; gap: 4px; margin: 0; }
#programarBusqueda .reparto-user-row { padding: 6px 10px; border-radius: 10px; font-size: 13.5px; color: var(--ad-text, #1d1d1f); }
#programarBusqueda .reparto-user-row:hover { background: color-mix(in srgb, var(--ad-text, #1d1d1f) 4%, transparent); }
#programarBusqueda .reparto-user-row label { font-weight: 500; cursor: pointer; }
#programarBusqueda .reparto-user-pct { width: 72px !important; padding: 5px 8px !important; font-size: 13px !important; text-align: center; }
#programarBusqueda .reparto-user-pct[disabled] { opacity: .5; }
#programarBusqueda #btnRepartoEquitativo { padding: 7px 14px !important; font-size: 12.5px !important; margin-top: 8px !important; align-self: flex-start; }
#programarBusqueda .schedule-section > label { font-size: 13.5px; font-weight: 600; color: var(--ad-text, #1d1d1f); }
#programarBusqueda #repartoSimulacionWrap label { font-size: 13.5px; font-weight: 500; color: var(--ad-text, #1d1d1f); }

/* envío y lista de programadas */
#programarBusqueda .submit-section { text-align: left; margin: 2px 0 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#programarBusqueda .btn-schedule-pro { padding: 12px 22px !important; font-size: 14px !important; }
#programarBusqueda #scheduleMessage:not(:empty) { font-size: 13px; color: var(--ad-text-2, #6e6e73); padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ad-text, #1d1d1f) 5%, transparent); }
#programarBusqueda .scheduled-list-heading { margin: 14px 0 0 !important; font-size: 15px !important; font-weight: 700 !important; letter-spacing: -.01em; color: var(--ad-text, #1d1d1f) !important; display: flex; align-items: center; gap: 8px; }
#programarBusqueda .scheduled-list-container { margin: 0 !important; display: flex; flex-direction: column; gap: 10px; }
#programarBusqueda .schedule-list-empty { padding: 28px 20px !important; text-align: center; font-size: 13.5px !important; color: var(--ad-text-2, #6e6e73) !important; }
#programarBusqueda .schedule-list-item { padding: 14px 16px !important; margin: 0 !important; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; transition: transform .15s ease, box-shadow .15s ease !important; }
#programarBusqueda .schedule-list-item:hover { transform: translateY(-1px); box-shadow: var(--ad-sh-h, 0 14px 40px rgba(0,0,0,.12)) !important; border-color: var(--ad-border, rgba(0,0,0,.08)) !important; }
#programarBusqueda .schedule-list-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
#programarBusqueda .schedule-list-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px !important; background: color-mix(in srgb, var(--ad-accent, #e88732) 12%, transparent); flex: 0 0 auto; }
#programarBusqueda .schedule-list-details h4 { margin: 0 0 2px !important; font-size: 14px !important; font-weight: 700 !important; color: var(--ad-text, #1d1d1f) !important; }
#programarBusqueda .schedule-list-details p { margin: 0 !important; font-size: 12.5px !important; color: var(--ad-text-2, #6e6e73) !important; }
#programarBusqueda .schedule-list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#programarBusqueda .schedule-list-btn { padding: 7px 14px !important; font-size: 12.5px !important; }
#programarBusqueda .schedule-list-btn:not(.delete) { background: color-mix(in srgb, var(--ad-blue, #0a84ff) 12%, var(--ad-card, #fff)) !important; color: #0a5fcc !important; border-color: color-mix(in srgb, var(--ad-blue, #0a84ff) 40%, transparent) !important; }
/* variante antigua del listado (schedule.js, clases utilitarias de Tailwind): mismas tarjetas y botones */
#programarBusqueda #scheduledList > div { padding: 16px 18px !important; margin: 0 !important; }
#programarBusqueda #scheduledList > div h3 { font-size: 14px !important; font-weight: 700 !important; color: var(--ad-text, #1d1d1f) !important; margin: 0 !important; }
#programarBusqueda #scheduledList > div p { color: var(--ad-text-2, #6e6e73) !important; font-size: 12.5px !important; }
#programarBusqueda #scheduledList > div span.rounded-full { border-radius: var(--ad-r-pill, 980px) !important; font-weight: 600 !important; }
#programarBusqueda #scheduledList button { padding: 7px 14px !important; font-size: 12.5px !important; }
#programarBusqueda #scheduledList > p { text-align: center; color: var(--ad-text-2, #6e6e73); font-size: 13.5px; padding: 20px; }

/* ── Modal de reparto (cuelga de <body>; lo pintan schedule.js o search-unified.js con estilos en línea) ───────── */
#repartoModalOverlay > div { border-radius: var(--ad-r-card, 18px) !important; background: var(--ad-card, #fff) !important; color: var(--ad-text, #1d1d1f) !important; box-shadow: var(--ad-sh-h, 0 14px 40px rgba(0,0,0,.2)) !important; font-family: var(--ad-font, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif); }
#repartoModalOverlay h3, #repartoModalOverlay h4 { color: var(--ad-text, #1d1d1f) !important; letter-spacing: -.01em; }
#repartoModalOverlay h3 { font-size: 17px !important; font-weight: 700 !important; }
#repartoModalOverlay h4 { font-size: 13.5px !important; font-weight: 700 !important; }
#repartoModalOverlay th { color: var(--ad-text-3, #a1a1a6) !important; font-size: 11.5px !important; text-transform: uppercase; letter-spacing: .04em; font-weight: 600 !important; }
#repartoModalOverlay td { color: var(--ad-text, #1d1d1f) !important; }
#repartoModalOverlay tr { border-color: var(--ad-border, rgba(0,0,0,.08)) !important; }
#repartoModalOverlay input[type="number"], #repartoModalOverlay select { border: 1px solid var(--ad-border-2, rgba(0,0,0,.14)) !important; border-radius: 10px !important; background: var(--ad-card-2, #fbfbfd) !important; color: var(--ad-text, #1d1d1f) !important; }
#repartoModalOverlay input[type="checkbox"] { accent-color: var(--ad-accent, #e88732); }
#repartoModalOverlay button { border-radius: var(--ad-r-pill, 980px) !important; font-weight: 600 !important; font-family: inherit !important; transition: filter .15s ease, transform .1s ease; }
#repartoModalOverlay button:hover { transform: translateY(-1px); }
#repartoModalOverlay button[style*="#4f46e5"], #repartoModalOverlay button.bg-indigo-600 {
  background: linear-gradient(135deg, #f0974a 0%, var(--ad-accent, #e88732) 100%) !important; color: #fff !important; border: 0 !important; box-shadow: 0 6px 18px rgba(232,135,50,.28) !important;
}

/* ── Modo oscuro: lo que no cubren los tokens ────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] #historial .filter-chip.active, [data-theme="dark"] #historial .quick-date-btn.active,
[data-theme="dark"] #programarBusqueda .schedule-day-chip input:checked + label, [data-theme="dark"] #historial #historialResultsCount { color: #ffb783 !important; }
[data-theme="dark"] #historial .filter-chip.ted-chip.active, [data-theme="dark"] #programarBusqueda .ted-country-chip.selected,
[data-theme="dark"] #programarBusqueda .ted-country-chip:has(input:checked), [data-theme="dark"] #programarBusqueda .schedule-list-btn:not(.delete) { color: #7fb8ff !important; }
[data-theme="dark"] #historial #historialResultsImporte:not(:empty) { color: #7fe39a !important; }
[data-theme="dark"] #programarBusqueda .schedule-source-card input:checked ~ .schedule-source-content,
[data-theme="dark"] #programarBusqueda .schedule-category-card input:checked ~ .schedule-category-content { color: #f5f5f7 !important; }
[data-theme="dark"] #programarBusqueda .multi-select-modern option { background: var(--ad-card, #1c1c1e); color: var(--ad-text, #f5f5f7); }
[data-theme="dark"] #repartoModalOverlay input[type="number"], [data-theme="dark"] #repartoModalOverlay select { color-scheme: dark; }

/* ── Responsive y movimiento reducido ────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* historial.css apila chips y botones en móvil; con pastillas quedan mejor en fila con salto de línea */
  #historial .quick-date-options, #historial .historial-actions { flex-direction: row !important; flex-wrap: wrap !important; }
  #historial .quick-date-btn, #historial .historial-actions button { width: auto !important; }
  #historial .historial-title-row { flex-direction: row !important; }
  #historial .config-actions { margin-left: 0; width: auto !important; }
}
@media (max-width: 640px) {
  #historial .historial-title, #programarBusqueda .search-unified-header h2 { font-size: 1.5rem !important; }
  #historial .historial-filters, #programarBusqueda .schedule-section { padding: 14px 14px !important; }
  #programarBusqueda .schedule-list-item { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  #historial *, #programarBusqueda * { transition: none !important; animation: none !important; }
}
