/* Preferências globais — modal + tema claro */

html.theme-light {
  --bg: #eef2f8;
  --bg-elevated: #e2e8f2;
  --bg-card: #ffffff;
  --border: #c5d0e0;
  --text: #0f1a2e;
  --text-muted: #5a6d88;
  --gold: #9a7b3c;
  --purple: #7c3aed;
  --green: #059669;
  --blue: #2563eb;
  --orange: #ea580c;
  --red: #dc2626;
}

html.theme-light body.dashboard-body {
  background: var(--bg);
  color: var(--text);
}

html.theme-light .icon-btn {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

html.theme-light .stat-card,
html.theme-light .panel,
html.theme-light .bottom-nav {
  background: var(--bg-card);
}

html.theme-light .bottom-nav {
  border-top-color: var(--border);
}

html.theme-light .deposit-topbar,
html.theme-light .detail-topbar {
  background: rgba(238, 242, 248, 0.92);
}

html.theme-light body {
  background: var(--bg);
  color: var(--text);
}

html.theme-light .page.card {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

html.theme-light .dash-logo svg rect {
  fill: #1e3354;
}

/* Modal de preferências */
.ninive-prefs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

html.theme-light .ninive-prefs-backdrop {
  background: rgba(15, 26, 46, 0.35);
}

.ninive-prefs-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 28px;
  color: var(--text);
}

.ninive-prefs-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 0 auto 14px;
}

.ninive-prefs-sheet h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}

.ninive-prefs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.82rem;
}

.ninive-prefs-field span {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.ninive-prefs-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
}

.ninive-prefs-field small {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.ninive-prefs-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.ninive-prefs-btn {
  flex: 1;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  font-family: inherit;
}

.ninive-prefs-btn.secondary {
  background: transparent;
  color: var(--text-muted);
}

.ninive-prefs-btn.primary {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.45);
  color: var(--blue);
}

html.theme-light .ninive-prefs-btn.primary {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue);
}

.ninive-prefs-floating-btn {
  flex-shrink: 0;
}

.ninive-prefs-fixed-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

@media (min-width: 768px) {
  .ninive-prefs-fixed-btn {
    right: calc(50% - 240px + 12px);
  }
}

@media (min-width: 768px) {
  .ninive-prefs-backdrop {
    align-items: center;
    padding: 20px;
  }

  .ninive-prefs-sheet {
    border-radius: 20px;
  }
}
