/**
 * NEXOX PRO — tema futurista premium
 * Camada visual sobre o painel existente (sem alterar HTML)
 */

/* ─── Base ─── */
body,
.page,
.app-sidebar,
.main-content {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

.page {
  background: #eef2f7;
}

/* Mesh de fundo no conteúdo */
.main-content.app-content {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(var(--primary-rgb), 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(var(--secondary-rgb), 0.06), transparent 50%),
    linear-gradient(180deg, #eef2f7 0%, #e8edf4 100%) !important;
}

.main-content.app-content::before {
  content: '';
  position: fixed;
  inset: 0;
  left: var(--sidebar-width, 240px);
  pointer-events: none;
  background-image:
    linear-gradient(rgba(44, 62, 80, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 62, 80, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 85%);
  z-index: 0;
}

.main-content .container-fluid {
  position: relative;
  z-index: 1;
}

/* ─── Loader ─── */
#loader {
  background: linear-gradient(135deg, #1a252f 0%, #0d1117 100%) !important;
}

#loader img {
  filter: drop-shadow(0 0 20px rgba(var(--primary-rgb), 0.5));
}

/* ─── Header ─── */
.app-header {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(44, 62, 80, 0.08) !important;
  box-shadow: 0 4px 30px rgba(15, 23, 42, 0.06) !important;
}

.header-link-icon,
.header-link {
  transition: transform 0.2s ease, color 0.2s ease;
}

.header-link:hover .header-link-icon {
  transform: scale(1.08);
  color: rgb(var(--primary-rgb)) !important;
}

/* ─── Sidebar futurista ─── */
.app-sidebar {
  background:
    linear-gradient(180deg, #1a252f 0%, #0f1419 55%, #0a0e12 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.25);
}

.app-sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.4), transparent 40%, rgba(var(--primary-rgb), 0.15));
  pointer-events: none;
}

.main-sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 1.1rem 1rem !important;
}

.app-sidebar .side-menu__item {
  margin: 2px 10px !important;
  border-radius: 12px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  overflow: hidden;
}

.app-sidebar .side-menu__item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.12), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.app-sidebar .side-menu__item:hover::before,
.app-sidebar .side-menu__item.active::before {
  opacity: 1;
}

.app-sidebar .side-menu__item:hover,
.app-sidebar .side-menu__item.active {
  background: rgba(var(--primary-rgb), 0.12) !important;
  border-left: none !important;
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.2);
}

.app-sidebar .side-menu__item.active {
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.35),
    0 4px 20px rgba(var(--primary-rgb), 0.15);
}

.app-sidebar .side-menu__item.active .side-menu__label,
.app-sidebar .side-menu__item.active .side-menu__icon {
  color: #fff !important;
}

.app-sidebar .slide-menu {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 10px;
  margin: 4px 10px 8px !important;
  padding: 6px 0 !important;
}

.app-sidebar .slide-menu .side-menu__item {
  margin: 1px 6px !important;
  font-size: 0.88rem;
}

/* ─── Page header ─── */
.page-header-breadcrumb p,
.page-header-breadcrumb .page-title,
.page-header-breadcrumb .fw-medium {
  font-size: 1.65rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1a252f 0%, rgb(var(--secondary-rgb)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── KPI Cards (dashboard) ─── */
.card.custom-card:has(.crm-card-chart) {
  background: linear-gradient(145deg, #1e2a38 0%, #121820 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 20px !important;
  box-shadow:
    0 20px 40px rgba(10, 14, 18, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}

.card.custom-card:has(.crm-card-chart)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgb(var(--primary-rgb)), transparent);
  opacity: 0.7;
}

.card.custom-card:has(.crm-card-chart):hover {
  transform: translateY(-4px);
  box-shadow:
    0 28px 50px rgba(10, 14, 18, 0.45),
    0 0 30px rgba(var(--primary-rgb), 0.12) !important;
}

.card.custom-card:has(.crm-card-chart) .flex-fill.fs-15 {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card.custom-card:has(.crm-card-chart) .fs-25 {
  color: #fff !important;
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

/* ─── Chart card ─── */
.card.custom-card:has(#earning-reports),
.card.custom-card:has(.card-header) {
  background: linear-gradient(160deg, #1a252f 0%, #0f1419 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 60px rgba(10, 14, 18, 0.3) !important;
}

.card.custom-card .card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 1.25rem 1.5rem !important;
}

.card.custom-card .card-title {
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 1.05rem !important;
  letter-spacing: -0.01em;
}

.card.custom-card .btn-outline-light {
  color: rgba(255, 255, 255, 0.65) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  padding: 0.35rem 0.9rem !important;
  transition: all 0.2s ease;
}

.card.custom-card .btn-check:checked + .btn-outline-light,
.card.custom-card .btn-outline-light:hover {
  background: rgba(var(--primary-rgb), 0.2) !important;
  border-color: rgb(var(--primary-rgb)) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.25);
}

/* ─── Cards secundários (relatórios, tabelas) ─── */
.card.custom-card:not(:has(.crm-card-chart)):not(:has(#earning-reports)) {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 20px !important;
  box-shadow:
    0 4px 6px rgba(44, 62, 80, 0.04),
    0 20px 50px rgba(44, 62, 80, 0.08) !important;
}

.card.custom-card:not(:has(.crm-card-chart)):not(:has(#earning-reports)) .card-header {
  background: linear-gradient(135deg, rgb(var(--secondary-rgb)) 0%, #1a252f 100%) !important;
  border-radius: 20px 20px 0 0 !important;
  border: 0 !important;
}

.card.custom-card:not(:has(.crm-card-chart)):not(:has(#earning-reports)) .card-title {
  color: #fff !important;
}

/* ─── Settings cards ─── */
.card.custom-card.p-5.border.rounded {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(var(--primary-rgb), 0.12) !important;
  border-radius: 24px !important;
  padding: 2rem 1.5rem !important;
  box-shadow:
    0 4px 24px rgba(44, 62, 80, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card.custom-card.p-5.border.rounded::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgb(var(--primary-rgb)), rgba(var(--primary-rgb), 0.3));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card.custom-card.p-5.border.rounded:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 50px rgba(var(--primary-rgb), 0.12),
    0 8px 24px rgba(44, 62, 80, 0.1) !important;
  border-color: rgba(var(--primary-rgb), 0.3) !important;
}

.card.custom-card.p-5.border.rounded:hover::before {
  opacity: 1;
}

.card.custom-card.p-5 .team-avatar,
.card.custom-card.p-5 .avatar {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--primary-rgb), 0.05)) !important;
  border: 1px solid rgba(var(--primary-rgb), 0.2) !important;
  color: rgb(var(--primary-rgb)) !important;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.15);
}

.card.custom-card.p-5 .team-member-details a {
  color: #1a252f !important;
  font-weight: 700 !important;
}

.card.custom-card.p-5 .btn-light {
  background: linear-gradient(135deg, rgb(var(--primary-rgb)), rgba(var(--primary-rgb), 0.85)) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  padding: 0.55rem 1.5rem !important;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
  transition: all 0.25s ease;
}

.card.custom-card.p-5 .btn-light:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 32px rgba(var(--primary-rgb), 0.4);
  filter: brightness(1.05);
}

/* ─── Tabelas ─── */
.table {
  border-radius: 14px;
  overflow: hidden;
}

.table thead th {
  background: linear-gradient(135deg, rgb(var(--secondary-rgb)), #1a252f) !important;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.9rem 1rem !important;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.04) !important;
}

.table td {
  padding: 0.85rem 1rem !important;
  vertical-align: middle;
  border-color: rgba(44, 62, 80, 0.06) !important;
}

/* ─── Botões ─── */
.btn-primary {
  background: linear-gradient(135deg, rgb(var(--primary-rgb)), rgba(var(--primary-rgb), 0.85)) !important;
  border: 0 !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(var(--primary-rgb), 0.4);
  filter: brightness(1.05);
}

.btn-success {
  border-radius: 12px !important;
  font-weight: 700 !important;
}

/* ─── Forms ─── */
.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(44, 62, 80, 0.1) !important;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: rgb(var(--primary-rgb)) !important;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12) !important;
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #475569;
}

/* ─── Modals premium ─── */
.modal-content {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(var(--primary-rgb), 0.1) !important;
}

.modal-header {
  background: linear-gradient(135deg, rgb(var(--secondary-rgb)), #1a252f) !important;
}

.modal-backdrop.show {
  backdrop-filter: blur(4px);
}

/* PIX modal */
.pix-modal-body {
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
}

.pix-success-icon {
  box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.4);
  animation: nexox-pulse 2s ease infinite;
}

@keyframes nexox-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3); }
  50% { box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.55); }
}

/* ─── Badges ─── */
.badge {
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35em 0.75em;
}

/* ─── Login / Register ─── */
.gradient-background {
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(var(--primary-rgb), 0.25), transparent 50%),
    linear-gradient(160deg, #1a252f 0%, #0a0e12 50%, #0d1117 100%) !important;
  position: relative;
  overflow: hidden;
}

.gradient-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.card-background,
.glass-card,
.login-card,
.register-card {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 24px !important;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* ─── Toast ─── */
.toast {
  border-radius: 14px !important;
  border-left-width: 4px !important;
  border-left-color: rgb(var(--primary-rgb)) !important;
  backdrop-filter: blur(12px);
}

.toast-check {
  background: linear-gradient(135deg, rgb(var(--primary-rgb)), rgba(var(--primary-rgb), 0.8)) !important;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.35);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--primary-rgb), 0.55);
}

/* ─── Status badges ─── */
.nexox-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
  border: 1px solid transparent;
}

.nexox-status-paid {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.28);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.12);
}

.nexox-status-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.1);
}

.nexox-status-reversed,
.nexox-status-processing {
  background: rgba(139, 92, 246, 0.14);
  color: #6d28d9;
  border-color: rgba(139, 92, 246, 0.28);
}

.nexox-status-cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
}

.nexox-status-default {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.22);
}

/* Dark cards / admin tables */
.card.custom-card:has(.crm-card-chart) .nexox-status-badge,
.admin-stat-card .nexox-status-badge,
.table-dark .nexox-status-badge {
  backdrop-filter: blur(4px);
}

.table td .nexox-status-badge {
  min-width: 88px;
}

@media (max-width: 991px) {
  .main-content.app-content::before {
    left: 0;
  }

  .card.custom-card:has(.crm-card-chart) .fs-25 {
    font-size: 1.4rem !important;
  }
}
