/* ============================================================
   GERADOR DE FORMATOS — estilos próprios
   Herda os tokens de styles.css (--purple, --cream, --serif...)
   ============================================================ */

.fmt-boot { padding: 60px; text-align: center; color: var(--ink-soft); }

/* ---------- casca ---------- */
.fmt-wrap { max-width: 1180px; margin: 0 auto; padding: 30px 28px 90px; }

.fmt-top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.fmt-top .eyebrow {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--purple-500); margin-bottom: 6px;
}
.fmt-top h1 { font-size: 38px; letter-spacing: -.5px; }
.fmt-top p { color: var(--ink-soft); margin: 8px 0 0; max-width: 560px; font-size: 14px; }
.fmt-top .voltar {
  font-size: 13px; color: var(--purple-700); display: inline-flex;
  align-items: center; gap: 6px; white-space: nowrap;
}

.fmt-tabs { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.fmt-tabs button {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft);
  padding: 9px 18px; border-radius: 999px; font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: .12s;
}
.fmt-tabs button:hover { border-color: var(--purple-300); color: var(--purple); }
.fmt-tabs button.on { background: var(--purple); border-color: var(--purple); color: #fff; }

/* ---------- briefing ---------- */
.fmt-brief {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 24px 26px; margin-bottom: 26px;
}
.fmt-brief h2 { font-size: 19px; margin-bottom: 4px; }
.fmt-brief .sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 18px; }

.fmt-row { display: grid; grid-template-columns: 260px 1fr; gap: 16px; margin-bottom: 14px; }
.fmt-field label {
  display: block; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--purple-500); font-weight: 700; margin-bottom: 6px;
}
.fmt-field input, .fmt-field select, .fmt-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; font: inherit; font-size: 14px; background: var(--cream-2);
  color: var(--ink); resize: vertical;
}
.fmt-field textarea { min-height: 74px; line-height: 1.5; }
.fmt-field input:focus, .fmt-field select:focus, .fmt-field textarea:focus {
  outline: none; border-color: var(--purple-300); background: #fff;
}
.fmt-field .hint { font-size: 12px; color: var(--ink-soft); margin-top: 5px; }

.fmt-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.fmt-chips button {
  border: 1px solid var(--line); background: var(--cream-2); color: var(--ink-soft);
  padding: 7px 13px; border-radius: 999px; font: inherit; font-size: 12.5px;
  font-weight: 600; cursor: pointer; transition: .12s;
}
.fmt-chips button:hover { border-color: var(--purple-300); }
.fmt-chips button.on { background: var(--purple-100); border-color: var(--purple-300); color: var(--purple); }

.fmt-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.btn-main {
  background: var(--purple); color: #fff; border: none; padding: 12px 26px;
  border-radius: 999px; font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: .12s;
}
.btn-main:hover { background: var(--purple-700); }
.btn-ghost {
  background: var(--paper); color: var(--purple); border: 1px solid var(--purple-300);
  padding: 12px 20px; border-radius: 999px; font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: .12s;
}
.btn-ghost:hover { background: var(--purple-100); }
.btn-mini {
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.btn-mini:hover { border-color: var(--purple-300); color: var(--purple); }

/* ---------- alerta do cliente ---------- */
.fmt-alerta {
  background: var(--amber-soft); border: 1px solid #e8d2ae; border-radius: var(--radius-sm);
  padding: 13px 16px; margin-top: 16px; font-size: 13px; line-height: 1.5;
}
.fmt-alerta b { color: var(--amber); }
.fmt-alerta .vetado { color: var(--red); font-weight: 600; }

/* ---------- fichas ---------- */
.fmt-fichas { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); align-items: start; }
@media (max-width: 1080px) { .fmt-fichas { grid-template-columns: 1fr; } }

.ficha {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.ficha-head { background: var(--purple); color: #fff; padding: 16px 20px 14px; }
.ficha-head .etapa {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--purple-300); font-weight: 700; margin-bottom: 5px;
}
.ficha-head h3 { color: #fff; font-size: 21px; line-height: 1.15; }
.ficha-head .angulo { font-size: 12.5px; color: #d9c9ee; margin-top: 5px; }

.ficha-body { padding: 4px 20px 18px; flex: 1; }
.bloco { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.bloco:last-child { border-bottom: none; }
.bloco .rot {
  font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--purple-500); font-weight: 700; margin-bottom: 7px;
}
.bloco p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.bloco p + p { margin-top: 7px; }
.bloco .porque { color: var(--ink-soft); font-style: italic; }

.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.ed-item { font-size: 12.5px; line-height: 1.4; }
.ed-item span { display: block; color: var(--purple-500); font-weight: 700; font-size: 10px;
  letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 1px; }

.beats { margin: 0; padding: 0; list-style: none; counter-reset: b; }
.beats li {
  position: relative; padding-left: 26px; margin-bottom: 8px;
  font-size: 13.5px; line-height: 1.5;
}
.beats li::before {
  counter-increment: b; content: counter(b);
  position: absolute; left: 0; top: 1px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--purple-100); color: var(--purple);
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.beats li b { color: var(--purple); }

.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  background: var(--cream); border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.tag.prod-Baixa { background: var(--green-soft); border-color: #c6ddcd; color: var(--green); }
.tag.prod-Média, .tag.prod-Media { background: var(--amber-soft); border-color: #e8d2ae; color: var(--amber); }
.tag.prod-Alta  { background: var(--red-soft); border-color: #e6c4c9; color: var(--red); }

.refs a {
  display: block; padding: 9px 11px; margin-bottom: 6px;
  background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.4; color: var(--ink); text-decoration: none;
}
.refs a:hover { border-color: var(--purple-300); background: #fff; text-decoration: none; }
.refs a .rede { color: var(--purple-500); font-weight: 700; font-size: 10.5px;
  letter-spacing: 1px; text-transform: uppercase; }
.refs a .txt { color: var(--ink-soft); display: block; margin-top: 2px; }

.ficha-foot {
  border-top: 1px solid var(--line); background: var(--cream-2);
  padding: 12px 20px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.ficha-foot .ok { color: var(--green); font-size: 12px; font-weight: 700; }

/* ---------- acervo ---------- */
.fmt-filtros {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 20px;
}
.fmt-filtros .fmt-field { min-width: 165px; }
.fmt-filtros .conta { margin-left: auto; font-size: 13px; color: var(--ink-soft); }

.acervo { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .acervo { grid-template-columns: 1fr; } }
.ac-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 17px;
}
.ac-card h4 { font-size: 15px; margin-bottom: 4px; }
.ac-card .meta { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 8px; }
.ac-card p { font-size: 13px; line-height: 1.5; margin: 0 0 10px; color: var(--ink); }
.ac-card .linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- histórico ---------- */
.hist-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hist-tbl th {
  text-align: left; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--purple-500); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.hist-tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hist-tbl tr:last-child td { border-bottom: none; }
.hist-vazio { color: var(--ink-soft); padding: 26px; text-align: center; font-size: 14px; }

.saldo { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.saldo .s-item {
  background: var(--cream-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.saldo .s-item b { display: block; font-size: 13px; color: var(--purple); }
.saldo .s-item span { font-size: 12px; color: var(--ink-soft); }
.saldo .s-item.zero { opacity: .55; }

/* ---------- login ---------- */
.fmt-login {
  max-width: 380px; margin: 90px auto; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 32px;
}
.fmt-login h1 { font-size: 26px; margin-bottom: 6px; }
.fmt-login p { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 22px; }
.fmt-login .erro { color: var(--red); font-size: 13px; margin-top: 10px; }

/* ---------- avisos ---------- */
.fmt-vazio {
  background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 44px; text-align: center; color: var(--ink-soft);
}
.fmt-vazio .big { font-size: 30px; margin-bottom: 10px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--purple); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); z-index: 60;
}

@media print {
  .fmt-tabs, .fmt-brief, .ficha-foot, .fmt-top .voltar { display: none; }
  .fmt-fichas { grid-template-columns: 1fr; }
  .ficha { break-inside: avoid; box-shadow: none; }
}

/* ---------- seletor de modo (mês inteiro x uma ideia) ---------- */
.fmt-modo { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.fmt-modo button {
  flex: 1 1 260px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 16px; font: inherit;
  transition: .12s;
}
.fmt-modo button:hover { border-color: var(--purple-300); }
.fmt-modo button.on { background: var(--purple-100); border-color: var(--purple); }
.fmt-modo button b {
  display: block; font-family: var(--serif); font-size: 16px;
  color: var(--purple); font-weight: 600; margin-bottom: 2px;
}
.fmt-modo button span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }

/* tabela da grade do mês */
.hist-tbl tr[style*="cursor"] :hover { background: var(--cream-2); }
.hist-tbl td { font-size: 13px; }
