/* src/public/css/lineas.css — Rediseño Cyber-Refined Dark Mode (Basado en rediseño.md) */

:root {
  --lineas-bg: #070913;
  --lineas-surface: rgba(20, 24, 45, 0.75);
  --lineas-surface-hover: rgba(26, 32, 60, 0.85);
  --lineas-border: rgba(255, 255, 255, 0.07);
  --lineas-border-highlight: rgba(79, 126, 248, 0.35);
  --lineas-accent: #4f7ef8;
  --lineas-amber: #f59e0b;
  --lineas-amber-bg: rgba(245, 158, 11, 0.08);
  --lineas-emerald: #10b981;
  --lineas-emerald-bg: rgba(16, 185, 129, 0.08);
}

.lineas-body {
  background: var(--lineas-bg);
  color: var(--text);
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', var(--sans);
  overflow-x: hidden;
}

/* Atmósfera de fondo y gradiente sutil */
.lineas-aura {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 540px;
  background: radial-gradient(circle at 45% -20%, rgba(79, 126, 248, 0.1) 0%, rgba(20, 24, 45, 0.2) 40%, rgba(7, 9, 19, 0) 75%);
  pointer-events: none;
  z-index: 0;
}

.lineas-main {
  position: relative;
  z-index: 1;
  padding: 32px;
  max-width: 1560px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .lineas-main {
    padding: 16px;
  }
}

/* ─── CABECERA DE LA PÁGINA ─── */
.lineas-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.lineas-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', var(--mono);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #60a5fa;
  background: rgba(79, 126, 248, 0.1);
  border: 1px solid rgba(79, 126, 248, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

.lineas-title {
  font-family: 'Outfit', var(--sans);
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.6px;
  margin-bottom: 6px;
}

.lineas-sub {
  font-size: 0.88rem;
  color: var(--text2);
  max-width: 820px;
  line-height: 1.5;
}

.lineas-sub strong {
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-refresh.loading .spin-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.btn-export {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(16, 185, 129, 0.16));
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.12);
}

.btn-export:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.26), rgba(16, 185, 129, 0.26));
  border-color: rgba(34, 197, 94, 0.45);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.22);
}

/* ─── TARJETAS DE MÉTRICAS (KPIS) ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--lineas-surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--lineas-border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Card especial para Duplicados (Prioridad) */
.kpi-dupes {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(20, 24, 45, 0.75));
  border-color: rgba(245, 158, 11, 0.3);
}

.kpi-dupes::after {
  background: #f59e0b;
}

.kpi-dupes:hover {
  border-color: rgba(245, 158, 11, 0.55);
}

.kpi-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.ico-wrap-blue {
  background: rgba(79, 126, 248, 0.12);
  border-color: rgba(79, 126, 248, 0.28);
  color: #60a5fa;
}

.ico-wrap-amber {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.ico-wrap-emerald {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  color: #34d399;
}

.ico-wrap-purple {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.28);
  color: #c084fc;
}

.ico-wrap-gray {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.kpi-data {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-header-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-badge-priority {
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', var(--mono);
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f59e0b;
  color: #000;
}

.kpi-label {
  font-size: 0.65rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-bottom: 1px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-value {
  font-family: 'Outfit', var(--sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.val-dupes {
  color: #fbbf24;
}

.kpi-sub-tag {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', var(--mono);
  color: #f59e0b;
  font-weight: 600;
}

.kpi-desc {
  font-size: 0.68rem;
  color: var(--text3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── PANEL PRINCIPAL Y CONTROLES ─── */
.panel-card {
  background: var(--lineas-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--lineas-border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.panel-controls-bar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

/* Campo de búsqueda */
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 440px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}

.search-field {
  width: 100%;
  background: rgba(7, 9, 19, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 9px 36px 9px 36px;
  font-size: 0.84rem;
  color: #fff;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-field:focus {
  outline: none;
  border-color: var(--lineas-accent);
  box-shadow: 0 0 0 3px rgba(79, 126, 248, 0.18);
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px;
}

.btn-clear-search:hover {
  color: #fff;
}

/* Chips de Filtro */
.filter-chips-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.filter-chip.active {
  background: rgba(79, 126, 248, 0.18);
  border-color: rgba(79, 126, 248, 0.45);
  color: #93c5fd;
}

.chip-dupes-highlight {
  border-color: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.chip-dupes-highlight.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.chip-count {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', var(--mono);
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  color: var(--text3);
}

.chip-count-amber {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

/* Selector de tamaño de página */
.pagination-size-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-label {
  font-size: 0.78rem;
  color: var(--text3);
}

.size-select {
  background: rgba(7, 9, 19, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text);
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}

.size-select:focus {
  border-color: var(--lineas-accent);
}

/* Barra de metadatos */
.results-meta-bar {
  padding: 10px 20px;
  background: rgba(7, 9, 19, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text3);
}

.active-filter-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(79, 126, 248, 0.12);
  border: 1px solid rgba(79, 126, 248, 0.28);
  color: #93c5fd;
  padding: 2px 8px;
  border-radius: 6px;
}

.filter-tag-close {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 2px;
}

/* ─── TABLA ESTILIZADA Y LIMPIA ─── */
.table-responsive-wrap {
  overflow-x: auto;
  min-height: 280px;
}

.lineas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.lineas-table thead th {
  background: rgba(14, 17, 32, 0.95);
  padding: 12px 16px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  user-select: none;
}

.lineas-table thead th[data-sort] {
  cursor: pointer;
  transition: color 0.15s;
}

.lineas-table thead th[data-sort]:hover {
  color: #fff;
}

.sort-indicator {
  font-size: 0.8rem;
  margin-left: 4px;
  opacity: 0.5;
}

.lineas-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.lineas-table tbody tr:hover {
  background: var(--lineas-surface-hover);
}

.lineas-table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
}

/* Resaltado de fila con DUPLICADO (Prioridad sutil y elegante, sin cajas dobles) */
.row-duplicate {
  background: rgba(245, 158, 11, 0.035) !important;
  border-left: 3px solid #f59e0b;
}

.row-duplicate:hover {
  background: rgba(245, 158, 11, 0.075) !important;
}

/* Columnas */
.col-num {
  width: 50px;
  color: var(--text3);
  font-family: 'JetBrains Mono', var(--mono);
  font-size: 0.76rem;
}

.num-dupe-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dupe-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  flex-shrink: 0;
}

/* Celda IMEI */
.imei-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.imei-val {
  font-family: 'JetBrains Mono', var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: #e2e8f0;
  letter-spacing: 0.5px;
}

.btn-copy {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
  opacity: 0.45;
}

.imei-cell:hover .btn-copy,
.line-cell:hover .btn-copy {
  opacity: 1;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: scale(1.1);
}

/* Celda Nombre / Dispositivo */
.name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.device-name-text {
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
}

.badge-equipo {
  font-size: 0.62rem;
  font-family: 'JetBrains Mono', var(--mono);
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #d8b4fe;
}

/* Celda Línea Telefónica (Formato unificado para todos los números) */
.line-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.line-val {
  font-family: 'JetBrains Mono', var(--mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.5px;
}

.line-val-dupe {
  color: #fbbf24;
}

.line-empty {
  color: var(--text3);
  font-style: italic;
  font-size: 0.8rem;
}

/* Celda Estado de la Línea (UN SOLO BADGE ELEGANTE) */
.status-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
}

.badge-status-dupe {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.38);
  color: #fbbf24;
}

.badge-status-ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.badge-status-empty {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #94a3b8;
}

.partner-conflict-hint {
  font-size: 0.72rem;
  color: #fbbf24;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.partner-btn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.partner-btn:hover {
  background: #f59e0b;
  color: #000;
  border-color: #f59e0b;
  transform: translateY(-1px);
}

/* Celda Último Reporte */
.lastseen-cell {
  font-size: 0.76rem;
  color: var(--text2);
  white-space: nowrap;
}



/* Estados de carga y vacío */
.table-loading-cell,
.table-empty-cell {
  text-align: center;
  padding: 48px 16px !important;
  color: var(--text2);
}

.spinner-inline {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(79, 126, 248, 0.2);
  border-top-color: #4f7ef8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

/* ─── PAGINACIÓN FOOTER ─── */
.pagination-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text3);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text2);
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.page-btn.active {
  background: var(--lineas-accent);
  border-color: var(--lineas-accent);
  color: #fff;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}



/* ─── TOAST NOTIFY ─── */
.toast-notify {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(14, 18, 36, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(79, 126, 248, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(79, 126, 248, 0.15);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notify.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  color: #60a5fa;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════════════════
   REGLAS RESPONSIVE PARA LÍNEAS (GUIA_RESPONSIVE.md)
   ════════════════════════════════════════════════════════════════════════ */

.table-responsive-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.lineas-table {
  min-width: 680px;
}

@media (max-width: 767px) {
  .lineas-main {
    padding: var(--page-block) var(--page-inline);
  }

  /* Header y Botones de acción más pequeños en móvil */
  .lineas-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }

  .lineas-header .header-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    margin-top: 4px !important;
  }

  .lineas-header .header-actions .btn-action {
    flex: 1 1 50% !important;
    width: 50% !important;
    max-width: calc(50% - 3px) !important;
    min-height: 30px !important;
    height: 30px !important;
    padding: 4px 6px !important;
    font-size: 0.70rem !important;
    border-radius: 6px !important;
    gap: 4px !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  .lineas-header .header-actions .btn-action svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0 !important;
  }

  /* Grid de KPIs ultra compacto y organizado en móvil */
  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px !important;
    margin-bottom: 10px !important;
  }

  .kpi-card {
    padding: 6px 8px !important;
    gap: 6px !important;
    border-radius: 6px !important;
    min-height: 40px !important;
  }

  .kpi-card.kpi-total {
    grid-column: 1 / -1 !important;
  }

  .kpi-icon-wrap {
    width: 24px !important;
    height: 24px !important;
    border-radius: 5px !important;
  }

  .kpi-icon-wrap svg {
    width: 12px !important;
    height: 12px !important;
  }

  .kpi-label {
    font-size: 0.54rem !important;
    letter-spacing: 0.2px !important;
    margin-bottom: 0px !important;
  }

  .kpi-badge-priority {
    font-size: 0.48rem !important;
    padding: 1px 4px !important;
    letter-spacing: 0.4px !important;
    border-radius: 3px !important;
  }

  .kpi-value {
    font-size: 1.05rem !important;
    line-height: 1.1 !important;
  }

  .kpi-sub-tag {
    font-size: 0.60rem !important;
  }

  .kpi-desc {
    display: none !important;
  }

  .panel-controls-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 14px;
  }

  .search-input-wrap {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .search-field {
    font-size: 16px !important;
    min-height: 38px;
  }

  .pagination-size-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .pagination-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    text-align: center;
  }

  .pagination-pages {
    justify-content: center;
  }
}

.kpi-card.active-filter-card {
  border-color: #3b82f6 !important;
  background: rgba(30, 58, 138, 0.25) !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35) !important;
}

.kpi-card.kpi-dupes.active-filter-card {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.22) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45) !important;
}

/* ==========================================================================
   MODO DÍA (LIGHT MODE) — LÍNEAS DE DISPOSITIVOS GPS
   ========================================================================== */
[data-theme="light"] {
  --lineas-bg: #f4f6fa;
  --lineas-surface: #ffffff;
  --lineas-surface-hover: #f8fafc;
  --lineas-border: #e2e8f0;
  --lineas-border-highlight: rgba(37, 99, 235, 0.35);
  --lineas-accent: #2563eb;
}

[data-theme="light"] .lineas-body {
  background: var(--lineas-bg);
  color: #0f172a;
}

[data-theme="light"] .lineas-aura {
  opacity: 0.12;
}

[data-theme="light"] .lineas-title,
[data-theme="light"] .lineas-header-title {
  color: #0f172a !important;
}

[data-theme="light"] .lineas-sub {
  color: #64748b !important;
}

[data-theme="light"] .lineas-sub strong {
  color: #0f172a !important;
}

[data-theme="light"] .lineas-badge-top {
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #1d4ed8 !important;
}

[data-theme="light"] #lineas-last-sync {
  color: #0284c7 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .kpi-card {
  background: #ffffff;
  border-color: var(--lineas-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .kpi-value {
  color: #0f172a;
}

[data-theme="light"] .kpi-label {
  color: #64748b;
}

[data-theme="light"] .lineas-table-card {
  background: #ffffff;
  border-color: var(--lineas-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .lineas-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--lineas-border);
  color: #475569;
}

[data-theme="light"] .lineas-table tbody tr {
  border-bottom: 1px solid var(--lineas-border);
}

[data-theme="light"] .lineas-table tbody tr:hover {
  background: #f8fafc;
}

[data-theme="light"] .lineas-search-input,
[data-theme="light"] .search-field {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .search-field::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .lineas-search-input:focus,
[data-theme="light"] .search-field:focus {
  border-color: var(--lineas-accent) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

[data-theme="light"] .search-icon {
  color: #64748b !important;
}

[data-theme="light"] .btn-clear-search {
  color: #64748b !important;
}

[data-theme="light"] .btn-clear-search:hover {
  color: #0f172a !important;
}

/* Panel contenedor y Toolbar de Filtros */
[data-theme="light"] .panel-card,
[data-theme="light"] .table-panel {
  background: #ffffff !important;
  border: 1px solid var(--lineas-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .size-select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .size-label {
  color: #475569 !important;
}

[data-theme="light"] .results-meta-bar {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

[data-theme="light"] .results-counter {
  color: #475569 !important;
}

/* Chips de Filtro */
[data-theme="light"] .filter-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] .filter-chip:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

[data-theme="light"] .filter-chip.active {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}

[data-theme="light"] .chip-count {
  background: #f1f5f9 !important;
  color: #475569 !important;
}

[data-theme="light"] .filter-chip.active .chip-count {
  background: #dbeafe !important;
  color: #1e40af !important;
}

[data-theme="light"] .filter-tag-label {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}

/* Botones de acción en cabecera */
[data-theme="light"] .btn-refresh {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .btn-refresh:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

/* ==========================================================================
   TABLA: TEXTO DE ALTO CONTRASTE Y LEGIBILIDAD EN MODO DÍA
   ========================================================================== */
[data-theme="light"] .col-num {
  color: #64748b !important;
  font-weight: 500 !important;
}

[data-theme="light"] .imei-val {
  color: #0f172a !important;
  font-weight: 600 !important;
}

[data-theme="light"] .device-name-text {
  color: #0f172a !important;
  font-weight: 600 !important;
}

[data-theme="light"] .line-val {
  color: #0f172a !important;
  font-weight: 600 !important;
}

[data-theme="light"] .line-val-dupe {
  color: #b45309 !important;
  font-weight: 700 !important;
}

[data-theme="light"] .line-empty {
  color: #94a3b8 !important;
}

[data-theme="light"] .lastseen-cell {
  color: #475569 !important;
  font-weight: 500 !important;
}

[data-theme="light"] .btn-copy {
  color: #64748b !important;
}

[data-theme="light"] .btn-copy:hover {
  background: rgba(37, 99, 235, 0.1) !important;
  color: #2563eb !important;
}

/* Fila de dispositivo con línea duplicada */
[data-theme="light"] tr.row-duplicate {
  background: #fffbeb !important;
}

[data-theme="light"] tr.row-duplicate:hover {
  background: #fef3c7 !important;
}

/* Badges de Estado de Línea */
[data-theme="light"] .badge-status-ok {
  background: #dcfce7 !important;
  border: 1px solid #86efac !important;
  color: #15803d !important;
}

[data-theme="light"] .badge-status-dupe {
  background: #fef3c7 !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
}

[data-theme="light"] .badge-status-empty {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #64748b !important;
}

[data-theme="light"] .badge-equipo {
  background: #f3e8ff !important;
  border: 1px solid #d8b4fe !important;
  color: #7e22ce !important;
}

[data-theme="light"] .partner-conflict-hint {
  color: #b45309 !important;
}

[data-theme="light"] .partner-btn {
  background: #fef3c7 !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
}

/* Paginador Footer */
[data-theme="light"] .pagination-footer {
  border-top: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

[data-theme="light"] .pagination-info {
  color: #64748b !important;
}

[data-theme="light"] .page-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] .page-btn:hover:not(:disabled) {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

[data-theme="light"] .page-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

[data-theme="light"] .page-btn:disabled {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #cbd5e1 !important;
}

