/* ============================================================
   SISTEMA DE VENDAS - ESTILO GLOBAL
   Dark mode premium, neon azul/verde, glassmorphism
   ============================================================ */

:root {
  --bg-900: #060a14;
  --bg-800: #0a1020;
  --bg-700: #0f172e;
  --surface: rgba(20, 30, 55, 0.55);
  --surface-solid: #111a30;
  --border: rgba(120, 160, 220, 0.14);
  --border-strong: rgba(120, 160, 220, 0.28);

  --text: #e6edf7;
  --text-dim: #93a3c0;
  --text-mute: #5e6f90;

  --neon-blue: #2f7bff;
  --neon-cyan: #25d3ff;
  --neon-green: #19e58f;
  --neon-gold: #ffc24b;

  --glow-blue: rgba(47, 123, 255, 0.45);
  --glow-green: rgba(25, 229, 143, 0.4);

  --radius: 18px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(47, 123, 255, 0.14), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(25, 229, 143, 0.1), transparent 55%),
    radial-gradient(800px 800px at 50% 120%, rgba(37, 211, 255, 0.08), transparent 60%),
    var(--bg-900);
  min-height: 100vh;
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(120, 160, 220, 0.25);
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 160, 220, 0.4);
}

/* ---------- Glass ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
  box-shadow:
    0 20px 50px -20px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ---------- Branding ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
  box-shadow: 0 0 22px var(--glow-blue);
  color: #fff;
  font-size: 20px;
}
.brand-text {
  font-size: 1.05rem;
  line-height: 1.1;
}
.brand-text small {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  text-transform: uppercase;
}

/* ---------- Sidebar layout ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 256px;
  flex-shrink: 0;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: rgba(8, 13, 26, 0.7);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar .brand {
  margin-bottom: 26px;
  padding: 0 8px;
}
.nav-link-c {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.nav-link-c i {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
}
.nav-link-c:hover {
  color: var(--text);
  background: rgba(47, 123, 255, 0.08);
}
.nav-link-c.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.22), rgba(37, 211, 255, 0.12));
  border-color: var(--border-strong);
  box-shadow: 0 0 18px rgba(47, 123, 255, 0.18);
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 60px;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
}
.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0;
}
.page-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 4px 0 0;
}

/* ---------- Topbar (mobile) ---------- */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 13, 26, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.stat-card {
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 80px at 90% 0%, var(--_glow, transparent), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px -24px rgba(0, 0, 0, 0.7);
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: #fff;
}
.stat-label {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 700;
  margin: 0;
}
.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 6px 0 0;
  letter-spacing: -0.5px;
}
.stat-trend {
  font-size: 0.78rem;
  margin-top: 8px;
  color: var(--text-dim);
}
.stat-trend.up {
  color: var(--neon-green);
}

.g-blue {
  background: linear-gradient(135deg, var(--neon-blue), #1b54c7);
  box-shadow: 0 0 20px var(--glow-blue);
}
.g-green {
  background: linear-gradient(135deg, var(--neon-green), #0fa968);
  box-shadow: 0 0 20px var(--glow-green);
}
.g-cyan {
  background: linear-gradient(135deg, var(--neon-cyan), #1390c4);
  box-shadow: 0 0 20px rgba(37, 211, 255, 0.4);
}
.g-gold {
  background: linear-gradient(135deg, var(--neon-gold), #d99320);
  box-shadow: 0 0 20px rgba(255, 194, 75, 0.35);
}

/* ---------- Section card ---------- */
.section {
  padding: 22px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title i {
  color: var(--neon-cyan);
}

/* ---------- Progress ---------- */
.progress-track {
  height: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
  box-shadow: 0 0 14px var(--glow-green);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Ranking ---------- */
.rank-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.rank-row:hover {
  border-color: var(--border-strong);
  background: rgba(47, 123, 255, 0.06);
}
.rank-row.leader {
  border-color: rgba(255, 194, 75, 0.4);
  background: linear-gradient(135deg, rgba(255, 194, 75, 0.1), transparent);
  box-shadow: 0 0 26px rgba(255, 194, 75, 0.16);
  animation: pulse-gold 3s ease-in-out infinite;
}
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 22px rgba(255, 194, 75, 0.14); }
  50% { box-shadow: 0 0 38px rgba(255, 194, 75, 0.3); }
}
.rank-pos {
  font-size: 1.2rem;
  font-weight: 800;
  width: 34px;
  text-align: center;
  flex-shrink: 0;
}
.rank-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  background: var(--surface-solid);
}
.rank-row.leader .rank-avatar {
  border-color: var(--neon-gold);
  box-shadow: 0 0 16px rgba(255, 194, 75, 0.5);
}
.rank-name {
  font-weight: 700;
  margin: 0;
}
.rank-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 2px 0 0;
}
.rank-value {
  text-align: right;
  flex-shrink: 0;
}
.rank-value b {
  font-size: 1.05rem;
}

/* ---------- Podium ---------- */
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 24px;
}
.podium-card {
  padding: 20px 14px;
  text-align: center;
  position: relative;
}
.podium-card .pavatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  display: block;
  border: 3px solid var(--border-strong);
}
.podium-1 {
  border-color: rgba(255, 194, 75, 0.5);
  box-shadow: 0 0 34px rgba(255, 194, 75, 0.25);
  transform: scale(1.06);
}
.podium-1 .pavatar { border-color: var(--neon-gold); box-shadow: 0 0 18px rgba(255,194,75,.55);}
.podium-2 .pavatar { border-color: #c7d2e0; }
.podium-3 .pavatar { border-color: #e08c4b; }
.podium-medal {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

/* ---------- Forms ---------- */
.form-control-c,
.form-select-c {
  width: 100%;
  background: rgba(10, 16, 32, 0.8);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  outline: none;
}
.form-control-c::placeholder { color: var(--text-mute); }
.form-control-c:focus,
.form-select-c:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.18);
}
.form-label-c {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 7px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ---------- Buttons ---------- */
.btn-neon {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 24px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px -6px var(--glow-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.btn-neon:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px -6px var(--glow-blue), 0 0 22px var(--glow-blue);
}
.btn-neon:active { transform: translateY(0); }
.btn-neon.green {
  background: linear-gradient(135deg, var(--neon-green), #0fa968);
  box-shadow: 0 8px 24px -6px var(--glow-green);
}

/* ---------- Assistente IA ---------- */
.ai-box {
  border: 1px solid rgba(47, 123, 255, 0.35);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(47, 123, 255, 0.12), transparent 60%),
    var(--surface);
}
.ai-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neon-blue);
  background: rgba(47, 123, 255, 0.15);
  border: 1px solid rgba(47, 123, 255, 0.4);
  border-radius: 999px;
  padding: 3px 10px;
}
.ai-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ai-row .form-control-c { flex: 1 1 260px; }
.ai-row .btn-neon { white-space: nowrap; }
.spin { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Upload / Drop ---------- */
.upload-drop {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 18px;
  border: 1.5px dashed rgba(47, 123, 255, 0.45);
  border-radius: 14px;
  background: rgba(47, 123, 255, 0.05);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.upload-drop i { font-size: 1.8rem; color: var(--neon-blue); }
.upload-drop:hover,
.upload-drop.drag {
  border-color: var(--neon-blue);
  background: rgba(47, 123, 255, 0.12);
  color: var(--text);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-ghost:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
}

/* ---------- Table ---------- */
.table-c {
  width: 100%;
  border-collapse: collapse;
}
.table-c th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mute);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.table-c td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}
.table-c tr:hover td {
  background: rgba(47, 123, 255, 0.05);
}
.badge-c {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(25, 229, 143, 0.14);
  color: var(--neon-green);
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast-c {
  min-width: 280px;
  padding: 15px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 46, 0.95);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--text);
}
.toast-c.success { border-left: 3px solid var(--neon-green); }
.toast-c.error { border-left: 3px solid #ff5b6e; }
.toast-c.info { border-left: 3px solid var(--neon-cyan); }
.toast-c .ti { font-size: 1.3rem; }
.toast-c.success .ti { color: var(--neon-green); }
.toast-c.error .ti { color: #ff5b6e; }
.toast-c.info .ti { color: var(--neon-cyan); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Fade ---------- */
.fade-up {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.stagger > * { animation: fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.12s; }
.stagger > *:nth-child(3) { animation-delay: 0.19s; }
.stagger > *:nth-child(4) { animation-delay: 0.26s; }
.stagger > *:nth-child(5) { animation-delay: 0.33s; }
.stagger > *:nth-child(6) { animation-delay: 0.4s; }

/* ---------- Mobile ---------- */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
  backdrop-filter: blur(2px);
}
@media (max-width: 900px) {
  .topbar { display: flex; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .backdrop.show { display: block; }
  .main { padding: 20px 16px 50px; }
  .page-title { font-size: 1.35rem; }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
@media (max-width: 1050px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.chart-box {
  position: relative;
  height: 280px;
}
