/* ==========================================================================
   ELIS NÁJERA 4.0 - FUNNEL MÓVIL & TABLET (PRODUCCIÓN)
   Diseñado especialmente para Smartphones y Tablets (Vertical & Horizontal)
   ========================================================================== */

:root {
  --bg-app: #080c14;
  --bg-card: #111827;
  --bg-card-hover: #1e293b;
  --bg-card-sub: #162032;
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --color-cyan: #38bdf8;
  --color-blue: #3b82f6;
  --color-emerald: #10b981;
  --color-green: #34d399;
  --color-amber: #f59e0b;
  --color-orange: #f97316;
  --color-red: #ef4444;
  --color-indigo: #818cf8;
  --color-purple: #c084fc;

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  line-height: 1.45;
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ==========================================================================
   HEADER MÓVIL
   ========================================================================== */
.funnel-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 16, 27, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.header-logo {
  height: 32px;
  width: auto;
  border-radius: 6px;
  background: white;
  padding: 2px 4px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--color-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--color-green);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 8px var(--color-green);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-icon:active {
  transform: scale(0.92);
  background: rgba(56, 189, 248, 0.2);
  color: var(--color-cyan);
}

.btn-icon.spinning i {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   BARRA DE TURNO INDUSTRIAL
   ========================================================================== */
.shift-strip {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 1px solid var(--border-card);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.shift-strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shift-pill {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.shift-strip-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   SELECTOR DE PESTAÑAS (SEGMENTED CONTROL MÓVIL / THUMB BAR)
   ========================================================================== */
.tabs-scroller-wrap {
  position: sticky;
  top: 53px;
  z-index: 90;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-card);
  padding: 8px 12px;
}

.tabs-segmented {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.tabs-segmented::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.tab-btn:active {
  transform: scale(0.96);
}

.tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.tab-btn i {
  font-size: 0.85rem;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL
   ========================================================================== */
.funnel-container {
  padding: 14px 12px 28px 12px;
  max-width: 1300px;
  margin: 0 auto;
}

/* ==========================================================================
   METRIC CARDS (HERO SUMMARY)
   ========================================================================== */
.hero-kpis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-cyan);
}

.kpi-card.cyan::before { background: var(--color-cyan); }
.kpi-card.emerald::before { background: var(--color-emerald); }
.kpi-card.indigo::before { background: var(--color-indigo); }
.kpi-card.purple::before { background: var(--color-purple); }
.kpi-card.amber::before { background: var(--color-amber); }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.kpi-icon {
  font-size: 0.9rem;
  opacity: 0.7;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Barra de progreso de objetivo */
.progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   VISTA 1: OVERVIEW DE MÁQUINAS (GRID ADAPTATIVO)
   ========================================================================== */
.section-headline {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 14px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.machines-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.funnel-machine-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.funnel-machine-card:active {
  transform: scale(0.985);
  border-color: var(--border-focus);
}

.machine-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.machine-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.machine-avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  position: relative;
}

.calandra-badge-num {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #0284c7;
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
}

.machine-meta h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.machine-meta span {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.status-badge-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.status-badge-chip.operativa {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-green);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-badge-chip.valle {
  background: rgba(249, 115, 22, 0.18);
  color: var(--color-orange);
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.status-badge-chip.inactiva {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.status-dot-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Chips de Métricas por Máquina */
.machine-kpis-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.mini-kpi-chip {
  background: var(--bg-card-sub);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.mini-kpi-chip .chip-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.mini-kpi-chip .chip-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-card-action {
  width: 100%;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--color-cyan);
  font-family: var(--font-stack);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-action:active {
  background: var(--color-cyan);
  color: #0b0f19;
}

/* ==========================================================================
   VISTA DETALLE DE MÁQUINA INDIVIDUAL
   ========================================================================== */
.machine-detail-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.machine-detail-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-banner-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-banner-title h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.detail-banner-title span {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Grilla de métricas de la máquina seleccionada */
.detail-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.detail-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}

.detail-metric-card .d-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.detail-metric-card .d-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 3px 0;
}

.detail-metric-card .d-sub {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* Tarjeta Gráfica Touch-Friendly */
.chart-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.chart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.btn-toggle-metric {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-metric.active {
  background: #0284c7;
  color: #fff;
}

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 230px;
}

/* Panel Desglose / Información Extra */
.info-extra-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.info-extra-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-extra-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row-label {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-row-val {
  font-weight: 700;
  color: #fff;
}

/* ==========================================================================
   ADAPTACIONES RESPONSIVAS: TABLETS & FORMATO HORIZONTAL (LANDSCAPE)
   ========================================================================== */

/* 1. MÓVIL EN MODO HORIZONTAL (LANDSCAPE, altura < 550px) */
@media screen and (orientation: landscape) and (max-height: 550px) {
  .funnel-header {
    padding: 6px 14px;
  }
  
  .header-logo {
    height: 26px;
  }

  .tabs-scroller-wrap {
    top: 45px;
    padding: 4px 10px;
  }

  .tab-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .hero-kpis-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .machines-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Layout 2 columnas para el detalle de máquina en landscape móvil */
  .landscape-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 12px;
    align-items: start;
  }

  .detail-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 0;
  }

  .chart-canvas-wrapper {
    height: 185px;
  }

  .chart-panel-card {
    padding: 10px 12px;
    margin-bottom: 0;
  }
}

/* 2. TABLETS EN MODO VERTICAL (PORTRAIT: 600px a 900px de ancho) */
@media screen and (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
  .hero-kpis-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .machines-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .detail-metrics-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .chart-canvas-wrapper {
    height: 300px;
  }

  .tab-btn {
    font-size: 0.85rem;
    padding: 9px 16px;
  }
}

/* 3. TABLETS EN MODO HORIZONTAL (LANDSCAPE: >= 900px) */
@media screen and (min-width: 901px) {
  .funnel-container {
    padding: 20px 24px 40px 24px;
  }

  .hero-kpis-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .machines-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .landscape-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
  }

  .detail-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .chart-canvas-wrapper {
    height: 290px;
  }

  .historial-controls-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   ESTILOS HISTORIAL DE TURNOS MÓVIL Y TABLET
   ========================================================================== */
.detail-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-banner {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--color-cyan);
  font-family: var(--font-stack);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 32px;
}

.btn-action-banner:active {
  background: var(--color-cyan);
  color: #080c14;
  transform: scale(0.96);
}

.btn-back-funnel {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-back-funnel:active {
  background: rgba(56, 189, 248, 0.25);
  color: var(--color-cyan);
  transform: scale(0.92);
}

.historial-controls-strip {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.historial-control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.historial-control-group label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mobile-select,
.mobile-input-date {
  width: 100%;
  background: var(--bg-card-sub);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 11px;
  color: #fff;
  font-family: var(--font-stack);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  min-height: 42px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.mobile-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2338bdf8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}

.mobile-select:focus,
.mobile-input-date:focus {
  border-color: var(--color-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.mobile-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.historial-placeholder {
  background: var(--bg-card);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 36px 18px;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 10px;
}

.historial-placeholder .placeholder-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  color: var(--color-cyan);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.historial-placeholder h3 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 6px;
}

.historial-placeholder p {
  font-size: 0.78rem;
  line-height: 1.5;
  max-width: 440px;
  margin: 0 auto;
}

/* Dashboard Reconstruido */
.m-historial-meta-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.m-historial-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-historial-meta-left h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.m-historial-meta-left span {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.m-historial-kpis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.m-historial-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}

.m-historial-kpi-card.cyan { border-left: 3px solid var(--color-cyan); }
.m-historial-kpi-card.green { border-left: 3px solid var(--color-green); }
.m-historial-kpi-card.amber { border-left: 3px solid var(--color-amber); }
.m-historial-kpi-card.purple { border-left: 3px solid var(--color-purple); }
.m-historial-kpi-card.blue { border-left: 3px solid var(--color-blue); }

.m-historial-kpi-card .h-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.m-historial-kpi-card .h-kpi-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 4px 0 2px 0;
}

.m-historial-kpi-card .h-kpi-sub {
  font-size: 0.66rem;
  color: var(--text-secondary);
  line-height: 1.25;
}

/* ==========================================================================
   FOOTER MÓVIL
   ========================================================================== */
.funnel-footer {
  text-align: center;
  padding: 20px 12px;
  border-top: 1px solid var(--border-card);
  margin-top: 24px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.funnel-footer a {
  color: var(--color-cyan);
  text-decoration: none;
  font-weight: 600;
}
