/* fm-ui.css — backoffice Franks Media */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --tinta: #0B1F3A;
  --tinta-suave: #5B6B85;
  --acao: #0B63F6;
  --acao-forte: #0A4FC7;
  --acao-fraca: #E9F0FE;
  --fundo: #F4F7FB;
  --superficie: #FFFFFF;
  --linha: #E3E9F2;
  --linha-forte: #C9D5E5;
  --erro: #D93025;
  --erro-fraca: #FDECEA;
  --raio: 10px;
  --raio-g: 14px;
  --sombra: 0 1px 2px rgba(11, 31, 58, 0.06);
  --sombra-alta: 0 12px 40px rgba(11, 31, 58, 0.12);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--fundo);
  color: var(--tinta);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--acao); }

.marca {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ---------- topo ---------- */

.topo {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 26px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linha);
}

.topo .marca { font-size: 18px; }

.topo .modulo {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--acao);
  background: var(--acao-fraca);
  padding: 4px 9px;
  border-radius: 100px;
}

.topo .espaco { flex: 1; }

.topo .quem { font-size: 13px; color: var(--tinta-suave); font-weight: 500; }

/* ---------- estrutura ---------- */

.pagina {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 26px 90px;
}

.cabecalho {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.cabecalho h1 {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 800;
  font-size: 32px;
  margin: 0;
  letter-spacing: -0.035em;
}

.cabecalho .contagem {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tinta-suave);
  background: var(--superficie);
  border: 1px solid var(--linha);
  padding: 3px 9px;
  border-radius: 100px;
}

.cabecalho .espaco { flex: 1; }

/* ---------- controles ---------- */

.botao {
  font: inherit;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--raio);
  border: 1px solid var(--acao);
  background: var(--acao);
  color: #fff;
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.1s ease;
  box-shadow: 0 1px 2px rgba(11, 99, 246, 0.25);
}

.botao:hover { background: var(--acao-forte); border-color: var(--acao-forte); }
.botao:active { transform: translateY(1px); }
.botao:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

.botao.secundario {
  background: var(--superficie);
  color: var(--tinta);
  border-color: var(--linha-forte);
  box-shadow: none;
}

.botao.secundario:hover { background: var(--acao-fraca); border-color: var(--acao); color: var(--acao); }

.botao.risco {
  background: var(--superficie);
  border-color: rgba(217, 48, 37, 0.35);
  color: var(--erro);
  box-shadow: none;
}

.botao.risco:hover { background: var(--erro-fraca); border-color: var(--erro); }

:is(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--acao);
  outline-offset: 2px;
}

.campo { margin-bottom: 15px; }

.campo label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--tinta-suave);
  margin-bottom: 6px;
}

.campo input[type="text"],
.campo input[type="email"],
.campo input[type="password"],
.campo select,
.campo textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--linha-forte);
  border-radius: var(--raio);
  background: var(--superficie);
  color: var(--tinta);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.campo :is(input, select, textarea):focus {
  border-color: var(--acao);
  box-shadow: 0 0 0 3px rgba(11, 99, 246, 0.14);
  outline: none;
}

.campo textarea { min-height: 78px; resize: vertical; }

.linha-campos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 14px;
}

.marcador {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  background: var(--superficie);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.marcador:hover { border-color: var(--linha-forte); }
.marcador:has(input:checked) { border-color: var(--acao); background: var(--acao-fraca); }
.marcador input { accent-color: var(--acao); width: 16px; height: 16px; }

/* ---------- filtros ---------- */

.filtros {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filtros input[type="search"] {
  flex: 1;
  min-width: 200px;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--linha-forte);
  border-radius: var(--raio);
  background: var(--superficie);
}

.filtros input[type="search"]:focus {
  border-color: var(--acao);
  box-shadow: 0 0 0 3px rgba(11, 99, 246, 0.14);
  outline: none;
}

.filtros select {
  font: inherit;
  font-weight: 500;
  padding: 10px 14px;
  border: 1px solid var(--linha-forte);
  border-radius: var(--raio);
  background: var(--superficie);
  color: var(--tinta);
}

/* ---------- lista ---------- */

.lista {
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio-g);
  overflow: hidden;
  box-shadow: var(--sombra);
}

.item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-top: 1px solid var(--linha);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}

.item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--acao);
  transform: scaleY(0);
  transition: transform 0.16s ease;
}

.item:hover::before { transform: scaleY(1); }
.item:first-child { border-top: 0; }
.item:hover { background: #F8FAFE; }

.item .principal { flex: 1; min-width: 0; }

.item .nome {
  display: block;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item .detalhe {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tinta-suave);
  margin-top: 3px;
}

.selo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.selo.fixo { background: var(--acao); color: #fff; }
.selo.avulso { background: var(--acao-fraca); color: var(--acao-forte); }
.selo.neutro { background: #EEF2F8; color: var(--tinta-suave); }
.selo.pausado { background: transparent; border-color: var(--linha-forte); color: var(--tinta-suave); }

.vazio {
  padding: 52px 26px;
  text-align: center;
  color: var(--tinta-suave);
  font-size: 14px;
}

/* ---------- painel lateral ---------- */

.veu {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.veu.aberto { opacity: 1; pointer-events: auto; }

.painel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(540px, 100%);
  background: var(--superficie);
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sombra-alta);
}

.painel.aberto { transform: translateX(0); }

.painel-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--linha);
}

.painel-topo h2 {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.03em;
  margin: 0;
  flex: 1;
}

.painel-corpo { flex: 1; overflow-y: auto; padding: 22px 24px 36px; }

.painel-rodape {
  display: flex;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid var(--linha);
  background: var(--fundo);
}

.painel-rodape .espaco { flex: 1; }

.secao {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--acao);
}

.secao::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--linha);
}

.secao:first-child { margin-top: 0; }

.fechar {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--tinta-suave);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--raio);
}

.fechar:hover { background: var(--fundo); color: var(--tinta); }

/* ---------- avisos ---------- */

.aviso {
  padding: 11px 14px;
  border-radius: var(--raio);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid;
}

.aviso.erro {
  background: var(--erro-fraca);
  border-color: rgba(217, 48, 37, 0.28);
  color: var(--erro);
}

.aviso.oculto { display: none; }

.recado {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 20px);
  background: var(--tinta);
  color: #fff;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 90;
  box-shadow: var(--sombra-alta);
}

.recado.visivel { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 620px) {
  .topo { padding: 12px 16px; }
  .topo .modulo { display: none; }
  .pagina { padding: 22px 16px 70px; }
  .cabecalho h1 { font-size: 25px; }
  .item { padding: 15px 16px; }
  .painel-corpo { padding: 20px 18px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- navegação de módulos ---------- */

.topo nav { display: flex; gap: 4px; }

.topo nav a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--tinta-suave);
  padding: 7px 13px;
  border-radius: 8px;
  transition: background 0.14s ease, color 0.14s ease;
}

.topo nav a:hover { background: var(--fundo); color: var(--tinta); }
.topo nav a[aria-current="page"] { background: var(--acao-fraca); color: var(--acao); }

/* ---------- painel ---------- */

.modulos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.modulo-cartao {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio-g);
  padding: 24px 22px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.modulo-cartao:hover {
  border-color: var(--acao);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 31, 58, 0.08);
}

.modulo-cartao.futuro {
  opacity: 0.62;
  pointer-events: none;
  background: transparent;
  border-style: dashed;
}

.modulo-cartao h3 {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}

.modulo-cartao p { margin: 0; font-size: 14px; color: var(--tinta-suave); }

.modulo-cartao .numero {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.04em;
  color: var(--acao);
  margin-bottom: 10px;
  line-height: 1;
}

.modulo-cartao .numero.quieto { color: var(--linha-forte); }

/* ---------- dado auxiliar ---------- */

.dica {
  font-size: 13px;
  color: var(--tinta-suave);
  margin: -8px 0 16px;
}

.dica strong { color: var(--tinta); font-weight: 700; }

.valor-mono {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
}
