/* ==========================================================================
   Angola Transparente — Design System (partilhado)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Verdes */
  --g-980: #021712;
  --g-950: #04201a;
  --g-900: #062b22;
  --g-850: #08352a;
  --g-800: #0a4134;
  --g-700: #0d5443;
  --primary: #0d5a45;
  --primary-hover: #0b4a39;
  --mint: #3ddc9a;
  --mint-2: #2bc488;
  --mint-soft: #e5f6ee;
  --mint-softer: #f1faf6;

  /* Neutros */
  --bg: #f4f7f6;
  --surface: #ffffff;
  --border: #e3ebe7;
  --border-2: #edf2f0;
  --text: #0e1f1a;
  --text-2: #33443e;
  --muted: #66766f;
  --muted-2: #8f9c97;

  /* Acentos */
  --blue: #3567d6;
  --blue-soft: #e9f0fd;
  --purple: #7b5bd6;
  --purple-soft: #f0ebfd;
  --orange: #d9821f;
  --orange-soft: #fdf2e2;
  --red: #d84a4a;
  --red-soft: #fdeaea;
  --pink: #e0596f;
  --pink-soft: #fdebee;

  /* Sectores (gráficos) */
  --c1: #0b3f31;
  --c2: #1a8a63;
  --c3: #3ddc9a;
  --c4: #8fa8c8;
  --c5: #b9c4d6;
  --c6: #23584a;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-xs: 0 1px 2px rgba(10, 40, 30, .05);
  --shadow-sm: 0 1px 3px rgba(10, 40, 30, .06), 0 1px 2px rgba(10, 40, 30, .04);
  --shadow: 0 6px 20px -6px rgba(10, 40, 30, .12), 0 2px 6px rgba(10, 40, 30, .04);
  --shadow-lg: 0 24px 50px -16px rgba(6, 43, 34, .25);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;

  --sidebar-w: 236px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -.02em; color: var(--text); }
p { margin: 0; }
[data-lucide], .lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }

::selection { background: var(--mint); color: var(--g-950); }

/* ---------- Utilitários ---------- */
.text-mint { color: var(--mint); }
.text-green { color: var(--primary); }
.text-muted { color: var(--muted); }
.text-red { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn [data-lucide], .btn .lucide { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.btn:hover .i-arrow { transform: translateX(3px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(13, 90, 69, .55); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-mint { background: var(--mint); color: var(--g-950); box-shadow: 0 10px 30px -8px rgba(61, 220, 154, .6); }
.btn-mint:hover { background: #55e6aa; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: #c9d6d0; background: #fafcfb; }
.btn-ghost-dark { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .22); color: #fff; }
.btn-ghost-dark:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 14.5px; border-radius: 12px; }
.btn-pill { border-radius: 999px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 12.5px; color: var(--primary);
}
.link-arrow [data-lucide], .link-arrow .lucide { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.link-arrow:hover [data-lucide], .link-arrow:hover .lucide { transform: translateX(3px); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge-green { background: var(--mint-soft); color: #128157; }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: #eef2f0; color: var(--muted); }

.delta {
  display: inline-flex; align-items: center; gap: 3px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600;
  background: var(--mint-soft); color: #128157;
}
.delta [data-lucide], .delta .lucide { width: 12px; height: 12px; stroke-width: 2.4; }

.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: #eef3f1; color: var(--text-2);
}

/* ---------- Ícone em quadrado ---------- */
.ico {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--mint-soft); color: var(--primary);
  flex-shrink: 0;
}
.ico [data-lucide], .ico .lucide { width: 20px; height: 20px; }
.ico.sm { width: 34px; height: 34px; border-radius: 9px; }
.ico.sm [data-lucide], .ico.sm .lucide { width: 16px; height: 16px; }
.ico.lg { width: 52px; height: 52px; border-radius: 14px; }
.ico.blue { background: var(--blue-soft); color: var(--blue); }
.ico.purple { background: var(--purple-soft); color: var(--purple); }
.ico.orange { background: var(--orange-soft); color: var(--orange); }
.ico.red { background: var(--red-soft); color: var(--red); }
.ico.pink { background: var(--pink-soft); color: var(--pink); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-hover { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d5e2dc; }

/* ---------- Form controls ---------- */
.input {
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus-within { border-color: var(--mint-2); box-shadow: 0 0 0 4px rgba(61, 220, 154, .15); }
.input [data-lucide], .input .lucide { width: 17px; height: 17px; color: var(--muted-2); }
.input input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; font-size: 13.5px; }
.input input::placeholder { color: var(--muted-2); }

.select {
  position: relative; display: inline-flex; align-items: center;
}
.select select {
  appearance: none; -webkit-appearance: none;
  height: 36px; padding: 0 34px 0 12px;
  border: 1px solid var(--border); border-radius: 9px; background: #fff;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer;
  transition: border-color .2s;
}
.select select:hover { border-color: #c9d6d0; }
.select select:focus { outline: 0; border-color: var(--mint-2); }
.select::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg); pointer-events: none;
}

/* ==========================================================================
   App shell — Sidebar + Topbar
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(61, 220, 154, .09), transparent 60%),
    linear-gradient(180deg, var(--g-900), var(--g-980));
  color: #cfe0d9;
  border-right: 1px solid rgba(255, 255, 255, .04);
  transition: transform .35s var(--ease);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 15px; line-height: 1.12; color: #fff; letter-spacing: -.01em; }
.brand-sub { font-size: 10.5px; color: #8fb1a5; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: #c3d6cf;
  transition: background .2s, color .2s;
}
.nav a [data-lucide], .nav a .lucide { width: 18px; height: 18px; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active {
  background: linear-gradient(90deg, rgba(61, 220, 154, .18), rgba(61, 220, 154, .06));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(61, 220, 154, .16);
}
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--mint);
}
.nav a.active [data-lucide], .nav a.active .lucide { color: var(--mint); opacity: 1; }

.sidebar-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-size: 11px; line-height: 1.35; color: #8fb1a5;
}
.flag-ao { width: 30px; height: 20px; border-radius: 4px; overflow: hidden; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 68px; padding: 0 32px;
  background: rgba(244, 247, 246, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-2);
}
.topbar .search {
  display: flex; align-items: center; gap: 10px;
  width: min(440px, 100%); height: 40px; padding: 0 8px 0 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  transition: border-color .2s, box-shadow .2s;
}
.topbar .search:focus-within { border-color: var(--mint-2); box-shadow: 0 0 0 4px rgba(61, 220, 154, .14); }
.topbar .search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; min-width: 0; }
.topbar .search input::placeholder { color: var(--muted-2); }
.topbar .search [data-lucide], .topbar .search .lucide { width: 16px; height: 16px; color: var(--muted-2); }
.kbd {
  display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 7px;
  border-radius: 6px; background: #f1f4f3; border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2);
  transition: background .2s;
}
.icon-btn:hover { background: rgba(13, 90, 69, .07); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--bg); }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border); }
.user-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-role { font-size: 11.5px; color: var(--muted); }
.menu-btn { display: none; }

/* Topbar escura (dentro do hero do painel) */
.topbar.dark { position: relative; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar.dark .search { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); color: #fff; }
.topbar.dark .search input { color: #fff; }
.topbar.dark .search input::placeholder { color: #8fb1a5; }
.topbar.dark .search [data-lucide], .topbar.dark .search .lucide { color: #8fb1a5; }
.topbar.dark .kbd { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #a9c4ba; }
.topbar.dark .icon-btn { color: #dbe9e3; }
.topbar.dark .icon-btn:hover { background: rgba(255,255,255,.07); }
.topbar.dark .icon-btn .dot { box-shadow: 0 0 0 2px var(--g-900); }
.topbar.dark .user-name { color: #fff; }
.topbar.dark .user-role { color: #8fb1a5; }
.topbar.dark .user img { box-shadow: 0 0 0 2px rgba(255,255,255,.15); }

.content { padding: 28px 32px 48px; width: 100%; max-width: 1480px; }

/* ---------- Page head ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.crumbs a:hover { color: var(--primary); }
.crumbs [data-lucide], .crumbs .lucide { width: 13px; height: 13px; }
.crumbs .current { color: var(--text); font-weight: 600; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 12px 14px; border: 0; background: none;
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: color .2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeUp .35s var(--ease) forwards; }

/* ---------- Chips (filtros em pílula) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  transition: all .2s var(--ease);
}
.chip:hover { border-color: #c4d3cc; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(13, 90, 69, .6); }

/* ---------- Tabela ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: #fbfcfc;
}
.table td { padding: 16px; border-bottom: 1px solid var(--border-2); white-space: nowrap; color: var(--text-2); }
.table tbody tr { transition: background .15s; cursor: pointer; }
.table tbody tr:hover { background: #f7fbf9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .ref { font-weight: 600; color: var(--text); }
.table .num { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text); }
.row-menu { border: 0; background: none; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.row-menu:hover { background: #eef3f1; color: var(--text); }

.pagination { display: flex; align-items: center; gap: 4px; }
.pagination button {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  display: grid; place-items: center; transition: background .2s;
}
.pagination button:hover { background: #eef3f1; }
.pagination button.active { background: var(--mint-soft); color: var(--primary); border-color: #cdebdc; }
.pagination [data-lucide], .pagination .lucide { width: 15px; height: 15px; }

/* ---------- Gráficos (SVG) ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .axis text, .chart text.axis { font-size: 11px; fill: var(--muted-2); font-family: var(--font); }
.chart .grid line { stroke: #edf1ef; stroke-dasharray: 3 4; }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  padding: 7px 11px; border-radius: 8px;
  background: var(--g-950); color: #fff; font-size: 11px; line-height: 1.3;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.45);
  transform: translate(-50%, calc(-100% - 14px));
  white-space: nowrap; transition: opacity .15s;
}
.chart-tooltip b { display: block; font-size: 13.5px; font-weight: 700; }
.chart-tooltip span { color: #9fc3b6; }
.chart-tooltip::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: var(--g-950); transform: rotate(45deg); border-radius: 2px; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.legend li i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend li b { margin-left: auto; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.legend-inline { display: flex; gap: 18px; font-size: 11.5px; color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 9px; height: 9px; border-radius: 2px; }

/* ---------- Animações ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes flow { to { stroke-dashoffset: -40; } }
.reveal { opacity: 0; animation: fadeUp .7s var(--ease) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .19s; }
.d4 { animation-delay: .26s; } .d5 { animation-delay: .33s; } .d6 { animation-delay: .4s; }

/* ---------- Responsivo (shell) ---------- */
.backdrop { display: none; }
@media (max-width: 1080px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(2, 23, 18, .45); }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .topbar, .content { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 640px) {
  .user-meta, .kbd { display: none; }
  .page-head { flex-direction: column; }
  .page-title { font-size: 24px; }
}
