* { box-sizing: border-box; }
html, body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; background: #f5f6f8; color: #1f2330; }
a { color: #2b6cb0; text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: #fff; border-bottom: 1px solid #e3e6eb;
}
header h1 { font-size: 18px; margin: 0; font-weight: 600; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-actions .hint { color: #6b7280; font-size: 12px; margin-right: 8px; }
button, .btn-link {
  padding: 8px 14px; border: 1px solid #d0d4dc; background: #fff; color: #1f2330;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500;
}
button:hover, .btn-link:hover { background: #f0f2f5; text-decoration: none; }
.btn-link.sec { color: #6b7280; }

main { padding: 24px; max-width: 1400px; margin: 0 auto; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid #e3e6eb; border-radius: 10px; padding: 16px; }
.kpi h3 { font-size: 12px; color: #6b7280; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.kpi p { font-size: 24px; font-weight: 700; margin: 0; color: #1f2330; }
.kpi span { font-size: 12px; color: #6b7280; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.card { background: #fff; border: 1px solid #e3e6eb; border-radius: 10px; padding: 16px; }
.card h2 { font-size: 14px; margin: 0 0 16px; font-weight: 600; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 6px 8px; background: #f9fafb; border-bottom: 1px solid #e3e6eb; font-weight: 600; color: #4b5563; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid #f0f2f5; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:hover td { background: #fafbfc; }

.tbl-wrap { max-height: 480px; overflow-y: auto; }
#filtro { padding: 6px 10px; border: 1px solid #d0d4dc; border-radius: 6px; width: 280px; font-size: 13px; }

.venc-controles { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.venc-filtros { display: flex; gap: 4px; padding: 3px; background: #f0f2f5; border-radius: 8px; }
.venc-tab {
  padding: 6px 14px; border: 0; background: transparent; cursor: pointer;
  font-size: 13px; color: #4b5563; border-radius: 6px; font-weight: 500;
}
.venc-tab:hover { background: #e5e7eb; }
.venc-tab.ativo { background: #fff; color: #1f2330; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.venc-tab span { color: #6b7280; font-weight: 400; margin-left: 4px; }
.venc-tab.ativo span { color: #4b5563; }
.tr-vencido td { background: #fef2f2; }
.tr-vencido:hover td { background: #fee2e2; }

.venc-avancados {
  display: flex; gap: 12px; align-items: end; flex-wrap: wrap;
  padding: 12px; background: #f9fafb; border: 1px solid #e3e6eb; border-radius: 8px;
  margin-bottom: 12px;
}
.venc-avancados .campo { display: flex; flex-direction: column; gap: 4px; }
.venc-avancados .campo.flex { flex: 1 1 220px; min-width: 220px; }
.venc-avancados .campo span { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.venc-avancados input {
  padding: 6px 10px; border: 1px solid #d0d4dc; border-radius: 6px; font-size: 13px;
  font-family: inherit; min-width: 130px;
}
.venc-avancados input[type="text"] { min-width: 200px; }
.link-btn {
  background: transparent; border: 0; color: #2b6cb0; cursor: pointer; font-size: 13px;
  padding: 8px 0; text-decoration: underline;
}
.link-btn:hover { color: #1e4d80; }

.tbl-sortable th.sortable { cursor: pointer; user-select: none; }
.tbl-sortable th.sortable:hover { background: #eef0f4; }
.sort-ind { font-size: 10px; color: #9ca3af; margin-left: 4px; }
.sort-ind.asc::after { content: "▲"; color: #1f2330; }
.sort-ind.desc::after { content: "▼"; color: #1f2330; }

.venc-rodape {
  display: flex; justify-content: space-between; padding: 12px 4px 0;
  font-size: 13px; color: #4b5563; border-top: 1px solid #f0f2f5; margin-top: 8px;
}
.venc-rodape span:last-child { font-weight: 600; color: #1f2330; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; padding: 36px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.06); width: 360px; }
.login-card h1 { margin: 0; font-size: 24px; text-align: center; letter-spacing: .04em; }
.login-card .subtitle { text-align: center; color: #6b7280; margin: 4px 0 24px; }
.login-card label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.login-card input { width: 100%; padding: 10px; border: 1px solid #d0d4dc; border-radius: 6px; font-size: 14px; margin-bottom: 16px; }
.login-card button { width: 100%; padding: 10px; background: #1f2330; color: #fff; border: 0; border-radius: 6px; font-size: 14px; cursor: pointer; }
.login-card button:hover { background: #383e4f; }
.msg { margin: 16px 0 0; font-size: 13px; text-align: center; min-height: 18px; }
.msg.ok { color: #047857; }
.msg.erro { color: #b91c1c; }
