/* Águia Financeiro: painel web do usuário (index.html) e termos (termos.html).
   Tema escuro com os tons da logo: verde-petróleo (teal), preto profundo e branco.
   Todo estilo mora aqui: a CSP do painel não aceita atributo style nem <style> inline. */
html, body { height: 100%; margin: 0; background: #0b1113; color: #e7f3f1; }
#aguia-root { height: 100%; }
.ag-noscript { padding: 24px; font-family: system-ui, sans-serif; }
.ag {
  --ag-teal: #0f8a84; --ag-teal-2: #19b5ad; --ag-teal-deep: #0b5f5c; --ag-ink: #0a0f10; --ag-bg: #0b1113;
  --ag-card: #111b1d; --ag-card-2: #16242a; --ag-line: rgba(25, 181, 173, .16); --ag-line-2: rgba(25, 181, 173, .32);
  --ag-text: #e7f3f1; --ag-muted: #8fb2ae; --ag-faint: #587f7b; --ag-ok: #2fd3a0; --ag-warn: #ffc857; --ag-err: #ff5d6c;
  --ag-purple: #a78bfa; --ag-radius: 12px; --ag-radius-sm: 8px;
  --ag-font: var(--font-body, "Inter", system-ui, sans-serif); --ag-mono: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  display: grid; grid-template-columns: 224px minmax(0, 1fr); height: 100%; min-height: 0; background: var(--ag-bg);
  color: var(--ag-text); font-family: var(--ag-font); font-size: 13.5px; line-height: 1.45; overflow: hidden; position: relative;
}
.ag *, .ag *::before, .ag *::after { box-sizing: border-box; }
.ag button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.ag input, .ag select, .ag textarea { font: inherit; color: var(--ag-text); background: var(--ag-card-2); border: 1px solid var(--ag-line); border-radius: var(--ag-radius-sm); padding: 8px 10px; outline: none; width: 100%; }
.ag input:focus, .ag select:focus, .ag textarea:focus { border-color: var(--ag-teal-2); box-shadow: 0 0 0 3px rgba(25, 181, 173, .18); }
.ag input[type="checkbox"] { width: auto; }
.ag select option { background: #16242a; color: var(--ag-text); }
.ag a { color: var(--ag-teal-2); }
.ag h1, .ag h2, .ag h3 { margin: 0; font-weight: 600; letter-spacing: 0; }
.ag h2 { font-size: 19px; }
.ag h3 { font-size: 14px; color: var(--ag-text); }
.ag p { margin: 0; }
.ag .ag-muted { color: var(--ag-muted); }
.ag .ag-faint { color: var(--ag-faint); font-size: 12px; }
.ag .ag-mono { font-family: var(--ag-mono); }
.ag .ag-ok { color: var(--ag-ok); } .ag .ag-warn { color: var(--ag-warn); } .ag .ag-err { color: var(--ag-err); } .ag .ag-teal { color: var(--ag-teal-2); }
.ag .ag-right { text-align: right; }
.ag .ag-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag .ag-grow { flex: 1; }
.ag .ag-hide { display: none !important; }
.ag.solo { grid-template-columns: minmax(0, 1fr); }
.ag a.ag-btn { text-decoration: none; }

/* lateral */
.ag-side { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; background: var(--ag-ink); border-right: 1px solid var(--ag-line); overflow-y: auto; }
.ag-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.ag-brand img, .ag-brand svg { width: 38px; height: 38px; flex: none; }
.ag-brand b { display: block; font-size: 16px; letter-spacing: .02em; background: linear-gradient(90deg, #7fe3dc, #19b5ad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ag-brand small { display: block; color: var(--ag-faint); font-size: 11px; }
.ag-nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--ag-muted) !important; text-align: left; font-size: 13px; }
.ag-nav .ag-i { width: 18px; text-align: center; flex: none; }
.ag-nav:hover { background: rgba(25, 181, 173, .08); color: var(--ag-text) !important; }
.ag-nav.on { background: linear-gradient(90deg, rgba(25, 181, 173, .22), rgba(25, 181, 173, .04)); color: #fff !important; box-shadow: inset 2px 0 0 var(--ag-teal-2); }
.ag-side-foot { margin-top: auto; padding: 10px 8px 0; font-size: 11px; color: var(--ag-faint); display: flex; flex-direction: column; gap: 6px; }
.ag-nav.more { display: none; }
.ag-profile { margin: 4px 0 10px; }
.ag-profile select { background: var(--ag-card); font-size: 12.5px; }

/* principal */
.ag-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; overflow-wrap: anywhere; padding: 18px 24px 28px; }
.ag-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ag-head .ag-sub { color: var(--ag-muted); font-size: 12.5px; }
.ag-grid { display: grid; gap: 12px; }
.ag-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ag-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ag-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ag-card { background: var(--ag-card); border: 1px solid var(--ag-line); border-radius: var(--ag-radius); padding: 14px 16px; min-width: 0; }
.ag-card.accent { border-color: var(--ag-line-2); background: linear-gradient(160deg, rgba(25, 181, 173, .12), var(--ag-card) 55%); }
.ag-card + .ag-card { margin-top: 12px; }
.ag-grid > .ag-card + .ag-card { margin-top: 0; }            /* na grade quem espaça é o gap */
.ag-card h3 { margin-bottom: 8px; }
.ag-q { font-size: 12px; color: var(--ag-muted); text-transform: uppercase; letter-spacing: .08em; }
.ag-a { font-size: 22px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.ag-a.sm { font-size: 17px; }
.ag-note { font-size: 12.5px; color: var(--ag-muted); }
.ag-kpi { display: flex; flex-direction: column; gap: 2px; }

/* botões */
.ag-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; background: var(--ag-card-2); border: 1px solid var(--ag-line); color: var(--ag-text) !important; font-size: 13px; white-space: nowrap; }
.ag-btn:hover { border-color: var(--ag-line-2); background: #1a2b31; }
.ag-btn.primary { background: linear-gradient(135deg, var(--ag-teal-2), var(--ag-teal)); border-color: transparent; color: #04201e !important; font-weight: 600; }
.ag-btn.primary:hover { filter: brightness(1.08); }
.ag-btn.danger { color: var(--ag-err) !important; border-color: rgba(255, 93, 108, .35); }
.ag-btn.ghost { background: transparent; border-color: transparent; color: var(--ag-muted) !important; }
.ag-btn.sm { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.ag-btn:disabled { opacity: .5; cursor: default; }

/* tabelas e listas */
.ag-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ag-table th, .ag-table td { padding: 8px 8px; border-bottom: 1px solid var(--ag-line); text-align: left; vertical-align: middle; }
.ag-table th { color: var(--ag-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.ag-table .nw { white-space: nowrap; }
.ag-table td.num, .ag-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-table tr:hover td { background: rgba(25, 181, 173, .04); }
.ag-table .actions { white-space: nowrap; text-align: right; }
.ag-list { display: flex; flex-direction: column; gap: 6px; }
.ag-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: var(--ag-card-2); border: 1px solid transparent; }
.ag-item:hover { border-color: var(--ag-line); }
.ag-item .t { flex: 1; min-width: 0; }
.ag-item .t b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-item .t small { color: var(--ag-muted); font-size: 12px; }
.ag-item .v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ag-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: rgba(143, 178, 174, .15); color: var(--ag-muted); }
.ag-badge.ok { background: rgba(47, 211, 160, .15); color: var(--ag-ok); }
.ag-badge.warn { background: rgba(255, 200, 87, .15); color: var(--ag-warn); }
.ag-badge.err { background: rgba(255, 93, 108, .16); color: var(--ag-err); }
.ag-badge.teal { background: rgba(25, 181, 173, .16); color: var(--ag-teal-2); }
.ag-badge.purple { background: rgba(167, 139, 250, .16); color: var(--ag-purple); }
.ag-empty { padding: 22px; text-align: center; color: var(--ag-faint); }
.ag-alert { display: flex; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--ag-card-2); border-left: 3px solid var(--ag-teal-2); }
.ag-alert.bad { border-left-color: var(--ag-err); } .ag-alert.warn { border-left-color: var(--ag-warn); } .ag-alert.ok { border-left-color: var(--ag-ok); }
.ag-alert b { display: block; font-weight: 600; font-size: 13px; }
.ag-alert span { color: var(--ag-muted); font-size: 12.5px; }
.ag-alerts { display: flex; flex-direction: column; gap: 8px; }

/* barras e medidores */
.ag-bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; margin: 6px 0; }
.ag-bar i { display: block; height: 100%; background: var(--ag-teal-2); border-radius: 999px; }
.ag-bar i.warn { background: var(--ag-warn); } .ag-bar i.err { background: var(--ag-err); } .ag-bar i.purple { background: var(--ag-purple); }
.ag-meter { position: relative; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, .06); overflow: hidden; margin: 10px 0 6px; }
.ag-meter .fc { position: absolute; top: 0; bottom: 0; left: 0; background: rgba(25, 181, 173, .22); }
.ag-meter .sp { position: absolute; top: 0; bottom: 0; left: 0; background: var(--ag-teal-2); }
.ag-meter .sp.warn { background: var(--ag-warn); } .ag-meter .sp.err { background: var(--ag-err); }
.ag-meter .ce { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; }
.ag-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; justify-content: space-between; font-size: 12px; color: var(--ag-muted); }

/* formulários */
.ag-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.ag-form .full { grid-column: 1 / -1; }
.ag-field label { display: block; font-size: 12px; color: var(--ag-muted); margin-bottom: 4px; }
.ag-field .hint { font-size: 11.5px; color: var(--ag-faint); margin-top: 3px; }
.ag-check { display: flex; align-items: center; gap: 8px; padding-top: 22px; }
.ag-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ag-filters input, .ag-filters select { width: auto; min-width: 120px; }
.ag-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.ag-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ag-line); margin-bottom: 14px; }
.ag-tab { padding: 8px 12px; color: var(--ag-muted); border-bottom: 2px solid transparent; }
.ag-tab.on { color: var(--ag-text); border-bottom-color: var(--ag-teal-2); }

/* modal e toast */
.ag-overlay { position: absolute; inset: 0; background: rgba(4, 10, 12, .72); display: grid; place-items: center; z-index: 30; padding: 20px; }
.ag-modal { width: min(720px, 100%); max-height: 92%; overflow: auto; background: var(--ag-card); border: 1px solid var(--ag-line-2); border-radius: 14px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9); }
.ag-modal .mh { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--ag-line); }
.ag-modal .mh h3 { flex: 1; font-size: 15px; }
.ag-modal .mb { padding: 16px 18px; }
.ag-modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--ag-line); }
.ag-toasts { position: absolute; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.ag-toast { padding: 10px 14px; border-radius: 10px; background: #16242a; border: 1px solid var(--ag-line-2); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .8); font-size: 13px; max-width: min(360px, calc(100vw - 36px)); }
.ag-toast.success { border-color: rgba(47, 211, 160, .5); } .ag-toast.error { border-color: rgba(255, 93, 108, .5); } .ag-toast.warning { border-color: rgba(255, 200, 87, .5); }

/* gráficos */
.ag-chart { width: 100%; height: auto; display: block; }
.ag-chart text { font-family: var(--ag-font); fill: var(--ag-muted); font-size: 11px; }
.ag-chart.ag-donut { max-width: 180px; }
.ag-chart text.tot { fill: var(--ag-text); }
.ag-chart text.tot.b { font-weight: 600; }
.ag-reasons { margin: 8px 0 0 18px; padding: 0; color: var(--ag-muted); }
.ag-legend-dots { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ag-muted); margin-top: 6px; }
.ag-legend-dots i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ag-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ag-cal .d { min-height: 48px; padding: 4px 6px; border-radius: 7px; background: var(--ag-card-2); font-size: 11px; color: var(--ag-muted); overflow: hidden; }
.ag-cal .d.today { outline: 1px solid var(--ag-teal-2); }
.ag-cal .d.has { color: var(--ag-text); }
.ag-cal .d b { display: block; font-size: 11.5px; }
.ag-cal .d .v { color: var(--ag-warn); font-size: 11px; }
.ag-cal .d .v.over { color: var(--ag-err); }
.ag-cal .wd { text-align: center; font-size: 10.5px; color: var(--ag-faint); text-transform: uppercase; }

/* boas-vindas */
.ag-welcome { max-width: 560px; margin: 40px auto; text-align: center; }
.ag-welcome svg, .ag-welcome img { width: 120px; height: 120px; margin-bottom: 14px; }
.ag-welcome h2 { font-size: 24px; margin-bottom: 6px; }
.ag-welcome p { color: var(--ag-muted); margin-bottom: 18px; }
.ag-welcome .ag-card { text-align: left; margin-top: 12px; }
.ag-welcome .ag-legal { margin: 22px 0 0; }

/* termos */
.ag-terms { max-width: 720px; width: 100%; margin: 0 auto; }
.ag-terms h1 { font-size: 22px; margin-bottom: 4px; }
.ag-terms h2 { font-size: 16px; margin: 20px 0 6px; }
.ag-terms p, .ag-terms li { color: var(--ag-muted); margin: 0 0 8px; }
.ag-terms ul { padding-left: 20px; margin: 0 0 8px; }


/* celular: abaixo de 720 px a lateral vira barra inferior com 4 telas e "Mais" (DESIGN 6.3) */
@media (max-width: 720px) {
  .ag { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .ag-side { order: 2; flex-direction: row; justify-content: space-around; overflow: hidden; padding: 4px; gap: 2px; border-right: 0; border-top: 1px solid var(--ag-line); }
  .ag-side .ag-brand, .ag-side .ag-side-foot, .ag-side .ag-profile { display: none; }
  .ag-nav { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 10.5px; text-align: center; }
  .ag-nav:not(.m) { display: none; }
  .ag-nav.more { display: flex; }
  .ag-nav .lb { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ag-nav.on { box-shadow: inset 0 2px 0 var(--ag-teal-2); }
  .ag-main { order: 1; padding: 12px 12px 16px; }
  .ag-grid.c2, .ag-grid.c3, .ag-grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .ag-form { grid-template-columns: minmax(0, 1fr); }
  .ag .opt { display: none; }
  .ag-card { padding: 12px; }
  .ag-overlay { padding: 10px; }
  .ag-toasts { left: 12px; right: 12px; bottom: 76px; }
}
