:root {
  --app-bg: #f6f7fb;
  --app-surface: #ffffff;
  --app-border: #e6ebf3;
  --app-primary: #2463eb;
  --app-primary-soft: #edf3ff;
  --app-ink: #111827;
  --app-muted: #6b7280;
  --app-success: #16a34a;
  --app-danger: #e11d48;
  --app-warning: #d97706;
  --chart-grid: #e5edf8;
  --chart-text: #8fa0b8;
  --chart-tooltip-bg: #111827;
  --chart-tooltip-text: #f8fafc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, sans-serif;
  background: radial-gradient(circle at 5% 10%, #e9efff 0%, transparent 35%), radial-gradient(circle at 95% 5%, #e7fff7 0%, transparent 30%), var(--app-bg);
  color: var(--app-ink);
}

.material-symbols-outlined { font-size: 20px; vertical-align: middle; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-visual {
  position: relative;
  background: linear-gradient(140deg, #2054cc, #2463eb, #1d88e5);
  color: #fff;
  padding: 3rem;
  overflow: hidden;
}

.login-visual::before,
.login-visual::after {
  content: '';
  position: absolute;
  border-radius: 999px;
}

.login-visual::before {
  width: 320px;
  height: 320px;
  right: -80px;
  top: -80px;
  background: rgba(255, 255, 255, 0.15);
}

.login-visual::after {
  width: 340px;
  height: 340px;
  left: -120px;
  bottom: -130px;
  background: rgba(255, 255, 255, 0.1);
}

.login-visual-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.1); }

.login-visual-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
  align-self: center;
}

.login-mini-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.8rem;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-mini-card strong { font-size: 0.86rem; }

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.login-form {
  width: 100%;
  max-width: 520px;
  border-radius: 18px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.app-sidebar {
  background: #fff;
  border-right: 1px solid var(--app-border);
  padding: 1.2rem 0.9rem;
  display: flex;
  flex-direction: column;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.2rem 0.5rem 1rem;
}

.app-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--app-primary);
}

.app-brand h3 { font-size: 1rem; font-weight: 800; }
.app-brand small { color: var(--app-muted); font-size: 0.75rem; }

.app-nav .nav-link {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #4b5563;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.75rem;
}

.app-nav .nav-link:hover {
  background: #f7f9fd;
  border-color: #eef2f9;
}

.app-nav .nav-link.active {
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border-color: #dce7ff;
}

.app-sidebar-footer {
  margin-top: auto;
  border: 1px solid var(--app-border);
  background: #f8fbff;
  border-radius: 12px;
  padding: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-sidebar-footer strong { display: block; font-size: 0.8rem; }
.app-sidebar-footer small { color: var(--app-muted); font-size: 0.72rem; }

.app-main { display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
  height: 72px;
  border-bottom: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 12;
}

.topbar-search-wrap {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: #f5f8fd;
}

.topbar-search-wrap .material-symbols-outlined { color: #8fa0b8; font-size: 18px; }
.topbar-search-wrap .form-control {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0.2rem 0.1rem;
  font-size: 0.88rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border-color: #e4ebf7;
  background: #f7f9fd;
}

.app-content { padding: 1rem; }

.card {
  border-color: var(--app-border);
  border-radius: 16px;
}

.kpi-card {
  box-shadow: 0 8px 20px rgba(22, 30, 45, 0.06);
}

.kpi-card .h4 {
  font-weight: 800;
  color: #0f172a;
}

.table {
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  border-bottom-color: #edf1f7;
}

.table thead th {
  color: #6f8098;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.btn {
  border-radius: 11px;
  font-weight: 600;
}

.btn-primary {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-primary:hover {
  background-color: #1d53c8;
  border-color: #1d53c8;
}

.form-control,
.form-select {
  border-color: #dbe3ef;
  border-radius: 11px;
  background-color: #fbfcff;
}

.form-control:focus,
.form-select:focus {
  border-color: #9fc0ff;
  box-shadow: 0 0 0 0.2rem rgba(36, 99, 235, 0.12);
}

.badge.text-bg-light {
  background: #edf2fa !important;
  color: #334155 !important;
}

.modal-content {
  border-radius: 18px;
  border-color: var(--app-border);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.modal-header,
.modal-footer {
  border-color: #eef2f7;
}

.category-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-block;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d5deea;
}

.category-icon-pill {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef4ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-icon-pill .material-symbols-outlined { font-size: 18px; }

@media (max-width: 991px) {
  .login-screen { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { border-right: 0; border-bottom: 1px solid var(--app-border); }
  .app-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
  .topbar-search-wrap { max-width: 340px; }
}

@media (max-width: 767px) {
  .app-nav { grid-template-columns: 1fr; }
  .app-content { padding: 0.7rem; }
  .topbar-search-wrap { display: none; }
  .app-sidebar-footer { display: none; }
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2f8;
  color: #64748b;
}

.kpi-icon .material-symbols-outlined { font-size: 18px; }
.kpi-icon-green { background: #e8faef; color: #16a34a; }
.kpi-icon-red { background: #ffecef; color: #e11d48; }
.kpi-icon-blue { background: #eef3ff; color: #2463eb; }

.kpi-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: #eef2f8;
  color: #73839a;
}

.kpi-chip-green { background: #e8faef; color: #16a34a; }
.kpi-chip-red { background: #ffecef; color: #e11d48; }
.kpi-chip-blue { background: #eef3ff; color: #2463eb; }

.dash-chart-wrap {
  min-height: 240px;
}

.dash-donut-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 210px;
}

.dash-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: none;
}

.dash-donut-center strong { font-size: 1.45rem; font-weight: 800; }
.dash-donut-center small { text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; font-size: .64rem; }

.dash-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
}

.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.dash-legend-item strong { color: #64748b; font-size: .78rem; }

.dash-tx-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe5f2;
  color: #7c8da6;
}

.dash-tx-icon .material-symbols-outlined { font-size: 14px; }

.dash-status {
  font-size: 0.76rem;
  font-weight: 700;
}

.dash-status-in { color: #16a34a; }
.dash-status-out { color: #0f9f6e; }

/* Fidelity pass (ZIP-aligned) */
body {
  background-color: #eef2f7;
  background-image: radial-gradient(#d9e0ee 0.75px, transparent 0.75px);
  background-size: 14px 14px;
  padding: 12px;
}

.app-shell {
  min-height: calc(100vh - 24px);
  border: 3px solid #5a62f0;
  border-radius: 14px;
  overflow: hidden;
  background: #f7f9fc;
  box-shadow: 0 12px 30px rgba(49, 64, 93, 0.08);
}

.app-sidebar {
  background: #ffffff;
  padding: 14px 10px;
}

.app-brand {
  padding: 2px 8px 14px;
}

.app-brand h3 {
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.app-brand small {
  font-size: 12px;
  color: #8594ab;
}

.app-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.app-nav .nav-link {
  min-height: 40px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #4d5d78;
}

.app-nav .nav-link .material-symbols-outlined {
  font-size: 18px;
}

.app-nav .nav-link.active {
  background: #eaf1ff;
  color: #2c63ed;
  border-color: #dee8ff;
}

.app-sidebar-footer {
  border-radius: 12px;
  background: #f2f5fa;
  min-height: 60px;
}

.app-sidebar-footer .material-symbols-outlined {
  font-size: 21px;
  color: #596b8a;
}

.app-main {
  background: #f8fafc;
}

.app-topbar {
  height: 62px;
  background: #ffffff;
  border-bottom: 1px solid #e6ebf4;
  padding: 0 14px;
}

.topbar-search-wrap {
  max-width: 520px;
  height: 38px;
  border-radius: 22px;
  background: #f3f6fb;
}

.topbar-search-wrap .form-control {
  font-size: 15px;
  color: #6b7c97;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f2f5fa;
  border-color: #dfe7f2;
}

.btn-icon.has-dot {
  position: relative;
}

.btn-icon.has-dot::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  position: absolute;
  right: 8px;
  top: 8px;
  border: 1px solid #fff;
}

.user-pill {
  border-left: 1px solid #e3e9f3;
  padding-left: 10px;
}

.user-pill-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  margin-right: 2px;
}

.user-pill-meta strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f1f3a;
}

.user-pill-meta small {
  font-size: 11px;
  color: #95a3b9;
}

.user-pill-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #ffd9bf;
  color: #7e5e4a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

#btnLogout.btn {
  border-radius: 9px;
  min-height: 32px;
  padding: 0 12px;
}

.app-content {
  padding: 16px;
}

.card {
  border-radius: 16px;
  border-color: #e2e8f3;
}

.kpi-card .card-body {
  padding: 16px 16px 14px;
}

.kpi-card .h4 {
  font-size: 2.15rem;
  letter-spacing: -0.01em;
}

.dash-chart-wrap {
  min-height: 310px;
}

.dash-donut-wrap {
  min-height: 240px;
}

.dash-tx-icon {
  width: 24px;
  height: 24px;
}

.dash-status {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dash-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.table thead th {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #7587a2;
}

.table td {
  font-size: 14px;
  color: #12223f;
}

.btn-primary {
  border-radius: 999px;
  padding-inline: 18px;
}

.modal-dialog {
  max-width: 760px;
}

.modal-content {
  border-radius: 20px;
}

@media (max-width: 991px) {
  body { padding: 0; background-image: none; }
  .app-shell { border: 0; border-radius: 0; min-height: 100vh; }
  .app-brand h3 { font-size: 23px; }
  .user-pill small { display: none; }
}

/* Hotfix: remove outer frame/pattern to match reference */
body {
  background: #f4f7fc !important;
  padding: 0 !important;
}

.app-shell {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 100vh !important;
}


/* Visual mappings: tipo/origem/categoria/valores */
.badge-type,
.badge-origin,
.category-color-badge {
  color: #fff !important;
  font-weight: 700;
  border: 0;
  padding: 0.35rem 0.55rem;
}

.badge-type-entrada { background: #166534 !important; }
.badge-type-saida { background: #991b1b !important; }
.badge-type-investimento { background: #1e3a8a !important; }

.badge-origin-recorrente { background: #c2410c !important; }
.badge-origin-manual { background: #38bdf8 !important; }
.badge-origin-parcelado { background: #b91c1c !important; }

.value-entrada { color: #166534 !important; }
.value-saida { color: #991b1b !important; }
.value-investimento { color: #1e3a8a !important; }
.value-recorrente { color: #c2410c !important; }
.value-parcelado { color: #b91c1c !important; }
.category-dot-btn {
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d5deea;
  cursor: pointer;
  padding: 0;
}

.category-dot-btn:hover {
  transform: scale(1.06);
}

/* Header without search */
.app-topbar {
  justify-content: flex-end;
}

#btnLogout.btn {
  background: #2463eb;
  border-color: #2463eb;
  color: #fff;
}

#btnLogout.btn:hover {
  background: #1d53c8;
  border-color: #1d53c8;
}

.user-avatar-img,
.settings-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #d9e2f0;
}

.settings-avatar {
  width: 56px;
  height: 56px;
}

.settings-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2f8;
  color: #64748b;
  font-size: 28px;
}

.notifications-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(420px, 92vw);
  max-height: 480px;
  overflow: auto;
  background: #fff;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.16);
  padding: 12px;
  z-index: 999;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-item {
  border: 1px solid #e3e9f4;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}

.notif-item.is-read {
  opacity: 0.68;
}

.notif-item-primary { border-left-color: #2463eb; }
.notif-item-info { border-left-color: #0284c7; }
.notif-item-warning { border-left-color: #d97706; }
.notif-item-danger { border-left-color: #b91c1c; }

.table-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.table-user-avatar,
.table-user-fallback {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #6b7ea1;
  border: 1px solid #dbe4f2;
  object-fit: cover;
  font-size: 18px;
}

.family-member-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.family-code-box {
  border: 1px dashed #c7d5f5;
  border-radius: 12px;
  background: #f6f9ff;
  padding: 0.65rem;
}
.installment-card .installment-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2463eb;
  color: #fff;
  box-shadow: 0 12px 28px rgba(36, 99, 235, 0.25);
}

.installment-card .installment-next-box {
  border: 1px solid #dfe6f4;
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8faff;
}

.installment-card .installment-detail-table {
  border: 1px solid #dfe6f4;
  border-radius: 14px;
  overflow: hidden;
}

.installment-card .installment-detail-table thead th {
  background: #f8faff;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
  color: #6a7a9f;
}

.tx-selector-modal {
  background: #fff;
}

.tx-selector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.tx-selector-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.tx-selector-btn .material-symbols-outlined {
  font-size: 20px;
}

.tx-selector-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(36, 99, 235, 0.25);
}

@media (min-width: 768px) {
  .tx-selector-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tx-selector-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    text-align: center;
  }
}

/* UX de quitação em parcelados */
.badge-quitado {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #86efac;
  font-weight: 800;
}

.installment-card-quitado {
  background: #f0fdf4;
  border: 1px solid #bbf7d0 !important;
}

.installment-card-quitado .installment-icon-box {
  background: #16a34a;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.25);
}

.installment-progress-finish {
  transition: width 0.9s ease;
  animation: installmentFinishPulse 0.9s ease;
}

.installment-card-just-paid {
  animation: installmentCardCelebrate 1s ease;
}

@keyframes installmentFinishPulse {
  0% { filter: brightness(0.9); }
  50% { filter: brightness(1.18); }
  100% { filter: brightness(1); }
}

@keyframes installmentCardCelebrate {
  0% { transform: scale(0.995); box-shadow: 0 0 0 rgba(34,197,94,0); }
  45% { transform: scale(1.005); box-shadow: 0 0 0 4px rgba(34,197,94,0.12); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(34,197,94,0); }
}

/* Reports UX redesign */
.rp-filters-card .form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #5c6f8f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rp-period-btn {
  min-width: 110px;
}

.rp-insight-row {
  border: 1px solid #e7edf8;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.55rem 0.65rem;
}

.rp-insight-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #edf2fa;
  overflow: hidden;
}

.rp-insight-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.rp-variation-box {
  border: 1px dashed #cddaf5;
  border-radius: 12px;
  background: #f7faff;
  padding: 0.65rem;
}

.rp-cat-metric-btn {
  min-width: 120px;
}

/* Auth UX */
#loginCard .input-group-text {
  background: #f6f8fc;
  border-color: #dce4f2;
  color: #6b7ea1;
}

#loginCard .form-control.is-invalid {
  border-color: #dc2626;
}

#loginCard .form-control.is-valid {
  border-color: #16a34a;
}

#passwordChecklist li.text-success {
  font-weight: 600;
}

.password-strength {
  font-weight: 600;
  color: #475569;
}

/* Recurrences cards UX (aligned with installment cards) */
.recurrence-card .recurrence-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2463eb;
  color: #fff;
  box-shadow: 0 12px 28px rgba(36, 99, 235, 0.25);
}

.recurrence-card .recurrence-next-box {
  border: 1px solid #dfe6f4;
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8faff;
}

.recurrence-card .recurrence-detail-table {
  border: 1px solid #dfe6f4;
  border-radius: 14px;
  overflow: hidden;
}

/* Dashboard principal (layout analitico) */
#view-dashboard .kpi-card .card-body { min-height: 132px; }
#view-dashboard .dash-chart-wrap { min-height: 280px; }
#view-dashboard .dash-donut-wrap { min-height: 250px; }

#view-dashboard .dash-legend-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.5rem;
}

#view-dashboard .dash-legend-item .badge {
  justify-self: start;
}

#view-dashboard .dash-upcoming-list .table thead th {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

#view-dashboard .dash-upcoming-list .table td,
#view-dashboard .dash-upcoming-list .table th {
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

@media (max-width: 1199px) {
  #view-dashboard .dash-chart-wrap { min-height: 250px; }
  #view-dashboard .dash-donut-wrap { min-height: 210px; }
}

/* Modal padrão global */
.mrk-modal {
  border-radius: 22px;
  border: 1px solid #e5ecf6;
  box-shadow: 0 24px 50px rgba(17, 24, 39, 0.18);
  overflow: hidden;
}

.mrk-modal .modal-header,
.mrk-modal .modal-footer {
  background: #fff;
  border-color: #eef2f8;
  padding: 1rem 1.25rem;
}

.mrk-modal .modal-body {
  background: #fff;
  padding: 1.1rem 1.25rem;
}

.mrk-modal .modal-title {
  font-size: 1.8rem;
  line-height: 1.1;
}

.mrk-modal .modal-subtitle {
  color: #64748b;
  font-size: 0.95rem;
}

.mrk-modal .form-label {
  font-weight: 700;
  color: #1f2937;
}

.mrk-modal .form-control,
.mrk-modal .form-select {
  background: #fff;
  border: 1px solid #d9e3f0;
  border-radius: 14px;
  min-height: 46px;
}

.mrk-modal .btn-primary {
  border-radius: 14px;
  min-width: 180px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.mrk-modal .btn-outline-secondary {
  border-radius: 14px;
  min-width: 150px;
}

.mrk-type-toggle-runtime {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #d9e3f0;
}

.mrk-type-toggle-runtime .btn {
  border: 0;
  border-radius: 0;
  min-height: 42px;
  font-weight: 700;
}

.mrk-type-toggle-runtime .btn.active {
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
}

.modal.fade .modal-dialog {
  transform: scale(0.97);
  transition: transform .2s ease, opacity .2s ease;
}

.modal.show .modal-dialog {
  transform: scale(1);
}


.notif-item {
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.notif-item.is-read {
  opacity: 1;
  border-left-color: #cbd5e1 !important;
  background: #f8fafc;
}

.notif-delete-btn .material-symbols-outlined {
  font-size: 16px;
}

body.dark-theme {
  --app-bg: #0b1220;
  --app-surface: #0f172a;
  --app-border: #243247;
  --app-ink: #e5e7eb;
  --app-muted: #94a3b8;
  --app-primary-soft: #1a2740;
  --chart-grid: #243247;
  --chart-text: #9fb0c8;
  --chart-tooltip-bg: #0b1220;
  --chart-tooltip-text: #e5e7eb;
  color: var(--app-ink);
  background-color: #080f1a;
  background-image: radial-gradient(rgba(148, 163, 184, .17) .75px, transparent .75px);
}

body.dark-theme .app-shell {
  background: #0b1527;
  border-color: #3d4fb5;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

body.dark-theme .app-sidebar,
body.dark-theme .app-topbar,
body.dark-theme .card,
body.dark-theme .modal-content,
body.dark-theme .login-form,
body.dark-theme .notifications-menu,
body.dark-theme .installment-card .installment-next-box,
body.dark-theme .recurrence-card .recurrence-next-box,
body.dark-theme .installment-card .installment-detail-table,
body.dark-theme .recurrence-card .recurrence-detail-table,
body.dark-theme .app-sidebar-footer,
body.dark-theme .family-code-box,
body.dark-theme .rp-insight-row,
body.dark-theme .rp-variation-box {
  background: #0f172a !important;
  border-color: #243247 !important;
  color: var(--app-ink);
}

body.dark-theme .app-topbar {
  background: rgba(11, 21, 39, 0.88);
}

body.dark-theme .app-brand small,
body.dark-theme .text-secondary,
body.dark-theme small,
body.dark-theme .form-text,
body.dark-theme .table thead th,
body.dark-theme .kpi-chip,
body.dark-theme .kpi-chip-green,
body.dark-theme .kpi-chip-red,
body.dark-theme .kpi-chip-blue {
  color: #9fb0c8 !important;
}

body.dark-theme .btn-light,
body.dark-theme .btn-outline-secondary,
body.dark-theme .btn-outline-primary,
body.dark-theme .btn-outline-danger {
  background: #111f35;
  border-color: #2b3c58;
  color: #d7e3f6;
}

body.dark-theme .btn-light:hover,
body.dark-theme .btn-outline-secondary:hover,
body.dark-theme .btn-outline-primary:hover,
body.dark-theme .btn-outline-danger:hover {
  background: #1a2c48;
  border-color: #3a4f74;
  color: #f1f5f9;
}

body.dark-theme .form-control,
body.dark-theme .form-select,
body.dark-theme .input-group-text {
  background: #111f35;
  border-color: #2b3c58;
  color: #e5e7eb;
}

body.dark-theme .form-control::placeholder {
  color: #8ea0ba;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
  border-color: #4f7ef7;
  box-shadow: 0 0 0 .2rem rgba(79, 126, 247, .18);
}

body.dark-theme .table > :not(caption) > * > * {
  border-bottom-color: #243247;
}

body.dark-theme .table-hover > tbody > tr:hover > * {
  background: rgba(59, 130, 246, 0.08);
  color: #e5e7eb;
}

body.dark-theme .notif-item {
  background: #13233b;
  border-color: #2a3b58;
}

body.dark-theme .notif-item.is-read {
  background: #0f1d33;
  border-left-color: #334155 !important;
}

body.dark-theme .badge.text-bg-light {
  background: #1e293b !important;
  color: #d1d5db !important;
}

body.dark-theme .modal-header,
body.dark-theme .modal-footer,
body.dark-theme .mrk-modal .modal-header,
body.dark-theme .mrk-modal .modal-footer,
body.dark-theme .mrk-modal .modal-body {
  background: #0f172a;
  border-color: #243247;
}

body.dark-theme .mrk-modal .modal-subtitle,
body.dark-theme .mrk-modal .form-label,
body.dark-theme .password-strength,
body.dark-theme #passwordChecklist li {
  color: #c0d0e8;
}

body.dark-theme .dash-tx-icon,
body.dark-theme .table-user-fallback,
body.dark-theme .settings-avatar-fallback,
body.dark-theme .category-icon-pill {
  background: #1e2c44;
  border-color: #2d4265;
  color: #c4d2e8;
}

body.dark-theme .installment-card-quitado {
  background: #0f2d22 !important;
  border-color: #1f6d4c !important;
}

body.dark-theme .rp-insight-bar {
  background: #1a2b47;
}

body.dark-theme .dropdown-menu {
  background: #0f172a;
  border-color: #243247;
}

body.dark-theme .dropdown-item {
  color: #d9e5f7;
}

body.dark-theme .dropdown-item:hover {
  background: #1a2a47;
}

body.dark-theme .toast,
body.dark-theme .toast-header {
  background: #0f172a;
  color: #e5e7eb;
  border-color: #243247;
}


/* Dark mode: texto branco nas listagens principais */
body.dark-theme #view-transactions .table tbody td,
body.dark-theme #view-reports .table tbody td,
body.dark-theme #view-categories .table tbody td,
body.dark-theme #view-installments .installment-detail-table tbody td,
body.dark-theme #view-installments .table tbody td {
  color: #f8fafc !important;
}

body.dark-theme #view-transactions .table-user span,
body.dark-theme #view-reports .table-user span,
body.dark-theme #view-installments .table-user span,
body.dark-theme #view-categories .table-user span {
  color: #f8fafc !important;
}

body.dark-theme #view-categories .table .category-dot {
  box-shadow: 0 0 0 1px #334155;
}

.dash-reload-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border-color: #dbe5f3;
  background: #f4f8ff;
  color: #5f7394;
}

.dash-reload-btn .material-symbols-outlined {
  font-size: 16px;
}

body.dark-theme .dash-reload-btn {
  background: #12233b;
  border-color: #2e4263;
  color: #d3e2f8;
}

@keyframes dashReloadSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.dash-reload-btn.is-spinning .material-symbols-outlined {
  animation: dashReloadSpin 0.24s linear 1;
}
#rpMainChartContext .badge {
  font-weight: 600;
}

.rp-mini-avatar {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: cover;
}

.rp-mini-avatar-icon {
  font-size: 18px;
  line-height: 1;
}

body.dark-theme #rpMainChartContext .badge {
  background: #112038 !important;
  color: #e2ecff !important;
  border-color: #29456d !important;
}
.visual-scope-wrap { min-width: 180px; }
.visual-scope-wrap .form-label { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.visual-scope-select { min-width: 180px; }
.dark-theme .visual-scope-wrap .form-label { color: #9aa9c2; }

