/* ================= Base / Reset ================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #e8e8ea;
  background: radial-gradient(1200px 800px at 10% -10%, #1b1f2e, #0b0c10);
}

/* Containers genéricos (cadastro/login etc.) */
.container { max-width: 980px; margin: 0 auto; padding: 32px 20px 64px; }
.header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; }
.brand { display:flex; align-items:center; gap:12px; }
.brand__logo { width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,#6ee7ff,#7c3aed); box-shadow:0 4px 24px rgba(124,58,237,.35); }
.brand__title { font-weight:700; letter-spacing:.3px; }

/* Cards, tipografia, botões */
.card { background:#0f1117; border:1px solid #232633; border-radius:16px; padding:22px; box-shadow:0 10px 30px rgba(0,0,0,.25); }
.card + .card { margin-top:16px; }
h1 { margin:8px 0 6px; font-size:28px; }
h2 { margin:6px 0 6px; font-size:22px; }
h3 { margin:6px 0 6px; font-size:18px; }
.sub { color:#99a1b3; margin-bottom:18px; }

.row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
a { color:#7cc4ff; text-decoration:none; }
a:hover { text-decoration:underline; }

.btn {
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px; padding:12px 16px; border:0; border-radius:12px;
  background:linear-gradient(135deg,#6ee7ff,#7c3aed); color:#0a0b0f; font-weight:700; cursor:pointer;
  box-shadow:0 10px 24px rgba(124,58,237,.35); transition:transform .12s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); filter: saturate(1.1); }
.btn.secondary { background:#161a23; color:#e8e8ea; border:1px solid #2d3342; box-shadow:none; }
.badge { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px; font-size:12px; color:#aab3c5; background:#131723; border:1px solid #232633; }

.input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border:1px solid #2b2f3a; background:#0b0e14; color:#eef0f6; transition:border .2s, box-shadow .2s;
}
.input:focus { outline:none; border-color:#6ee7ff; box-shadow:0 0 0 4px rgba(110,231,255,.15); }
label { display:block; font-size:13px; color:#aab3c5; margin-bottom:6px; }
.field { display:grid; gap:6px; }
.help { font-size:12px; color:#8d96a8; margin-top:4px; }

/* Utilitários */
.mt-8{margin-top:8px} .mt-12{margin-top:12px} .mt-16{margin-top:16px} .mt-24{margin-top:24px}
.sep{height:1px; background:#232633; margin:16px 0}
.muted{ color:#99a1b3; }
.hide{ display:none !important; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* KPIs */
.kpis{ display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap:12px; }
.kpi{ background:#0f1117; border:1px solid #232633; border-radius:12px; padding:16px; }
.kpi__num{ font-size:22px; font-weight:800; }
.kpi__label{ color:#99a1b3; font-size:12px; }

/* Link box e QR */
.link-box{ display:flex; align-items:center; gap:12px; background:#0b0e14; border:1px solid #2b2f3a; border-radius:12px; padding:12px 14px; overflow:auto; }
.qr{ width:180px; height:180px; border-radius:12px; background:#0b0e14; border:1px dashed #2b2f3a; display:flex; align-items:center; justify-content:center; color:#6b7280; }

/* ================= Dashboard (namespaced) ================= */
:root { --sidebar-w: 260px; }

#dashboard-app{
  display:grid;
  grid-template-columns: var(--sidebar-w) minmax(0,1fr);
  min-height: 100svh;
  background:#0b0c10;
}

/* Sidebar (desktop) */
#dashboard-app > .sidebar{
  position: sticky; top:0; align-self:start;
  height: 100svh; overflow:auto;
  background:#0f172a; color:#e5e7eb; padding:18px;
}
#dashboard-app .nav{ display:grid; gap:6px; margin-top:8px; }
#dashboard-app .nav-link{
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  color:#e5e7eb; text-decoration:none;
}
#dashboard-app .nav-link:hover{ background:#1f2937; }
#dashboard-app .nav-link.active{ background:#374151; font-weight:600; }
#dashboard-app .nav .sep{ height:1px; background:#1f2937; margin:8px 0; }

/* Main */
#dashboard-app > .main{ display:flex; flex-direction:column; min-width:0; }
#dashboard-app .topbar{
  position: sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px; background:#0f1117; border-bottom:1px solid #232633;
}
#dashboard-app #btnMenu{
  display:none; /* só mobile */
  width:36px; height:36px; border-radius:8px; background:#161a23; color:#e8e8ea; border:1px solid #232633;
}
#dashboard-app .content{
  width:100%; max-width:1120px; margin:0 auto; padding:24px;
  display:grid; gap:20px;
}
#dashboard-app .view{ display:none; }
#dashboard-app .view.active{ display:block; }

.kv{ display:grid; grid-template-columns:200px 1fr; gap:8px 12px; align-items:center; }

/* Mobile ≤ 1024px: sidebar off-canvas */
@media (max-width:1024px){
  #dashboard-app{ grid-template-columns: 1fr; }
  #dashboard-app > .sidebar{
    position: fixed; left:0; top:0; bottom:0; width:var(--sidebar-w); height:auto;
    transform: translateX(-100%); transition: transform .2s ease; z-index:50; box-shadow:2px 0 14px rgba(0,0,0,.25);
  }
  body.sidebar-open #dashboard-app > .sidebar{ transform: translateX(0); }
  .scrim{ display:none; }
  body.sidebar-open .scrim{ display:block; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:40; }
  #dashboard-app #btnMenu{ display:inline-flex; align-items:center; justify-content:center; }
  #dashboard-app .content{ max-width:100%; padding:18px; }
  .grid-2{ grid-template-columns:1fr; }
  .kv{ grid-template-columns:1fr; }
}

/* Materiais grid */
.grid-materials{ display:grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.material{ background:#0f1117; border:1px solid #232633; border-radius:12px; overflow:hidden; }
.material img{ display:block; width:100%; height:140px; object-fit:cover; background:#0b0e14; }
.material .p{ padding:10px 12px; display:flex; justify-content:space-between; align-items:center; }
/* ================== FIX DESKTOP LAYOUT ================== */
/* Desktop: sidebar fixa em coluna + conteúdo ao lado */
#dashboard-app{
  display: grid;
  grid-template-columns: 280px 1fr; /* 280px de menu + conteúdo */
  min-height: 100vh;
}
#dashboard-app .sidebar{
  position: sticky;   /* fica colada no topo ao rolar */
  top: 0;
  left: auto;         /* garante que não fica "fora" da tela */
  height: 100vh;
  overflow-y: auto;
  width: 280px;
  transform: none;    /* cancela translate/left de mobile */
  box-shadow: none;
  z-index: auto;
}
#dashboard-app .main{
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#dashboard-app .topbar{
  position: sticky;
  top: 0;
  z-index: 1;
}
#dashboard-app .content{
  width: 100%;
  max-width: 1120px;  /* largura confortável */
  margin: 24px auto;  /* centraliza o conteúdo */
  padding: 0 24px;
}
#dashboard-app .scrim{ display: none !important; }

/* ================== MOBILE OVERLAY (≤1023px) ================== */
@media (max-width: 1023.98px){
  #dashboard-app{
    grid-template-columns: 1fr; /* some a coluna da esquerda; vira overlay */
  }
  #dashboard-app .sidebar{
    position: fixed;
    top: 0; bottom: 0; left: -280px;
    width: 280px;
    z-index: 40;
    transition: left .2s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,.35);
  }
  body.sidebar-open #dashboard-app .sidebar{ left: 0; }

  #dashboard-app .scrim{
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 30;
  }

  #dashboard-app .content{
    margin: 16px auto;
    padding: 0 16px;
    max-width: 760px; /* mais enxuto no mobile */
  }
}
.alert.alert-warn{
  background: rgba(255, 99, 99, .08);
  color: #ff6b6b;
  border: 1px solid rgba(255, 99, 99, .3);
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.4;
}
.product-links-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-top:16px;
}

.product-link-card{
  background:#0f1117;
  border:1px solid #232633;
  border-radius:16px;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
}

.product-logo{
  width:58px;
  height:58px;
  object-fit:contain;
  border-radius:14px;
  background:#0b0e14;
  border:1px solid #232633;
  padding:6px;
}

.product-info h3{
  margin:0;
  font-size:16px;
}

.product-info p{
  margin:6px 0 10px;
  color:#99a1b3;
  font-size:13px;
  line-height:1.35;
}

.product-link-text{
  font-size:12px;
  padding:9px 10px;
  max-height:42px;
  overflow:auto;
}

.product-link-card .row{
  gap:8px;
}

.product-link-card .btn{
  padding:9px 12px;
  border-radius:10px;
  font-size:12px;
  box-shadow:none;
}

@media(max-width:1024px){
  .product-links-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:640px){
  .product-links-grid{
    grid-template-columns:1fr;
  }

  .product-link-card{
    padding:14px;
  }
}
.commission-preview{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.commission-preview > div{
  background:#0b0e14;
  border:1px solid #232633;
  border-radius:14px;
  padding:14px;
}

.commission-preview span{
  display:block;
  color:#99a1b3;
  font-size:12px;
  margin-bottom:6px;
}

.commission-preview strong{
  display:block;
  font-size:22px;
}

@media(max-width:640px){
  .commission-preview{
    grid-template-columns:1fr;
  }
}
/* ===========================
   VENDAS - NOVA UX
=========================== */

.sales-cards{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.sale-card{
  background:#121722;
  border:1px solid #232633;
  border-radius:14px;
  padding:18px;
  transition:.2s;
}

.sale-card:hover{
  border-color:#334155;
}

.sale-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.sale-product{
  font-size:18px;
  font-weight:700;
  color:#fff;
}

.sale-amount{
  font-size:34px;
  font-weight:800;
  color:#22c55e;
}

.sale-type{
  display:inline-flex;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
}

.sale-type.direct{
  background:#172554;
  color:#93c5fd;
}

.sale-type.affiliate{
  background:#3b0764;
  color:#d8b4fe;
}

.sale-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:12px;
  font-size:13px;
  color:#94a3b8;
}

.sale-affiliate{
  margin-top:8px;
  font-size:14px;
  color:#cbd5e1;
}

@media (max-width:768px){

  .sale-header{
    flex-direction:column;
  }

  .sale-amount{
    font-size:24px;
  }

  .sale-footer{
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
  }

}
/* ===========================
   AFILIADOS - CARDS VENDEDOR
=========================== */

.affiliate-sections{
  display:grid;
  gap:20px;
}

.affiliate-cards-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:12px;
}

.affiliate-card{
  background:#121722;
  border:1px solid #232633;
  border-radius:16px;
  padding:18px;
  min-width:0;
}

.affiliate-card--active{
  border-color:rgba(34,197,94,.35);
}

.affiliate-card--pending{
  border-color:rgba(245,158,11,.35);
}

.affiliate-card__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.affiliate-card__top h3{
  margin:0;
  font-size:17px;
}

.affiliate-card__top p{
  margin:6px 0 0;
  color:#99a1b3;
  font-size:13px;
  word-break:break-word;
}

.affiliate-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.affiliate-status--active{
  background:rgba(34,197,94,.12);
  color:#86efac;
  border:1px solid rgba(34,197,94,.25);
}

.affiliate-status--pending{
  background:rgba(245,158,11,.12);
  color:#fbbf24;
  border:1px solid rgba(245,158,11,.25);
}

.affiliate-metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:16px;
}

.affiliate-metrics > div{
  background:#0b0e14;
  border:1px solid #232633;
  border-radius:12px;
  padding:10px;
}

.affiliate-metrics span{
  display:block;
  color:#99a1b3;
  font-size:11px;
  margin-bottom:6px;
}

.affiliate-metrics strong{
  display:block;
  font-size:18px;
}

.affiliate-card--pending .affiliate-metrics{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.affiliate-card__link{
  margin-top:14px;
  background:#0b0e14;
  border:1px solid #232633;
  border-radius:12px;
  padding:10px 12px;
  color:#99a1b3;
  font-size:12px;
  overflow:auto;
}

.affiliate-card .btn{
  padding:9px 12px;
  border-radius:10px;
  font-size:12px;
  box-shadow:none;
}

@media(max-width:900px){
  .affiliate-cards-grid{
    grid-template-columns:1fr;
  }

  .affiliate-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
.affiliate-products-list{
  display:grid;
  gap:10px;
  margin-top:14px;
}

.affiliate-product-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:#0b0e14;
  border:1px solid #232633;
  border-radius:12px;
  padding:10px 12px;
}

.affiliate-product-link strong{
  display:block;
  font-size:13px;
}

.affiliate-product-link span{
  display:block;
  color:#99a1b3;
  font-size:11px;
  word-break:break-all;
  margin-top:4px;
}

@media(max-width:700px){
  .affiliate-product-link{
    align-items:flex-start;
    flex-direction:column;
  }
}
.inline-create-card{
  margin-top:16px;
}

.inline-create-card .modal__card{
  background:#0f1117;
  border:1px solid #232633;
  border-radius:16px;
  padding:22px;
  box-shadow:none;
  max-width:none;
  width:100%;
}
.sales-filters,
.affiliate-filters{
  display:grid;
  grid-template-columns:2fr 1fr 1fr auto auto;
  gap:10px;
  align-items:end;
}

.affiliate-filters{
  grid-template-columns:2fr 1fr 1fr auto auto;
}

@media(max-width:900px){
  .sales-filters,
  .affiliate-filters{
    grid-template-columns:1fr;
  }
}
.date-input{
  color-scheme: dark;
  cursor:pointer;
}

.date-input::-webkit-calendar-picker-indicator{
  opacity:1;
  cursor:pointer;
}
.marketing-empty {
  background: #0f1117;
  border: 1px solid #232633;
  border-radius: 18px;
  padding: 28px;
}

.marketing-shelf {
  margin-bottom: 34px;
}

.marketing-shelf__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 14px;
}

.marketing-shelf__head h2 {
  margin: 0;
  font-size: 22px;
}

.marketing-shelf__head p {
  margin: 4px 0 0;
  color: #99a1b3;
}

.marketing-shelf__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 260px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.marketing-netflix-card {
  background: #0f1117;
  border: 1px solid #232633;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.marketing-netflix-card:hover {
  transform: translateY(-3px);
  border-color: #6ee7ff;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
}

.marketing-netflix-thumb {
  position: relative;
  height: 300px;
  background: #080a10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marketing-netflix-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b0e14;
}

.marketing-netflix-icon {
  font-size: 54px;
}

.marketing-netflix-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,0));
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
}

.marketing-netflix-card:hover .marketing-netflix-overlay {
  opacity: 1;
  transform: translateY(0);
}

.marketing-netflix-overlay .btn {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.marketing-netflix-body {
  padding: 14px;
}

.marketing-netflix-body h3 {
  margin: 8px 0 6px;
  font-size: 15px;
  line-height: 1.25;
}

.marketing-netflix-body p {
  color: #99a1b3;
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.marketing-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.marketing-card-tags span {
  font-size: 11px;
  color: #aab3c5;
  border: 1px solid #2d3342;
  background: #151a24;
  border-radius: 999px;
  padding: 4px 8px;
}

@media (max-width: 720px) {
  .marketing-shelf__row {
    grid-auto-columns: minmax(190px, 78vw);
  }

  .marketing-netflix-thumb {
    height: 260px;
  }

  .marketing-netflix-overlay {
    opacity: 1;
    transform: none;
  }
}
.vendor-home-hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.08);
  background: #090d16;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}

.vendor-home-hero img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .45s ease;
}

.vendor-home-hero:hover img {
  transform: scale(1.025);
}

.vendor-home-hero__cta {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 2;
  padding: 14px 24px;
  border-radius: 16px;
  font-weight: 800;
  text-decoration: none;
  color: #05070d;
  background: linear-gradient(135deg,#6ee7ff,#7c3aed);
  box-shadow: 0 14px 35px rgba(124,58,237,.45);
}

.vendor-home-hero__cta:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.vendor-home-alert {
  margin-top: 24px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(239,68,68,.35);
  box-shadow: 0 18px 50px rgba(127,29,29,.18);
}

.vendor-home-alert img {
  width: 100%;
  display: block;
}

@media(max-width:768px) {
  .vendor-home-hero__cta {
    left: 16px;
    right: 16px;
    bottom: 16px;
    text-align: center;
  }
}