:root{
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfcff;
  --border: #e6e8f0;
  --text: #0f172a;
  --muted: #475569;
  --muted-2: #64748b;
  --brand: #0ea5e9;
  --brand-2: #0369a1;
  --ok: #16a34a;
  --warn: #f59e0b;
  --shadow: 0 10px 25px rgba(2, 6, 23, .08);
  --shadow-sm: 0 4px 12px rgba(2, 6, 23, .06);
  --radius: 16px;
  --radius-sm: 12px;

  /* ===== Header com imagem (img/abt2.png) a 50% + altura maior ===== */
  --header-height: 110px;
  --header-bg-img: url("img/abt2.png");
  --header-bg-opacity: 0.8; /* 0..1 */
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}
img{max-width:100%; display:block}
a{color:inherit}

.wrap{max-width:1400px; margin:0 auto; padding:0 16px}
.sr-only{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0}

/* =========================
   Header (sticky + imagem)
   ========================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;

  min-height: var(--header-height);
  overflow: hidden;
  isolation: isolate;

  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(10px);
}

/* Imagem no cabeçalho */
.site-header::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  background-image: var(--header-bg-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  opacity: var(--header-bg-opacity);
  pointer-events: none;
}

/* Véu para legibilidade */
.site-header::after{
  content:"";
  position:absolute;
  inset:0;
  z-index: 0;
  pointer-events:none;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.92),
    rgba(255,255,255,0.70)
  );
}

/* Conteúdo acima da imagem */
.site-header > *{
  position: relative;
  z-index: 1;
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
  min-height: calc(var(--header-height) - 20px);
}

.brand{display:flex; align-items:center; gap:10px; text-decoration:none}
.brand-mark{
  width:38px; height:38px; border-radius:12px;
  display:grid; place-items:center;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#fff; font-weight:800;
  letter-spacing:.3px;
}
.brand-text strong{display:block; line-height:1.1}
.brand-text span{display:block; color:var(--muted-2)}

.nav{display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.nav a{
  text-decoration:none;
  font-weight:600;
  color:var(--muted);
  padding:8px 10px;
  border-radius:10px;
}
.nav a:hover{background:rgba(14,165,233,.10); color:var(--text)}

/* Hero */
.hero{padding:26px 0 18px}
.hero-grid{display:grid; grid-template-columns: 1.25fr .75fr; gap:16px; align-items:stretch}
@media (max-width: 920px){.hero-grid{grid-template-columns:1fr}}

.hero-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.hero-content{padding:18px 18px 0 18px}
.hero h1{margin:0 0 6px 0; font-size: clamp(22px, 2.2vw, 30px); letter-spacing:-.2px}
.hero p{margin:0 0 12px 0; color:var(--muted)}

.hero-stats{display:grid; grid-template-columns:repeat(4,1fr); gap:10px; padding:14px 18px 18px}
@media (max-width: 720px){.hero-stats{grid-template-columns:repeat(2,1fr)}}

.stat{
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  box-shadow:var(--shadow-sm);
}
.stat .k{font-size:12px; color:var(--muted-2); font-weight:600}
.stat .v{font-size:18px; font-weight:800; margin-top:4px}

.hero-media{
  margin-top:8px;
  border-top:1px solid var(--border);
  background:linear-gradient(180deg, #ffffff, #f4f7ff);
  padding:14px 18px 16px;
}
.media-slot{
  border-radius:14px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  height:180px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted-2);
  text-align:center;
  padding:14px;
}

/* Sections */
.section{padding:26px 0}
.section-head{margin-bottom:14px}
.section-head h2{margin:0 0 6px 0; font-size:22px}
.section-head p{margin:0; color:var(--muted)}

.grid{display:grid; gap:16px}
.grid.two{grid-template-columns:1fr 1fr}
@media (max-width: 920px){.grid.two{grid-template-columns:1fr}}

.cards{display:grid; grid-template-columns:repeat(3,1fr); gap:12px}
@media (max-width: 920px){.cards{grid-template-columns:repeat(2,1fr)}}
@media (max-width: 560px){.cards{grid-template-columns:1fr}}

.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  padding:16px;
}
.card-head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px}
.card h3{margin:0; font-size:16px}

.muted{color:var(--muted)}
.micro{font-size:12px}
.note{margin-top:12px; padding:12px; border:1px solid var(--border); border-radius:14px; background:#f8fafc}

/* Table */
.table-wrap{overflow:auto; border-radius:14px; border:1px solid var(--border)}
.table{width:100%; border-collapse:collapse; background:var(--surface)}
.table th,.table td{padding:10px 12px; text-align:left; border-bottom:1px solid var(--border); font-size:14px}
.table th{background:#f1f5f9; color:#0f172a; font-weight:700}
.table tr:last-child td{border-bottom:0}

/* Inputs / Buttons */
.search-row{display:flex; gap:10px; align-items:center; margin:10px 0 8px}
.input{
  flex:1;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  outline:none;
  font-size:14px;
}
.input:focus{border-color:rgba(14,165,233,.55); box-shadow:0 0 0 4px rgba(14,165,233,.12)}

.btn{
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  padding:11px 14px;
  border-radius:14px;
  font-weight:700;
  cursor:pointer;
}
.btn:hover{box-shadow:var(--shadow-sm)}
.btn.primary{background:linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff; border-color:transparent}

/* Charts + Maps */
.chart{width:100%; height:320px}
.map{height:420px; border-radius:var(--radius); border:1px solid var(--border)}
.embed{border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); background:#fff}
.embed iframe{width:100%; height:420px; border:0; display:block}

/* Footer */
.site-footer{border-top:1px solid var(--border); background:#fff}
.footer-grid{display:grid; grid-template-columns: 1.1fr .9fr .9fr .9fr; gap:18px; padding:22px 0}
@media (max-width: 920px){.footer-grid{grid-template-columns:1fr 1fr}}
@media (max-width: 560px){.footer-grid{grid-template-columns:1fr}}

.footer-brand{display:flex; gap:10px; align-items:flex-start}
.footer-links{list-style:none; padding:0; margin:8px 0 0 0}
.footer-links li{margin:6px 0}
.footer-links a{text-decoration:none; color:var(--muted); font-weight:600}
.footer-links a:hover{color:var(--text)}
.footer-bottom{padding:12px 0 18px; border-top:1px solid var(--border)}

/* Skeleton */
.skeleton{color:var(--muted-2)}

/* Power BI Embed */
.pbi-embed{
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
}

/* 16:9 por defeito */
.pbi-embed::before{
  content:"";
  display:block;
  padding-top: 56.25%;
}

.pbi-embed iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}
