:root{
  --bg:#f5f7fb;
  --panel:#ffffff;
  --card:#ffffff;
  --text:#1c2430;
  --muted:#6b778c;
  --line:rgba(0,0,0,.08);
  --primary:#2f6fff;
  --danger:#e54863;
}

*{box-sizing:border-box}
html{min-height:100%;}
body{
  min-height:100vh;
  margin:0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1000px 600px at 20% 0%, rgba(47,111,255,.12), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(229,72,99,.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color:var(--text);
}

.container{max-width:1300px;margin:0 auto;padding:18px}
.muted{color:var(--muted);font-weight:400}

.topbar{
  border-bottom:1px solid var(--line);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  position:sticky;top:0;z-index:10;
}

.topbar__inner{display:flex;align-items:center;justify-content:space-between;gap:16px}

.brand{display:flex;align-items:center;gap:12px}

.brand__logo{
  width:38px;height:38px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(47,111,255,.12);
  border:1px solid rgba(47,111,255,.25);
  font-weight:700;
}

.brand__logo img{
  width:70%;
  height:70%;
  object-fit:contain;
  display:block;
}

.brand__title{
  font-weight:600;
  letter-spacing:-0.2px;
}

.brand__subtitle{
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}

.pill{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:999px;
  color:var(--muted);
  font-size:12px;
  background:#fff;
}

.footer{
  border-top:1px solid var(--line);
  margin-top:24px
}

.footer__inner{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between
}

.h1{
  font-size:22px;
  margin:0 0 10px 0;
  font-weight:600;
}

.h2{
  font-size:15px;
  margin:0 0 10px 0;
  font-weight:600;
}

.pagehead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  margin:22px 0 26px;
}

.grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:14px
}

@media (max-width: 920px){
  .grid{grid-template-columns: 1fr}
}

.card{
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  padding:16px;
  margin-top:14px;
  box-shadow:0 8px 22px rgba(0,0,0,.06);
}

.card--narrow{
  max-width:520px;
  margin:28px auto
}

.form{display:grid;gap:12px}
.form--grid{gap:14px}

.section-title{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px
}

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap
}

.row--end{justify-content:flex-end}

.label{
  display:grid;
  gap:6px;
  font-size:13px;
  color:var(--muted)
}

.input{
  width:260px;
  max-width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}

.input::placeholder{
  color:#9aa5b5;
}

.input:focus{
  border-color: rgba(47,111,255,.6);
  box-shadow: 0 0 0 3px rgba(47,111,255,.12)
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  text-decoration:none;
  color:var(--text);
  background:#fff;
  cursor:pointer;
}

.btn--primary{
  background:linear-gradient(
    180deg,
    rgba(47,111,255,.95),
    rgba(47,111,255,.85)
  );
  border-color:rgba(47,111,255,.9);
  color:#fff;
  box-shadow:0 6px 14px rgba(47,111,255,.25);
}

.btn--ghost{
  background:transparent
}

.btn:hover{
  filter:brightness(1.05)
}

.alert{
  border-radius:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  background:#fff;
}

.alert--error{
  border-color: rgba(229,72,99,.35);
  background: rgba(229,72,99,.08);
  color:#a0203a;
}

.meta{
  margin-top:12px;
  display:grid;
  gap:10px
}

.kpis{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px
}

@media (max-width: 720px){
  .kpis{grid-template-columns: 1fr}
}

.kpi{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  background:#fff;
}

.kpi__label{
  font-size:12px;
  color:var(--muted)
}

.kpi__value{
  font-size:18px;
  font-weight:700;
  margin-top:6px
}

.tablewrap{
  max-height:65vh;
  overflow:auto;
  border-radius:12px;
  border:1px solid var(--line);
}

.tablewrap table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

.tablewrap th,
.tablewrap td{
  padding:10px;
  border-bottom:1px solid var(--line);
}

.tablewrap th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f7f9fc;
  text-align:left;
  font-weight:700;
}

.tablewrap tr:hover td{
  background:rgba(0,0,0,.03)
}

.row--late td{
  background: rgba(229,72,99,.10);
}

.row--late:hover td{
  background: rgba(229,72,99,.15);
}

.badge{
  display:inline-block;
  margin-left:8px;
  padding:4px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:600;
}

.badge--danger{
  background: rgba(229,72,99,.12);
  border:1px solid rgba(229,72,99,.35);
  color:#a0203a;
}

.loading-overlay {
  display: none; /* ESCONDIDO por padrão */
}

.loading-overlay.is-visible {
  display: flex; /* ou block, dependendo do layout */
}

.table-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.btn-exportar {
  background: linear-gradient(135deg, #1c9c4b, #0d612c);
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.btn-exportar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.btn-exportar:active {
  transform: scale(0.97);
}