:root {
  --bg-main: #0B0F19;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --primary: #4F46E5;
  --primary-glow: rgba(79, 70, 229, 0.35);
  --comex-red: #E11D48;
  --comex-glow: rgba(225, 29, 72, 0.3);
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(225, 29, 72, 0.08) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR SUPERIOR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--comex-red));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.2);
  color: #A5B4FC;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-left: 0.5rem;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* SELECTOR DE EMPRESAS */
.company-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.6);
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.company-select {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.company-select option {
  background: #0F172A;
  color: #fff;
}

/* NOTIFICACIONES CAMPANITA */
.notification-bell-btn {
  position: relative;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-bell-btn:hover {
  color: #fff;
  background: rgba(51, 65, 85, 0.8);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--comex-red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-main);
}

/* PERFIL DE USUARIO & ROL */
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(30, 41, 59, 0.6);
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.user-role-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.role-superadmin { background: #E11D48; color: white; }
.role-admin { background: #4F46E5; color: white; }
.role-colaborador { background: #0D9488; color: white; }
.role-lector { background: #475569; color: #E2E8F0; }

/* CONTENEDOR PRINCIPAL Y PESTAÑAS */
.main-container {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.tabs-navigation {
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* SUB-PESTAÑAS DE NAVEGACIÓN DENTRO DE CADA MUNDO */
.subtabs-navigation {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  width: fit-content;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.subtab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.subtab-btn.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.5);
}

/* KPI CARDS GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.blue::before { background: #3B82F6; }
.kpi-card.red::before { background: var(--comex-red); }
.kpi-card.amber::before { background: var(--warning); }
.kpi-card.green::before { background: var(--success); }

.kpi-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ACCIONES EJECUTIVAS BAR */
.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: #4338CA;
  box-shadow: 0 0 14px var(--primary-glow);
}

.btn-whatsapp {
  background: #16A34A;
  color: white;
}
.btn-whatsapp:hover {
  background: #15803D;
  box-shadow: 0 0 14px rgba(22, 163, 74, 0.4);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
}

.btn:disabled, .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* GRÁFICAS ANALÍTICAS */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
}

/* TABLA DE LICITACIONES */
.table-container {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.table-controls {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  color: white;
  font-size: 0.85rem;
}

.filter-select, .filter-date {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: white;
  font-size: 0.85rem;
}

/* MULTI-SELECT COMBOBOX */
.combobox-container {
  position: relative;
  display: inline-block;
  min-width: 170px;
}

.combobox-trigger {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: #E2E8F0;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.combobox-trigger:hover {
  border-color: rgba(99, 102, 241, 0.5);
}

.combobox-badge {
  background: #4F46E5;
  color: white;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  max-width: 320px;
  max-height: 260px;
  overflow-y: auto;
  background: #0F172A;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  z-index: 1000;
  padding: 0.5rem;
  display: none;
}

.combobox-dropdown.active {
  display: block;
}

.combobox-search {
  width: 100%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  color: white;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.combobox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #CBD5E1;
  transition: background 0.15s ease;
}

.combobox-option:hover {
  background: rgba(99, 102, 241, 0.15);
  color: white;
}

.combobox-option input[type="checkbox"] {
  cursor: pointer;
  accent-color: #4F46E5;
}

.filter-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

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

.data-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* BADGES DE ESTATUS */
.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-abierta { background: rgba(16, 185, 129, 0.2); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-por_vencer { background: rgba(225, 29, 72, 0.2); color: #FB7185; border: 1px solid rgba(225, 29, 72, 0.3); animation: pulse 2s infinite; }
.status-espera_fallo { background: rgba(245, 158, 11, 0.2); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-proyecto_convocatoria { background: rgba(168, 85, 247, 0.2); color: #C084FC; border: 1px solid rgba(168, 85, 247, 0.3); }
.status-adjudicada { background: rgba(99, 102, 241, 0.2); color: #A5B4FC; border: 1px solid rgba(99, 102, 241, 0.3); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* MODALES */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.75rem;
  max-width: 550px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ========================================================= */
/* BARRA DE PAGINACIÓN INTELIGENTE DUAL Y ORDENAMIENTO */
/* ========================================================= */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination-bar.bottom {
  border-bottom: none;
  border-top: 1px solid var(--border-subtle);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.6);
  color: white;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.05);
  color: #64748B;
  pointer-events: none;
}

.page-indicator {
  padding: 0 0.5rem;
  font-weight: 700;
  color: #F8FAFC;
  font-size: 0.82rem;
}

.pagination-size-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  color: #38BDF8;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ENCABEZADOS ORDENABLES */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.data-table th.sortable:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #F8FAFC;
}

.sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.72rem;
  color: #94A3B8;
}

.sort-icon.active {
  color: #38BDF8;
  font-weight: 800;
}

/* MENÚ CONFIGURACIÓN DE COLUMNAS */
.columns-menu-container {
  position: relative;
  display: inline-block;
}

.columns-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 250px;
  background: #0F172A;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 0.75rem;
  z-index: 1050;
  display: none;
}

.columns-dropdown.active {
  display: block;
}

.columns-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

.column-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.45rem;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.5);
  font-size: 0.78rem;
  color: #E2E8F0;
}

.column-item label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  flex: 1;
}

.column-move-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 2px 4px;
  border-radius: 3px;
}

.column-move-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* ==========================================================================
   BADGES & INTERACCIÓN DE LICITACIÓN ADJUDICADA -> INTELIGENCIA DE CONTRATOS
   ========================================================================== */
.badge-award-won {
  display: inline-block;
  margin-top: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.badge-award-competitor {
  display: inline-block;
  margin-top: 4px;
  background: rgba(99, 102, 241, 0.18);
  color: #A5B4FC;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
}

.btn-drilldown-contrato {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-drilldown-contrato:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38BDF8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.badge-contrato-monitoreado {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   CENTRO DE NOTIFICACIONES UX / UI MEJORADO
   ========================================================================== */
.notif-modal-card {
  max-width: 620px;
  background: #0B1120;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 25px rgba(99, 102, 241, 0.15);
}

.notif-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.notif-pills-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.notif-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.notif-filter-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #F8FAFC;
}

.notif-filter-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #C7D2FE;
}

.pill-badge {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 10px;
  color: #E2E8F0;
}

.notif-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.notif-btn-read {
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-subtle);
  color: #94A3B8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.notif-btn-read:hover {
  color: #F8FAFC;
  background: rgba(51, 65, 85, 0.8);
}

.notif-btn-clear {
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #FCA5A5;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.notif-btn-clear:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
  color: #FFF;
}

.notif-scrollable-list {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 4px;
}

.notif-card-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: all 0.18s ease;
}

.notif-card-item:hover {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(99, 102, 241, 0.3);
}

.notif-card-item.unread {
  border-left: 3px solid #6366F1;
  background: rgba(30, 41, 59, 0.7);
}

.notif-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.notif-icon-success { background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(16, 185, 129, 0.3); }
.notif-icon-info { background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.3); }
.notif-icon-warning { background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.3); }
.notif-icon-error { background: rgba(239, 68, 68, 0.18); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ==========================================================================
   SPINNER & SYNC BUTTON STYLES
   ========================================================================== */
@keyframes spinClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-icon-inline {
  display: inline-block;
  animation: spinClockwise 0.8s linear infinite;
}

.btn-spinning {
  position: relative;
  opacity: 0.85;
  cursor: wait !important;
  pointer-events: none;
}

/* ==========================================================================
   MODAL DE PROGRESO DE SINCRONIZACIÓN
   ========================================================================== */
.modal-sync-card {
  background: linear-gradient(145deg, #111827 0%, #0B0F19 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.2);
  padding: 2.2rem;
  border-radius: 16px;
}

.sync-spin-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 0.75rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-spinner {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: #6366F1;
  border-right-color: #818CF8;
  animation: spinClockwise 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.orbit-center-icon {
  font-size: 1.8rem;
  animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.92); opacity: 0.75; }
  100% { transform: scale(1.08); opacity: 1; }
}

.sync-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin: 1.25rem 0 1.5rem 0;
}

.sync-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(90deg, #6366F1, #38BDF8, #6366F1);
  border-radius: 999px;
  animation: indeterminateBar 1.8s ease-in-out infinite;
}

@keyframes indeterminateBar {
  0% { left: -40%; width: 30%; }
  50% { left: 35%; width: 55%; }
  100% { left: 105%; width: 30%; }
}

.sync-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  background: rgba(15, 23, 42, 0.6);
  padding: 1rem 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sync-step-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.82rem;
  color: #64748B;
  transition: all 0.25s ease;
}

.sync-step-item.active {
  color: #E2E8F0;
}

.sync-step-item.completed {
  color: #10B981;
}

.sync-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.sync-step-item.pending .sync-step-icon {
  border: 1px dashed #475569;
  color: #475569;
}

.sync-step-item.active .sync-step-icon {
  border: 1px solid #6366F1;
  background: rgba(99, 102, 241, 0.2);
  color: #818CF8;
  animation: pulseGlow 1s infinite alternate;
}

.sync-step-item.completed .sync-step-icon {
  border: 1px solid #10B981;
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38BDF8;
  animation: pulseGlow 1.2s infinite;
}

/* ==========================================================================
   TOAST FLOTANTE CON CUENTA REGRESIVA DE 15 SEGUNDOS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast-sync {
  pointer-events: auto;
  width: 420px;
  max-width: calc(100vw - 48px);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 14px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(16, 185, 129, 0.2);
  padding: 1.15rem 1.25rem 0.85rem 1.25rem;
  color: #F8FAFC;
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-sync.closing {
  opacity: 0;
  transform: translateY(15px) scale(0.95);
}

.toast-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.toast-header-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #10B981;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.toast-close-btn:hover {
  color: #fff;
}

.toast-body-summary {
  font-size: 0.85rem;
  color: #CBD5E1;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.toast-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.toast-stat-item {
  display: flex;
  flex-direction: column;
}

.toast-stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.toast-stat-num.highlight {
  color: #38BDF8;
}

.toast-stat-num.green {
  color: #10B981;
}

.toast-stat-lbl {
  font-size: 0.7rem;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

.toast-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748B;
  padding-top: 0.2rem;
}

/* Barra de progreso de cuenta regresiva de 15 segundos */
.toast-countdown-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.toast-countdown-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #38BDF8);
  width: 100%;
  animation: countdownShrink 15s linear forwards;
}

@keyframes countdownShrink {
  from { width: 100%; }
  to { width: 0%; }
}


