:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#172033;
  --muted:#687386;
  --line:#e5e9f0;

  --brand:#1f6feb;
  --brand-soft:#eaf2ff;

  --green:#159463;
  --green-soft:#eaf8f2;

  --orange:#ef8a0c;
  --orange-soft:#fff4e5;

  --purple:#6f31b8;
  --purple-soft:#f3ebff;

  --danger:#b42318;
  --shadow:0 10px 28px rgba(20,35,60,.07);
}

*{
  box-sizing:border-box;
}

html{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
}

a{
  color:var(--brand);
  text-decoration:none;
}

code{
  font-size:.85em;
}

/* ================================
   TOPO
================================ */

.topbar{
  height:68px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 max(20px,calc((100vw - 1180px)/2));
}

.brand{
  font-weight:800;
  letter-spacing:.04em;
  color:var(--text);
}

.brand span{
  font-weight:500;
  color:var(--brand);
}

.topbar nav{
  display:flex;
  gap:20px;
  align-items:center;
}

.topbar nav a{
  color:var(--text);
  font-size:14px;
}

.container{
  max-width:1180px;
  margin:0 auto;
  padding:34px 20px 70px;
}

.footer{
  text-align:center;
  color:var(--muted);
  padding:28px;
  font-size:13px;
}

/* ================================
   TIPOGRAFIA
================================ */

h1{
  font-size:clamp(27px,4vw,42px);
  line-height:1.08;
  margin:.25em 0;
}

h2{
  margin:.2em 0;
  font-size:20px;
}

p{
  line-height:1.55;
  color:var(--muted);
}

.eyebrow{
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  color:var(--brand);
}

.muted,
.fine{
  color:var(--muted);
}

/* ================================
   BOTÕES
================================ */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  padding:10px 16px;
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
  font:inherit;
}

.btn:hover{
  filter:brightness(.98);
}

.btn-primary{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
}

.btn-dark{
  background:#172033;
  color:#fff;
  border-color:#172033;
}

.btn-danger{
  color:var(--danger);
}

.btn-lg{
  padding:13px 22px;
}

/* ================================
   LOGIN
================================ */

.login-shell{
  min-height:68vh;
  display:grid;
  place-items:center;
}

.hero-card{
  max-width:690px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:24px;
  padding:48px;
  box-shadow:var(--shadow);
  text-align:center;
}

.hero-card p{
  font-size:17px;
}

.hero-card .fine{
  font-size:13px;
  margin-top:20px;
}

/* ================================
   CABEÇALHO DE PÁGINA
================================ */

.page-heading{
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:flex-end;
  margin-bottom:26px;
}

.page-heading p{
  margin:.4em 0;
}

.back-link{
  display:inline-block;
  margin-bottom:18px;
  font-size:14px;
}

/* ================================
   CARDS
================================ */

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:22px;
  box-shadow:var(--shadow);
  margin-bottom:20px;
}

.status-pill{
  display:inline-block;
  padding:5px 9px;
  border-radius:999px;
  background:#eef5ff;
  color:var(--brand);
  font-size:12px;
  font-weight:700;
}

.section-title{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:16px;
}

/* ================================
   MÉTRICAS
================================ */

.metrics{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin-bottom:20px;
}

.metric{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
}

.metric span,
.metric small{
  display:block;
  color:var(--muted);
  font-size:13px;
}

.metric strong{
  display:block;
  font-size:30px;
  margin:5px 0;
}

/* ================================
   FUNIL DE CAPTAÇÃO
================================ */

.funnel-capture{
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:24px;
  align-items:start;
}

.funnel-main{
  min-width:0;
}

.funnel-row{
  display:grid;
  grid-template-columns:190px minmax(260px,1fr) 120px;
  gap:16px;
  align-items:center;
  margin-bottom:12px;
}

.funnel-stage-info{
  display:flex;
  gap:12px;
  align-items:center;
}

.funnel-icon{
  width:48px;
  height:48px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-weight:800;
  background:#edf4ff;
  color:var(--brand);
  flex:0 0 auto;
}

.funnel-stage-info strong{
  display:block;
  font-size:14px;
  margin-bottom:4px;
}

.funnel-stage-info small{
  display:block;
  color:var(--muted);
  line-height:1.35;
}

.funnel-shape{
  min-height:92px;
  display:grid;
  place-items:center;
  color:#fff;
  text-align:center;
  font-weight:800;
  clip-path:polygon(0 0,100% 0,88% 100%,12% 100%);
  border-radius:8px;
}

.funnel-shape strong{
  display:block;
  font-size:34px;
  line-height:1;
}

.funnel-attraction{
  background:linear-gradient(180deg,#2f80ed,#1462d2);
}

.funnel-intent{
  background:linear-gradient(180deg,#2faa72,#168c5d);
}

.funnel-action{
  background:linear-gradient(180deg,#ff9b17,#ee7f00);
}

.funnel-conversion{
  background:linear-gradient(180deg,#8649c7,#6827aa);
}

.funnel-row.stage-2 .funnel-shape{
  width:82%;
  justify-self:center;
}

.funnel-row.stage-3 .funnel-shape{
  width:66%;
  justify-self:center;
}

.funnel-row.stage-4 .funnel-shape{
  width:46%;
  justify-self:center;
}

.funnel-rate{
  font-weight:800;
  font-size:20px;
  text-align:center;
}

.funnel-rate small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:11px;
  font-weight:600;
}

.rate-blue{
  color:var(--brand);
}

.rate-green{
  color:var(--green);
}

.rate-orange{
  color:var(--orange);
}

.rate-purple{
  color:var(--purple);
}

.funnel-summary{
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  background:#fff;
}

.funnel-summary h3{
  margin:0 0 18px;
  font-size:16px;
}

.conversion-box{
  padding:16px 0;
  border-bottom:1px solid var(--line);
}

.conversion-box:last-child{
  border-bottom:0;
}

.conversion-box .label{
  display:block;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  margin-bottom:3px;
}

.conversion-box strong{
  display:block;
  font-size:28px;
}

.conversion-blue strong{
  color:var(--brand);
}

.conversion-green strong{
  color:var(--green);
}

.conversion-orange strong{
  color:var(--orange);
}

.funnel-update{
  margin-top:12px;
  font-size:12px;
  color:var(--muted);
  text-align:center;
}

/* ================================
   RADAR / INSIGHTS
================================ */

.trend{
  font-size:13px;
  font-weight:800;
  padding:7px 10px;
  border-radius:999px;
}

.trend.up{
  background:#eaf8f2;
  color:var(--green);
}

.trend.down{
  background:#fff0ee;
  color:var(--danger);
}

.insight-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}

.insight{
  border:1px solid var(--line);
  border-left:4px solid #98a2b3;
  border-radius:12px;
  padding:14px;
}

.insight.good{
  border-left-color:var(--green);
}

.insight.attention{
  border-left-color:var(--orange);
}

.insight.neutral{
  border-left-color:#94a3b8;
}

.insight p{
  font-size:14px;
  margin:.45em 0 0;
}

/* ================================
   DUAS COLUNAS
================================ */

.two-col{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:20px;
}

/* ================================
   BARRAS / RANKING
================================ */

.rank-row{
  margin:14px 0;
}

.rank-head{
  display:flex;
  justify-content:space-between;
  gap:15px;
  font-size:14px;
}

.track{
  height:9px;
  background:#edf0f5;
  border-radius:9px;
  margin-top:7px;
  overflow:hidden;
}

.track span{
  display:block;
  height:100%;
  background:var(--brand);
  border-radius:9px;
}

.simple-list>div{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}

.simple-list>div:last-child{
  border-bottom:0;
}

/* ================================
   EVOLUÇÃO
================================ */

.bars{
  height:250px;
  display:flex;
  align-items:flex-end;
  gap:4px;
  padding-top:25px;
  overflow:hidden;
}

.bar-col{
  height:100%;
  flex:1;
  min-width:10px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:center;
  position:relative;
}

.bar{
  width:72%;
  background:var(--brand);
  min-height:3px;
  border-radius:4px 4px 0 0;
}

.bar-value{
  font-size:10px;
  color:var(--muted);
  margin-bottom:4px;
}

.bar-label{
  font-size:9px;
  color:var(--muted);
  transform:rotate(-50deg);
  margin-top:12px;
  white-space:nowrap;
}

/* ================================
   PERFIL DOS INSCRITOS
================================ */

.profile-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
}

.profile-panel{
  min-width:0;
}

.profile-panel h3{
  font-size:15px;
  margin:0 0 12px;
}

.profile-stat{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
  font-size:13px;
}

.profile-stat:last-child{
  border-bottom:0;
}

.profile-stat span{
  color:var(--muted);
}

.profile-stat strong{
  white-space:nowrap;
}

.profile-bar{
  height:8px;
  background:#eef1f5;
  border-radius:10px;
  overflow:hidden;
  margin-top:5px;
}

.profile-bar span{
  display:block;
  height:100%;
  background:var(--brand);
  border-radius:10px;
}

/* ================================
   ALERTAS
================================ */

.alert{
  padding:14px 16px;
  border-radius:12px;
  margin:16px 0;
}

.alert.info{
  background:#eef5ff;
  color:#174fa8;
}

.alert.danger{
  background:#fff0ee;
  color:#8b1e15;
}

/* ================================
   ADMIN
================================ */

.admin-links{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.link-card{
  display:flex;
  flex-direction:column;
  gap:8px;
  color:var(--text);
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:15px;
}

.form-grid .wide{
  grid-column:1/-1;
}

label{
  font-size:14px;
  font-weight:700;
}

input,
select{
  font:inherit;
}

input[type=text],
input[type=date],
input[type=file],
select{
  display:block;
  width:100%;
  padding:11px 12px;
  border:1px solid #cfd6e2;
  border-radius:9px;
  margin-top:6px;
  background:#fff;
}

.form-actions{
  display:flex;
  align-items:end;
}

.table-wrap{
  overflow:auto;
}

table{
  border-collapse:collapse;
  width:100%;
  font-size:14px;
}

th,
td{
  text-align:left;
  padding:12px;
  border-bottom:1px solid var(--line);
}

th{
  color:var(--muted);
}

.request-card{
  display:grid;
  grid-template-columns:.7fr 1.3fr;
  gap:24px;
}

.checks{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin:12px 0 18px;
}

.checks label{
  font-weight:500;
}

.actions{
  display:flex;
  gap:10px;
}

/* ================================
   ASSISTENTE IA
================================ */

.ai-card{
  background:linear-gradient(135deg,#172033,#24395d);
  color:#fff;
  border-radius:20px;
  padding:28px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  margin-top:20px;
}

.ai-card p{
  color:#cbd5e1;
  max-width:720px;
}

.ai-card .eyebrow{
  color:#8eb8ff;
}

.prose{
  white-space:normal;
  line-height:1.65;
}

/* ================================
   RESPONSIVO
================================ */

@media(max-width:980px){

  .funnel-capture{
    grid-template-columns:1fr;
  }

  .funnel-row{
    grid-template-columns:150px minmax(180px,1fr) 100px;
  }

  .profile-grid{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:800px){

  .metrics{
    grid-template-columns:1fr 1fr;
  }

  .two-col,
  .insight-grid,
  .admin-links,
  .request-card{
    grid-template-columns:1fr;
  }

  .page-heading,
  .ai-card{
    align-items:flex-start;
    flex-direction:column;
  }

  .bars{
    height:210px;
  }

  .bar-value{
    display:none;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .form-grid .wide{
    grid-column:auto;
  }

  .checks{
    grid-template-columns:1fr;
  }

  .funnel-row{
    grid-template-columns:1fr;
    gap:8px;
    margin-bottom:20px;
  }

  .funnel-stage-info{
    justify-content:center;
    text-align:center;
  }

  .funnel-rate{
    margin-top:4px;
  }

  .funnel-row.stage-2 .funnel-shape,
  .funnel-row.stage-3 .funnel-shape,
  .funnel-row.stage-4 .funnel-shape{
    width:100%;
  }

  .profile-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:480px){

  .metrics{
    grid-template-columns:1fr;
  }

  .topbar{
    padding:0 14px;
  }

  .topbar nav{
    gap:12px;
  }

  .topbar nav a:not(:last-child){
    display:none;
  }

  .container{
    padding:24px 14px 60px;
  }

  .hero-card{
    padding:30px 22px;
  }
}