:root {
  --color-primary: #2563EB;
  --color-primary-dark: #1D4ED8;
  --color-success: #16A34A;
  --color-danger: #DC2626;
  --color-warning: #F59E0B;
  --color-bg: #F6F8FC;
  --color-surface: #FFFFFF;
  --color-text: #172033;
  --color-text-secondary: #64748B;
  --color-border: #E5E7EB;

  --radius-card: 16px;
  --radius-input: 12px;
  --shadow-card: 0 1px 2px rgba(23, 32, 51, 0.04), 0 6px 16px rgba(23, 32, 51, 0.06);
  --shadow-elevated: 0 8px 24px rgba(37, 99, 235, 0.28);
  --font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --sidebar-width: 220px;
  --content-max-width: 1240px;
  --bottom-nav-height: 60px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  font-weight: 400;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

/* Teste de tipografia: normalizar qualquer peso pesado escondido (negrito
   padrão de navegador em strong/b/headings, ou peso herdado em botões) para
   400 — a hierarquia passa a ser só tamanho/cor/espaçamento/contraste. */
h1, h2, h3, h4, h5, h6,
strong, b,
button {
  font-weight: 400;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

button {
  font-family: inherit;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
}

/* ================= LOGIN ================= */
.screen-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px 26px;
  width: 100%;
  max-width: 380px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.brand-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--color-primary), var(--color-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 8px;
  box-shadow: var(--shadow-elevated);
}

.brand-badge .icon {
  width: 28px;
  height: 28px;
}

.brand-title {
  font-size: 21px;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 22px;
  max-width: 260px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 48px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface);
}

.btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 13px;
  font-size: 15.5px;
  font-weight: 400;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-input);
  cursor: pointer;
  margin-top: 6px;
  transition: transform 0.08s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary .icon {
  width: 20px;
  height: 20px;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.alert-error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: var(--color-danger);
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .card {
    max-width: 420px;
    padding: 40px 36px;
  }
}

/* ================= APP SHELL ================= */
.app-shell {
  min-height: 100vh;
}

.home-header {
  padding: 16px 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-greeting {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.home-body {
  padding: 8px 14px calc(var(--bottom-nav-height) + 20px);
}

.btn-link-add {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 400;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-link-add .icon {
  width: 17px;
  height: 17px;
}

.section-title .icon {
  width: 18px;
  height: 18px;
}

/* ---- month switcher ---- */
.month-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 16px 10px;
}

.month-label {
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--color-text-secondary);
  min-width: 120px;
  text-align: center;
  text-transform: uppercase;
}

.month-arrow {
  color: var(--color-primary);
  padding: 5px 8px;
  line-height: 1;
  border-radius: 10px;
  display: flex;
}

.month-arrow:active {
  background: var(--color-border);
}

.month-arrow .icon {
  width: 18px;
  height: 18px;
}

/* ---- hero saldo card ---- */
.hero-card {
  background: linear-gradient(155deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-card);
  padding: 18px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: var(--shadow-elevated);
}

.hero-label {
  font-size: 12.5px;
  font-weight: 400;
  opacity: 0.85;
  margin-bottom: 3px;
}

.hero-value {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-split {
  display: flex;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-split-item {
  flex: 1;
}

.hero-split-label {
  font-size: 12px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  font-weight: 400;
}

.hero-split-value {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ---- status cards row ---- */
.status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 12px 8px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 3px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.stat-value {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.stat-success { color: var(--color-success); }
.stat-warning { color: var(--color-warning); }
.stat-danger { color: var(--color-danger); }

.home-grid-2col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-grid-2col .panel-daily {
  order: 1;
}

.home-grid-2col .panel-topay {
  order: 2;
}

.section-title {
  font-size: 18px;
  font-weight: 400;
  margin: 16px 0 8px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary);
  background: var(--color-border);
  padding: 2px 9px;
  border-radius: 20px;
}

.section-title-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-icon-danger { color: var(--color-danger); }
.section-icon-warning { color: #B45309; }
.section-icon-success { color: var(--color-success); }

.icon-xl {
  width: 40px;
  height: 40px;
}

.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
}

.info-card-chart {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  text-align: center;
}

.donut-wrap {
  position: relative;
  display: inline-block;
}

.donut-svg {
  display: block;
  margin: 0 auto;
}

.donut-segment {
  cursor: pointer;
  transform-origin: 84px 84px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.donut-segment.donut-active {
  transform: scale(1.045);
}

.donut-segment.donut-dim {
  opacity: 0.35;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.donut-center-value {
  font-size: 15px;
  color: var(--color-text);
  margin-top: 2px;
}

.donut-tooltip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--color-text);
  color: #fff;
  border-radius: 12px;
  min-width: 140px;
}

.donut-tooltip-name {
  font-size: 13px;
  opacity: 0.9;
}

.donut-tooltip-value {
  font-size: 17px;
}

.donut-tooltip-percent {
  font-size: 12.5px;
  opacity: 0.75;
}

.legend-row {
  cursor: pointer;
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
  margin: 0 -8px;
  transition: background-color 0.15s ease;
}

.legend-row:hover,
.legend-row.legend-active {
  background: var(--color-bg);
}

.side-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 14px;
}

.empty-state {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 18px 16px;
  font-size: 13.5px;
  background: var(--color-surface);
  border-radius: var(--radius-card);
}

/* ---- bill card ---- */
.bill-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: box-shadow 0.15s ease;
}

/* Tons pastel MUITO suaves por status — reforço visual discreto, o badge
   continua sendo a fonte de verdade do status, isto é só um "wash" de fundo. */
.card-status-danger {
  background: #FEF5F5;
  border-color: #FBDCDC;
}

.card-status-success {
  background: #F3FBF6;
  border-color: #D9F0E1;
}

.card-status-warning {
  background: #FFFCF3;
  border-color: #FBEFCF;
}

.bill-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.bill-card-icon .icon {
  width: 19px;
  height: 19px;
}

.bill-card-body {
  flex: 1;
  min-width: 0;
}

.bill-card-desc {
  font-weight: 400;
  font-size: 15px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bill-card-due {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 3px;
}

.bill-card-due.is-overdue {
  color: var(--color-danger);
  font-weight: 400;
}

.bill-card-amount {
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 3px;
}

.stat-icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.bill-card-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: none;
}

.btn-pay {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 400;
  font-size: 12.5px;
  cursor: pointer;
  min-height: 42px;
  white-space: nowrap;
}

.btn-pay:active {
  background: var(--color-primary-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-success { background: #ECFDF5; color: #15803D; }
.badge-danger { background: #FEF2F2; color: #B91C1C; }
.badge-warning { background: #FFFBEB; color: #B45309; }
.badge-muted { background: var(--color-bg); color: var(--color-text-secondary); }

.bill-card-early-note {
  display: block;
  font-size: 11.5px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.section-title-sub {
  font-size: 15px;
  margin: 12px 0 6px;
}

.previous-pending-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
}

.previous-pending-title {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.previous-pending-desc {
  font-size: 15px;
}

.paid-section {
  margin-bottom: 12px;
}

.paid-section-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  color: var(--color-text-secondary);
  font-size: 15px;
}

.paid-section-summary::-webkit-details-marker {
  display: none;
}

.paid-section[open] .paid-section-summary {
  margin-bottom: 4px;
}

.badge-icon {
  width: 13px;
  height: 13px;
  flex: none;
}

/* ---- filter tabs (mantido como opção secundária, hoje sem uso na Contas) ---- */
.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 0 20px 12px;
  overflow-x: auto;
}

.filter-tab {
  flex: none;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}

.filter-tab.active {
  background: var(--color-primary);
  color: #fff;
}

/* ---- bottom nav ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--color-text-secondary);
  flex: 1;
  padding: 5px 0;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -24px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  cursor: pointer;
  flex: none;
}

.nav-fab .icon {
  width: 22px;
  height: 22px;
}

.nav-fab:active {
  transform: scale(0.95);
}

/* ---- modal / action sheet ---- */
#modal-root:empty {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 51, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 17px;
  font-weight: 400;
  margin-bottom: 4px;
}

.modal-bill-desc {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 14px;
}

.btn-secondary {
  width: 100%;
  min-height: 44px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 2px;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  padding: 8px 0;
}

/* amount display grande (Pagar / Nova despesa) */
.amount-display {
  text-align: center;
  padding: 10px 0 18px;
}

.amount-display-value {
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.amount-input-big {
  width: 100%;
  border: none;
  background: none;
  text-align: center;
  font-size: 40px;
  font-weight: 400;
  color: var(--color-text);
  padding: 6px 0 16px;
  font-family: inherit;
}

.amount-input-big:focus {
  outline: none;
}

/* action sheet (menu do +) */
.sheet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding: 16px 4px;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}

.sheet-option:last-child {
  border-bottom: none;
}

.sheet-option-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* ---- resumo ---- */
.summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--color-border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.summary-name {
  flex: 1;
  font-size: 14px;
  font-weight: 400;
}

.summary-value {
  font-weight: 400;
  font-size: 15px;
}

.summary-rank {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-secondary);
  width: 18px;
}

/* ---- toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + 16px);
  transform: translateX(-50%) translateY(12px);
  background: var(--color-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 400;
  box-shadow: var(--shadow-card);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast svg {
  color: #4ADE80;
}

/* ---- settings / mais ---- */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.settings-row:last-child {
  border-bottom: none;
}

.sidebar {
  display: none;
}

/* ---- categorias (Configurações) ---- */
.category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.category-row:last-child {
  border-bottom: none;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.category-name {
  flex: 1;
  min-width: 90px;
  font-size: 14.5px;
}

.category-actions {
  display: flex;
  gap: 4px;
  flex: none;
  width: 100%;
  justify-content: flex-end;
}

.cat-action {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 8px;
}

.cat-action:hover {
  background: var(--color-bg);
}

.cat-action-danger {
  color: var(--color-danger);
}

.field-optional {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.color-input {
  width: 64px;
  min-height: 40px;
  padding: 4px;
  cursor: pointer;
}

@media (min-width: 481px) {
  .category-actions {
    width: auto;
  }
}

/* ================= DESKTOP ================= */
@media (min-width: 1024px) {
  .home-body {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 24px 32px 60px;
  }

  .home-header {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 28px 32px 8px;
  }

  .month-switcher {
    max-width: var(--content-max-width);
    margin: 0 auto;
  }

  .filter-tabs {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 32px 12px;
  }

  .status-row {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Home desktop: coluna principal (O que preciso pagar) ~65% + coluna
     secundária (gastos do dia, atalhos) ~35%, em vez de esticar uma coluna
     única de 760px no meio de uma tela de 1920px. Mobile usa a MESMA
     estrutura em flex-column (ver regra base), só troca a ordem visual. */
  .home-grid-2col {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .home-grid-2col .panel-topay {
    order: 1;
    flex: 1.85;
  }

  .home-grid-2col .panel-daily {
    order: 2;
    flex: 1;
  }

  .side-panel {
    padding: 20px;
  }

  .bottom-nav {
    display: none;
  }

  body.has-sidebar {
    padding-left: var(--sidebar-width);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 30;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 20px;
    margin-bottom: 12px;
    font-weight: 400;
    font-size: 15.5px;
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--color-border);
  }

  .sidebar-brand .brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    margin-bottom: 0;
  }

  .sidebar-brand .brand-badge .icon {
    width: 18px;
    height: 18px;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--color-text-secondary);
    font-weight: 400;
    font-size: 14.5px;
    border-left: 2.5px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .sidebar-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
  }

  .sidebar-link.active {
    background: #EFF6FF;
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 400;
  }

  .sidebar-link .icon {
    width: 19px;
    height: 19px;
    flex: none;
  }

  .sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-user {
    font-size: 13.5px;
    font-weight: 400;
  }

  .sidebar-logout {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    padding: 6px;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .sidebar-logout:hover {
    background: var(--color-bg);
    color: var(--color-danger);
  }

  .sidebar-logout .icon {
    width: 18px;
    height: 18px;
  }

  #modal-root .modal-overlay {
    align-items: center;
  }

  #modal-root .modal-card {
    border-radius: 20px;
  }
}

/* ================= MOVIMENTAÇÕES (gastos/receitas) ================= */
.tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tx-row-income {
  background: #F3FBF6;
  border-bottom-color: transparent;
}

.tx-row:last-child {
  border-bottom: none;
}

.tx-row-desc {
  font-weight: 400;
  font-size: 15px;
  margin-bottom: 2px;
}

.tx-row-meta {
  font-size: 12.5px;
  color: var(--color-text-secondary);
}

.tx-row-amount {
  font-weight: 400;
  font-size: 17px;
  white-space: nowrap;
}

.amount-income { color: var(--color-success); }
.amount-expense { color: var(--color-text); }
.amount-expense-strong { color: var(--color-danger); }
.daily-balance { color: var(--color-primary); }

.icon-today {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.icon-in { color: var(--color-success); }
.icon-out { color: var(--color-danger); }

.modal-subtitle {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  margin: -8px 0 16px;
}

.btn-danger-link {
  width: 100%;
  min-height: 44px;
  background: none;
  border: none;
  color: var(--color-danger);
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.btn-danger-link .icon {
  width: 16px;
  height: 16px;
}

.field-note {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.sheet-option-desc {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  font-weight: 400;
  display: block;
  margin-top: 2px;
}

.daily-summary-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.daily-summary-item {
  flex: 1;
}

.daily-summary-label {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
  white-space: nowrap;
}

.daily-summary-value {
  font-size: 16px;
  font-weight: 400;
}

@media (min-width: 480px) {
  .daily-summary-label {
    font-size: 12.5px;
  }

  .daily-summary-value {
    font-size: 19px;
  }
}

/* Faixa 481-767px (telas mobile maiores): mesma base compacta, com um leve
   reforço de tamanho onde a largura sobra — segue até o breakpoint desktop
   (1024px), já que não há um tratamento de tablet à parte. */
@media (min-width: 481px) {
  .home-greeting {
    font-size: 24px;
  }

  .month-label {
    font-size: 16px;
  }

  .hero-value {
    font-size: 32px;
  }

  .hero-split-value {
    font-size: 17px;
  }

  .stat-label {
    font-size: 13px;
  }

  .stat-value {
    font-size: 18px;
  }

  .section-title {
    font-size: 19px;
  }
}

.link-see-all {
  display: block;
  text-align: center;
  font-weight: 400;
  font-size: 13.5px;
  padding: 8px 0 0;
}

/* Afinamento extra só para telas bem pequenas (<=480px) — hero card,
   Movimentação de hoje e cards de conta um pouco mais finos na vertical.
   Não mexe em 481px+ nem em desktop. */
@media (max-width: 480px) {
  .hero-card {
    padding: 14px 16px;
    margin-bottom: 10px;
  }

  .hero-label {
    margin-bottom: 2px;
  }

  .hero-value {
    font-size: 26px;
    margin-bottom: 8px;
  }

  .hero-split {
    gap: 16px;
    padding-top: 10px;
  }

  .hero-split-label {
    margin-bottom: 1px;
  }

  .hero-split-value {
    font-size: 14px;
  }

  .side-panel {
    padding: 12px;
  }

  .daily-summary-row {
    gap: 6px;
    margin-bottom: 8px;
  }

  .empty-state {
    padding: 14px 16px;
    font-size: 13px;
  }

  .link-see-all {
    padding: 6px 0 0;
  }

  .bill-card {
    padding: 10px 12px;
  }

  .bill-card-desc {
    margin-bottom: 1px;
  }

  .bill-card-due {
    margin-bottom: 2px;
  }

  .bill-card-amount {
    margin-bottom: 2px;
  }
}
