:root{
  --bg:#0b1020;
  --bg-2:#0f1528;
  --sidebar:#0d1426;
  --panel:#131a2e;
  --panel-2:#18213a;
  --stroke:rgba(255,255,255,.08);
  --stroke-2:rgba(255,255,255,.12);
  --text:#eef3ff;
  --muted:#9eabc7;
  --muted-2:#c8d3eb;
  --shadow:0 20px 50px rgba(0,0,0,.35);

  --youtube:#ff3b30;
  --meta:#2f6bff;
  --whatsapp:#22c55e;
  --sms:#f59e0b;
  --email:#8b5cf6;
  --funnel:#facc15;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  min-height:100%;
}

body{
  font-family:Inter, "Segoe UI", Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(47,107,255,.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(250,204,21,.08), transparent 25%),
    var(--bg);
}

button,
input,
select{
  font:inherit;
}

button{
  border:none;
  outline:none;
}

strong{
  font-weight:700;
}

.app-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:280px 1fr;
}

.sidebar{
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-right:1px solid var(--stroke);
  padding:24px 18px;
  position:sticky;
  top:0;
  height:100vh;
}

.brand-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border:1px solid var(--stroke);
  border-radius:20px;
  background:rgba(255,255,255,.03);
  box-shadow:var(--shadow);
  margin-bottom:24px;
}

.brand-badge{
  width:46px;
  height:46px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg, #2f6bff, #8b5cf6);
  font-weight:800;
  font-size:18px;
}

.brand-copy h1{
  font-size:15px;
  line-height:1.1;
  margin:0 0 4px;
}

.brand-copy p{
  margin:0;
  color:var(--muted);
  font-size:12px;
}

.sidebar-group{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.sidebar-label{
  margin:0 10px 6px;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.16em;
  color:var(--muted);
}

.side-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.side-link{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px;
  border-radius:16px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  border:1px solid var(--stroke);
  cursor:pointer;
  transition:.2s ease;
}

.side-link:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.05);
}

.side-link.active{
  background:rgba(255,255,255,.08);
  border-color:var(--stroke-2);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);
}

.side-link-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.side-arrow{
  color:var(--muted);
  font-size:18px;
}

.side-dot,
.module-dot{
  border-radius:999px;
  display:inline-block;
}

.side-dot{
  width:10px;
  height:10px;
}

.module-dot{
  width:14px;
  height:14px;
}

.youtube-dot{ background:var(--youtube); }
.meta-dot{ background:var(--meta); }
.whatsapp-dot{ background:var(--whatsapp); }
.sms-dot{ background:var(--sms); }
.email-dot{ background:var(--email); }
.funnel-dot{ background:var(--funnel); }

.main-layout{
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  padding:22px 24px;
  border-bottom:1px solid var(--stroke);
  background:rgba(255,255,255,.02);
  backdrop-filter:blur(8px);
}

.eyebrow{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.16em;
  color:var(--muted);
  margin-bottom:8px;
}

.topbar h2{
  margin:0;
  font-size:28px;
}

.topbar p{
  margin:6px 0 0;
  font-size:14px;
  color:var(--muted);
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.filter-pill{
  padding:10px 14px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  color:var(--muted-2);
  font-size:13px;
}

.content-area{
  padding:24px;
}

.module-section{
  display:none;
  gap:18px;
}

.module-section.active{
  display:grid;
}

.module-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:20px;
  border:1px solid var(--stroke);
  border-radius:24px;
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow:var(--shadow);
}

.module-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}

.module-title-row h3{
  margin:0;
  font-size:24px;
}

.module-header p{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

.module-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.primary-btn,
.ghost-btn,
.table-btn{
  cursor:pointer;
  transition:.2s ease;
}

.primary-btn{
  padding:11px 16px;
  border-radius:14px;
  background:#2f6bff;
  color:#fff;
  font-weight:600;
}

.primary-btn:hover{
  filter:brightness(1.06);
}

.ghost-btn{
  padding:11px 16px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  color:var(--text);
  border:1px solid var(--stroke);
}

.ghost-btn:hover{
  background:rgba(255,255,255,.06);
}

.table-btn{
  padding:8px 12px;
  border-radius:10px;
  background:rgba(255,255,255,.04);
  color:var(--text);
  border:1px solid var(--stroke);
}

.subtabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  padding:4px 2px;
}

.subtab{
  padding:11px 15px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  color:var(--text);
  border:1px solid var(--stroke);
  cursor:pointer;
}

.subtab.active{
  background:rgba(255,255,255,.10);
  border-color:var(--stroke-2);
}

.subtab-panel{
  display:none;
  gap:18px;
}

.subtab-panel.active{
  display:grid;
}

.kpi-grid{
  display:grid;
  gap:14px;
}

.kpi-grid-6{
  grid-template-columns:repeat(6, minmax(0,1fr));
}

.kpi-grid-4{
  grid-template-columns:repeat(4, minmax(0,1fr));
}

.kpi-card{
  min-width:0;
  padding:18px;
  border-radius:20px;
  border:1px solid var(--stroke);
  background:var(--panel);
  display:flex;
  flex-direction:column;
  gap:8px;
}

.kpi-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.10em;
  color:var(--muted);
}

.kpi-value{
  font-size:28px;
  line-height:1;
  font-weight:800;
}

.kpi-meta{
  font-size:12px;
  color:var(--muted);
}

.content-grid{
  display:grid;
  grid-template-columns:minmax(0, 1.55fr) minmax(320px, .85fr);
  gap:16px;
  align-items:start;
}

.content-grid.single-column{
  grid-template-columns:1fr;
}

.inbox-layout{
  grid-template-columns:minmax(320px, .9fr) minmax(0, 1.1fr);
}

.panel{
  min-width:0;
  border:1px solid var(--stroke);
  background:var(--panel);
  border-radius:22px;
  padding:18px;
}

.panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.panel-header h4{
  margin:0;
  font-size:16px;
}

.chart-placeholder{
  min-height:260px;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015)),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 64px,
      rgba(255,255,255,.03) 65px
    );
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px;
}

.placeholder-title{
  font-weight:700;
  font-size:18px;
  margin-bottom:8px;
}

.placeholder-subtitle{
  color:var(--muted);
  font-size:14px;
  max-width:420px;
}

.stack-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.stack-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px;
  border-radius:16px;
  background:var(--panel-2);
  border:1px solid var(--stroke);
}

.stack-item span{
  color:var(--muted);
  font-size:13px;
}

.stack-item strong{
  font-size:15px;
}

.info-card{
  padding:16px;
  border-radius:16px;
  background:var(--panel-2);
  border:1px solid var(--stroke);
  color:var(--muted-2);
  line-height:1.6;
}

.empty-state{
  min-height:220px;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px;
  background:rgba(255,255,255,.02);
}

.empty-state strong{
  font-size:16px;
  margin-bottom:8px;
}

.empty-state p{
  margin:0;
  max-width:520px;
  color:var(--muted);
  line-height:1.5;
}

.table-wrap{
  overflow:auto;
  border:1px solid var(--stroke);
  border-radius:18px;
}

.data-table{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
  background:var(--panel-2);
}

.data-table thead{
  background:rgba(255,255,255,.03);
}

.data-table th,
.data-table td{
  text-align:left;
  padding:14px 16px;
  border-bottom:1px solid var(--stroke);
  font-size:14px;
}

.data-table th{
  color:var(--muted-2);
  font-weight:600;
}

.field-block{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.field-block label{
  color:var(--muted);
  font-size:13px;
}

.input-control{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:var(--panel-2);
  color:var(--text);
}

.render-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.render-card{
  padding:14px;
  border-radius:16px;
  background:var(--panel-2);
  border:1px solid var(--stroke);
}

.render-card-title{
  font-weight:700;
  margin-bottom:6px;
}

.render-card-sub{
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.render-card-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-top:8px;
  font-size:13px;
  color:var(--muted-2);
}

.helper-note{
  padding:14px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
  color:var(--muted);
}

.message-item{
  padding:12px 14px;
  border-radius:14px;
  background:var(--panel-2);
  border:1px solid var(--stroke);
  margin-bottom:10px;
}

.message-role{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  margin-bottom:6px;
}

.message-text{
  line-height:1.5;
  color:var(--text);
}

.clickable{
  cursor:pointer;
}

.clickable:hover{
  background:rgba(255,255,255,.06);
}

@media (max-width:1440px){
  .kpi-grid-6{
    grid-template-columns:repeat(3, minmax(0,1fr));
  }
}

@media (max-width:1100px){
  .app-shell{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:relative;
    height:auto;
    border-right:none;
    border-bottom:1px solid var(--stroke);
  }

  .content-grid,
  .inbox-layout{
    grid-template-columns:1fr;
  }

  .topbar{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width:760px){
  .content-area{
    padding:16px;
  }

  .topbar{
    padding:18px 16px;
  }

  .module-header{
    padding:16px;
    flex-direction:column;
    align-items:flex-start;
  }

  .kpi-grid-6,
  .kpi-grid-4{
    grid-template-columns:1fr;
  }

  .subtabs{
    overflow:auto;
    flex-wrap:nowrap;
    padding-bottom:4px;
  }

  .subtab{
    white-space:nowrap;
  }
}








.wa-mode-selector{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:16px;
  margin-bottom:18px;
}

.wa-top-tab{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  text-align:left;
  padding:20px 22px;
  border-radius:24px;
  border:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  color:var(--text);
  cursor:pointer;
  transition:.2s ease;
  box-shadow:var(--shadow);
  appearance:none;
  -webkit-appearance:none;
  outline:none;
  font:inherit;
}

.wa-top-tab:hover{
  transform:translateY(-1px);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
}

.wa-top-tab.active{
  border-color:var(--stroke-2);
  background:linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.04), var(--shadow);
}

.wa-top-tab-head{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}

.wa-top-tab-title{
  font-size:18px;
  font-weight:700;
  line-height:1.1;
}

.wa-top-tab-subtitle{
  color:var(--muted-2);
  font-size:14px;
  line-height:1.5;
}

@media (max-width:760px){
  .wa-mode-selector{
    grid-template-columns:1fr;
  }
}






.provider-shell{
  display:grid;
  gap:18px;
}

.provider-subpanel{
  display:none;
  gap:18px;
}

.provider-subpanel.active{
  display:grid;
}