:root {
  --bg: #100c17;
  --surface: #161120;      /* card externo */
  --surface-2: #1c1628;    /* painel interno / upload */
  --surface-3: #221b30;    /* stat card, inputs de filtro */
  --topbar: linear-gradient(180deg, #1b1526, #171120);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2eef8;
  --muted: #9a92a8;
  --muted-2: #8a8598;
  --dim: #6f6880;
  --pink: #ff5c8f;
  --pink-strong: #ff2f8e;
  --purple: #7b2ff7;
  --purple-soft: #a77bff;
  --orange: #ff5a37;
  --accent: linear-gradient(135deg, #7b2ff7, #ff2f8e 60%, #ff5a37);
  --accent-2: linear-gradient(135deg, #7b2ff7, #ff2f8e);
  --accent-text: linear-gradient(120deg, #a77bff, #ff2f8e);
  --success: #34d399;
  --success-text: #8ef0c4;
  --success-bg: linear-gradient(120deg, rgba(52,211,153,0.12), rgba(52,211,153,0.04));
  --success-border: rgba(52, 211, 153, 0.28);
  --amber: #ffb020;
  --amber-text: #ffce7a;
  --amber-num: #ffc861;
  --danger: #ff6b6b;
  --danger-bg: rgba(255, 77, 77, 0.1);
  --danger-border: rgba(255, 77, 77, 0.32);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-card: 0 40px 90px -40px rgba(0, 0, 0, 0.8);
  --shadow-accent: 0 14px 30px -12px rgba(255, 47, 142, 0.75);
}

* { box-sizing: border-box; }

/* o atributo `hidden` precisa vencer qualquer `display` de classe (ex.: .campo,
   .passo) que tenha a mesma especificidade. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(123, 47, 247, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 0% 110%, rgba(255, 77, 46, 0.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(224, 33, 138, 0.35); color: #fff; }

@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- marca HUB ---------- */

.marca-hub {
  display: flex;
  justify-content: center;
  padding: 40px 20px 8px;
}
.marca-hub img { height: 96px; width: auto; display: block; }

/* ---------- topo ---------- */

header.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1280px;
  margin: 12px auto 0;
  padding: 20px 32px;
  background: var(--topbar);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.topo-marca { display: flex; align-items: center; gap: 16px; }
.topo-icone {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(123,47,247,0.25), rgba(255,47,142,0.25));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--pink);
}
header.topo h1 { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; }
.topo-sub { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted-2); }

.botao-icone {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.botao-icone:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }

/* ---------- stepper ---------- */

nav.stepper {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  max-width: 1280px; margin: 0 auto;
  padding: 32px 20px 8px;
}
.step {
  display: flex; align-items: center; gap: 12px;
  background: none; border: none; padding: 4px; cursor: default;
}
.step-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.95rem;
  color: var(--muted); background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all .2s;
}
.step-label { font-weight: 600; font-size: 0.95rem; color: var(--muted); }
.step[data-status="ativo"] .step-num {
  color: #fff; background: var(--accent-2); border-color: transparent;
  box-shadow: 0 0 0 4px rgba(255, 47, 142, 0.18);
}
.step[data-status="ativo"] .step-label { color: var(--text); font-weight: 700; }
.step[data-status="concluido"] .step-num { color: #fff; background: var(--accent-2); border-color: transparent; }
.step[data-status="concluido"] .step-label { color: #c9c2d6; }
.step[data-status="pendente"] { opacity: 0.5; }
.step-linha { width: 56px; height: 2px; background: rgba(255, 255, 255, 0.1); }

/* ---------- layout ---------- */

main { max-width: 1280px; margin: 0 auto; padding: 12px 20px 80px; }

.passo { display: none; }
.passo.ativa { display: block; }

.painel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 40px;
  margin: 16px 0;
}
.painel-central { max-width: 760px; margin: 24px auto; }
.painel h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }

.painel-cabecalho {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
}

/* ---------- seletor de tipo (tabs boletos/balancetes) ---------- */

.seletor-tipo {
  display: flex; gap: 8px; padding: 6px; margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.04); border-radius: 12px;
}
.tipo-btn {
  flex: 1; border: none; cursor: pointer; font-family: inherit;
  padding: 14px; border-radius: 9px;
  font-weight: 600; font-size: 0.95rem; color: var(--muted);
  background: transparent; transition: all .15s;
}
.tipo-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tipo-btn.ativo {
  color: #fff; font-weight: 700;
  background: var(--accent-2);
  box-shadow: 0 8px 22px -10px rgba(255, 47, 142, 0.7);
}

/* ---------- dropzone ---------- */

.dropzone {
  border: 2px dashed rgba(255, 47, 142, 0.35);
  border-radius: 14px;
  padding: 52px 32px;
  text-align: center;
  cursor: pointer;
  background: radial-gradient(400px 200px at 50% 0%, rgba(255, 47, 142, 0.08), transparent 70%);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: rgba(255, 47, 142, 0.65);
  outline: none;
}
.dropzone.arrastando { border-color: var(--pink); background: radial-gradient(400px 220px at 50% 0%, rgba(255, 47, 142, 0.18), transparent 70%); }
.dropzone-icone {
  width: 72px; height: 72px; border-radius: 18px;
  margin: 0 auto 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(123,47,247,0.2), rgba(255,47,142,0.2));
  border: 1px solid rgba(255, 47, 142, 0.25);
  color: var(--pink);
}
.dropzone-titulo { margin: 0 0 8px; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.dropzone-sub { margin: 0; font-size: 0.95rem; color: var(--muted); }
.dropzone .link { color: var(--pink); font-weight: 700; border-bottom: 1px solid rgba(255, 92, 143, 0.5); cursor: pointer; }
.dropzone .texto-pequeno { margin: 18px auto 0; max-width: 440px; line-height: 1.5; }

/* ---------- lista de arquivos ---------- */

.lista-arquivos { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.arquivo-chip {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-3); border: 1px solid var(--border);
}
.arquivo-chip-icone { color: var(--pink); flex-shrink: 0; }
.arquivo-info { flex: 1; min-width: 0; }
.arquivo-nome { display: block; font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arquivo-tamanho { font-size: 0.8rem; color: var(--muted); }
.arquivo-remover {
  border: none; background: none; color: var(--muted); cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%; font-size: 1.1rem; flex-shrink: 0;
}
.arquivo-remover:hover { background: var(--danger-bg); color: var(--danger); }

.alerta-pareamento { color: var(--danger); margin-top: 10px; }

.acoes-passo1 {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 26px; flex-wrap: wrap;
}

/* ---------- campo (referência / ajustes) ---------- */

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-weight: 700; font-size: 0.9rem; }
.campo-referencia { margin-top: 20px; }
.campo textarea, .campo input[type="text"], #input-referencia {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-3); border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text); font-family: inherit; font-size: 0.9rem;
}
.campo-referencia input { max-width: 240px; }
.campo textarea:focus, .campo input:focus, #input-referencia:focus {
  outline: none; border-color: rgba(255, 47, 142, 0.6);
}

/* ---------- botões ---------- */

.botao {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 0.9rem;
  color: var(--text); background: rgba(255, 255, 255, 0.05);
  transition: background .15s, border-color .15s, filter .15s;
}
.botao:hover { background: rgba(255, 255, 255, 0.1); }
.botao:disabled { opacity: 0.45; cursor: not-allowed; }
.botao:disabled:hover { background: rgba(255, 255, 255, 0.05); }

.botao-primario {
  color: #fff; border: none;
  background: var(--accent);
  box-shadow: var(--shadow-accent);
}
.botao-primario:hover { background: var(--accent); filter: brightness(1.08); }
.botao-primario:disabled { filter: grayscale(0.4) brightness(0.8); }
.botao-grande { padding: 15px 28px; font-size: 0.95rem; font-weight: 700; }

.botao-perigo { color: #ffd9d9; background: rgba(255, 77, 77, 0.12); border-color: var(--danger-border); }
.botao-perigo:hover { background: rgba(255, 77, 77, 0.2); }

.link-botao {
  border: none; background: none; color: var(--pink); cursor: pointer;
  font-family: inherit; font-size: 0.88rem; font-weight: 600; padding: 8px 0; margin-top: 8px;
}
.link-botao:hover { color: var(--pink-strong); }

.icone-botao { flex-shrink: 0; }
.acoes { display: flex; gap: 12px; flex-wrap: wrap; }
.acoes-centro { justify-content: center; margin-top: 22px; }
.acoes-resultado { margin: 20px 0 36px; }

/* ---------- processando ---------- */

.processando { max-width: 640px; margin: 0 auto; text-align: center; }
.processando-spinner { display: inline-grid; place-items: center; color: var(--pink); animation: girar 1.1s linear infinite; margin-bottom: 20px; }
.processando-fase { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; margin: 0 0 10px; }

.barra-progresso {
  height: 9px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.07); overflow: hidden; margin: 8px 0 6px;
}
.barra-progresso-interna {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, #7b2ff7, #ff2f8e 70%, #ff5a37);
  transition: width .25s;
}

.log {
  text-align: left; margin-top: 12px; padding: 16px 18px;
  background: #0d0a12; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: #cdc6da; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.8rem; max-height: 280px; overflow-y: auto; white-space: pre-wrap;
}

/* ---------- alertas ---------- */

.alerta { padding: 14px 16px; border-radius: var(--radius-sm); margin: 14px 0; font-size: 0.9rem; text-align: left; }
.alerta-erro { background: var(--danger-bg); border: 1px solid var(--danger-border); color: #ffb3b3; }

.texto-pequeno { font-size: 0.82rem; color: var(--muted); }

/* ---------- banner de sucesso ---------- */

.banner-sucesso {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 22px 26px; margin: 16px 0 0;
  border-radius: 14px; background: var(--success-bg); border: 1px solid var(--success-border);
}
.banner-icone {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(52, 211, 153, 0.16); border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--success);
}
.banner-sucesso > div { display: flex; align-items: center; gap: 16px; }
.banner-titulo { margin: 0; font-weight: 800; font-size: 1.05rem; color: var(--success-text); }
.banner-sub { margin: 3px 0 0; font-size: 0.86rem; color: var(--muted); word-break: break-all; }
.banner-sucesso .botao { margin-left: auto; flex-shrink: 0; }

/* ---------- cartões de números ---------- */

.cartoes-numeros {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 4px 0 8px;
}
.cartao-numero {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 20px;
}
.cartao-numero span { display: block; font-weight: 900; font-size: 2.2rem; line-height: 1; }
.cartao-numero label { display: block; margin-top: 10px; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.cartao-correio {
  background: linear-gradient(150deg, rgba(255,47,142,0.16), rgba(123,47,247,0.08));
  border-color: rgba(255, 47, 142, 0.35);
}
.cartao-correio span { background: linear-gradient(120deg, #ff5c8f, #a77bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cartao-correio label { color: #ffa9c6; }
.cartao-interno {
  background: linear-gradient(150deg, rgba(255,176,32,0.16), rgba(255,176,32,0.04));
  border-color: rgba(255, 176, 32, 0.35);
}
.cartao-interno span { color: var(--amber-num); }
.cartao-interno label { color: var(--amber-text); }

/* ---------- selects ---------- */

select {
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-3); border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text); font-family: inherit; font-size: 0.88rem; cursor: pointer;
}
select:focus { outline: none; border-color: rgba(255, 47, 142, 0.6); }
#select-remessa-resultado { font-weight: 600; }

/* ---------- vencimento resumo ---------- */

.venc-resumo { margin: 8px 0 20px; }
.venc-resumo h3 { font-size: 0.95rem; font-weight: 700; margin: 0 0 12px; }

/* ---------- subabas ---------- */

.subabas { display: flex; gap: 28px; border-bottom: 1px solid var(--border); margin-top: 22px; }
.subaba-btn {
  padding: 0 0 14px; background: none; border: none; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 0.95rem; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subaba-btn:hover { color: var(--text); }
.subaba-btn.ativa { color: #fff; font-weight: 700; border-bottom-color: var(--pink-strong); }
.subaba { display: none; padding-top: 22px; }
.subaba.ativa { display: block; }

/* ---------- filtros ---------- */

.filtros { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filtros input[type="text"] {
  flex: 1; min-width: 240px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-3); border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text); font-family: inherit; font-size: 0.88rem;
}
.filtros input::placeholder { color: var(--dim); }
.filtros input:focus { outline: none; border-color: rgba(255, 47, 142, 0.6); }

/* ---------- tabelas ---------- */

.tabela-scroll { border: 1px solid var(--border); border-radius: 12px; overflow: auto; max-height: 560px; }
.tabela-scroll-baixa { max-height: 240px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tabela th, .tabela td { text-align: left; padding: 14px 20px; }
.tabela thead th {
  position: sticky; top: 0; z-index: 1;
  background: #1a1424;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 700; cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--border);
}
.tabela thead th:hover { color: var(--text); }
.tabela tbody td { border-top: 1px solid rgba(255, 255, 255, 0.06); color: #c9c2d6; }
.tabela tbody tr:first-child td { border-top: none; }

/* pills de destino */
.pill-destino {
  display: inline-block; padding: 4px 11px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
}
.pill-destino.CORREIO { color: #ffa9c6; background: rgba(255, 47, 142, 0.14); border: 1px solid rgba(255, 47, 142, 0.4); }
.pill-destino.MALOTE { color: #b9b2c7; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); }
.pill-destino.INTERNO { color: var(--amber-text); background: rgba(255, 176, 32, 0.15); border: 1px solid rgba(255, 176, 32, 0.4); }

tr.linha-destino-INTERNO td { background: rgba(255, 176, 32, 0.06); }

.tabela.oculta-vencimento th:nth-child(2), .tabela.oculta-vencimento td:nth-child(2) { display: none; }
#tabela-condominios.oculta-interno th:nth-child(5), #tabela-condominios.oculta-interno td:nth-child(5) { display: none; }

/* ---------- modal ajustes ---------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 6, 12, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-card); padding: 26px 28px;
}
.modal-cabecalho { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-cabecalho h2 { margin: 0; font-size: 1.2rem; font-weight: 800; }
form#form-ajustes { display: flex; flex-direction: column; gap: 18px; }

/* ---------- responsivo ---------- */

@media (max-width: 820px) {
  .cartoes-numeros { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .marca-hub img { height: 68px; }
  header.topo { padding: 16px 18px; border-radius: 14px; }
  main { padding: 8px 12px 60px; }
  .painel { padding: 24px 20px; }
  nav.stepper { gap: 4px; }
  .step-linha { width: 24px; }
  .step-label { display: none; }
  .cartoes-numeros { grid-template-columns: 1fr 1fr; }
  .banner-sucesso .botao { margin-left: 0; }
}
