/* Design system compartilhado — Buscador de Oportunidades (Pregio Consórcios).
   Tema claro/contemporâneo: fundo branco, navy + gold como acento de marca. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e4e8ee;
  --border-strong: #cdd5e0;
  --navy: #0a2350;
  --navy-deep: #011435;
  --steel: #4B7D9B;
  --steel-light: #dde9f1;
  --gold: #c9993f;
  --gold-bg: #fbf1dd;
  --green: #15803d;
  --green-bg: #e7f6ec;
  --amber: #92650a;
  --amber-bg: #fff6e5;
  --amber-border: #f0c675;
  --red: #b91c1c;
  --red-bg: #fdecec;
  --red-border: #f3b4ac;
  --text: #1a2333;
  --text-dim: #64748b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 35, 70, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* CASCO: trilho de ícones navy + conteúdo */
.shell { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
  flex: none; width: 84px; background: var(--navy-deep); color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .marca { display: flex; align-items: center; justify-content: center; padding: 4px 0 16px; text-decoration: none; }
.sidebar .marca img { height: 38px; }
.sidebar .item {
  display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 14px;
  color: rgba(255,255,255,.65); text-decoration: none; transition: all .15s ease;
}
.sidebar .item span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sidebar .item svg { width: 27px; height: 27px; stroke: currentColor; fill: none; stroke-width: 1.6; flex: none; }
.sidebar .item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .item.ativo { background: rgba(255,255,255,.16); color: #fff; }
.sidebar .separador { width: 34px; height: 1px; background: rgba(255,255,255,.14); margin: auto 0 8px; }

.conteudo { flex: 1; min-width: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }

/* CABEÇALHO (dentro do conteúdo) */
header.topo { margin-bottom: 28px; }
header.topo .ttl { font-size: 21px; font-weight: 800; color: var(--navy-deep); }
header.topo .ttl span { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-top: 3px; }

@media (max-width: 480px) {
  .sidebar { width: 68px; padding: 14px 8px; }
  .sidebar .item { width: 48px; height: 48px; }
  .sidebar .item svg { width: 23px; height: 23px; }
}

/* PAINÉIS / CARTÕES DE FORMULÁRIO */
.painel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 26px 22px; box-shadow: var(--shadow);
}
.painel h1 { font-size: 21px; font-weight: 800; letter-spacing: -.3px; color: var(--navy-deep); }
.painel p.lead { font-size: 13.5px; color: var(--text-dim); margin-top: 6px; max-width: 62ch; line-height: 1.55; }

.linha { display: flex; gap: 16px; align-items: flex-end; margin-top: 20px; flex-wrap: wrap; }

label.rotulo { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-dim); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .3px; }

.campo { flex: 1; min-width: 200px; }
.campo input, .campo select {
  width: 100%; border: 1px solid var(--border-strong); background: #fbfcfd; color: var(--text);
  border-radius: 12px; padding: 13px 15px; font-size: 15.5px; font-weight: 600;
  font-family: inherit; outline: none; transition: border-color .15s ease;
}
.campo.grande input { font-size: 18px; font-weight: 700; }
.campo input:focus, .campo select:focus { border-color: var(--steel); background: #fff; }
.campo input::placeholder { color: #a3adbd; font-weight: 500; }

.campo-toggle { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; }
.switch { position: relative; width: 44px; height: 25px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #e2e8f0; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; transition: .15s; }
.slider::before { content: ""; position: absolute; width: 19px; height: 19px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--navy); border-color: var(--navy); }
.switch input:checked + .slider::before { transform: translateX(19px); }
.campo-toggle .lbl { font-size: 14px; font-weight: 600; cursor: pointer; }
.campo-toggle .lbl small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-dim); }

.btn {
  border: none; font-family: inherit; font-size: 15px; font-weight: 800;
  border-radius: 12px; padding: 14px 26px; cursor: pointer; transition: filter .15s ease, background .15s ease;
  white-space: nowrap; display: inline-block; text-decoration: none; text-align: center;
}
.btn-primario { background: var(--navy); color: #fff; }
.btn-primario:hover { background: var(--navy-deep); }
.btn-primario:disabled { opacity: .55; cursor: default; }
.btn-secundario { background: var(--surface); color: var(--navy); border: 1px solid var(--border-strong); }
.btn-secundario:hover { background: #f1f4f8; }

.erro-campo { color: var(--red); font-size: 12.5px; margin-top: 10px; display: none; font-weight: 600; }
.erro-campo.mostrar { display: block; }
.sucesso-campo { color: var(--green); font-size: 12.5px; margin-top: 10px; display: none; font-weight: 600; }
.sucesso-campo.mostrar { display: block; }

/* FAIXAS DE AVISO */
.banner {
  display: none; align-items: center; gap: 10px; padding: 13px 18px; border-radius: 12px;
  background: var(--amber-bg); border: 1px solid var(--amber-border); color: var(--amber);
  font-size: 13.5px; font-weight: 700; margin-bottom: 18px;
}
.banner.mostrar { display: flex; }
.banner svg { flex: none; width: 18px; height: 18px; stroke: var(--amber); }

.aviso-inconsistencia {
  background: var(--red-bg); border: 1px solid var(--red-border); border-radius: 12px;
  padding: 12px 16px; font-size: 13px; color: var(--red); margin-bottom: 10px; line-height: 1.5;
}
.aviso-inconsistencia b { color: var(--navy-deep); }

.secao-titulo { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); margin: 26px 0 12px; }

.notice {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  font-size: 14px; line-height: 1.55; margin-bottom: 16px; color: var(--text);
}

/* CARROSSEL */
.carrossel-row { display: flex; align-items: center; gap: 10px; }
.carrossel-wrap { flex: 1; min-width: 0; overflow: hidden; }
.carrossel {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 12px; scrollbar-width: thin;
}
.carrossel::-webkit-scrollbar { height: 6px; }
.carrossel::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.nav-seta {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--navy); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .15s ease; box-shadow: var(--shadow);
}
.nav-seta:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.nav-seta svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

.card {
  position: relative;
  flex: none; width: 272px; scroll-snap-align: start; align-self: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; cursor: pointer;
  box-shadow: var(--shadow); transition: border-color .15s ease, box-shadow .15s ease;
}
.logo-canto {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: #fff;
}
.card.card-grande { width: 544px; padding: 22px; }
.card:hover { border-color: var(--steel); box-shadow: 0 12px 30px rgba(15,35,70,.10); }
.card .badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px; margin-bottom: 11px;
}
.card .badge.carta { color: var(--green); background: var(--green-bg); }
.card .badge.grupo { color: var(--amber); background: var(--gold-bg); }
.card .badge.fora { color: var(--red); background: var(--red-bg); }
.card .credito { font-size: 21px; font-weight: 800; color: var(--navy-deep); line-height: 1.15; }
.card .credito small { display: flex; align-items: center; font-size: 11.5px; font-weight: 600; color: var(--text-dim); margin-top: 4px; }
.logo-mini { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; margin-right: 6px; flex: none; }
.card .sub { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }
.card .sub b { color: var(--text); font-weight: 700; }
.card .toggle-detalhe { font-size: 11px; color: var(--steel); margin-top: 10px; font-weight: 700; }

.card .detalhes { display: none; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--border); }
.card.expandido .detalhes { display: block; }
.card.expandido .toggle-detalhe { display: none; }
.card .detalhes .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.card .detalhes .grid div { font-size: 11px; color: var(--text-dim); }
.card .detalhes .grid div b { display: block; font-size: 13.5px; color: var(--text); font-weight: 700; margin-top: 2px; }
.card .detalhes .hist { font-size: 11px; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }
.card .detalhes .atualizado { font-size: 10.5px; color: var(--text-dim); margin-top: 10px; }
.card .detalhes .atualizado.stale { color: var(--amber); font-weight: 700; }

.hint { font-size: 11.5px; color: var(--text-dim); text-align: center; margin-top: 24px; line-height: 1.5; }

/* BUSCA COM PAINEL FIXO À ESQUERDA (grupos.html) */
.wrap-largo { max-width: 1560px; }
.busca-layout { display: flex; align-items: flex-start; gap: 24px; }
.busca-painel { flex: none; width: 320px; position: sticky; top: 24px; }
.busca-painel .campo { margin-top: 16px; }
.busca-painel .campo:first-child { margin-top: 0; }
.busca-conteudo { flex: 1; min-width: 0; }
.historico-buscas { max-height: 320px; overflow-y: auto; margin-top: 10px; }
.historico-item {
  padding: 10px 0; border-top: 1px solid var(--border); font-size: 12.5px; cursor: pointer;
  transition: opacity .15s ease;
}
.historico-item:hover { opacity: .7; }
.historico-item .cliente { font-weight: 700; color: var(--text); }
.historico-item .info { color: var(--text-dim); margin-top: 2px; }

.card .destaques { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.card .destaques div { font-size: 11px; color: var(--text-dim); }
.card .destaques div b { display: block; font-size: 16px; color: var(--navy-deep); font-weight: 800; margin-top: 2px; }
.valor-riscado { text-decoration: line-through; color: var(--text-dim) !important; }
.card .meses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.card .meses-grid div { font-size: 10.5px; color: var(--text-dim); text-align: center; background: var(--gold-bg); border-radius: 10px; padding: 8px 4px; }
.card .meses-grid div b { display: block; font-size: 15px; color: var(--navy-deep); font-weight: 800; margin-top: 2px; }

.btn-mes-seta {
  border: 1px solid var(--border-strong); background: #fff; border-radius: 6px; width: 20px; height: 20px;
  font-size: 13px; line-height: 1; cursor: pointer; color: var(--navy); margin: 0 5px; vertical-align: middle; padding: 0;
}
.btn-mes-seta:disabled { opacity: .3; cursor: default; }
.btn-mes-seta:hover:not(:disabled) { background: var(--navy); color: #fff; }

@media (max-width: 1080px) {
  .busca-layout { flex-direction: column; }
  .busca-painel { width: 100%; position: static; }
}

/* LADRILHOS DA PÁGINA INICIAL */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: all .15s ease; display: flex; flex-direction: column; gap: 14px;
}
.tile:hover { border-color: var(--steel); box-shadow: 0 14px 34px rgba(15,35,70,.12); transform: translateY(-2px); }
.tile .icone {
  width: 46px; height: 46px; border-radius: 12px; background: var(--gold-bg);
  display: flex; align-items: center; justify-content: center;
}
.tile .icone svg { width: 24px; height: 24px; stroke: var(--amber); fill: none; stroke-width: 1.7; }
.tile h2 { font-size: 17px; font-weight: 800; color: var(--navy-deep); }
.tile p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.tile .seta { margin-top: auto; font-size: 12.5px; font-weight: 700; color: var(--steel); }

@media (max-width: 880px) {
  .tiles { grid-template-columns: 1fr; }
}

/* TABELA SIMPLES (admin) */
table.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tabela th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-dim); padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.tabela td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text); }
table.tabela tr:last-child td { border-bottom: none; }

@media (max-width: 640px) {
  .wrap { padding: 20px 14px 40px; }
  .painel { padding: 20px; }
  .linha { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .card { width: 240px; }
}
