/*
 * Vinera Finanças 2.5.3 — Tipografia e acabamento visual
 * Uma escala tipográfica para todas as telas e páginas.
 * Sem fontes externas, dependências ou JavaScript adicional.
 */
:root {
  --vf-font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --vf-type-xs: .76rem;     /* legenda, chips e indicadores */
  --vf-type-sm: .84rem;     /* texto auxiliar, metadados */
  --vf-type-base: .925rem;  /* texto corrente e formulários */
  --vf-type-ui: .86rem;     /* ações e navegação */
  --vf-type-section: 1.125rem; /* títulos das seções: sempre 18 px */
  --vf-type-page: clamp(1.38rem, 2.5vw, 1.55rem); /* título da página */
  --vf-type-modal: 1.38rem;
  --vf-radius: 17px;
  font-family: var(--vf-font);
  font-size: 16px;
  font-optical-sizing: auto;
  font-synthesis: none;
}
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body {
  font-family:var(--vf-font);
  font-size:var(--vf-type-base);
  font-weight:400;
  line-height:1.52;
  letter-spacing:0;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  background:radial-gradient(ellipse 80% 36rem at 55% -24rem,rgba(45,126,116,.11),transparent 78%),var(--bg);
}
p { line-height:1.58; }
small { font-size:var(--vf-type-xs); }
button,input,select,textarea { font-family:inherit; }
button { font-weight:650; }
strong,b { font-weight:730; }

/* Marca: mesma apresentação no desktop, mobile e acesso. */
.app-topbar .system-name h1,
.top .brand h1,
.brand h1 { font-size:1.27rem; font-weight:760; letter-spacing:-.025em; line-height:1.25; }
.mark { font-size:1rem; font-weight:850; }
.system-logo { background:linear-gradient(138deg,#52dbb4 3%,#3e85b6 100%); }
.account-identity strong { font-size:var(--vf-type-ui); font-weight:740; letter-spacing:-.01em; }
.account-identity small { font-size:var(--vf-type-xs); }
.account-trigger { border-color:#3d6270; box-shadow:0 5px 20px #0002; }
.profile-summary strong { font-size:var(--vf-type-section); }
.profile-summary .small { font-size:var(--vf-type-sm); }

/* Hierarquia: página > seção > rótulo > explicação. */
.page-title h2,
#app > .section-heading > h2,
#app > h2,
#app > section > .page-title > h2 {
  font-size:var(--vf-type-page);
  line-height:1.22;
  font-weight:790;
  letter-spacing:-.035em;
  color:#f4f9ff;
  margin:0;
}
.page-title p { font-size:var(--vf-type-sm); line-height:1.55; margin-top:7px; }
.page-titlebar { margin-bottom:18px; }
.page-title h2::after,
#app > .section-heading > h2::after {
  content:""; display:block; width:32px; height:3px; margin-top:9px;
  background:linear-gradient(90deg,var(--green),#4d8dbc);
  border-radius:99px; opacity:.8;
}
.card h2,
.card > h2,
.card .section-heading > h2,
.welcome h2,
.settings-details summary strong,
.settings-privacy h2 {
  font-size:var(--vf-type-section);
  line-height:1.3;
  letter-spacing:-.02em;
  color:#eaf4fc;
  font-weight:730;
}
.card h2,
.welcome h2,
.settings-privacy h2 { margin-bottom:13px; }
.card .section-heading > h2 { margin:0; }
.card > h2::before,
.card .section-heading > h2::before,
.welcome > h2::before,
.settings-privacy > h2::before {
  content:""; display:inline-block; vertical-align:-2px; width:3px; height:1.05em;
  background:linear-gradient(180deg,#6de9c0,#4e92af); border-radius:5px;
  margin-right:10px; opacity:.88;
}
.section-heading { gap:12px; margin-bottom:14px; }
.section-heading h2 { overflow-wrap:anywhere; }
.settings-details summary strong { margin:0; }
.settings-details summary small { font-size:var(--vf-type-sm); line-height:1.55; }
.sheet .body h2,
.account-panel-header h2,
.auth-shell h1 { font-size:var(--vf-type-modal); font-weight:790; line-height:1.23; letter-spacing:-.03em; }
.auth-shell .field label { font-size:var(--vf-type-sm); }

/* Informação corrente e microtextos: sem saltos entre abas. */
.note,
.small,
.data-grid .meta,
.line .meta,
.installment-row .meta,
.field-help,
.status,
.mutedtag,
.cal-week .dow,
.sortbar label,
.summary-footnote { font-size:var(--vf-type-sm); line-height:1.55; }
.note { color:#a8bdca; }
.empty { font-size:var(--vf-type-sm); line-height:1.6; }
.data-grid .name,.line .name,.installment-row .name {
  font-size:var(--vf-type-base); font-weight:680; line-height:1.4; letter-spacing:-.008em;
}
.value,.data-grid .amount { font-size:var(--vf-type-base); line-height:1.35; }
.data-grid .amount,.value,.summary-balance,.stat .v,.reserve-large,.reserve-goal {
  font-variant-numeric:tabular-nums lining-nums;
}
.stat .k,.mini-stat .k,.summary-due small { font-size:var(--vf-type-sm); }
.stat .v { font-size:1.15rem; font-weight:760; letter-spacing:-.02em; }
.mini-stat .number { font-size:1.25rem; font-weight:765; }
.tag,.mutedtag,.pill,.status,.summary-status {
  font-size:var(--vf-type-xs); letter-spacing:.01em; font-weight:690;
}
.eyebrow,.monthly-summary .eyebrow {
  font-size:var(--vf-type-xs); font-weight:750; letter-spacing:.095em;
}
.app-version { font-size:var(--vf-type-xs); line-height:1.5; }

/* Painel principal: valor é o único elemento deliberadamente muito maior. */
.monthly-summary { border-radius:21px; box-shadow:0 14px 32px #00000016; }
.summary-balance {
  font-size:clamp(2.08rem,4.8vw,3rem);
  font-weight:820; letter-spacing:-.048em; line-height:1.12; margin:13px 0 18px;
}
.summary-total span { font-size:var(--vf-type-sm); color:#b7cad7; }
.summary-total strong { font-size:clamp(1.1rem,2.2vw,1.48rem); font-weight:770; letter-spacing:-.025em; }
.summary-breakdown>div,.summary-reserve,.summary-after { font-size:var(--vf-type-sm); }
.summary-breakdown>div strong,.summary-reserve strong,.summary-after strong { font-size:var(--vf-type-sm); font-weight:720; }
.summary-after strong { font-size:.96rem; }
.reserve-large { font-size:clamp(1.72rem,4vw,2.13rem); font-weight:795; }
.reserve-goal { font-size:1.12rem; font-weight:740; }
.big-amount { font-size:clamp(1.38rem,2.5vw,1.8rem); font-weight:760; }
.forecast { font-size:var(--vf-type-sm); line-height:1.65; }

/* Botões, campos e controles na mesma escala em todo o produto. */
.btn,.page-title-actions .btn,.summary-actions .btn,.settings-danger .btn {
  font-size:var(--vf-type-ui); font-weight:700; line-height:1.3;
  letter-spacing:-.005em; border-radius:11px; min-height:42px;
  padding:10px 14px; transition:background-color .15s ease,border-color .15s ease,transform .15s ease;
}
.btn:hover:not(:disabled) { filter:brightness(1.075); }
.btn:active:not(:disabled) { transform:translateY(1px); }
.btn.tiny,.data-grid .footer-actions .btn,.btn.ghost {
  font-size:var(--vf-type-xs); min-height:34px; padding:7px 10px;
}
.profile-actions .btn,.account-menu-actions .btn { font-size:var(--vf-type-ui); }
.field label,.sortbar label,.period-caption {
  font-size:var(--vf-type-sm); font-weight:680; color:#c2d5df;
}
.field input,.field select,.field textarea,.sortbar select {
  font-size:var(--vf-type-base); line-height:1.4;
  border-radius:11px;
}
.period-strip { border-color:#34495a; box-shadow:0 7px 23px #0000000d; }
.period-strip .period-picker select { font-size:var(--vf-type-ui); font-weight:730; letter-spacing:0; }
.period-caption { letter-spacing:.006em; }

/* Cards com relevo discreto, sem poluição gráfica. */
.card {
  background:linear-gradient(155deg,#142235 0%,#121e30 80%);
  border-color:#304358;
  border-radius:var(--vf-radius);
  box-shadow:0 10px 28px #00000011;
}
.welcome { border-color:#32655a; border-radius:var(--vf-radius); }
.welcome p { font-size:var(--vf-type-sm); }
.summary-due,.mini-stat { border-color:#324e5e; }
.data-grid,.installment-row { line-height:1.45; }
.data-grid .right { line-height:1.5; }
.tab { font-weight:620; letter-spacing:0; }
.tab.active { font-weight:790; }

/* Evita cortes de títulos ou controles em telas menores. */
@media(max-width:899px) {
  .page-title h2,#app > .section-heading > h2 { font-size:1.35rem; }
  .card h2,.card .section-heading>h2,.welcome h2,.settings-details summary strong { font-size:1.06rem; }
  .period-strip .period-picker select { font-size:.86rem; }
  .app-topbar .system-name h1 { font-size:1.16rem; }
  .page-title-actions .btn { font-size:var(--vf-type-ui); }
  .monthly-summary { border-radius:19px; }
}
@media(max-width:599px) {
  .card { padding:17px 16px; margin:13px 0; }
  .monthly-summary { padding:20px 17px; }
  .summary-balance { font-size:clamp(2rem,9.5vw,2.55rem); }
  .summary-total strong { font-size:clamp(1.03rem,5vw,1.34rem); }
  .page-titlebar { margin-bottom:15px; }
  .period-strip { margin-bottom:17px; }
  .btn { min-height:42px; }
  .field input,.field select,.field textarea { font-size:16px; } /* impede zoom automático no iPhone */
  .data-grid .meta,.line .meta,.note { font-size:.81rem; }
}
@media(prefers-reduced-motion:reduce) { .btn,.card { transition:none; } }


/* Correções de consistência 2.5.7 (UX): períodos, linhas, formulários e responsividade. */
.period-strip {display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.period-strip .period-caption {margin-right:auto;}
.period-strip .period-picker {flex:0 1 415px;max-width:415px;min-width:0;}
.period-strip .period-today {min-height:46px;white-space:nowrap;flex:0 0 auto;border-radius:10px;}
.period-strip .period-today:disabled {opacity:.55;}
.card .line.spaced {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 0;margin:0;border-bottom:1px solid var(--stroke);min-width:0;}
.card .line.spaced:last-child {border-bottom:0;padding-bottom:3px;}
.card .line.spaced span {min-width:0;font-size:var(--vf-type-base);color:#bad0de;white-space:normal;overflow-wrap:anywhere;}
.card .line.spaced strong {flex:0 0 auto;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:var(--vf-type-base);color:#edf8ff;}
.card .data-grid {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:16px 0;border-bottom:1px solid var(--stroke);}
.card .data-grid:last-child {border-bottom:0;}
.card .data-grid > div:first-child {min-width:0;overflow-wrap:anywhere;}
.card .data-grid .right {display:flex;align-items:flex-end;flex-direction:column;gap:9px;min-width:0;}
.card .data-grid .right .row-buttons {display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;}
.card .installment-row {grid-template-columns:minmax(0,1fr) auto;gap:18px;padding:15px 0;}
.card .installment-row>div:first-child {min-width:0;overflow-wrap:anywhere;}
.card .installment-row .right {display:flex;flex-direction:column;align-items:flex-end;gap:8px;}
.card .installment-row .right>.footer-actions{margin-top:0;display:flex;flex-wrap:wrap;justify-content:flex-end;}
.card .installment-row .right .value,.card .installment-row .right strong {font-size:var(--vf-type-base);font-weight:750;white-space:nowrap;font-variant-numeric:tabular-nums;}
.card .installment-row .cat-badge {margin-top:6px;}
.modal-error {margin:12px 0;border-left:3px solid var(--red);border-radius:8px;padding:10px 12px;background:#442631;color:#ffe0e1;font-size:var(--vf-type-sm);}
.sheet .footer-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.sheet .footer-actions .btn{min-height:45px;white-space:normal;margin:0;}
@media(max-width:750px) {
 .period-strip {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;}
 .period-caption {grid-column:1/-1;}
 .period-strip .period-picker {grid-column:1;max-width:none;width:100%;}
 .period-strip .period-today {grid-column:2;min-height:42px;padding:9px 12px;}
}
@media(max-width:440px) {
 .period-strip {grid-template-columns:1fr;}
 .period-strip .period-picker {grid-column:1;}
 .period-strip .period-today {grid-column:1;justify-self:end;min-height:36px;padding:7px 12px;}
 .card .data-grid {grid-template-columns:minmax(0,1fr);gap:10px;}
 .card .data-grid .right {align-items:flex-start;text-align:left;gap:8px;}
 .card .data-grid .right .row-buttons {justify-content:flex-start;}
 .card .installment-row {grid-template-columns:minmax(0,1fr);gap:11px;}
 .card .installment-row .right {align-items:flex-start;text-align:left;}
 .card .installment-row .right>.footer-actions {justify-content:flex-start;}
 .card .line.spaced {gap:8px;}
 .sheet .footer-actions {gap:8px;}
}
/* Títulos e botões seguem a mesma grade, inclusive cartões com valores longos. */
#app .card .section-heading {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 14px;}
#app .card .section-heading>h2 {min-width:0;overflow-wrap:anywhere;flex:1 1 180px;}
#app .card .section-heading>.btn {flex:0 0 auto;}
#app .card .line:has(.big-amount) {flex-wrap:wrap;gap:12px;}
#app .card .line:has(.big-amount) .big-amount {min-width:0;overflow-wrap:anywhere;}
#app .card .line:has(.big-amount) .btn {margin-left:auto;}
@media(max-width:440px){
 #app .card .section-heading>h2 {flex-basis:140px;}
 #app .card .section-heading>.btn {min-height:38px;}
 #app .card .line:has(.big-amount) {align-items:flex-start;}
}
