/* Atualização NowFinance 01/08/2026 — consistência visual, acessibilidade e mobile. */
:root {
  --nf-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nf-overlay-sidebar: 280;
  --nf-overlay-popover: 340;
  --nf-overlay-sheet: 400;
  --nf-overlay-modal: 500;
  --nf-overlay-toast: 700;
}

html { font-family: var(--nf-font); text-rendering: optimizeLegibility; }
body, button, input, select, textarea { font-family: inherit; }
body { font-weight: 400; }
p, li, td, input, select, textarea { font-weight: 400; }
label, th, .btn, .badge, .nav-section-label { font-weight: 500; }
h1, h2, h3, h4, strong, b { font-weight: 600; }
.page-kicker { font-weight: 600; letter-spacing: .09em; }
.muted, small, .form-hint { font-weight: 400; }

img, svg, video, canvas { max-width: 100%; }
button, [role="button"], input, select, textarea { touch-action: manipulation; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary, #075fd8) 38%, transparent);
  outline-offset: 2px;
}

:where(.checkbox-line, .checkbox-inline, .check-line, .check-row, .checkbox-field, .switch-line) {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  line-height: 1.45;
  cursor: pointer;
}
:where(.checkbox-line, .checkbox-inline, .check-line, .check-row, .checkbox-field, .switch-line) > input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  min-width: 1.2rem;
  min-height: 1.2rem;
  margin: .08rem 0 0;
  padding: 0;
  flex: 0 0 1.2rem;
  accent-color: var(--primary, #075fd8);
  cursor: pointer;
}
:where(.checkbox-line, .checkbox-inline, .check-line, .check-row, .checkbox-field, .switch-line) > input:disabled,
:where(.checkbox-line, .checkbox-inline, .check-line, .check-row, .checkbox-field, .switch-line):has(input:disabled) {
  cursor: not-allowed;
  opacity: .6;
}

.sidebar { z-index: var(--nf-overlay-sidebar) !important; }
body.mobile-sidebar-open::before { z-index: calc(var(--nf-overlay-sidebar) - 10) !important; }
:where(.help-popover, .help-popover > :not(summary), .tooltip, [role="tooltip"], .dropdown-menu) { z-index: var(--nf-overlay-popover) !important; }
:where(.nf-quick-create, .mobile-sheet, .pwa-install-banner) { z-index: var(--nf-overlay-sheet) !important; }
:where(.center-modal, .pay-adjustment-modal, .pwa-install-modal, .avatar-editor-modal, .tutorial-modal) { z-index: var(--nf-overlay-modal) !important; }
:where(.toast, .flash-stack) { z-index: var(--nf-overlay-toast) !important; }
html.has-center-modal { overflow: hidden; }
.center-modal[hidden] { display: none !important; }
.center-modal-card {
  width: min(94vw, 640px);
  max-height: min(88vh, 88dvh);
  overflow: auto;
  overscroll-behavior: contain;
}
.broadcast-sound-button { align-self: flex-start; margin-top: .5rem; }

.help-popover > summary,
[data-help-trigger],
.icon-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
}
.help-popover > summary { cursor: help; }
.help-popover[open] > :not(summary) {
  max-width: min(22rem, calc(100vw - 1.5rem));
  overflow-wrap: anywhere;
}

[data-import-destination-form] [hidden] { display: none !important; }
[data-import-destination-form] .form-hint { margin: 0; align-self: end; }

@media (max-width: 760px) {
  html, body { min-height: 100%; min-height: 100dvh; }
  .content { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
  :where(.btn, button, select, input:not([type="checkbox"]):not([type="radio"])) { min-height: 2.75rem; }
  .center-modal { padding: max(.75rem, env(safe-area-inset-top)) .75rem max(.75rem, env(safe-area-inset-bottom)); }
  .center-modal-card { width: 100%; max-height: calc(100dvh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .form-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3, .span-4 { grid-column: 1 / -1; }
  .table-row-actions { flex-wrap: wrap; }
  .table-row-actions > * { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  :where(.topbar, .center-modal-card, .auth-card-v17, .sidebar) {
    backdrop-filter: none !important;
  }
}
