[hidden] { display: none !important; }
.public-page { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.fixed-costs-page { display: grid; gap: 28px; }
.fixed-costs-intro h2, .fixed-costs-form-panel h3, .fixed-costs-list-panel h3 { font-family: "Sora", sans-serif; }
.fixed-costs-intro h2 { margin: 4px 0 12px; font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
.fixed-costs-intro p:last-child, .fixed-costs-form-panel > p, .fixed-costs-help { color: var(--muted); line-height: 1.6; }
.fixed-costs-intro p:last-child { max-width: 68ch; margin: 0; }
.fixed-costs-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.fixed-costs-summary article, .fixed-costs-form-panel, .fixed-costs-list-panel { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel-strong); }
.fixed-costs-summary article { display: grid; gap: 8px; }
.fixed-costs-summary article > span { color: var(--muted); font-weight: 600; }
.fixed-costs-summary strong { font: 700 clamp(1.55rem, 2.8vw, 2.2rem)/1.2 "Sora", sans-serif; overflow-wrap: anywhere; }
.fixed-costs-summary small { color: var(--muted); line-height: 1.5; }
.fixed-costs-content { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); align-items: start; gap: 22px; }
.fixed-costs-form-panel h3, .fixed-costs-list-panel h3 { margin: 0; font-size: 1.2rem; }
.fixed-costs-form-panel > p { margin: 12px 0 22px; }
.fixed-costs-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fixed-costs-form .field:first-child, .fixed-costs-form .field:nth-child(3), .fixed-costs-form .fixed-costs-help, .fixed-costs-form .entry-message, .fixed-costs-form button { grid-column: 1 / -1; }
.fixed-costs-form .field { min-width: 0; }
.fixed-costs-form .field input, .fixed-costs-form .field select { width: 100%; }
.fixed-costs-help { margin: 0; font-size: .84rem; }
.fixed-costs-form button { justify-self: start; }
.fixed-costs-list { display: grid; gap: 12px; margin-top: 20px; }
.fixed-cost-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); }
.fixed-cost-item h4 { margin: 0 0 7px; font-size: 1rem; overflow-wrap: anywhere; }
.fixed-cost-item p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; overflow-wrap: anywhere; }
.fixed-cost-item .fixed-cost-value { font-weight: 700; white-space: nowrap; }
.fixed-cost-status { display: inline-flex; width: fit-content; margin-top: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(31, 138, 92, .12); color: var(--income); font-size: .75rem; font-weight: 700; }
.fixed-cost-status.is-ended { background: rgba(197, 75, 66, .12); color: var(--expense); }
.fixed-cost-item button { grid-column: 2; justify-self: end; }
.fixed-costs-list .guided-empty { margin: 0; }
@media (max-width: 1000px) { .fixed-costs-content { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .fixed-costs-summary, .fixed-costs-form { grid-template-columns: 1fr; }
  .fixed-costs-summary article, .fixed-costs-form-panel, .fixed-costs-list-panel { padding: 18px; }
  .fixed-cost-item { grid-template-columns: 1fr; }
  .fixed-cost-item button { grid-column: 1; justify-self: start; }
}
.public-header, .public-header nav, .public-actions, .public-footer nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.public-header { min-height: 154px; justify-content: space-between; border-bottom: 1px solid var(--line); }
.public-brand { display: block; width: clamp(100px, 10vw, 126px); aspect-ratio: 1; overflow: hidden; border: 1px solid rgba(239, 153, 88, .5); border-radius: 50%; background: #050505; box-shadow: 0 18px 42px rgba(201, 111, 45, .26); }
.public-brand img { display: block; width: 100%; height: 100%; object-fit: cover; }
.public-page a { color: var(--text); text-underline-offset: 5px; }
.public-hero { position: relative; display: grid; grid-template-columns: minmax(0, .9fr) minmax(280px, 1.1fr); align-items: center; min-height: 650px; margin-top: 34px; padding: 64px clamp(32px, 5vw, 72px); overflow: hidden; border: 1px solid rgba(239, 153, 88, .34); border-radius: 32px; background-image: linear-gradient(90deg, rgba(10, 8, 6, .97) 0%, rgba(18, 13, 9, .86) 42%, rgba(12, 9, 7, .2) 70%, rgba(10, 8, 7, .48) 100%), url("logo-localgest.png"); background-position: center, center; background-size: cover, cover; box-shadow: 0 34px 80px rgba(72, 35, 10, .3); }
.public-hero-copy { position: relative; z-index: 1; grid-column: 1; min-width: 0; max-width: 610px; }
.public-hero h1 { font: 700 clamp(2rem, 5.7vw, 4.75rem)/1.2 "Sora", sans-serif; letter-spacing: -.035em; margin: 20px 0 28px; text-wrap: balance; overflow-wrap: anywhere; }
.public-hero h1 { color: #fff4e7; text-shadow: 0 3px 28px rgba(0, 0, 0, .5); }
.public-intro { max-width: 640px; font-size: 1.3rem; line-height: 1.65; color: #dcc6b4; }
.public-actions { margin: 30px 0 20px; }
.public-hero .public-how-link { color: #fff4e7; }
.public-note { font-size: .9rem; color: #c8b09e; }
.public-benefits { display: grid; grid-template-columns: 1fr 1.2fr; gap: 70px; margin-top: 56px; padding: 50px 0; border-top: 1px solid var(--line); }
.public-benefits h2, .public-steps h2 { font-family: "Sora", sans-serif; line-height: 1.4; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.04em; }
.public-benefits dl { margin: 0; }
.public-benefits dl > div { padding: 0 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.public-benefits dt { font-size: 1.18rem; font-weight: 600; }
.public-benefits dd { margin: 8px 0 0; line-height: 1.65; color: var(--muted); }
.public-steps { padding: 38px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); }
.public-steps ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 22px; gap: 36px; margin: 32px 0; }
.public-steps li { padding-left: 5px; line-height: 1.65; }
.public-steps li span { display: block; color: var(--muted); }
.public-footer { padding: 44px 0; line-height: 1.6; color: var(--muted); }
.public-footer-logo { display: block; width: min(340px, 100%); height: auto; object-fit: contain; border: 1px solid rgba(201, 111, 45, .28); border-radius: 16px; background: #080808; }
.access-back { margin-bottom: 24px; }
.login-logo { display: block; width: 100%; height: 168px; margin: 0 0 28px; border-radius: 20px; object-fit: cover; object-position: center 48%; background: #080808; border: 1px solid rgba(201, 111, 45, .38); box-shadow: 0 20px 44px rgba(72, 35, 10, .22); }
.sidebar-logo { display: block; width: 100%; height: 76px; object-fit: cover; object-position: center 48%; border: 1px solid rgba(201, 111, 45, .3); border-radius: 16px; background: #080808; }
.sidebar-brand-fallback { display: none; }
.sidebar-brand { flex: 1; min-width: 0; padding: 0; }
.app-layout.sidebar-collapsed .sidebar-logo { display: none; }
.app-layout.sidebar-collapsed .sidebar-brand-fallback { display: grid; }
.access-trust { font-size: .85rem; line-height: 1.65; color: var(--muted); margin-top: 22px; }
.access-legal { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: .85rem; }
.access-legal a { color: var(--text); text-underline-offset: 4px; }
.legal-check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(239, 153, 88, .07); color: var(--muted); font-size: .86rem; line-height: 1.55; }
.legal-check input, .ai-data-choice input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent-strong); }
.legal-check a, .ai-data-choice a { color: var(--accent-strong); }
.field .field-explanation { display: block; color: var(--muted); font-size: .82rem; line-height: 1.5; font-weight: 400; }
.sidebar-group-label { margin: 20px 14px 3px; color: var(--muted); font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.sidebar-group-label:first-child { margin-top: 2px; }
.sidebar-admin-label { border-top: 1px solid var(--line); padding-top: 20px; }
.sidebar-collapsed .sidebar-group-label { height: 1px; font-size: 0; margin: 12px 0 3px; padding: 0; border-top: 1px solid var(--line); }
.sidebar-link { text-decoration: none; }
.workspace-page { min-width: 0; scroll-margin-top: 24px; }
.workspace-page > * + * { margin-top: 24px; }
.workspace-heading { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.workspace-heading h1 { font: 700 clamp(1.8rem, 3.2vw, 2.6rem)/1.2 "Sora", sans-serif; letter-spacing: -.045em; margin: 0; }
.workspace-heading p { color: var(--muted); margin: 12px 0 0; line-height: 1.65; max-width: 70ch; }
.workspace-page.panel > .workspace-heading { margin-bottom: 26px; }
.header-period .field { display: flex; align-items: center; gap: 10px; }
.header-period input { width: 170px; flex: 0 1 170px; }
.header-copy { min-width: 0; }
.header-copy strong { overflow-wrap: anywhere; }
#painel.hero { display: block; }
#painel .hero-copy { padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; }
#painel h1 { max-width: 30ch; font-size: clamp(1.75rem, 3vw, 2.6rem); line-height: 1.2; letter-spacing: -.035em; }
#painel .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; }
#painel .summary-card { padding: 22px; box-shadow: none; min-width: 0; }
#painel .summary-card strong { font-size: clamp(1.25rem, 2.2vw, 1.9rem); overflow-wrap: anywhere; }
#painel .summary-card p { line-height: 1.5; }
.summary-explanation { color: var(--muted); font-size: .83rem; line-height: 1.6; }
.today-title { font-family: "Sora", sans-serif; margin: 34px 0 16px; font-size: 1.25rem; }
#painel .day-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.finance-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.finance-nav a { padding: 11px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--muted); background: var(--panel); font-weight: 600; }
.finance-nav a[aria-current] { color: var(--accent-strong); border-color: var(--accent); background: var(--bg-strong); }
.finance-entries { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; }
.finance-entries > span:empty { display: none; }
.finance-entries .workspace-actions { grid-column: 1 / -1; }
.finance-entries .panel { margin: 0; align-self: start; }
.cashflow-chart.is-empty { display: block; }
.workspace-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.account-hub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg, rgba(239, 153, 88, .13), var(--panel-strong)); }
.account-hub h2 { margin: 0; font: 700 clamp(1.3rem, 2.4vw, 1.7rem)/1.3 "Sora", sans-serif; letter-spacing: -.035em; }
.account-hub p:last-child { max-width: 58ch; margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.account-guidance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-guidance article { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.account-guidance h3 { margin: 0; font: 700 1rem/1.4 "Sora", sans-serif; }
.account-guidance p { margin: 8px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.report-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
#metas .hero-card-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.goal-today { max-width: 420px; }
.goal-today::before { content: "Meta do mês atual"; color: var(--muted); font-size: .8rem; }
.onboarding { background: var(--panel-strong); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; margin-top: 34px; }
.onboarding h2 { font-family: "Sora", sans-serif; font-size: 1.25rem; line-height: 1.45; margin: 0; }
.onboarding-progress { color: var(--muted); }
.onboarding progress { width: 100%; height: 8px; accent-color: var(--accent-strong); }
.onboarding-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 22px; gap: 28px; margin: 26px 0; }
.onboarding-steps li { padding-left: 4px; line-height: 1.5; }
.onboarding-steps p { color: var(--muted); font-size: .9rem; }
.onboarding-steps button { font-size: .85rem; padding: 10px 12px; margin: 4px 4px 4px 0; }
.step-done { color: var(--income); font-weight: 600; }
.guided-empty { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 24px; border: 1px dashed var(--line); border-radius: 18px; }
.guided-empty h3 { color: var(--text); margin: 0 0 8px; font-size: 1.08rem; line-height: 1.4; }
.guided-empty p { margin: 0 0 18px; line-height: 1.65; }
.guided-empty button { white-space: normal; }
.account-legal { border-top: 1px solid var(--line); padding-top: 22px; line-height: 1.7; }
.account-legal a { display: inline-block; color: var(--accent-strong); margin-right: 18px; overflow-wrap: anywhere; }
.privacy-center { background: radial-gradient(circle at 90% 4%, rgba(239, 153, 88, .13), transparent 24rem), var(--panel); }
.privacy-summary-grid, .privacy-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.privacy-summary-card, .privacy-detail-grid article { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel-strong); }
.privacy-summary-card h3, .privacy-detail-grid h3, .privacy-rights h3 { margin: 12px 0 8px; font-family: "Sora", sans-serif; font-size: 1.05rem; line-height: 1.4; }
.privacy-summary-card p, .privacy-detail-grid p, .privacy-rights p { margin: 0; color: var(--muted); line-height: 1.65; }
.privacy-card-icon { display: inline-flex; padding: 6px 10px; border: 1px solid rgba(239, 153, 88, .28); border-radius: 999px; color: var(--accent-strong); background: rgba(239, 153, 88, .1); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.privacy-rights { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: 32px; align-items: center; padding: 30px; border: 1px solid rgba(239, 153, 88, .28); border-radius: 22px; background: linear-gradient(135deg, rgba(239, 153, 88, .1), rgba(31, 138, 92, .06)); }
.privacy-actions { display: grid; gap: 10px; }
.privacy-actions .button, .privacy-delete-zone .button { text-align: center; text-decoration: none; }
.privacy-rights .entry-message { grid-column: 1 / -1; margin: 0; }
.privacy-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.privacy-links { display: flex; flex-wrap: wrap; gap: 14px 24px; padding: 20px 0; border-block: 1px solid var(--line); }
.privacy-links a { color: var(--accent-strong); font-weight: 600; text-underline-offset: 4px; }
.privacy-delete-zone { align-items: center; }
.privacy-notice { position: fixed; z-index: 1000; right: 24px; bottom: 24px; left: 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; max-width: 1040px; margin: 0 auto; padding: 20px 22px; border: 1px solid rgba(239, 153, 88, .4); border-radius: 20px; background: rgba(24, 18, 14, .97); color: #fff4e7; box-shadow: 0 24px 70px rgba(0, 0, 0, .42); backdrop-filter: blur(18px); }
.privacy-notice strong { display: block; margin-bottom: 5px; font-family: "Sora", sans-serif; }
.privacy-notice p { max-width: 72ch; margin: 0; color: #d8c3b2; font-size: .9rem; line-height: 1.55; }
.privacy-notice-actions { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }
.privacy-notice a { color: #fff4e7; text-underline-offset: 4px; white-space: nowrap; }
.ai-data-choice { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; width: 100%; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.legal-page { max-width: 820px; margin: auto; padding: 32px 24px 60px; line-height: 1.8; }
.legal-page h1 { font: 700 clamp(2rem, 5vw, 3rem)/1.2 "Sora", sans-serif; letter-spacing: -.05em; }
.legal-page h2 { font: 600 1.25rem/1.5 "Sora", sans-serif; margin-top: 34px; }
.legal-page a { color: var(--accent-strong); overflow-wrap: anywhere; }
.legal-page .legal-meta { color: var(--muted); }
.legal-page nav { display: flex; flex-wrap: wrap; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.legal-page .legal-summary { padding: 22px; border: 1px solid rgba(239, 153, 88, .28); border-radius: 18px; background: rgba(239, 153, 88, .08); }
.legal-page .legal-toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; margin: 24px 0 36px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
.legal-page .legal-toc a { font-size: .92rem; }
.legal-table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 16px; }
.legal-table { width: 100%; min-width: 660px; border-collapse: collapse; font-size: .92rem; }
.legal-table th, .legal-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal-table th { color: var(--text); background: var(--panel-strong); font-family: "Sora", sans-serif; }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-page .legal-callout { padding: 18px 20px; border-left: 4px solid var(--accent); border-radius: 0 14px 14px 0; background: var(--panel); }
.app-content :is(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
@media(max-width:1100px) {
  #painel .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-entries { grid-template-columns: 1fr; }
  .account-hub { grid-template-columns: 1fr; align-items: start; }
  .onboarding-steps { grid-template-columns: 1fr; gap: 20px; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
:is(.public-page, .login-screen) :is(a, button, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
:root[data-theme="dark"] :is(.public-page, .login-screen, .app-content) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  color-scheme: dark;
  color: var(--text);
  background: #201913;
  border-color: rgba(255, 232, 207, .2);
}
:root[data-theme="dark"] :is(.public-page, .login-screen, .app-content) :is(input, textarea)::placeholder { color: #a99180; opacity: 1; }
:root[data-theme="dark"] :is(.public-page, .login-screen, .app-content) option { color: var(--text); background: #2a211a; }
:root[data-theme="dark"] :is(.public-page, .login-screen, .app-content) :is(input, select, textarea):focus { background: #17120f; border-color: var(--accent); }
:root[data-theme="dark"] :is(.day-metric, .summary-card, .category-row, .entry-item, .tips-card, .ai-form, .ai-message.is-assistant, .investment-kpis article, .investment-form, .investment-item, .online-sheet-row, .inventory-history-item, .business-item, .inventory-item, .toggle-field) { background: rgba(48, 38, 30, .78); }
:root[data-theme="dark"] .investments-panel { background: radial-gradient(circle at 92% 8%, rgba(239, 153, 88, .13), transparent 24rem), linear-gradient(145deg, rgba(38, 31, 25, .96), rgba(24, 19, 15, .9)); }
:root[data-theme="dark"] .investment-badge { color: #ffd2a9; background: rgba(201, 111, 45, .18); border-color: rgba(239, 153, 88, .35); }
@media(max-width:760px) {
  .app-main .site-header { flex-wrap: wrap; gap: 18px; }
  .header-period { width: 100%; }
  .header-period .field { justify-content: space-between; }
  .onboarding { padding: 20px; }
  #painel .summary-card { padding: 16px; }
  #painel .day-summary-grid, #metas .hero-card-top { grid-template-columns: 1fr; }
  .finance-nav a { padding: 10px 12px; font-size: .9rem; }
  .workspace-actions .button { flex: 1 1 160px; }
  .account-hub { padding: 20px; }
  .account-guidance { grid-template-columns: 1fr; }
  .public-page { padding-inline: 22px; }
  .public-header { min-height: 0; padding-block: 22px; gap: 20px; }
  .public-brand { width: min(112px, 30vw); }
  .public-header nav { gap: 18px; font-size: .9rem; }
  .public-hero { display: block; min-height: 620px; margin-top: 24px; padding: 44px 26px; background-image: linear-gradient(180deg, rgba(10, 8, 6, .96) 0%, rgba(15, 11, 8, .88) 58%, rgba(10, 8, 7, .52) 100%), url("logo-localgest.png"); background-position: center, 64% center; }
  .login-logo { width: 100%; height: 142px; }
  .public-benefits { grid-template-columns: 1fr; gap: 24px; padding-top: 30px; }
  .public-steps { padding: 24px; }
  .public-steps ol { grid-template-columns: 1fr; gap: 22px; }
  .privacy-summary-grid, .privacy-detail-grid, .privacy-rights { grid-template-columns: 1fr; }
  .privacy-rights { padding: 22px; }
  .privacy-notice { right: 14px; bottom: 14px; left: 14px; display: block; padding: 18px; }
  .privacy-notice-actions { justify-content: space-between; margin-top: 16px; }
  .legal-page .legal-toc { grid-template-columns: 1fr; }
}
@media(min-width:761px) and (max-width:1020px) {
  .public-hero { grid-template-columns: minmax(0, 1fr) minmax(220px, .72fr); min-height: 610px; background-position: center, 58% center; }
}
@media(max-width:900px) {
  .app-layout.sidebar-collapsed .sidebar-logo { display: block; }
  .app-layout.sidebar-collapsed .sidebar-brand-fallback { display: none; }
}
@media(max-width:380px) {
  #painel .summary-grid, .report-stats { grid-template-columns: 1fr; }
}

/* Keep every data surface visually anchored to the dark workspace. */
:root[data-theme="dark"] {
  --dark-surface: #261e18;
  --dark-surface-raised: #30251e;
  --dark-surface-soft: #382a21;
  --dark-surface-line: rgba(255, 226, 199, .13);
}

:root[data-theme="dark"] :is(
  .day-metric,
  .day-attention-item,
  .summary-card,
  .button-secondary,
  .sales-history,
  .sales-history-item,
  .recurring-entry-item,
  .category-row,
  .entry-item,
  .tips-card,
  .ai-message.is-assistant,
  .investment-kpis article,
  .investment-form,
  .investment-item,
  .investment-option-card,
  .investment-intent,
  .investment-preference-review,
  .investment-profile-overview,
  .investment-scenario-card,
  .investment-simulation-rates,
  .online-sheet-kpis article,
  .online-sheet-row,
  .inventory-history-item,
  .business-item,
  .inventory-item,
  .danger-zone,
  .toggle-field,
  .guided-empty
) {
  background: var(--dark-surface-raised);
  border-color: var(--dark-surface-line);
  color: var(--text);
}

:root[data-theme="dark"] :is(
  .sales-target-card,
  .profile-form,
  .spreadsheet-tools,
  .ai-assistant
) {
  background: linear-gradient(145deg, var(--dark-surface-raised), var(--dark-surface));
  border-color: var(--dark-surface-line);
  color: var(--text);
}

:root[data-theme="dark"] .sales-target-grid article {
  background: var(--dark-surface-soft);
  border-color: var(--dark-surface-line);
}

:root[data-theme="dark"] .sales-target-grid .sales-target-daily {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

:root[data-theme="dark"] :is(.sales-form, .online-sheet-row.is-complete) {
  background: linear-gradient(145deg, rgba(31, 138, 92, .16), var(--dark-surface));
  border-color: rgba(84, 205, 145, .2);
}

:root[data-theme="dark"] :is(.cashflow-current, .spreadsheet-tools, .insight-card.forecast) {
  background: linear-gradient(145deg, rgba(72, 103, 177, .2), var(--dark-surface));
  border-color: rgba(126, 155, 224, .2);
}

:root[data-theme="dark"] .ai-assistant {
  background: linear-gradient(145deg, rgba(31, 138, 92, .14), var(--dark-surface));
  border-color: rgba(84, 205, 145, .18);
}

:root[data-theme="dark"] .business-item.is-active {
  background: rgba(201, 111, 45, .14);
  border-color: rgba(239, 153, 88, .32);
}

:root[data-theme="dark"] .online-sheet-row :is(input, select):focus {
  background: #17120f;
  border-color: var(--accent);
}

/* Allow content to shrink and wrap inside its own grid/flex cell. */
:is(.panel, .hero-card, .summary-card, .day-metric, .insight-card,
  .sales-target-grid > article, .sales-history, .profile-form,
  .entry-form, .online-sheet-form, .online-sheet-table, .workspace-page) {
  min-width: 0;
  overflow-wrap: anywhere;
}

:is(.panel-heading-inline, .section-heading-inline, .sales-heading,
  .investments-heading, .online-sheet-heading, .online-sheet-list-heading,
  .entry-item, .entry-side, .sales-history-item, .category-row,
  .profile-avatar-area, .header-period .field) {
  flex-wrap: wrap;
}

:is(.panel-heading-inline, .section-heading-inline, .online-sheet-heading,
  .online-sheet-list-heading, .investments-heading, .sales-heading) > div {
  min-width: 0;
  flex: 1 1 220px;
}

:is(.entry-main, .entry-side, .profile-avatar-actions,
  .inventory-history-item > div, .business-item > div) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.entry-main { flex: 1 1 220px; }
.entry-badge, .toggle-field input { flex-shrink: 0; }
.entry-title { display: block; line-height: 1.5; }
.summary-card.insight-card strong { white-space: normal; overflow: visible; text-overflow: clip; }
.ai-data-choice { grid-column: 1 / -1; }
.panel-description { margin-top: 0; }
.investment-jump-nav { gap: 12px; }
.login-card h1 { line-height: 1.3; overflow-wrap: anywhere; }
.login-message, .entry-message { line-height: 1.5; overflow-wrap: anywhere; }
.field > span { line-height: 1.5; }
.field input[type="file"] { overflow: hidden; }
.sidebar-link > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.sidebar-footer { flex-shrink: 0; }
.sidebar { overflow: hidden; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
.sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; align-content: start; overscroll-behavior-y: contain; touch-action: pan-y pinch-zoom; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; padding-bottom: 12px; }
.sidebar-footer { margin-top: 0; }
@media (max-width: 760px) {
  body.mobile-menu-open { overflow: hidden; }
  .sidebar { height: 100vh; height: 100dvh; max-height: 100dvh; padding-top: max(20px, env(safe-area-inset-top)); gap: 20px; }
}

/* Financial cards follow the selected month; stock uses current data. */
.home-greeting { margin: 0 0 12px; color: var(--accent-strong); font: 700 1.15rem/1.6 "Sora", sans-serif; overflow-wrap: anywhere; }
#painel #homeTitle { max-width: 28ch; font-size: clamp(2rem, 3.7vw, 3.5rem); line-height: 1.18; margin: 0; }
#painel .home-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.home-kpi { position: relative; min-width: 0; grid-column: span 2; display: flex; flex-direction: column; gap: 16px; padding: 22px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel-strong); overflow: hidden; }
.home-kpi.stock-value, .home-kpi.stock-quantity { grid-column: span 3; }
.home-kpi.fixed-costs { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 28px; background: linear-gradient(120deg, rgba(239, 153, 88, .09), transparent 70%), var(--panel-strong); }
.home-fixed-overview { display: flex; flex-direction: column; gap: 16px; }
.home-fixed-overview > span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.home-fixed-overview > strong { color: var(--accent-strong); font-size: clamp(1.55rem, 2.5vw, 2.25rem); }
.home-fixed-details { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.home-fixed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.home-fixed-list li { min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.home-fixed-list span { min-width: 0; overflow-wrap: anywhere; font-size: .82rem; }
.home-kpi .home-fixed-list strong { flex-shrink: 0; font-size: .85rem; letter-spacing: -.025em; }
.home-fixed-list .home-fixed-more { font-size: .75rem; color: var(--muted); }
.home-fixed-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.home-fixed-actions .button { padding: 11px 14px; font-size: .75rem; }
.home-kpi::before { content: ""; position: absolute; inset: 0 20px auto; height: 3px; background: var(--accent-strong); border-radius: 0 0 4px 4px; }
.home-kpi > span { min-height: 2.8em; font-size: .82rem; line-height: 1.4; font-weight: 600; color: var(--muted); }
.home-kpi strong { font: 700 clamp(1.12rem, 1.8vw, 1.65rem)/1.35 "Sora", sans-serif; letter-spacing: -.04em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.home-kpi p { margin: 0; font-size: .75rem; line-height: 1.6; color: var(--muted); }
.home-kpi strong.is-long { font-size: clamp(.95rem, 1.3vw, 1.1rem); letter-spacing: -.035em; }
.home-kpi.income strong { color: var(--income); }
.home-kpi.income::before { background: var(--income); }
.home-kpi.expense strong, .home-kpi strong.negative { color: var(--expense); }
.home-kpi.expense::before { background: var(--expense); }
.home-kpi.balance { background: linear-gradient(145deg, rgba(239, 153, 88, .15), transparent 75%), var(--panel-strong); border-color: var(--accent); }
.home-kpi.profit-goal-card { grid-column: 1 / -1; gap: 10px; }
.home-kpi.profit-goal-card > span { min-height: auto; }
.home-kpi.profit-goal-card .profit-goal-status { color: var(--text); font-weight: 700; }
.home-kpi.profit-goal-card.is-loss .profit-goal-status { color: var(--expense); }
.home-kpi.profit-goal-card .button { align-self: flex-start; margin-top: 4px; }
.profit-goal-progress { width: 100%; height: 12px; overflow: hidden; border-radius: 999px; background: var(--line); }
.profit-goal-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--income); transition: width 220ms ease; }
.profit-goal-card.is-loss .profit-goal-progress span { background: var(--expense); }
.profit-goal-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; }
.profit-goal-form { display: grid; gap: 16px; align-content: start; }
.profit-goal-form .button { justify-self: start; }
.profit-goal-period { margin: 0; color: var(--muted); font-weight: 700; }
.profit-goal-form .field-explanation { margin: 0; color: var(--muted); line-height: 1.6; }
.profit-goal-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profit-goal-summary > div { display: grid; align-content: center; gap: 8px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel-strong); }
.profit-goal-summary span { color: var(--muted); font-size: .82rem; }
.profit-goal-summary strong { overflow-wrap: anywhere; font: 700 clamp(1rem, 2vw, 1.35rem)/1.3 "Sora", sans-serif; }
.profit-goal-summary strong.negative { color: var(--expense); }
@media (max-width: 760px) { .profit-goal-layout { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .profit-goal-summary { grid-template-columns: 1fr; } }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 28px; }
.home-actions .button { font-size: .88rem; }
.home-detail-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; }
.home-detail { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); }
.home-detail-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.home-detail-heading h2 { font: 600 1.05rem/1.5 "Sora", sans-serif; margin: 0; }
.home-detail-heading .text-button { color: var(--accent-strong); font-weight: 600; font-size: .8rem; }
.home-list { display: grid; }
.home-list-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.home-list-row > div { flex: 1; min-width: 0; display: grid; gap: 7px; }
.home-list-row strong { font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }
.home-list-row > strong { text-align: right; font-variant-numeric: tabular-nums; max-width: 45%; }
.home-list-row > div > span { font-size: .75rem; line-height: 1.6; color: var(--muted); }
.stock-status { color: var(--income); font-size: .75rem; white-space: nowrap; }
.stock-status.is-low { color: var(--accent-strong); }
.home-stock-warning { color: var(--accent-strong); font-size: .8rem; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 16px; }
.inventory-adjustment { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.inventory-adjustment > div { grid-column: 1 / -1; min-width: 0; }
.inventory-adjustment-actions { flex-wrap: wrap; }
#painel .home-detail .guided-empty { padding: 20px; }
#minha-empresa .onboarding { margin-top: 28px; }
.report-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1200px) {
  .home-kpi strong { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
}
@media (max-width: 900px) {
  .home-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .inventory-adjustment { grid-template-columns: minmax(0, 1fr); }
  #painel .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-kpi { grid-column: auto; padding: 20px 16px; gap: 12px; }
  .home-kpi.stock-value, .home-kpi.stock-quantity { grid-column: auto; }
  .home-kpi.fixed-costs { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .home-kpi.balance { grid-column: 1 / -1; grid-row: 2; }
  .home-kpi strong { font-size: clamp(1.15rem, 4.8vw, 1.55rem); }
  .home-kpi.balance strong { font-size: 1.8rem; }
  .home-kpi.balance strong.is-long { font-size: clamp(1.05rem, 4.3vw, 1.5rem); }
  .home-kpi > span { min-height: auto; }
  .home-detail { padding: 20px 16px; }
  .home-actions .button { flex: 1 1 44%; padding: 12px 10px; white-space: normal; }
  .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  #painel .home-kpis, .report-stats { grid-template-columns: minmax(0, 1fr); }
  .home-kpi.balance { grid-row: auto; }
  .home-fixed-list li { flex-wrap: wrap; gap: 6px; }
}
.sidebar-collapsed .sidebar-group-label { flex-shrink: 0; }

/* The expanded sidebar also takes space on medium-sized desktop screens. */
@media (min-width: 761px) and (max-width: 1200px) {
  .insights-dashboard, .sales-layout, .sales-target-card { grid-template-columns: minmax(0, 1fr); }
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #metas .hero-card-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .privacy-summary-grid { grid-template-columns: minmax(0, 1fr); }
  .privacy-rights { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  :is(.panel-heading-inline, .section-heading-inline, .online-sheet-heading,
    .online-sheet-list-heading, .investments-heading, .sales-heading) > div {
    flex-basis: auto;
  }
  .entry-main { flex-basis: auto; }
  .entry-side { flex-direction: row; align-items: center; }
  .entry-item > .entry-main { width: 100%; }
  .profile-avatar-actions { flex: 1 1 180px; }
  .section-heading-inline { align-items: flex-start; }
  .header-period .field { justify-content: space-between; }
  .investment-form, .investment-simulation-rates { padding: 16px; }
}

@media (max-width: 400px) {
  .public-header nav { gap: 12px; }
  .public-hero { padding: 30px 20px; }
  .privacy-notice-actions { flex-wrap: wrap; }
  .entry-main { flex-wrap: wrap; }
  .entry-main > div:last-child { flex: 1 1 150px; }
  .recurring-entry-item { grid-template-columns: minmax(0, 1fr); }
  .recurring-stop-button { grid-column: auto; grid-row: auto; justify-self: start; }
}
