.ac-mail-page {
  font-family: "Poppins", sans-serif;
}

.ac-mail-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
}

.ac-mail-header {
  margin-bottom: 16px;
}

.ac-mail-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #111827;
}

.ac-mail-subtitle {
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
}

.ac-mail-hint {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 0.82rem;
  line-height: 1.45;
}

.ac-mail-hint code {
  font-size: 0.78rem;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
}

.ac-preview-wrap {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.ac-email-preview {
  width: 100%;
  min-height: 420px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}

.ac-panel {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.ac-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 10px;
}

.ac-panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ac-counter {
  color: #6b7280;
  font-size: 0.88rem;
}

.ac-flotas-list {
  max-height: 520px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #1f2937 #cbd5e1;
}

.ac-flota-item {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
}

.ac-flota-item:hover {
  border-color: #3b82f6;
  background: #f8fbff;
}

.ac-flota-item.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.ac-flota-nombre {
  font-weight: 600;
  color: #111827;
  margin-bottom: 3px;
}

.ac-flota-email {
  font-size: 0.82rem;
  color: #6b7280;
}

.ac-supervisores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ac-supervisor-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  background: #e0ecff;
  color: #1e3a8a;
}

.ac-search-wrap {
  margin-bottom: 10px;
}

.ac-alertas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #1f2937 #cbd5e1;
}

.ac-flotas-list::-webkit-scrollbar,
.ac-alertas-grid::-webkit-scrollbar {
  width: 7px;
}

.ac-flotas-list::-webkit-scrollbar-track,
.ac-alertas-grid::-webkit-scrollbar-track {
  background: #cbd5e1;
  border-radius: 10px;
}

.ac-flotas-list::-webkit-scrollbar-thumb,
.ac-alertas-grid::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 10px;
}

.ac-flotas-list::-webkit-scrollbar-thumb:hover,
.ac-alertas-grid::-webkit-scrollbar-thumb:hover {
  background: #111827;
}

.ac-alerta-item {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.ac-alerta-label {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  color: #1f2937;
  font-size: 0.88rem;
}

.ac-alerta-label input {
  margin-top: 2px;
}

.ac-empty {
  color: #6b7280;
  font-size: 0.9rem;
  padding: 10px 0;
}

.ac-toast-stack {
  position: fixed;
  top: 80px;
  right: 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.ac-toast {
  min-width: 280px;
  max-width: 420px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(26px);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.ac-toast.is-entered {
  opacity: 1;
  transform: translateX(0);
}

.ac-toast.is-leaving {
  opacity: 0;
  transform: translateX(-22px);
}

.ac-toast-body {
  padding: 11px 12px 9px;
  font-size: 0.9rem;
  font-weight: 500;
}

.ac-toast-success {
  border-color: #10b981;
}

.ac-toast-info {
  border-color: #3b82f6;
}

.ac-toast-warning {
  border-color: #f59e0b;
}

.ac-toast-danger {
  border-color: #ef4444;
}

.ac-toast-progress {
  height: 3px;
  width: 100%;
  background: #1f2937;
  transition-property: width;
  transition-timing-function: linear;
}

[data-theme="dark"] .ac-mail-card,
[data-theme="dark"] .ac-panel,
.dark-theme .ac-mail-card,
.dark-theme .ac-panel {
  background: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .ac-mail-title,
[data-theme="dark"] .ac-panel-title,
.dark-theme .ac-mail-title,
.dark-theme .ac-panel-title {
  color: #f3f4f6;
}

[data-theme="dark"] .ac-mail-hint,
[data-theme="dark"] .ac-mail-hint code,
.dark-theme .ac-mail-hint,
.dark-theme .ac-mail-hint code {
  color: #9ca3af;
}

[data-theme="dark"] .ac-mail-hint code,
.dark-theme .ac-mail-hint code {
  background: #374151;
}

[data-theme="dark"] .ac-preview-wrap,
.dark-theme .ac-preview-wrap {
  background: #111827;
  border-color: #4b5563;
}

[data-theme="dark"] .ac-email-preview,
.dark-theme .ac-email-preview {
  background: #0f172a;
  border-color: #4b5563;
}

[data-theme="dark"] .ac-mail-subtitle,
[data-theme="dark"] .ac-counter,
[data-theme="dark"] .ac-flota-email,
[data-theme="dark"] .ac-empty,
.dark-theme .ac-mail-subtitle,
.dark-theme .ac-counter,
.dark-theme .ac-flota-email,
.dark-theme .ac-empty {
  color: #9ca3af;
}

[data-theme="dark"] .ac-flota-item,
[data-theme="dark"] .ac-alerta-item,
.dark-theme .ac-flota-item,
.dark-theme .ac-alerta-item {
  background: #111827;
  border-color: #4b5563;
}

[data-theme="dark"] .ac-flota-item:hover,
[data-theme="dark"] .ac-flota-item.active,
.dark-theme .ac-flota-item:hover,
.dark-theme .ac-flota-item.active {
  background: #1e3a5f;
  border-color: #3b82f6;
}

[data-theme="dark"] .ac-flota-nombre,
[data-theme="dark"] .ac-alerta-label,
.dark-theme .ac-flota-nombre,
.dark-theme .ac-alerta-label {
  color: #e5e7eb;
}

[data-theme="dark"] .ac-supervisor-chip,
.dark-theme .ac-supervisor-chip {
  background: #1e40af;
  color: #dbeafe;
}

[data-theme="dark"] .ac-toast,
.dark-theme .ac-toast {
  background: #1f2937;
  color: #f3f4f6;
  border-color: #4b5563;
}

[data-theme="dark"] .ac-toast-progress,
.dark-theme .ac-toast-progress {
  background: #93c5fd;
}

[data-theme="dark"] .ac-alerta-label .text-muted,
.dark-theme .ac-alerta-label .text-muted {
  color: #cbd5e1 !important;
}

@media (max-width: 768px) {
  .ac-mail-card {
    padding: 14px;
  }

  .ac-panel-top {
    flex-direction: column;
    align-items: stretch;
  }

  .ac-alertas-grid {
    grid-template-columns: 1fr;
    max-height: 380px;
  }

  .ac-toast-stack {
    top: 70px;
    right: 10px;
    left: 10px;
  }

  .ac-toast {
    max-width: none;
    min-width: 0;
  }
}
