/* ════════════════════════════════════════════════════════
   ALERTAS DEL SISTEMA — estilos
   ════════════════════════════════════════════════════════ */

/* ── Panel dropdown (campana) ──────────────────────────── */
.al-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 340px;
  max-height: 480px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.al-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1A3C8F;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.al-panel-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}
.al-panel-close:hover { opacity: .7; }

.al-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.al-panel-loading, .al-panel-empty {
  padding: 24px 16px;
  text-align: center;
  color: #64748B;
  font-size: 13px;
}

/* ── Tarjeta en el panel ───────────────────────────────── */
.al-card {
  background: #F8FAFC;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-left: 3px solid #E2E8F0;
  transition: opacity .3s;
}

/* Faltantes de stock → fondo rojo suave + borde rojo */
.al-card.al-tipo-stock {
  background: #FFF1F1;
  border-left: 4px solid #DC2626;
}

/* Rotación detenida → fondo naranja suave + borde naranja */
.al-card.al-tipo-rotacion {
  background: #FFF7ED;
  border-left: 4px solid #F59E0B;
}

/* Manual (admin → usuario específico) → fondo azul suave + borde azul */
.al-card.al-tipo-manual {
  background: #EFF6FF;
  border-left: 4px solid #2563EB;
}

/* Chip de tipo — pill con color de fondo */
.al-card-tipo-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 5px;
  padding: 2px 7px;
  border-radius: 10px;
}
.al-tipo-stock-label    { background: #FEE2E2; color: #B91C1C; }
.al-tipo-rotacion-label { background: #FEF3C7; color: #B45309; }
.al-tipo-manual-label   { background: #DBEAFE; color: #1D4ED8; }

.al-card-msg {
  font-size: 12px;
  color: #1E293B;
  line-height: 1.4;
  margin-bottom: 8px;
}

.al-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.al-sev-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.al-card-read {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.al-card-read:hover { background: #DBEAFE; }

/* ── Severidad — colores compartidos ──────────────────── */
.al-sev-alta  { border-left-color: #DC2626 !important; }
.al-sev-media { border-left-color: #F59E0B !important; }
.al-sev-baja  { border-left-color: #10B981 !important; }

.al-sev-badge.al-sev-alta,  .al-sev-pill.alta  { background: #FEE2E2; color: #DC2626; }
.al-sev-badge.al-sev-media, .al-sev-pill.media { background: #FEF3C7; color: #D97706; }
.al-sev-badge.al-sev-baja,  .al-sev-pill.baja  { background: #D1FAE5; color: #059669; }

/* ── Módulo — página principal ────────────────────────── */
.al-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.al-page-header {
  background: linear-gradient(135deg, #1A3C8F, #2563EB);
  color: #fff;
  padding: 20px 24px;
  flex-shrink: 0;
}

/* ── Barra de configuración (admin) ───────────────────── */
.al-admin-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.al-admin-params {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #374151;
  align-items: center;
}

.al-admin-params label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.al-admin-params input {
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 13px;
}

.al-btn-generar {
  background: #1A3C8F;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.al-btn-generar:hover    { background: #2563EB; }
.al-btn-generar:disabled { background: #9CA3AF; cursor: not-allowed; }

.al-btn-nueva {
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.al-btn-nueva:hover { background: #047857; }

.al-btn-faltantes {
  background: #7C3AED;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.al-btn-faltantes:hover    { background: #6D28D9; }
.al-btn-faltantes:disabled { background: #9CA3AF; cursor: not-allowed; }

/* ── Tabs ────────────────────────────────────────────── */
.al-tabs {
  display: flex;
  padding: 0 24px;
  border-bottom: 2px solid #E2E8F0;
  background: #fff;
  flex-shrink: 0;
}

.al-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: color .15s;
}
.al-tab.active { color: #1A3C8F; border-bottom-color: #1A3C8F; }
.al-tab:hover  { color: #1A3C8F; }

/* ── Contenido principal ─────────────────────────────── */
.al-contenido {
  padding: 16px 24px;
  flex: 1;
}

.al-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Tarjeta completa (tab activas / historial) ──────── */
.al-card-full {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #F8FAFC;
  border-radius: 8px;
  padding: 14px;
  border-left: 4px solid #E2E8F0;
  transition: opacity .3s;
}

.al-card-left { flex-shrink: 0; padding-top: 2px; }

.al-sev-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.al-card-body   { flex: 1; min-width: 0; }
.al-card-msg2   { font-size: 13px; color: #1E293B; line-height: 1.45; }
.al-card-meta   { font-size: 11px; color: #94A3B8; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }

.al-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.al-btn-read {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.al-btn-read:hover { background: #DBEAFE; }

.al-btn-del {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.al-btn-del:hover { background: #FEE2E2; }

/* ── Estados vacíos / carga / error ──────────────────── */
.al-loading, .al-empty, .al-msg-error {
  text-align: center;
  padding: 40px 20px;
  color: #64748B;
  font-size: 13px;
}
.al-empty > div:first-child { font-size: 36px; margin-bottom: 8px; }
.al-msg-error { color: #DC2626; }

/* ── Paginación ──────────────────────────────────────── */
.al-paginacion {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 0 4px;
  font-size: 13px;
  color: #64748B;
}
.al-paginacion button {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
}
.al-paginacion button:hover { background: #DBEAFE; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  /* Panel campana: ocupa casi todo el ancho */
  .al-panel {
    width: calc(100vw - 16px) !important;
    right: 8px !important;
    left: 8px !important;
    max-height: 70vh;
  }
  /* Tarjetas más compactas en móvil */
  .al-card { padding: 8px 10px; }
  .al-card-msg { font-size: 11px; }
  .al-card-tipo-label { font-size: 9px; }
  .al-card-footer { flex-wrap: wrap; gap: 4px; }
  .al-card-read { font-size: 10px; padding: 2px 6px; }
  .al-sev-badge { font-size: 9px; }

  .al-admin-bar { flex-direction: column; align-items: flex-start; }
  .al-card-full { flex-wrap: wrap; }
  .al-card-actions { width: 100%; justify-content: flex-end; }
  .al-contenido { padding: 12px 16px; }
  .al-tabs { padding: 0 12px; overflow-x: auto; }
  .al-tab  { padding: 10px 12px; font-size: 12px; white-space: nowrap; }
}
