﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f0f4f8;
  color: #2d3748;
  min-height: 100vh;
}

/* LOGIN */
.login-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a3a5c 0%, #2563eb 100%);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 48px 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.logo-area { text-align: center; margin-bottom: 32px; }
.logo-icon { font-size: 48px; margin-bottom: 12px; }
.logo-area h1 { font-size: 22px; font-weight: 700; color: #1a3a5c; }
.subtitle { font-size: 13px; color: #718096; margin-top: 6px; }
.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: 14px; }
.alert-erro { background: #fff5f5; color: #c53030; border: 1px solid #fc8181; }
.field-group { margin-bottom: 20px; }
.field-group label { display: block; font-size: 13px; font-weight: 600; color: #4a5568; margin-bottom: 6px; }
.field-group input {
  width: 100%; padding: 12px 14px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 15px; transition: border-color 0.2s; outline: none;
}
.field-group input:focus { border-color: #2563eb; }
.btn-entrar {
  width: 100%; padding: 13px; background: #2563eb; color: #fff;
  border: none; border-radius: 8px; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-entrar:hover { background: #1d4ed8; }
.rodape-info { text-align: center; font-size: 12px; color: #a0aec0; margin-top: 24px; }

/* TOPBAR */
.topbar {
  background: #1a3a5c; color: #fff;
  padding: 0 24px; height: 60px;
  display: flex; align-items: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 960px; margin: 0 auto;
}
.topbar-brand { font-size: 16px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.btn-sair {
  padding: 7px 16px; background: rgba(255,255,255,0.15); color: #fff;
  border-radius: 6px; text-decoration: none; font-size: 13px;
  transition: background 0.2s;
}
.btn-sair:hover { background: rgba(255,255,255,0.3); }

/* BOTAO PDF - vermelho, sempre visivel no topbar */
.btn-pdf {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  background: #e53e3e;
  color: #fff !important;
  border-radius: 7px;
  text-decoration: none !important;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(229,62,62,0.4);
  transition: background 0.2s;
  border: none; cursor: pointer;
}
.btn-pdf:hover { background: #c53030; }

/* BOTAO PDF GRANDE (abaixo da tabela) */
.btn-pdf-grande {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 30px;
  background: #e53e3e; color: #fff !important;
  border-radius: 9px; text-decoration: none !important;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 3px 12px rgba(229,62,62,0.4);
  transition: background 0.2s, transform 0.1s;
}
.btn-pdf-grande:hover { background: #c53030; transform: translateY(-1px); }
.pdf-bottom { margin-top: 24px; display: flex; justify-content: flex-end; }

/* MAIN */
.main-content { max-width: 960px; margin: 28px auto; padding: 0 16px; }
.cliente-info { margin-bottom: 22px; }
.cliente-info h2 { font-size: 20px; font-weight: 700; color: #1a3a5c; }
.cliente-info .razao { font-size: 13px; color: #718096; margin-top: 4px; }

/* ABAS */
.abas {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}
.aba {
  padding: 10px 20px; border-radius: 8px 8px 0 0;
  text-decoration: none; font-size: 14px; font-weight: 600;
  color: #718096; background: #f7fafc;
  border: 2px solid #e2e8f0; border-bottom: none;
  transition: all 0.2s; display: flex; align-items: center; gap: 8px;
  margin-bottom: -2px;
}
.aba:hover { color: #2563eb; background: #ebf8ff; }
.aba.ativa { background: #fff; color: #2563eb; border-bottom-color: #fff; }
.badge-aba {
  background: #2563eb; color: #fff;
  border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 700;
}

/* RESUMO */
.resumo-bar {
  display: flex; align-items: center; gap: 16px;
  background: #1a3a5c; color: #fff;
  border-radius: 10px; padding: 14px 20px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.resumo-label { font-size: 14px; opacity: 0.85; }
.resumo-valor { font-size: 22px; font-weight: 700; }
.resumo-count {
  margin-left: auto; background: rgba(255,255,255,0.15);
  border-radius: 20px; padding: 4px 12px; font-size: 13px;
}

/* TABELA */
.table-wrapper {
  background: #fff; border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08); overflow-x: auto;
}
.tabela-contas { width: 100%; border-collapse: collapse; }
.tabela-contas th {
  background: #f7fafc; padding: 12px 16px; text-align: left;
  font-size: 12px; font-weight: 700; color: #4a5568;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}
.tabela-contas td { padding: 13px 16px; font-size: 14px; border-bottom: 1px solid #edf2f7; }
.tabela-contas tbody tr:hover { background: #f7fafc; }
.tabela-contas tbody tr.vencida td { background: #fff5f5; }
.tabela-contas tfoot td {
  padding: 14px 16px; border-top: 2px solid #e2e8f0; background: #f7fafc;
}
.total-label { font-weight: 700; font-size: 14px; color: #4a5568; }
.total-valor { font-weight: 800; font-size: 16px; color: #1a3a5c; }
.right { text-align: right; }
.center { text-align: center; }
.doc { font-family: monospace; font-size: 13px; color: #4a5568; }
.hist { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nome-produto { word-break: break-word; white-space: normal; min-width: 200px; }
.venc { white-space: nowrap; }
.valor { font-weight: 600; }
.txt-venc { color: #c53030; font-weight: 600; }

/* BADGES */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge.vencido { background: #fff5f5; color: #c53030; }
.badge.aberto  { background: #ebf8ff; color: #2b6cb0; }

/* SEM PENDENCIAS */
.sem-pendencias {
  text-align: center; padding: 64px 24px; background: #fff;
  border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.check-icon { font-size: 56px; color: #48bb78; margin-bottom: 16px; }
.sem-pendencias h3 { font-size: 20px; color: #2d3748; margin-bottom: 8px; }
.sem-pendencias p { color: #718096; }

/* RESPONSIVE */
@media (max-width: 600px) {
  .login-card { padding: 32px 20px; margin: 16px; }
  .resumo-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .resumo-count { margin-left: 0; }
  .tabela-contas th, .tabela-contas td { padding: 10px; font-size: 13px; }
  .btn-pdf { font-size: 11px; padding: 7px 12px; }
}

/* botao comprovantes */
.btn-comprovante {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; background: #2f855a; color: #fff !important;
  border-radius: 7px; text-decoration: none !important;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(47,133,90,0.4);
  transition: background 0.2s;
}
.btn-comprovante:hover { background: #276749; }

/* contador de atualizacao */
.refresh-timer {
  font-size: 12px; color: rgba(255,255,255,0.7);
  display: flex; align-items: center; gap: 4px;
  margin-left: 12px;
}
