/* ══════════════════════════════════════════════════════
   PAINEL DE GERENCIAMENTO DE ALERTAS — NAVEIDEAL (CSS)
   ══════════════════════════════════════════════════════ */

:root {
  --painel-brand: #10b981;
  --painel-brand-dark: #059669;
  --painel-brand-light: #ecfdf5;
  --painel-bg: #f8fafc;
  --painel-card-bg: #ffffff;
  --painel-border: #e2e8f0;
  --painel-text-main: #0f172a;
  --painel-text-muted: #64748b;
  --painel-danger: #ef4444;
  --painel-danger-light: #fef2f2;
  --painel-warning: #f59e0b;
  --painel-warning-light: #fffbeb;
  --painel-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  --painel-shadow-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

body.painel-body {
  background-color: var(--painel-bg);
  color: var(--painel-text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ═══════════════ CARDS DE AUTENTICAÇÃO E EXPIRADO ═══════════════ */

.auth-wrapper {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.auth-card {
  background: var(--painel-card-bg);
  border: 1px solid var(--painel-border);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: var(--painel-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

.auth-icon-badge.wpp {
  background: #ecfdf5;
  color: #10b981;
}

.auth-icon-badge.validating {
  background: #ecfdf5;
  color: #10b981;
}

.auth-icon-badge.expired {
  background: #fffbeb;
  color: #f59e0b;
}

.auth-title {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--painel-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--painel-text-muted);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

/* ═══════════════ BOTÕES & INPUTS ═══════════════ */

.painel-input-group {
  position: relative;
  margin-bottom: 1.25rem;
}

.painel-input-group .form-control {
  border-radius: 12px;
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  border: 1.5px solid var(--painel-border);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.painel-input-group .form-control:focus {
  border-color: var(--painel-brand);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.painel-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--painel-text-muted);
  font-size: 1.15rem;
  z-index: 5;
  pointer-events: none;
}

.btn-brand-cta {
  background: var(--painel-brand);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  padding: 0.85rem 1.5rem;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-brand-cta:hover {
  background: var(--painel-brand-dark);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-brand-cta:active {
  transform: translateY(0);
}

/* ═══════════════ TOPO / STATUS BAR DO USUÁRIO ═══════════════ */

.user-topbar-card {
  background: #ffffff;
  border: 1px solid var(--painel-border);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  box-shadow: var(--painel-shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.user-info-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-phone-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--painel-text-main);
  line-height: 1.2;
  white-space: nowrap;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .user-topbar-card {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .user-phone-label {
    font-size: 0.88rem;
  }

  .plan-badge {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
  }
}

.plan-badge.trial {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.plan-badge.pro {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.plan-badge.expired {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ═══════════════ BANNER DE TRIAL / PRO ═══════════════ */

.plan-banner-card {
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid transparent;
}

.plan-banner-card.trial-active {
  background: linear-gradient(135deg, #07151b 0%, #0f2731 100%);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.3);
}

.plan-banner-card.pro-active {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-color: #f59e0b;
}

.plan-banner-card.expired {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.plan-banner-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-banner-sub {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 0;
}

/* ═══════════════ GRADE DE ALERTAS (CARDS) ═══════════════ */

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

.alerts-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--painel-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.alerts-sub {
  font-size: 0.875rem;
  color: var(--painel-text-muted);
  margin-bottom: 0;
}

.alert-card {
  background: var(--painel-card-bg);
  border: 1px solid var(--painel-border);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: var(--painel-shadow);
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.alert-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--painel-shadow-hover);
  border-color: #cbd5e1;
}

.alert-card.paused {
  opacity: 0.75;
  background: #f8fafc;
  border-style: dashed;
}

.alert-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.alert-vehicle-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--painel-text-main);
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.alert-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.alert-status-pill.active {
  background: #ecfdf5;
  color: #059669;
}

.alert-status-pill.paused {
  background: #f1f5f9;
  color: #64748b;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-pulse-dot.paused {
  background: #94a3b8;
  box-shadow: none;
}

/* Detalhes do Alerta */
.alert-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.alert-meta-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #f1f5f9;
}

.alert-meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--painel-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.alert-meta-val {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--painel-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botões de Ação do Alerta */
.alert-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.btn-alert-action {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--painel-border);
  background: #ffffff;
  color: var(--painel-text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  flex: 1;
}

.btn-alert-action:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-alert-action.toggle-pause {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.btn-alert-action.toggle-pause:hover {
  background: #fef3c7;
}

.btn-alert-action.toggle-resume {
  color: #059669;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.btn-alert-action.toggle-resume:hover {
  background: #d1fae5;
}

.btn-alert-action.delete {
  color: #dc2626;
  flex: 0 0 auto;
  padding: 0.5rem 0.75rem;
}

.btn-alert-action.delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

/* ═══════════════ EMPTY STATE ═══════════════ */

.empty-alerts-card {
  background: #ffffff;
  border: 1.5px dashed var(--painel-border);
  border-radius: 20px;
  padding: 3.5rem 2rem;
  text-align: center;
}

.empty-alerts-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #10b981;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

/* ═══════════════ MODAL DESIGN ═══════════════ */

.painel-modal .modal-content {
  border-radius: 20px;
  border: 1px solid var(--painel-border);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.painel-modal .modal-header {
  border-bottom: 1px solid #f1f5f9;
  padding: 1.25rem 1.5rem;
}

.painel-modal .modal-body {
  padding: 1.5rem;
}

.painel-modal .modal-footer {
  border-top: 1px solid #f1f5f9;
  padding: 1rem 1.5rem;
}

/* ═══════════════ LOADING SPINNERS & TOASTS ═══════════════ */

.painel-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}

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

/* Feedback Box */
.feedback-box {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.feedback-box.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.feedback-box.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
