/* HISTORIAL_REPORTES_PREMIUM_V1 */
/* Alcance visual exclusivo de historial-reportes.html. No modifica .wbi-* */

html,
body.history-reportes-cleanup {
  max-width: 100%;
  overflow-x: hidden;
}

body.history-reportes-cleanup {
  --page-bg: #061217;
  --card: #091920;
  --soft: #0d252d;
  --input: #07171d;
  --text: #eae9e9;
  --muted: #91a3a3;
  --line: rgba(234, 233, 233, 0.12);
  --primary: #dfee04;
  --primary-dark: #c8d600;
  --success: #54e39a;
  --warning: #ffbd4a;
  --danger: #ff5e6c;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.34);
  margin: 0;
  min-height: 100vh;
  padding: 12px;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(223, 238, 4, 0.075), transparent 29%),
    radial-gradient(circle at 94% 86%, rgba(84, 227, 154, 0.045), transparent 31%),
    linear-gradient(155deg, #041015 0%, #06171d 48%, #061217 100%);
  overscroll-behavior-x: none;
}

body.history-reportes-cleanup.night {
  --page-bg: #061217;
  --card: #091920;
  --soft: #0d252d;
  --input: #07171d;
  --text: #eae9e9;
  --muted: #91a3a3;
  --line: rgba(234, 233, 233, 0.12);
  --primary: #dfee04;
  --primary-dark: #c8d600;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.38);
}

body.history-reportes-cleanup,
body.history-reportes-cleanup button,
body.history-reportes-cleanup input,
body.history-reportes-cleanup select,
body.history-reportes-cleanup textarea {
  -webkit-tap-highlight-color: transparent;
}

body.history-reportes-cleanup button {
  touch-action: manipulation;
}

body.history-reportes-cleanup .app,
body.history-reportes-cleanup .hero,
body.history-reportes-cleanup .hero-row,
body.history-reportes-cleanup .hero-copy,
body.history-reportes-cleanup .history-panel,
body.history-reportes-cleanup .history-nav-shell,
body.history-reportes-cleanup .history-nav-content,
body.history-reportes-cleanup .history-toolbar,
body.history-reportes-cleanup .filter-grid,
body.history-reportes-cleanup .quick-filters,
body.history-reportes-cleanup .history-summary,
body.history-reportes-cleanup .weeks,
body.history-reportes-cleanup .week-card,
body.history-reportes-cleanup .week-head,
body.history-reportes-cleanup .week-title,
body.history-reportes-cleanup .week-copy,
body.history-reportes-cleanup .week-stats,
body.history-reportes-cleanup .week-body,
body.history-reportes-cleanup .report-card,
body.history-reportes-cleanup .report-head,
body.history-reportes-cleanup .report-details,
body.history-reportes-cleanup .detail-grid,
body.history-reportes-cleanup .report-badges {
  min-width: 0;
  max-width: 100%;
}

body.history-reportes-cleanup .app {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

/* Header */
body.history-reportes-cleanup .hero {
  position: relative;
  margin: 0 0 12px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid rgba(223, 238, 4, 0.18);
  border-radius: 24px;
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(223, 238, 4, 0.105), transparent 42%),
    linear-gradient(145deg, rgba(13, 37, 45, 0.98), rgba(6, 18, 23, 0.98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body.history-reportes-cleanup .hero::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), rgba(223, 238, 4, 0.05), transparent);
}

body.history-reportes-cleanup .hero-row {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 43px minmax(0, 1fr) 46px !important;
  align-items: center !important;
  gap: 12px !important;
}

body.history-reportes-cleanup .home-btn {
  width: 43px;
  height: 43px;
  min-width: 43px;
  border: 1px solid rgba(234, 233, 233, 0.13);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.history-reportes-cleanup .home-btn:hover {
  border-color: rgba(223, 238, 4, 0.34);
  color: var(--primary);
  background: rgba(223, 238, 4, 0.075);
}

body.history-reportes-cleanup .hero-copy {
  grid-column: 2 !important;
  grid-row: 1 !important;
  padding-right: 0 !important;
}

body.history-reportes-cleanup .hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.16rem, 3.2vw, 1.52rem);
  line-height: 1.12;
  letter-spacing: -0.034em;
}

body.history-reportes-cleanup .hero p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.46;
}

body.history-reportes-cleanup #historyToolsShell.page-fixed-tools {
  position: static !important;
  inset: auto !important;
  grid-column: 3 !important;
  grid-row: 1 !important;
  width: 46px !important;
  height: 46px !important;
  margin: 0 !important;
  justify-self: end !important;
  align-self: center !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 30 !important;
}

body.history-reportes-cleanup #menuToolsToggle.history-premium-user-button,
body.history-reportes-cleanup #menuToolsToggle.history-plan-user-trigger,
body.history-reportes-cleanup #menuToolsToggle.history-user-toggle {
  position: relative !important;
  inset: auto !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  overflow: visible !important;
  border: 1px solid rgba(223, 238, 4, 0.23) !important;
  border-radius: 15px !important;
  color: var(--text) !important;
  background:
    radial-gradient(circle at 34% 22%, rgba(223, 238, 4, 0.13), transparent 40%),
    linear-gradient(145deg, #102b32, #081a20) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.055) !important;
}

body.history-reportes-cleanup #menuToolsToggle.history-premium-user-button:hover {
  border-color: rgba(223, 238, 4, 0.52) !important;
  color: var(--primary) !important;
}

body.history-reportes-cleanup #menuToolsToggle.history-premium-user-button:active {
  transform: scale(0.97) !important;
}

body.history-reportes-cleanup #menuToolsToggle .portal-v12-user-trigger-avatar {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

body.history-reportes-cleanup #menuToolsToggle .portal-v12-user-trigger-avatar svg {
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

body.history-reportes-cleanup #historyToolsShell .header-actions,
body.history-reportes-cleanup #themeBtn,
body.history-reportes-cleanup #portalGlobalToolsButton {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.history-reportes-cleanup #menuToolsToggle .pn-tools-badge,
body.history-reportes-cleanup #menuToolsToggle .pn-badge,
body.history-reportes-cleanup #menuToolsToggle .portal-notification-badge,
body.history-reportes-cleanup #menuToolsToggle .history-user-status-dot,
body.history-reportes-cleanup #portalAvatarNotificationBadge,
body.history-reportes-cleanup #menuProfileNotificationBadge,
body.history-reportes-cleanup #portalAvatarFab .portal-notification-badge,
body.history-reportes-cleanup #portalAvatarFab .pn-tools-badge,
body.history-reportes-cleanup #portalAvatarFab .pn-badge {
  display: none !important;
}

/* Main surface */
body.history-reportes-cleanup .history-panel {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.history-reportes-cleanup .history-nav-shell {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid rgba(234, 233, 233, 0.11);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(13, 37, 45, 0.97), rgba(7, 23, 29, 0.98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

body.history-reportes-cleanup .history-nav-toggle {
  min-height: 62px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 1px solid rgba(234, 233, 233, 0.075);
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(223, 238, 4, 0.07), transparent 45%),
    rgba(6, 18, 23, 0.42);
}

body.history-reportes-cleanup .history-nav-mark {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(223, 238, 4, 0.24);
  border-radius: 13px;
  color: var(--primary);
  background: rgba(223, 238, 4, 0.075);
}

body.history-reportes-cleanup .history-nav-copy strong {
  color: var(--text);
  font-size: 0.78rem;
}

body.history-reportes-cleanup .history-nav-copy small {
  color: var(--muted);
  font-size: 0.59rem;
}

body.history-reportes-cleanup .history-nav-chevron,
body.history-reportes-cleanup .week-chevron,
body.history-reportes-cleanup .report-chevron {
  border-color: rgba(223, 238, 4, 0.2);
  color: var(--primary);
  background: rgba(223, 238, 4, 0.05);
}

body.history-reportes-cleanup .history-nav-content {
  background: rgba(4, 16, 21, 0.22);
}

body.history-reportes-cleanup .history-toolbar {
  padding: 12px;
  border-bottom: 1px solid rgba(234, 233, 233, 0.075);
  background: transparent;
}

body.history-reportes-cleanup .filter-grid {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

body.history-reportes-cleanup .filter-grid .search {
  grid-column: 1 / -1;
  min-width: 0;
}

body.history-reportes-cleanup .search input {
  min-height: 44px;
  padding-left: 39px;
  border: 1px solid rgba(234, 233, 233, 0.12);
  border-radius: 14px;
  color: var(--text);
  background: rgba(4, 16, 21, 0.72);
}

body.history-reportes-cleanup .search input::placeholder {
  color: rgba(145, 163, 163, 0.72);
}

body.history-reportes-cleanup .search input:focus {
  border-color: rgba(223, 238, 4, 0.52);
  box-shadow: 0 0 0 3px rgba(223, 238, 4, 0.095);
}

body.history-reportes-cleanup .search span {
  color: var(--primary);
}

body.history-reportes-cleanup .modern-filter-trigger {
  grid-column: 1 / -1;
  min-height: 46px;
  padding: 8px 11px;
  border: 1px solid rgba(234, 233, 233, 0.105);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

body.history-reportes-cleanup .modern-filter-trigger:hover {
  border-color: rgba(223, 238, 4, 0.28);
  background: rgba(223, 238, 4, 0.045);
}

body.history-reportes-cleanup .modern-filter-trigger .mark {
  color: var(--primary);
  background: rgba(223, 238, 4, 0.075);
}

body.history-reportes-cleanup .modern-filter-trigger small {
  color: var(--muted);
}

body.history-reportes-cleanup .nav-action {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid rgba(234, 233, 233, 0.11);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

body.history-reportes-cleanup .nav-action:hover {
  border-color: rgba(223, 238, 4, 0.3);
  color: var(--primary);
}

body.history-reportes-cleanup .quick-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  padding-top: 2px;
}

body.history-reportes-cleanup .quick-chip {
  min-width: 0;
  min-height: 36px;
  padding: 6px 7px;
  overflow: hidden;
  border: 1px solid rgba(234, 233, 233, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  text-overflow: ellipsis;
}

body.history-reportes-cleanup .quick-chip:hover {
  border-color: rgba(223, 238, 4, 0.25);
  color: var(--text);
}

body.history-reportes-cleanup .quick-chip.active {
  border-color: var(--primary);
  color: #101600;
  background: linear-gradient(135deg, #f2ff47, var(--primary));
  box-shadow: 0 8px 22px rgba(223, 238, 4, 0.12);
}

/* Metrics */
body.history-reportes-cleanup .history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 11px 12px 13px;
  border: 0;
  background: transparent;
}

body.history-reportes-cleanup .history-summary .stat {
  position: relative;
  min-height: 76px;
  padding: 12px 10px 10px 43px;
  overflow: hidden;
  border: 1px solid rgba(234, 233, 233, 0.105);
  border-radius: 16px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.043), rgba(255, 255, 255, 0.018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.history-reportes-cleanup .history-summary .stat::after {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  bottom: 13px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

body.history-reportes-cleanup .history-summary .stat strong {
  color: var(--text);
  font-size: 1.12rem;
  letter-spacing: -0.04em;
}

body.history-reportes-cleanup .history-summary .stat span:last-child {
  color: var(--muted);
  font-size: 0.58rem;
}

body.history-reportes-cleanup .stat-icon {
  left: 11px;
  top: 13px;
  width: 25px;
  height: 25px;
  border-radius: 9px;
  color: #111800;
  background: var(--primary);
}

body.history-reportes-cleanup .stat-violet::after {
  background: #ad8cff !important;
}

body.history-reportes-cleanup .stat-violet .stat-icon {
  color: #fff;
  background: rgba(173, 140, 255, 0.84);
}

body.history-reportes-cleanup .stat-cyan::after {
  background: #54e39a !important;
}

body.history-reportes-cleanup .stat-cyan .stat-icon {
  color: #062013;
  background: #54e39a;
}

body.history-reportes-cleanup .stat-amber::after {
  background: #ffbd4a !important;
}

body.history-reportes-cleanup .stat-amber .stat-icon {
  color: #2d1b00;
  background: #ffbd4a;
}

/* Weeks */
body.history-reportes-cleanup .weeks {
  display: grid;
  gap: 12px;
  padding: 0;
}

body.history-reportes-cleanup .week-card {
  overflow: hidden;
  border: 1px solid rgba(234, 233, 233, 0.11);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(13, 37, 45, 0.95), rgba(7, 23, 29, 0.98));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.028);
}

body.history-reportes-cleanup .week-card.open {
  border-color: rgba(223, 238, 4, 0.31);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(223, 238, 4, 0.035);
}

body.history-reportes-cleanup .week-head {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 76px;
  padding: 13px 14px 10px;
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(223, 238, 4, 0.055), transparent 45%),
    transparent;
}

body.history-reportes-cleanup .week-icon {
  width: 43px;
  height: 43px;
  border: 1px solid rgba(223, 238, 4, 0.22);
  border-radius: 14px;
  color: #111800 !important;
  background: linear-gradient(145deg, #f3ff4e, var(--primary)) !important;
  box-shadow: 0 10px 24px rgba(223, 238, 4, 0.09);
}

body.history-reportes-cleanup .week-copy strong {
  color: var(--text);
  font-size: 0.86rem;
  letter-spacing: -0.012em;
}

body.history-reportes-cleanup .week-copy span {
  color: var(--muted);
  font-size: 0.62rem;
}

body.history-reportes-cleanup .week-count {
  border: 1px solid rgba(234, 233, 233, 0.11);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

body.history-reportes-cleanup .week-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  overflow: visible;
  padding: 0 13px 13px;
}

body.history-reportes-cleanup .week-stat {
  min-width: 0;
  padding: 9px 9px 8px;
  border: 1px solid rgba(234, 233, 233, 0.1);
  border-left: 3px solid var(--primary) !important;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.028);
}

body.history-reportes-cleanup .week-stat:nth-child(2) {
  border-left-color: #ad8cff !important;
}

body.history-reportes-cleanup .week-stat:nth-child(3) {
  border-left-color: #ffbd4a !important;
}

body.history-reportes-cleanup .week-stat:nth-child(4) {
  border-left-color: #ff5e6c !important;
}

body.history-reportes-cleanup .week-stat strong {
  color: var(--text);
  font-size: 0.84rem;
}

body.history-reportes-cleanup .week-stat span {
  color: var(--muted);
  font-size: 0.55rem;
}

body.history-reportes-cleanup .week-stat.planified strong {
  color: var(--text);
}

body.history-reportes-cleanup .week-body {
  gap: 9px;
  padding: 0 11px 11px;
}

/* Reports */
body.history-reportes-cleanup .report-card {
  overflow: hidden;
  border: 1px solid rgba(234, 233, 233, 0.095);
  border-radius: 16px;
  background: rgba(4, 16, 21, 0.5);
  box-shadow: none;
}

body.history-reportes-cleanup .report-card.open {
  border-color: rgba(223, 238, 4, 0.24);
  background: rgba(7, 25, 31, 0.92);
}

body.history-reportes-cleanup .report-head {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
  color: var(--text);
}

body.history-reportes-cleanup .report-title {
  color: var(--text);
  font-size: 0.76rem;
  letter-spacing: -0.008em;
}

body.history-reportes-cleanup .report-title::before {
  color: var(--primary);
}

body.history-reportes-cleanup .report-subtitle {
  color: var(--muted);
  font-size: 0.61rem;
}

body.history-reportes-cleanup .report-badges {
  gap: 5px;
  margin-top: 8px;
}

body.history-reportes-cleanup .report-badges .badge,
body.history-reportes-cleanup .sync-state,
body.history-reportes-cleanup .photo-pill,
body.history-reportes-cleanup .report-version-badge,
body.history-reportes-cleanup .correction-revision-badge {
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(234, 233, 233, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.55rem;
  line-height: 1.18;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.history-reportes-cleanup .work-badge.mst,
body.history-reportes-cleanup .work-badge.planificado {
  border-color: rgba(223, 238, 4, 0.24);
  color: #eef86c;
  background: rgba(223, 238, 4, 0.075);
}

body.history-reportes-cleanup .work-badge.wr,
body.history-reportes-cleanup .work-badge.no_programado,
body.history-reportes-cleanup .report-version-badge {
  border-color: rgba(173, 140, 255, 0.27) !important;
  color: #cdbfff !important;
  background: rgba(173, 140, 255, 0.09) !important;
}

body.history-reportes-cleanup .work-badge.falla {
  border-color: rgba(255, 94, 108, 0.28);
  color: #ffc0c6;
  background: rgba(255, 94, 108, 0.09);
}

body.history-reportes-cleanup .origin-badge.whatsapp {
  border-color: rgba(84, 227, 154, 0.25);
  color: #9df0c3;
  background: rgba(84, 227, 154, 0.08);
}

body.history-reportes-cleanup .status-badge.informado {
  color: #b7c3c4;
  background: rgba(145, 163, 163, 0.08);
}

body.history-reportes-cleanup .status-badge.atendido {
  border-color: rgba(255, 189, 74, 0.25);
  color: #ffda92;
  background: rgba(255, 189, 74, 0.08);
}

body.history-reportes-cleanup .status-badge.resuelto,
body.history-reportes-cleanup .sync-state {
  border-color: rgba(84, 227, 154, 0.24);
  color: #9df0c3;
  background: rgba(84, 227, 154, 0.075);
}

body.history-reportes-cleanup .photo-pill {
  border-color: rgba(255, 189, 74, 0.24);
  color: #ffda92;
  background: rgba(255, 189, 74, 0.075);
  white-space: nowrap;
}

body.history-reportes-cleanup .report-details {
  border-top: 1px solid rgba(234, 233, 233, 0.085);
}

body.history-reportes-cleanup .detail-grid {
  gap: 8px;
}

body.history-reportes-cleanup .detail-block {
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid rgba(234, 233, 233, 0.09);
  border-left: 3px solid var(--primary);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

body.history-reportes-cleanup .detail-block:nth-child(2) {
  border-left-color: #ad8cff;
}

body.history-reportes-cleanup .detail-block.full {
  border-left-color: #54e39a;
}

body.history-reportes-cleanup .detail-block strong {
  color: var(--muted);
}

body.history-reportes-cleanup .detail-block p,
body.history-reportes-cleanup .detail-block .activity-render {
  color: var(--text);
}

body.history-reportes-cleanup .activity-bullet > span {
  color: var(--primary);
}

body.history-reportes-cleanup .ot-report-series {
  border-color: rgba(173, 140, 255, 0.2);
  background: rgba(173, 140, 255, 0.035);
}

body.history-reportes-cleanup .ot-report-series-head span {
  border-color: rgba(173, 140, 255, 0.25);
  color: #cdbfff;
  background: rgba(173, 140, 255, 0.075);
}

/* Modals */
body.history-reportes-cleanup .filter-modal-bg,
body.history-reportes-cleanup .report-edit-backdrop {
  background: rgba(0, 7, 10, 0.82);
  backdrop-filter: blur(14px);
}

body.history-reportes-cleanup .filter-modal,
body.history-reportes-cleanup .report-edit-modal {
  border-color: rgba(223, 238, 4, 0.18);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(13, 37, 45, 0.99), rgba(6, 18, 23, 0.995));
  box-shadow: 0 30px 95px rgba(0, 0, 0, 0.55);
}

body.history-reportes-cleanup .filter-modal-head,
body.history-reportes-cleanup .filter-modal-actions,
body.history-reportes-cleanup .report-edit-head {
  border-color: rgba(234, 233, 233, 0.09);
  background: rgba(6, 18, 23, 0.94);
}

body.history-reportes-cleanup .filter-option,
body.history-reportes-cleanup .failure-chip,
body.history-reportes-cleanup .filter-modal-actions button,
body.history-reportes-cleanup .report-edit-actions button,
body.history-reportes-cleanup .filter-modal-head button,
body.history-reportes-cleanup .report-edit-close {
  border-color: rgba(234, 233, 233, 0.11);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

body.history-reportes-cleanup .filter-option.active,
body.history-reportes-cleanup .filter-modal-actions .apply {
  border-color: var(--primary);
  color: #101600;
  background: var(--primary);
}

body.history-reportes-cleanup .report-edit-field input,
body.history-reportes-cleanup .report-edit-field select,
body.history-reportes-cleanup .report-edit-field textarea,
body.history-reportes-cleanup #modernDateFilter {
  border-color: rgba(234, 233, 233, 0.11);
  color: var(--text);
  background: rgba(4, 16, 21, 0.72);
}

body.history-reportes-cleanup .report-edit-field input:focus,
body.history-reportes-cleanup .report-edit-field select:focus,
body.history-reportes-cleanup .report-edit-field textarea:focus,
body.history-reportes-cleanup #modernDateFilter:focus {
  border-color: rgba(223, 238, 4, 0.5);
  box-shadow: 0 0 0 3px rgba(223, 238, 4, 0.09);
}

body.history-reportes-cleanup .report-edit-actions .save,
body.history-reportes-cleanup .failure-save-btn {
  border-color: rgba(223, 238, 4, 0.4);
  color: #101600;
  background: var(--primary);
}

/* Lightbox and footer */
body.history-reportes-cleanup .lightbox {
  background:
    radial-gradient(circle at 50% 45%, rgba(223, 238, 4, 0.07), transparent 43%),
    rgba(0, 7, 10, 0.96);
}

body.history-reportes-cleanup .lightbox-close,
body.history-reportes-cleanup .lightbox-nav,
body.history-reportes-cleanup .lightbox-info {
  border-color: rgba(223, 238, 4, 0.17);
  background: rgba(6, 18, 23, 0.86);
}

body.history-reportes-cleanup .lightbox-counter {
  color: #eff86c;
  background: rgba(223, 238, 4, 0.08);
}

body.history-reportes-cleanup .footer {
  margin-top: 13px;
  padding: 13px 8px 6px;
  border-top: 1px solid rgba(234, 233, 233, 0.075);
  color: rgba(145, 163, 163, 0.78);
  background: transparent;
}

/* Empty and loading */
body.history-reportes-cleanup .empty,
body.history-reportes-cleanup .loading-row {
  border: 1px solid rgba(234, 233, 233, 0.09);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(9, 25, 32, 0.78);
}

body.history-reportes-cleanup .empty strong {
  color: var(--text);
}

/* Responsive */
@media (max-width: 760px) {
  body.history-reportes-cleanup {
    padding: 8px;
  }

  body.history-reportes-cleanup .hero {
    padding: 14px 13px;
    border-radius: 20px;
  }

  body.history-reportes-cleanup .hero-row {
    grid-template-columns: 40px minmax(0, 1fr) 43px !important;
    gap: 9px !important;
  }

  body.history-reportes-cleanup .home-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 13px;
  }

  body.history-reportes-cleanup #historyToolsShell.page-fixed-tools,
  body.history-reportes-cleanup #menuToolsToggle.history-premium-user-button,
  body.history-reportes-cleanup #menuToolsToggle.history-plan-user-trigger,
  body.history-reportes-cleanup #menuToolsToggle.history-user-toggle {
    width: 43px !important;
    height: 43px !important;
    min-width: 43px !important;
    min-height: 43px !important;
  }

  body.history-reportes-cleanup .hero h1 {
    font-size: 1.12rem;
  }

  body.history-reportes-cleanup .hero p {
    font-size: 0.62rem;
  }

  body.history-reportes-cleanup .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  body.history-reportes-cleanup .filter-grid .search,
  body.history-reportes-cleanup .modern-filter-trigger {
    grid-column: 1 / -1;
  }

  body.history-reportes-cleanup .nav-action {
    width: 100%;
  }

  body.history-reportes-cleanup .quick-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.history-reportes-cleanup .quick-filters .quick-chip:last-child {
    grid-column: 1 / -1;
  }

  body.history-reportes-cleanup .history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.history-reportes-cleanup .week-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.history-reportes-cleanup .detail-grid {
    grid-template-columns: 1fr;
  }

  body.history-reportes-cleanup .detail-block.full {
    grid-column: auto;
  }
}

@media (max-width: 430px) {
  body.history-reportes-cleanup {
    padding: 6px;
  }

  body.history-reportes-cleanup .hero {
    padding: 13px 11px;
  }

  body.history-reportes-cleanup .hero-row {
    grid-template-columns: 38px minmax(0, 1fr) 41px !important;
    gap: 8px !important;
  }

  body.history-reportes-cleanup .home-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  body.history-reportes-cleanup #historyToolsShell.page-fixed-tools,
  body.history-reportes-cleanup #menuToolsToggle.history-premium-user-button,
  body.history-reportes-cleanup #menuToolsToggle.history-plan-user-trigger,
  body.history-reportes-cleanup #menuToolsToggle.history-user-toggle {
    width: 41px !important;
    height: 41px !important;
    min-width: 41px !important;
    min-height: 41px !important;
  }

  body.history-reportes-cleanup .history-nav-toggle {
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 8px;
    padding: 9px 10px;
  }

  body.history-reportes-cleanup .history-nav-mark {
    width: 38px;
    height: 38px;
  }

  body.history-reportes-cleanup .history-toolbar {
    padding: 10px;
  }

  body.history-reportes-cleanup .history-summary {
    padding: 9px 10px 11px;
  }

  body.history-reportes-cleanup .history-summary .stat {
    min-height: 72px;
    padding-left: 40px;
  }

  body.history-reportes-cleanup .week-head {
    padding: 12px 11px 9px;
  }

  body.history-reportes-cleanup .week-stats {
    padding: 0 11px 11px;
  }

  body.history-reportes-cleanup .week-body {
    padding: 0 9px 9px;
  }

  body.history-reportes-cleanup .report-head {
    padding: 11px 10px;
  }
}

/* HISTORY_IMPORT_CARDS_EQUAL_V1 */
body.history-reportes-cleanup .wa-launch-strip,
body.history-reportes-cleanup .wbi-launch-strip {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
  display: block !important;
}

body.history-reportes-cleanup .wa-launch-strip .whatsapp-import-btn,
body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-btn {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 62px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 38px !important;
  grid-template-rows: 1fr !important;
  align-items: center !important;
  justify-items: stretch !important;
  gap: 11px !important;
  border-radius: 18px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.history-reportes-cleanup .wa-launch-strip .portal-whatsapp-template-icon,
body.history-reportes-cleanup .wa-launch-strip .whatsapp-import-btn > svg,
body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-icon {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: center !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  margin: 0 !important;
  flex: 0 0 38px !important;
}

body.history-reportes-cleanup .wa-launch-strip .wa-copy,
body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-copy {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  align-self: center !important;
  justify-self: stretch !important;
  display: grid !important;
  gap: 3px !important;
  margin: 0 !important;
  text-align: left !important;
}

body.history-reportes-cleanup .wa-launch-strip .wa-copy strong,
body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-copy strong {
  display: block !important;
  margin: 0 !important;
  font-size: 0.79rem !important;
  line-height: 1.12 !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.history-reportes-cleanup .wa-launch-strip .wa-copy small,
body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-copy small {
  display: block !important;
  margin: 0 !important;
  font-size: 0.53rem !important;
  line-height: 1.24 !important;
  font-weight: 750 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.history-reportes-cleanup .wa-launch-strip .wa-import-badge,
body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-mark {
  grid-column: 3 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: end !important;
  position: static !important;
  inset: auto !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.history-reportes-cleanup .wa-launch-strip .wa-open-mark {
  display: none !important;
}

@media (max-width: 520px) {
  body.history-reportes-cleanup .wa-launch-strip,
  body.history-reportes-cleanup .wbi-launch-strip {
    margin-bottom: 11px !important;
  }

  body.history-reportes-cleanup .wa-launch-strip .whatsapp-import-btn,
  body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-btn {
    min-height: 60px !important;
    grid-template-columns: 38px minmax(0, 1fr) 36px !important;
    gap: 9px !important;
    padding: 9px 10px !important;
    border-radius: 17px !important;
  }

  body.history-reportes-cleanup .wa-launch-strip .portal-whatsapp-template-icon,
  body.history-reportes-cleanup .wa-launch-strip .whatsapp-import-btn > svg,
  body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
  }

  body.history-reportes-cleanup .wa-launch-strip .wa-import-badge,
  body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-mark {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
  }

  body.history-reportes-cleanup .wa-launch-strip .wa-copy strong,
  body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-copy strong {
    font-size: 0.75rem !important;
  }

  body.history-reportes-cleanup .wa-launch-strip .wa-copy small,
  body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-copy small {
    font-size: 0.51rem !important;
  }
}

/* HISTORY_COMPACT_CLEANUP_V1 */

/* Las métricas dejan de mostrarse, pero sus nodos se conservan para no
   alterar los cálculos internos ni el resumen de navegación. */
body.history-reportes-cleanup .history-summary {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* Carpeta del importador masivo: fondo de la paleta corporativa. */
body.history-reportes-cleanup .wbi-launch-strip .wbi-launch-icon {
  color: var(--text, #EAE9E9) !important;
  background:
    radial-gradient(circle at 28% 22%, rgba(223, 238, 4, 0.10), transparent 48%),
    linear-gradient(145deg, #0D252D, #091920) !important;
  border: 1px solid rgba(223, 238, 4, 0.28) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.22) !important;
}

/* Calendario de cada semana: se elimina el bloque amarillo intenso. */
body.history-reportes-cleanup .week-icon {
  color: var(--text, #EAE9E9) !important;
  background:
    radial-gradient(circle at 28% 22%, rgba(223, 238, 4, 0.08), transparent 50%),
    linear-gradient(145deg, #0D252D, #091920) !important;
  border: 1px solid rgba(223, 238, 4, 0.25) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 9px 22px rgba(0, 0, 0, 0.20) !important;
}

/* El navegador cerrado no conserva separadores o espacios innecesarios. */
body.history-reportes-cleanup .history-nav-shell.collapsed .history-nav-toggle {
  border-bottom-color: transparent !important;
}

body.history-reportes-cleanup .history-nav-shell.collapsed .history-nav-content {
  max-height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
