/* =============================================
   modern.css — Design System GestãoPro
   Base compartilhada por todas as páginas
   ============================================= */

/* FONTES */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  background: #0a0e27; /* fallback garantido */
  min-height: 100%;
}

/* BODY */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1628 100%) fixed;
  background-attachment: fixed;
  color: #ffffff;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(99,102,241,.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(236,72,153,.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Garante que o conteúdo fica acima do ::before */
.page-content, .sidebar, .topbar-mobile { position: relative; z-index: 1; }

/* TIPOGRAFIA */
h1 {
  font-size: 36px; font-weight: 800; margin-bottom: 6px;
  background: linear-gradient(135deg, #00d4ff 0%, #0099ff 50%, #6366f1 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -1px;
}
.subtit { color: #a0aec0; font-size: 15px; margin-bottom: 24px; font-weight: 500; }
.secao {
  font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: #94a3b8; margin: 32px 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(148,163,184,.15);
}

/* MAIN */
main { max-width: 1400px; margin: 0 auto; padding: 36px 24px; }

/* MÊS BADGE */
.mes-badge {
  background: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
  color: white; padding: 8px 18px; border-radius: 10px; font-size: 13px;
  font-weight: 700; display: inline-block; margin-bottom: 28px;
  box-shadow: 0 8px 24px rgba(236,72,153,.3);
}

/* CARDS */
.cards, .cards-topo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin-bottom: 40px;
}
.card {
  background: #1e293b;
  border: 1px solid rgba(148,163,184,.2); border-radius: 16px; padding: 24px;
  position: relative; overflow: hidden;
  transition: all .4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.card:hover { border-color: rgba(148,163,184,.4); box-shadow: 0 20px 50px rgba(0,0,0,.5); transform: translateY(-6px); }
.card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #6366f1, #ec4899);
}
.card.c1::after { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.card.c2::after { background: linear-gradient(90deg, #10b981, #22c55e); }
.card.c3::after { background: linear-gradient(90deg, #f59e0b, #f97316); }
.card.c4::after { background: linear-gradient(90deg, #ec4899, #f97316); }
.card.ci::after { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.card.cp::after { background: linear-gradient(90deg, #f59e0b, #f97316); }
.card.cx::after { background: linear-gradient(90deg, #10b981, #22c55e); }
.card .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #94a3b8; margin-bottom: 10px; font-weight: 700; }
.card .val { font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.card .hint { font-size: 12px; color: #64748b; margin-top: 6px; font-weight: 500; }

/* GRADIENTES DE VALOR */
.grad-azul   { background: linear-gradient(135deg,#3b82f6,#6366f1);   -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.grad-verde  { background: linear-gradient(135deg,#22c55e,#10b981);  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.grad-amarelo{ background: linear-gradient(135deg,#f59e0b,#f97316);  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.grad-vermelho{ background: linear-gradient(135deg,#ff6b6b,#ff4757); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.grad-rosa   { background: linear-gradient(135deg,#ec4899,#f97316);  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.grad-ciano  { background: linear-gradient(135deg,#00d4ff,#0099ff);  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.positivo    { background: linear-gradient(135deg,#22c55e,#10b981);  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.negativo    { background: linear-gradient(135deg,#ff6b6b,#ff4757);  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }

/* BOX / PANEL */
.box {
  background: #1e293b;
  border: 1px solid rgba(148,163,184,.15); border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.box-h {
  padding: 18px 22px; border-bottom: 1px solid rgba(148,163,184,.1);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.box-h h3 { font-size: 15px; font-weight: 700; color: #e2e8f0; display: flex; align-items: center; gap: 10px; }
.box-h a  { font-size: 12px; color: #00d4ff; text-decoration: none; font-weight: 600; }
.box-h a:hover { color: #0099ff; }

/* GRIDS */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.donos-grid, .sit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 18px; margin-bottom: 32px; }

/* TABELA */
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #64748b;
  padding: 12px 16px; text-align: left;
  background: rgba(15,23,42,.5); border-bottom: 1px solid rgba(148,163,184,.1);
}
td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid rgba(148,163,184,.07); vertical-align: middle; color: #cbd5e1; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(99,102,241,.06); }
tfoot td { background: rgba(15,23,42,.6) !important; font-weight: 700; border-top: 1px solid rgba(148,163,184,.2); color: #e2e8f0; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* BARRA PROGRESSO */
.prog-wrap { background: rgba(148,163,184,.15); border-radius: 4px; height: 6px; }
.prog { height: 100%; border-radius: 4px; background: linear-gradient(90deg,#22c55e,#10b981); transition: width .4s; }
.prog.over    { background: linear-gradient(90deg,#f59e0b,#f97316); }
.prog.negativo{ background: linear-gradient(90deg,#ff6b6b,#ff4757); }

/* FORM */
form.f { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
label { font-size: 12px; color: #94a3b8; display: block; margin-bottom: 5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 11px 14px;
  color: #e2e8f0;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
select option { background: #0f172a; color: #e2e8f0; }
textarea { resize: vertical; min-height: 70px; }
.r2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* BOTÕES */
.btn {
  padding: 11px 20px; border: none; border-radius: 10px; font-family: 'Poppins', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all .3s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-p  { background: linear-gradient(135deg,#6366f1,#4f46e5); color:#fff; box-shadow:0 4px 15px rgba(99,102,241,.3); }
.btn-p:hover  { transform:translateY(-2px); box-shadow:0 8px 25px rgba(99,102,241,.5); }
.btn-g  { background: linear-gradient(135deg,#22c55e,#16a34a); color:#fff; box-shadow:0 4px 15px rgba(34,197,94,.3); }
.btn-g:hover  { transform:translateY(-2px); box-shadow:0 8px 25px rgba(34,197,94,.5); }
.btn-warn { background: linear-gradient(135deg,#f59e0b,#d97706); color:#fff; box-shadow:0 4px 15px rgba(245,158,11,.3); }
.btn-warn:hover { transform:translateY(-2px); box-shadow:0 8px 25px rgba(245,158,11,.5); }
.btn-rosa { background: linear-gradient(135deg,#ec4899,#db2777); color:#fff; box-shadow:0 4px 15px rgba(236,72,153,.3); }
.btn-rosa:hover { transform:translateY(-2px); box-shadow:0 8px 25px rgba(236,72,153,.5); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; border: none; cursor: pointer; font-family: 'Poppins',sans-serif; font-weight: 600; transition: all .2s; }
.btn-e  { background: rgba(99,102,241,.2);   color: #a5b4fc; }
.btn-e:hover  { background: rgba(99,102,241,.35); }
.btn-d  { background: rgba(239,68,68,.15);   color: #fca5a5; }
.btn-d:hover  { background: rgba(239,68,68,.3); }
.btn-verde-sm { background: rgba(34,197,94,.15); color: #86efac; }
.btn-verde-sm:hover { background: rgba(34,197,94,.3); }

/* BADGE */
.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; }
.badge-dono  { background:rgba(99,102,241,.2);  color:#a5b4fc; }
.badge-socio { background:rgba(34,197,94,.15);  color:#86efac; }
.badge-vazio { background:rgba(148,163,184,.1); color:#94a3b8; }
.badge-ok    { background:rgba(34,197,94,.15);  color:#86efac; }
.badge-warn  { background:rgba(245,158,11,.15); color:#fcd34d; }
.badge-erro  { background:rgba(239,68,68,.15);  color:#fca5a5; }

/* ALERT */
.alert { padding:14px 18px; border-radius:10px; font-size:13px; margin-bottom:18px; font-weight:500; }
.alert-ok   { background:rgba(34,197,94,.12);  border-left:3px solid #22c55e; color:#86efac; }
.alert-erro { background:rgba(239,68,68,.12);  border-left:3px solid #ef4444; color:#fca5a5; }

/* FILTRO */
.filtro { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:24px; }
.filtro select { width:auto; padding:9px 12px; font-size:13px; border-radius:10px; }

/* VAZIO */
.vazio { text-align:center; padding:40px 20px; color:#475569; font-size:14px; }
.vazio a { color:#6366f1; text-decoration:none; font-weight:600; }

/* MODAL */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.75); z-index:300; align-items:center; justify-content:center; }
.modal-overlay.aberto { display:flex; }
.modal { background:#1e293b; border:1px solid rgba(148,163,184,.2); border-radius:20px; padding:32px; width:100%; max-width:440px; margin:20px; box-shadow:0 24px 60px rgba(0,0,0,.6); }
.modal h3 { font-size:18px; font-weight:800; margin-bottom:22px; background:linear-gradient(135deg,#00d4ff,#6366f1); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.modal .fechar { float:right; background:none; border:none; color:#64748b; font-size:22px; cursor:pointer; margin-top:-4px; transition:color .2s; }
.modal .fechar:hover { color:#e2e8f0; }

/* DONO CARD */
.dono-card {
  background: #1e293b;
  border: 1px solid rgba(148,163,184,.15); border-radius: 16px; padding: 22px;
  border-top: 3px solid;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  transition: transform .3s, box-shadow .3s;
}
.dono-card:hover { transform:translateY(-4px); box-shadow:0 16px 40px rgba(0,0,0,.35); }
.dono-card .dc-nome { font-weight:800; font-size:16px; margin-bottom:16px; display:flex; align-items:center; justify-content:space-between; color:#e2e8f0; }
.dc-row { display:flex; justify-content:space-between; align-items:center; font-size:13px; margin-bottom:10px; padding:8px 12px; background:#0f172a; border-radius:8px; }
.dc-row .k { color:#94a3b8; font-weight:500; }
.dc-row .v { font-family:'JetBrains Mono',monospace; font-weight:700; }
.custos-lista { margin-top:14px; border-top:1px solid rgba(148,163,184,.1); padding-top:12px; }
.cl-titulo { font-size:10px; text-transform:uppercase; letter-spacing:.8px; color:#64748b; margin-bottom:8px; font-weight:700; }
.cl-item { display:flex; justify-content:space-between; font-size:12px; padding:5px 0; border-bottom:1px solid rgba(255,255,255,.04); }
.cl-item .cn { color:#cbd5e1; }
.cl-item .cv { font-family:'JetBrains Mono',monospace; color:#f59e0b; font-weight:600; }

/* STATUS TAG */
.st-tag { font-size:11px; font-weight:700; padding:3px 10px; border-radius:20px; display:inline-block; }
.st-ok      { background:rgba(34,197,94,.15);  color:#86efac; }
.st-parcial { background:rgba(245,158,11,.15); color:#fcd34d; }
.st-aberto  { background:rgba(239,68,68,.15);  color:#fca5a5; }
.st-sem     { background:rgba(148,163,184,.1); color:#94a3b8; }

/* TOTAL ROW */
.tot-row td { background:rgba(99,102,241,.08) !important; font-weight:800; border-top:2px solid rgba(99,102,241,.2); color:#e2e8f0; font-size:14px; }

/* MOBILE */
@media(max-width:768px) {
  main { padding: 16px; }
  h1 { font-size: 26px; }
  .cards, .cards-topo { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { padding: 16px; }
  .card .val { font-size: 20px; }
  .grid2, .donos-grid, .sit-grid { grid-template-columns: 1fr !important; }
  .r2 { grid-template-columns: 1fr !important; }
  .box { overflow-x: auto; }
  table { min-width: 460px; }
  .filtro { flex-direction: column; align-items: stretch; }
  .filtro select, .filtro button, .filtro input { width: 100%; }
}
@media(max-width:480px) {
  .cards, .cards-topo { grid-template-columns: 1fr; }
}
