/* ORBIT DESIGN SYSTEM · Reusáveis globais */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 400 var(--text-base)/1.5 var(--font-ui); background: var(--color-bg); color: var(--color-text); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
select {
  color-scheme: dark !important;
  background-color: #121324;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b7a1ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid rgba(190, 180, 235, 0.18);
  border-radius: var(--radius-sm, 8px);
  color: var(--color-text);
  padding: 0 32px 0 11px;
  font-size: 11.5px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  box-sizing: border-box;
}
select:hover {
  background-color: #16182c;
  border-color: rgba(185, 165, 255, 0.38);
  color: var(--color-accent-high);
}
select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(185, 165, 255, 0.18);
  outline: none;
}
select option, select optgroup {
  background-color: #171828 !important;
  color: #f3f3fe !important;
  padding: 8px 12px;
}
select option:checked {
  background-color: #2b284c !important;
  color: #b7a1ff !important;
  font-weight: 600;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
select:focus-visible { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(185, 165, 255, 0.25); }
::selection { background: rgba(183, 161, 255, .28); color: white; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 13px; height: 13px; }
.card { background: linear-gradient(159deg, rgba(24, 23, 38, .74), rgba(16, 17, 29, .92) 30%, rgba(15, 16, 27, .95)); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); min-width: 0; transition: transform var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard); }
.button { height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: var(--text-md); font-weight: 600; white-space: nowrap; transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast); }
.button:active { transform: translateY(1px); }
.button-primary { color: #1a152c; background: linear-gradient(130deg, #d6c7ff 0%, #b9a5ff 80%); border-color: rgba(224, 209, 255, .5); box-shadow: 0 5px 28px rgba(158, 122, 241, .17), inset 0 1px 0 rgba(255, 255, 255, .42); }
.button-primary:hover { background: #dfd3ff; }
.button-outline { color: var(--color-text-secondary); background: rgba(21, 21, 35, .78); border-color: var(--color-border-strong); }
.button-outline:hover { color: var(--color-text); border-color: rgba(191, 169, 255, .37); }
.icon-button { display: inline-grid; place-items: center; width: 37px; height: 37px; flex: 0 0 auto; padding: 0; border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm); color: var(--color-text-secondary); transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast); }
.icon-button:hover { color: var(--color-text); background: var(--color-surface-hover); border-color: var(--color-border); }
.icon-button-small { width: 30px; height: 30px; border: 1px solid var(--color-border); }
.avatar { display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; font-size: var(--text-xs); font-weight: 750; letter-spacing: .015em; flex: none; }
.avatar-purple { background: linear-gradient(130deg, #d5c7ff, #8a73c8); color: #241c47; border: 1px solid #d3beff; }
.avatar-teal { background: #173c39; color: #9ee0c9; border: 1px solid #306e60; }
.avatar-peach { background: #4e3544; color: #e8b5cb; border: 1px solid #775060; }
.avatar-blue { background: #253d60; color: #b6caff; border: 1px solid #3c5b85; }
.avatar-amber { background: #443721; color: #e7ca97; border: 1px solid #67502e; }
.eyebrow, .card-kicker { font-size: 10px; font-weight: 730; letter-spacing: .135em; color: var(--color-text-muted); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-header h2 { font-size: 17px; font-weight: 650; letter-spacing: -.036em; line-height: 1.25; margin: 7px 0 4px; }
.card-header p { color: var(--color-text-muted); font-size: 12px; margin: 0; }
.trend { display: inline-flex; align-items: center; gap: 2px; border-radius: 6px; padding: 3px 7px 3px 5px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.trend-up { color: var(--color-positive); background: var(--color-positive-soft); }
.trend-down { color: var(--color-negative); background: var(--color-negative-soft); }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.revenue-dot { background: var(--color-accent); box-shadow: 0 0 12px rgba(185, 165, 255, .33); }
.goal-dot { background: #676178; }
.organic-dot { background: #7968bc; }
.direct-dot { background: #494457; }
.popover-anchor, .dropdown-anchor { position: relative; z-index: 25; }
.popover, .dropdown-menu { z-index: 50; position: absolute; right: 0; top: calc(100% + 8px); background: #131422; border: 1px solid rgba(190, 180, 235, 0.22); box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(185, 165, 255, 0.14); border-radius: var(--radius-lg); backdrop-filter: blur(16px); }
.topbar .dropdown-anchor { position: relative; z-index: 10010 !important; }
.topbar .popover, .topbar .dropdown-menu, .topbar .profile-dropdown-panel, .topbar-actions .dropdown-menu, .topbar-actions .profile-dropdown-panel, .topbar-actions .notification-popover { z-index: 100050 !important; }
.popover:not([hidden]), .dropdown-menu:not([hidden]) { animation: popoverIn 180ms var(--ease-standard) both; transform-origin: top right; }
@keyframes popoverIn { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dropdown-menu { min-width: 260px; padding: 6px; box-sizing: border-box; }
.dropdown-menu button { display: block; width: 100%; padding: 8px 12px; text-align: left; background: none; border: none; color: var(--color-text-secondary); border-radius: 7px; font-size: var(--text-md); transition: background var(--duration-fast), color var(--duration-fast); box-sizing: border-box; }
.dropdown-menu button:hover, .dropdown-menu button.selected { background: var(--color-accent-soft); color: var(--color-accent-high); }
.toast-region { position: fixed; z-index: 3000 !important; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast { pointer-events: auto; max-width: min(390px, calc(100vw - 32px)); padding: 12px 17px; border: 1px solid var(--color-border-strong); background: #242236; box-shadow: var(--shadow-menu); color: var(--color-text); border-radius: var(--radius-md); font-size: 13px; animation: toast-in 240ms var(--ease-standard) both; }
.toast strong { color: var(--color-accent-high); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================================
   CENTRAL DE NOTIFICAÇÕES (ORBIT DESIGN SYSTEM)
   ============================================================================ */
.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #0d0e18; /* Alto contraste: texto escuro sob fundo lilás conforme Design System */
  font-size: 9.5px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--color-bg), 0 2px 8px rgba(185, 165, 255, 0.45);
  pointer-events: none;
  z-index: 2;
  line-height: 1;
}

.notification-badge[hidden] {
  display: none !important;
}

.notification-popover {
  width: 360px;
  max-width: min(360px, calc(100vw - 20px));
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-menu);
  overflow: hidden;
}

.notification-popover .popover-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.notification-popover .popover-heading strong {
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.notification-popover .popover-subheading {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.notification-popover .button-link {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}

.notification-popover .button-link:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent-high);
  border-color: rgba(185, 165, 255, 0.2);
}

.notification-list {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px var(--space-4);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), opacity var(--duration-fast);
  text-decoration: none;
  background: transparent;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item.unread {
  background: var(--color-accent-soft);
}

.notification-item.unread:hover {
  background: rgba(168, 142, 248, 0.16);
}

.notification-item.read {
  opacity: 0.72;
}

.notification-item.read:hover {
  opacity: 1;
  background: var(--color-surface-hover);
}

.notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  margin-top: 1px;
}

.notification-icon svg {
  width: 14px;
  height: 14px;
}

.notification-icon.violet {
  background: var(--color-accent-soft);
  color: var(--color-accent-high);
  border-color: rgba(185, 165, 255, 0.22);
}

.notification-icon.emerald {
  background: var(--color-positive-soft);
  color: var(--color-positive);
  border-color: rgba(117, 217, 175, 0.22);
}

.notification-icon.amber {
  background: var(--color-warning-soft);
  color: var(--color-warning);
  border-color: rgba(248, 201, 142, 0.22);
}

.notification-icon.rose {
  background: var(--color-negative-soft);
  color: var(--color-negative);
  border-color: rgba(255, 143, 168, 0.22);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.notification-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-time {
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.notification-desc {
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-text-secondary);
  margin: 0;
  word-break: break-word;
}

.notification-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
  flex-shrink: 0;
  margin-top: 6px;
}

.notification-empty {
  padding: 38px var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 11.5px;
}

.notification-empty svg {
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  opacity: 0.45;
  stroke: currentColor;
}

/* Scrollbars modernas integradas ao Orbit Design System */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 165, 255, 0.25) rgba(16, 17, 29, 0.4);
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(16, 17, 29, 0.4);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb {
  background: rgba(185, 165, 255, 0.22);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(185, 165, 255, 0.45);
}

/* Tabelas e visualizações tabulares: Bloqueio absoluto de scroll vertical espúrio */
.table-scroll {
  overflow-x: auto;
  overflow-y: hidden !important;
}
.data-table, .data-table tbody {
  overflow-y: hidden !important;
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }

/* Notificações do sino: cor por urgência (faixa lateral, ícone, fundo da não lida e etiqueta) */
.notification-item { border-left: 3px solid transparent; }
.notification-item.urgency-critical { border-left-color: var(--color-negative); }
.notification-item.urgency-warning { border-left-color: var(--color-warning); }
.notification-item.urgency-success { border-left-color: var(--color-positive); }
.notification-item.urgency-info { border-left-color: var(--color-accent-high); }
.notification-item.unread.urgency-critical { background: rgba(255, 92, 124, 0.10); }
.notification-item.unread.urgency-critical:hover { background: rgba(255, 92, 124, 0.16); }
.notification-item.unread.urgency-warning { background: rgba(248, 201, 142, 0.08); }
.notification-item.unread.urgency-warning:hover { background: rgba(248, 201, 142, 0.14); }
.notification-item.unread.urgency-success { background: rgba(117, 217, 175, 0.07); }
.notification-item.unread.urgency-success:hover { background: rgba(117, 217, 175, 0.13); }
.notification-urgency { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 5px; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; vertical-align: 1px; }
.urgency-critical .notification-urgency { background: var(--color-negative-soft); color: var(--color-negative); }
.urgency-warning .notification-urgency { background: var(--color-warning-soft); color: var(--color-warning); }
.notification-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
