/* ─────────────────────────────────────────────────────────────
   MODALS — drill-down de KPIs (clique no card → modal com
   transações detalhadas) + login gate
───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal-box-sm { max-width: 420px; }

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.modal-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: all 0.15s;
}
.modal-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Login gate */
.login-gate {
  position: fixed; inset: 0;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.login-brand {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--text);
  margin-bottom: 6px;
}
.login-tagline {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 32px;
}
.login-field {
  width: 100%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 11px 14px;
  border-radius: var(--r-md);
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.18s;
}
.login-field:focus { border-color: var(--text); }
.login-submit {
  width: 100%;
  background: var(--text);
  color: var(--bg);
  border: none;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.18s;
}
.login-submit:hover { opacity: 0.88; }
.login-submit:disabled { opacity: 0.5; cursor: wait; }
.login-error {
  color: var(--accent-red);
  font-size: 0.75rem;
  margin-top: 12px;
  min-height: 18px;
}

/* Labels dos forms dos modais (transações, custos fixos, etc) */
.fin-lbl {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
