/* ==========================================================
   Estilo compartilhado por todas as páginas da plataforma.
   Mude as cores aqui e todas as ferramentas acompanham.
   ========================================================== */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #1c1f24;
  --muted: #5f6672;
  --border: #d8dce2;
  --accent: #1f6feb;
  --accent-soft: #e3edff;
  --warn-bg: #fff6e0;
  --warn-text: #7a5600;
  --ok: #1a7f37;
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --surface-2: #232730;
    --text: #e6e8eb;
    --muted: #9aa1ac;
    --border: #2f343d;
    --accent: #4c8dff;
    --accent-soft: #1d2b45;
    --warn-bg: #3a2f12;
    --warn-text: #f3d27a;
    --ok: #4cc26b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ---------- Cabeçalho ---------- */
.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topo a { color: var(--text); text-decoration: none; }
.topo .marca { font-weight: 700; }
.topo .voltar { color: var(--accent); font-size: 0.95rem; }
.topo .sep { color: var(--muted); }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* ---------- Página inicial ---------- */
.busca {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  display: block;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.tag {
  display: inline-block;
  margin-top: 10px;
  margin-right: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Formulários das calculadoras ---------- */
.painel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.campos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }

input, select {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input.invalido { outline: 2px solid #d1242f; }

.resultados {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.resultado {
  padding: 14px;
  border-radius: 8px;
  background: var(--accent-soft);
}
.resultado .rotulo { font-size: 0.85rem; color: var(--muted); }
.resultado .valor { font-size: 1.5rem; font-weight: 700; font-family: var(--mono); }
.resultado .valor small { font-size: 0.9rem; font-weight: 400; }
.resultado.destaque { background: var(--accent); color: #fff; }
.resultado.destaque .rotulo { color: rgba(255, 255, 255, 0.85); }

.aviso {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.9rem;
}

.formula {
  font-family: var(--mono);
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
}

/* ---------- Tabelas (catálogos) ---------- */
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: var(--surface-2); font-size: 0.85rem; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-family: var(--mono); }
tr:hover td { background: var(--surface-2); }
td img { width: 48px; height: 48px; object-fit: contain; }

.filtros { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.filtros > div { flex: 1 1 180px; }

.vazio { color: var(--muted); padding: 20px 0; }


.toolboxBtn{
    border-radius: 10px;
    padding: 10px;
    background-color: white;
    width: fit-content;
    height: fit-content;
    color: #111317;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
}

.toolboxBtn:hover{
    background-color: #4c8dff;
    color: whitesmoke;
}

.sairBtn{
    border-radius: 10px;
    padding: 10px;
    background-color: white;
    width: fit-content;
    height: fit-content;
    color: #111317;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
}

.sairBtn:hover{
    background-color: #4c8dff;
    color: whitesmoke;
}
