/* Radar inteligente da Agenda — Artegraf ERP */

#plannerView .pl-smart-alerts {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 430px);
  overflow: auto;
  padding-right: 5px;
}

#plannerView .pl-smart-alerts::-webkit-scrollbar {
  width: 6px;
}

#plannerView .pl-smart-alerts::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .35);
  border-radius: 999px;
}

#plannerView .pl-smart-alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 4px;
}

#plannerView .pl-smart-alerts-title {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #7c2d12;
}

#plannerView .pl-smart-alerts-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 750;
}

#plannerView .pl-smart-alerts-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 21px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .10);
  border: 1px solid rgba(239, 68, 68, .24);
  color: #b91c1c;
  font-size: 11px;
  font-weight: 950;
}

#plannerView .pl-smart-alert {
  width: 100%;
  text-align: left;
  cursor: pointer !important;
  border-radius: 13px;
  padding: 12px 12px 12px 15px;
  min-height: 82px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05), inset 0 1px 0 rgba(255, 255, 255, .75);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  position: relative;
  overflow: hidden;
  pointer-events: auto !important;
}

#plannerView .pl-smart-alert * {
  pointer-events: none;
}

#plannerView .pl-smart-alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 4px;
  border-radius: 999px;
  background: #94a3b8;
}

#plannerView .pl-smart-alert:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .86);
}

#plannerView .pl-smart-alert-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 7px;
}

#plannerView .pl-smart-alert-top strong {
  font-size: 12px;
  line-height: 1.15;
  font-weight: 950;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

#plannerView .pl-smart-alert-msg {
  display: block;
  font-size: 12px;
  line-height: 1.32;
  font-weight: 850;
  color: #1f2937;
  overflow: visible;
  white-space: normal;
}

#plannerView .pl-smart-alert-meta {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.25;
  color: #64748b;
  font-weight: 850;
}

#plannerView .pl-smart-alert::after {
  content: "Clique para ver";
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(148, 163, 184, .25);
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
}

#plannerView .pl-smart-alert[data-tone="hot"] {
  background:
    radial-gradient(circle at 10% 0%, rgba(254, 202, 202, .80), transparent 42%),
    linear-gradient(135deg, rgba(255, 247, 237, .98), rgba(254, 226, 226, .92));
  border-color: rgba(239, 68, 68, .42);
  box-shadow: 0 12px 26px rgba(249, 115, 22, .15), 0 5px 13px rgba(185, 28, 28, .10), inset 0 1px 0 rgba(255, 255, 255, .82);
}

#plannerView .pl-smart-alert[data-tone="hot"]::before {
  background: linear-gradient(180deg, #ef4444, #f97316);
}

#plannerView .pl-smart-alert[data-tone="hot"] .pl-smart-alert-top strong {
  color: #991b1b;
}

#plannerView .pl-smart-alert[data-tone="blue"] {
  background:
    radial-gradient(circle at 10% 0%, rgba(147, 197, 253, .70), transparent 42%),
    linear-gradient(135deg, rgba(239, 246, 255, 1), rgba(219, 234, 254, .95));
  border-color: rgba(37, 99, 235, .42);
  box-shadow: 0 12px 26px rgba(59, 130, 246, .15), 0 5px 13px rgba(37, 99, 235, .10), inset 0 1px 0 rgba(255, 255, 255, .82);
}

#plannerView .pl-smart-alert[data-tone="blue"]::before {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

#plannerView .pl-smart-alert[data-tone="blue"] .pl-smart-alert-top strong {
  color: #1d4ed8;
}

#plannerView .pl-smart-alert[data-tone="amber"] {
  background:
    radial-gradient(circle at 10% 0%, rgba(254, 240, 138, .55), transparent 42%),
    linear-gradient(135deg, rgba(255, 251, 235, .98), rgba(254, 243, 199, .88));
  border-color: rgba(245, 158, 11, .38);
  box-shadow: 0 10px 22px rgba(245, 158, 11, .12), 0 4px 10px rgba(146, 64, 14, .07), inset 0 1px 0 rgba(255, 255, 255, .82);
}

#plannerView .pl-smart-alert[data-tone="amber"]::before {
  background: linear-gradient(180deg, #facc15, #f59e0b);
}

#plannerView .pl-smart-alert[data-tone="amber"] .pl-smart-alert-top strong {
  color: #92400e;
}

#plannerView .pl-smart-alert[data-tone="violet"] {
  background:
    radial-gradient(circle at 10% 0%, rgba(221, 214, 254, .75), transparent 42%),
    linear-gradient(135deg, rgba(245, 243, 255, .98), rgba(237, 233, 254, .88));
  border-color: rgba(124, 58, 237, .34);
  box-shadow: 0 10px 22px rgba(124, 58, 237, .11), 0 4px 10px rgba(76, 29, 149, .07), inset 0 1px 0 rgba(255, 255, 255, .82);
}

#plannerView .pl-smart-alert[data-tone="violet"]::before {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

#plannerView .pl-smart-alert[data-tone="violet"] .pl-smart-alert-top strong {
  color: #6d28d9;
}

#plannerView .pl-smart-alert-empty {
  padding: 13px 12px;
  border-radius: 13px;
  border: 1px dashed rgba(148, 163, 184, .34);
  background: rgba(248, 250, 252, .72);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#plannerView .pl-smart-alert-empty strong {
  font-size: 12px;
  color: #334155;
  font-weight: 900;
}

#plannerView .pl-smart-alert-empty span {
  font-size: 11px;
  font-weight: 750;
}

#plannerView .pl-smart-alert-more {
  font-size: 11px;
  font-weight: 900;
  color: #64748b;
  padding: 2px 4px 4px;
}

/* Modal do Radar */

.pl-alert-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, .32);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pl-alert-modal {
  width: min(540px, calc(100vw - 32px));
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .35);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  overflow: hidden;
}

.pl-alert-modal-head {
  padding: 18px 20px 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(254, 202, 202, .72), transparent 42%),
    linear-gradient(135deg, rgba(255, 247, 237, .98), rgba(254, 226, 226, .86));
  border-bottom: 1px solid rgba(239, 68, 68, .18);
}

.pl-alert-modal-title {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 950;
  color: #991b1b;
}

.pl-alert-modal-sub {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}

.pl-alert-modal-body {
  padding: 18px 20px 8px;
}

.pl-alert-modal-msg {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 850;
  color: #1f2937;
  margin-bottom: 14px;
}

.pl-alert-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.pl-alert-modal-info {
  padding: 10px 11px;
  border-radius: 13px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, .24);
}

.pl-alert-modal-info span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .055em;
  font-weight: 900;
  color: #94a3b8;
  margin-bottom: 4px;
}

.pl-alert-modal-info strong {
  display: block;
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 950;
  color: #1f2937;
}

.pl-alert-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px 18px;
}

.pl-alert-modal-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, .35);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.pl-alert-modal-btn.primary {
  border-color: rgba(37, 99, 235, .35);
  background: #2563eb;
  color: #fff;
}

.pl-alert-card-focus {
  outline: 3px solid rgba(37, 99, 235, .48) !important;
  outline-offset: 3px !important;
}

@media (max-width: 720px) {
  .pl-alert-modal-grid {
    grid-template-columns: 1fr;
  }
}