/* Meu Financeiro's own identity. Financial view styles are inherited separately. */
:root {
  color-scheme: light;
  --ink: #143b42; --ink-deep: #10343b; --green: #b8edaa; --green-dark: #306f49;
  --page: #f4f6f3; --surface: #ffffff; --line: #dce6e0; --quiet: #667a78;
  --bg: #f4f6f3; --panel: #fff; --border: #dce6e0; --text: #173a40; --muted: #667a78;
  --cyan: #2d746e; --lime: #407b43; --danger: #ab3636;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font-family: inherit; font-size: 15px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,p { margin: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; padding: 12px 18px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.product-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 19px; font-weight: 750; letter-spacing: -.6px; line-height: 1.25; }
.product-brand img { display: block; width: 42px; height: 42px; flex: 0 0 auto; }
.product-brand small { display: block; margin-top: 6px; font-size: 8px; font-weight: 650; letter-spacing: 1.6px; color: var(--quiet); }
.primary, button.primary { display: inline-flex; justify-content: space-between; align-items: center; gap: 18px; background: var(--ink); border: 1px solid var(--ink); color: white; border-radius: 10px; font-size: 14px; font-weight: 650; line-height: 1.4; padding: 13px 18px; min-height: 46px; width: auto; margin: 0; box-shadow: none; transition: background .2s ease, transform .2s ease; }
.primary:hover:not(:disabled) { background: #22555c; transform: translateY(-1px); }
.secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 10px 14px; color: var(--ink); font-size: 13px; font-weight: 600; }
.secondary:hover:not(:disabled) { background: #eef5ef; }
.danger { background: #fff1f0; color: #a53b38; border: 1px solid #f0c8c4; border-radius: 8px; font-size: 13px; padding: 9px 13px; }
.subtle-button { background: none; border: 0; color: var(--quiet); padding: 0; font-size: 12px; line-height: 1.5; }
.subtle-button:hover { color: var(--ink); text-decoration: underline; }
.inline-link { display: inline; border: 0; padding: 0; background: none; color: var(--ink); text-decoration: underline; font: inherit; }
.product-eyebrow { color: #5b7d72; font-size: 10px; font-weight: 750; letter-spacing: 1.8px; }
.notice, .form-message { color: #924b28; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.notice { background: #fff6e6; border: 1px solid #eee2c7; padding: 12px 15px; margin: 14px 0; }
.notice:empty, .form-message:empty { display: none; }
.form-message { margin: 12px 0; }
.form-message.success { color: #306f49; }
.check-label { display: flex; align-items: flex-start; gap: 10px; }
.check-label input { width: 17px; height: 17px; min-height: 0; margin: 3px 0 0; accent-color: var(--ink); flex: 0 0 auto; }
.field-help { font-size: 11px; color: var(--quiet); margin-top: 8px; line-height: 1.6; }
.table-wrap { max-width: 100%; overflow: auto; }

/* Public entrance */
.welcome-page { background: #f3f5ee; min-height: 100dvh; }
.welcome-header { display: flex; align-items: center; justify-content: space-between; width: min(1260px, 100%); margin: 0 auto; padding: 32px 44px; }
.welcome-login { display: flex; align-items: center; gap: 26px; font-size: 12px; color: #47615c; }
.welcome-login span { font-size: 18px; color: var(--ink); }
.welcome-main { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(350px, .84fr); align-items: start; gap: 86px; width: min(1260px,100%); margin: 30px auto 38px; padding: 0 44px; }
.welcome-story { padding: 18px 0 0; }
.welcome-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; background: #e6eddf; border: 1px solid #d9e5d1; border-radius: 100px; font-size: 9px; color: #48724c; font-weight: 700; letter-spacing: 1px; }
.welcome-pill i { width: 5px; height: 5px; border-radius: 50%; background: #61934c; }
.welcome-story h1 { font-size: clamp(38px,4vw,59px); line-height: 1.12; letter-spacing: -2.9px; font-weight: 600; margin: 25px 0 23px; }
.welcome-story h1 em { font-style: normal; color: #6f914b; }
.welcome-story > p { font-size: 14px; color: #647871; max-width: 405px; line-height: 1.8; }
.welcome-features { display: flex; flex-wrap: wrap; gap: 10px 19px; margin-top: 25px; color: #4b665b; font-size: 10px; font-weight: 600; }
.welcome-illustration { position: relative; margin-top: 34px; border-radius: 17px; background: var(--ink); padding: 24px 26px 17px; color: #e6f1e8; overflow: hidden; box-shadow: 0 15px 30px #153b4210; }
.illustration-top { display: flex; align-items: center; justify-content: space-between; }
.illustration-top span:not(.illustration-arrow) { display: block; font-size: 8px; letter-spacing: 1.6px; color: #a4bcb5; }
.illustration-top strong { display: block; margin-top: 7px; font-size: 17px; font-weight: 500; letter-spacing: -.5px; }
.illustration-arrow { color: var(--green); width: 35px; height: 35px; border: 1px solid #b8edaa40; border-radius: 50%; display: grid; place-items: center; font-size: 21px; }
.illustration-chart { display: block; width: calc(100% + 52px); margin: 11px -26px 3px; height: 123px; }
.illustration-bottom { display: flex; align-items: center; gap: 18px; font-size: 9px; color: #c3d5ce; }
.illustration-bottom > span { display: flex; align-items: center; gap: 5px; }
.illustration-bottom small { font-size: 8px; margin-left: auto; opacity: .65; }
.illustration-bottom i { width: 5px; height: 5px; border-radius: 50%; }
.dot-green { background: var(--green); }.dot-blue { background: #8ebcc8; }
.welcome-story .welcome-signature { font-size: 11px; margin-top: 20px; color: #819185; }
.account-card { padding: 34px 34px 25px; background: #fff; border: 1px solid #e3e8dc; border-radius: 20px; box-shadow: 0 12px 38px #173b4206; scroll-margin-top: 20px; }
.account-kicker { font-size: 9px; font-weight: 700; letter-spacing: 1.7px; color: #84977d; }
.account-card h2 { font-size: 25px; letter-spacing: -1px; font-weight: 600; line-height: 1.2; margin: 13px 0 9px; }
.account-card > p { font-size: 12px; color: var(--quiet); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #f0f4ee; border-radius: 9px; margin: 26px 0 25px; }
.auth-tabs button { border: 0; background: none; font-size: 12px; padding: 10px; color: #7a8e80; border-radius: 6px; font-weight: 600; }
.auth-tabs button.selected { background: #fff; color: var(--ink); box-shadow: 0 1px 5px #123b4210; }
.auth-form label, .product-dialog form label { display: block; color: #47605a; font-size: 12px; margin: 16px 0 7px; font-weight: 600; }
.auth-form input, .product-dialog input:not([type="checkbox"]), .product-dialog select { display: block; width: 100%; padding: 12px 13px; margin-top: 7px; min-height: 44px; color: var(--ink); border: 1px solid #dce5dc; border-radius: 8px; background: #fcfdfb; font-size: 12px; font-weight: 400; }
.auth-form input::placeholder, .product-dialog input::placeholder { color: #9aa99a; }
.auth-form input:focus, .product-dialog input:focus, .product-dialog select:focus { border-color: #4e7b6e; outline-color: #b3d6bf; }
.password-input { display: flex; align-items: center; position: relative; }
.password-input input { padding-right: 44px; }
.password-toggle { position: absolute; right: 10px; top: 14px; background: none; border: 0; color: #8b9e8c; font-size: 15px; padding: 4px; }
.forgot-link { display: block; margin: 12px 0 24px auto; font-size: 11px; color: #55795d; }
.auth-form .primary, .action-panel .primary { width: 100%; margin-top: 18px; }
.auth-form .check-label, .product-dialog form .check-label { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.auth-form .consent { font-size: 10px; line-height: 1.6; }
.auth-form .consent input { width: 15px; height: 15px; min-height: 0; margin: 0; }
.back-login { display: block; margin: 18px auto 0; }
.account-footnote { display: flex; justify-content: center; align-items: center; gap: 12px; border-top: 1px solid #edf0e9; padding-top: 20px; margin-top: 27px; color: #94a38e; }
.account-footnote > span { font-size: 23px; }
.account-footnote p { font-size: 10px; line-height: 1.65; color: #91a08a; }
.action-panel { margin: 25px 0 5px; }
.action-icon { width: 48px; height: 48px; display: grid; place-items: center; font-size: 26px; background: #eef5e6; border-radius: 12px; margin-bottom: 16px; }
.action-panel p { color: var(--quiet); font-size: 13px; line-height: 1.7; }
.action-panel .subtle-button { display: block; margin: 18px auto 0; }
.welcome-footer { display: flex; justify-content: space-between; gap: 15px; width: min(1260px,100%); padding: 12px 44px 26px; margin: 0 auto; color: #92a08c; font-size: 10px; }
.welcome-footer div { display: flex; gap: 22px; }
.welcome-footer button { color: #92a08c; font-size: 10px; }

/* Workspace shell */
.session-loading { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--quiet); font-size: 14px; padding: 28px; text-align: center; }
.product-shell { display: grid; grid-template-columns: 252px minmax(0,1fr); min-height: 100dvh; }
.product-sidebar { background: #fff; border-right: 1px solid var(--line); padding: 28px 19px 18px; display: flex; flex-direction: column; align-self: stretch; min-width: 0; }
.product-sidebar .product-brand { font-size: 17px; gap: 9px; margin: 0 4px 30px; }
.product-sidebar .product-brand img { width: 37px; height: 37px; }
.product-sidebar .product-brand small { font-size: 6px; letter-spacing: 1px; }
.space-switcher { padding: 14px 12px 9px; background: #f4f7f1; border: 1px solid #e4eadf; border-radius: 11px; }
.space-switcher label { display: block; color: #81927a; font-size: 9px; font-weight: 650; margin-bottom: 5px; }
.space-switcher select { border: 0; background: transparent; width: 100%; color: var(--ink); font-size: 12px; font-weight: 650; padding: 2px 18px 4px 0; text-overflow: ellipsis; }
.space-switcher .subtle-button { font-size: 10px; display: block; padding-top: 11px; color: #6d8b65; }
.side-label { color: #91a08d; font-size: 8px; font-weight: 650; letter-spacing: 1px; margin: 32px 12px 12px; }
.product-nav .nav-button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 4px 0; border: 1px solid transparent; background: none; border-radius: 9px; width: 100%; color: #71827b; font-size: 12px; font-weight: 550; text-align: left; }
.product-nav .nav-button.active { color: var(--ink); background: #edf4e8; border-color: #e7efdf; }
.product-nav .nav-button:hover { background: #f2f6ee; }
.nav-glyph { font-size: 17px; color: #6a8f64; line-height: 1; }
.sidebar-note { margin: auto 5px 28px; padding: 25px 12px 0; }
.sidebar-note > span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #dde8d5; border-radius: 50%; color: #6e9159; margin-bottom: 12px; font-size: 19px; }
.sidebar-note strong { font-size: 11px; font-weight: 600; }
.sidebar-note p { color: #99a58f; font-size: 10px; line-height: 1.75; margin-top: 6px; }
.product-account { display: flex; align-items: center; gap: 10px; border-top: 1px solid #edf0e8; padding: 18px 4px 0; min-width: 0; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: #e9f0df; color: #688052; font-size: 11px; font-weight: 700; }
.product-account > div { flex: 1; min-width: 0; }
.product-account strong { display: block; font-size: 10px; color: #5e786c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-account small { display: block; font-size: 8px; color: #99a68f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-account button { font-size: 20px; padding: 0 3px; }
.product-main { padding: 33px 34px 0; min-width: 0; max-width: 2400px; }
.product-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.product-header h1 { color: var(--ink); font-size: 29px; font-weight: 550; letter-spacing: -1.3px; line-height: 1.2; margin: 10px 0 7px; }
.product-header > div > p:last-child { color: #839280; font-size: 11px; }
.header-status { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line); padding: 7px 11px; border-radius: 100px; font-size: 10px; color: #7c9072; white-space: nowrap; }
.status-circle { background: #8ab269; width: 5px; height: 5px; border-radius: 50%; }
.integration-notice { font-size: 10px; color: #8c977f; margin: -4px 0 18px; line-height: 1.7; }
.product-footer { color: #9aa58f; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 0; font-size: 9px; }
.product-panel { min-height: 450px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 25px; }
.panel-heading h2 { font-size: 23px; font-weight: 550; letter-spacing: -.9px; margin-top: 7px; }
.panel-heading p:last-child { color: var(--quiet); font-size: 12px; margin-top: 8px; }
.panel-heading .primary { font-size: 12px; white-space: nowrap; padding: 11px 14px; }
.product-panel table { border-collapse: collapse; font-size: 12px; width: 100%; }
.product-panel th { color: #8b9a84; font-size: 9px; font-weight: 650; letter-spacing: 1px; text-align: left; text-transform: uppercase; background: #f8faf5; border-bottom: 1px solid var(--line); padding: 12px 15px; }
.product-panel td { border-bottom: 1px solid #edf0e8; padding: 16px 15px; color: #67806e; }
.member-person strong { display: block; font-size: 12px; font-weight: 600; color: #3f6252; }
.member-person small { display: block; font-size: 10px; color: #94a08a; margin-top: 3px; }
.role-badge { background: #f0f5ea; color: #6d8960; border-radius: 5px; font-size: 10px; padding: 5px 8px; }
.member-actions { display: flex; gap: 8px; }
.member-actions button { font-size: 10px; padding: 7px 10px; }
.permission-legend { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 22px; }
.permission-legend > strong { color: #5d7b66; font-size: 11px; font-weight: 600; }
.permission-legend dl { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; font-size: 10px; margin: 16px 0 0; }
.permission-legend dt { color: #6c865e; font-weight: 650; margin-bottom: 5px; }
.permission-legend dd { color: #97a18d; line-height: 1.7; margin: 0; }
.spaces-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.space-card { border: 1px solid #dfe9d6; border-radius: 12px; padding: 24px; background: #fafcf7; }
.space-card h3 { font-size: 19px; font-weight: 550; margin: 10px 0 5px; }
.space-card p { color: #90a080; font-size: 11px; }
.space-card button { margin-top: 24px; font-size: 11px; }
.space-card button + button { margin: 8px 0 0 7px; }
.appearance-setting { display: flex; justify-content: space-between; align-items: center; gap: 24px; border: 1px solid var(--line); background: #fafcf7; padding: 16px 20px; border-radius: 10px; margin-bottom: 24px; }
.appearance-setting strong { font-size: 12px; font-weight: 650; }
.appearance-setting p { font-size: 10px; color: #718366; margin-top: 4px; }
.appearance-setting select { background: #fff; color: #526d4a; border: 1px solid #d9e4d1; border-radius: 8px; font-size: 12px; padding: 10px 12px; min-width: 180px; }
.product-dialog { color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px; width: min(490px,calc(100% - 30px)); max-height: 90dvh; overflow: auto; box-shadow: 0 24px 70px #123b4220; }
.product-dialog::backdrop { background: #143b4266; backdrop-filter: blur(4px); }
.product-dialog h2 { color: var(--ink); font-size: 24px; letter-spacing: -.9px; line-height: 1.2; font-weight: 550; margin: 12px 0; }
.product-dialog p { color: #829077; font-size: 12px; line-height: 1.7; }
.product-dialog .form-message { color: #a15435; margin-top: 14px; }
.product-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.product-dialog #legal-content p { margin: 14px 0; }
#onboarding-form > .primary { width: 100%; margin-top: 22px; }
.space-profile-dialog { width: min(710px,calc(100% - 30px)); }
.space-profile-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
.space-profile-logo { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); padding: 16px; border-radius: 10px; margin-top: 24px; }
.space-profile-logo img { object-fit: contain; flex-shrink: 0; }
.space-profile-logo label { margin: 0 !important; flex: 1; min-width: 0; }
.space-profile-logo input { max-width: 100%; }
.space-profile-logo small { font-size: 9px; color: #9aa78d; display: block; margin-top: 5px; }

/* The shared, full-feature financial view has a quiet petroleum canvas. */
#fin-panel, #fin-dialog, #pluggy-dialog, #fin-csv-dialog {
  color-scheme: dark;
  --bg: #102e36; --panel: #153a43; --border: #30525a; --text: #e1ece8; --muted: #93ada8;
  --cyan: #9fd4c8; --lime: #b8edaa; --danger: #f3a09a;
  --neon-cyan: #9fd4c8; --neon-cyan-glow: transparent; --neon-cyan-subtle: #a7d9c410;
  --neon-lime: #b8edaa; --neon-lime-glow: transparent; --neon-lime-subtle: #b8edaa10;
  --neon-blue: #83bbc7; --neon-purple: #c4b4d8; --neon-danger: #f1a19b;
  --neon-border: #a6cfba29; --glass-bg: #153a43; --glass-panel: #173e46;
  color: var(--text); background: #102e36;
}
#fin-panel { padding: 22px; border-radius: 16px; box-shadow: 0 6px 18px #103b4205; overflow: hidden; }
#fin-panel .fin-subnav { background: #173b43; border-color: #315159; padding: 5px; border-radius: 11px; gap: 3px; width: 100%; }
#fin-panel .fin-subnav-btn { font-size: 10px; border-radius: 7px; padding: 9px 12px; gap: 5px; color: #95ada6; font-weight: 550; white-space: nowrap; }
#fin-panel .fin-subnav-btn.active { color: #d7eacb; border-color: #52715a; background: #335847; box-shadow: none; }
#fin-panel .fin-subnav-icon { font-size: 13px; filter: none; }
#fin-panel .finance-toolbar { background: transparent; border: 0; box-shadow: none; padding: 0 0 16px; margin-top: 20px; }
#fin-panel .finance-toolbar label, #fin-panel .fin-filter-group label { font-size: 10px; color: #8fa99f; }
#fin-panel .fin-filter-group { gap: 12px; }
#fin-panel .finance-toolbar,
#fin-panel .fin-filter-group { min-width: 0; max-width: 100%; }
#fin-panel .fin-actions-quick { flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 8px; }
#fin-panel .fin-actions-quick > label { flex: 0 1 auto; min-width: 0; white-space: normal; }
#fin-panel .fin-date-nav-wrap { max-width: 100%; }
#fin-panel .fin-date-nav-wrap input { min-width: 0; flex: 1; }
#fin-panel input, #fin-panel select, #fin-panel textarea, #fin-dialog input, #fin-dialog select, #fin-dialog textarea, #fin-csv-dialog input, #fin-csv-dialog select { background: #153b43; color: #d9e8df; border: 1px solid #35565c; border-radius: 7px; font-size: 12px; padding: 9px 10px; }
#fin-panel input[type="checkbox"] { accent-color: #b8edaa; }
#fin-panel .primary, #fin-dialog .primary, #fin-csv-dialog .primary { color: #173c35; background: #b8edaa; border-color: #b8edaa; padding: 10px 14px; border-radius: 8px; min-height: 38px; font-size: 11px; box-shadow: none; margin: 0; }
#fin-panel .secondary, #fin-dialog .secondary, #pluggy-dialog .secondary, #fin-csv-dialog .secondary { color: #b7cfc2; background: #1b434a; border-color: #365960; padding: 8px 11px; border-radius: 7px; font-size: 10px; min-height: 34px; }
#fin-panel .data-panel { color: #dbe8e1; background: #173b43; border: 1px solid #31535a; border-radius: 11px; box-shadow: none; padding: 20px; }
#fin-panel .data-panel h2 { font-size: 15px; font-weight: 550; color: #d5e5dc; }
#fin-panel .data-header .muted { font-size: 10px; }
#fin-panel .fin-kpi-grid { gap: 12px; }
#fin-panel .fin-kpi-card { background: #173b43; border: 1px solid #31535a; border-radius: 10px; box-shadow: none; padding: 17px; transform: none; }
#fin-panel .fin-kpi-card::before { display: none; }
#fin-panel .fin-kpi-card strong { font-size: 24px; font-weight: 550; letter-spacing: -1px; text-shadow: none; }
#fin-panel .fin-kpi-header { font-size: 10px; color: #a3b8ad; }
#fin-panel .fin-kpi-header span { font-size: 10px; }
#fin-panel .fin-kpi-header .fin-kpi-icon { font-size: 13px; }
#fin-panel .fin-kpi-card small { font-size: 9px; }
#fin-panel .fin-range-pill { border: 0; background: transparent; color: #9bb2a5; font-size: 10px; padding-left: 0; }
#fin-panel .fin-status-bar { margin: 0 0 16px; }
#fin-panel .fin-chart-panel { min-height: 260px; }
#fin-panel .fin-ai-panel, #fin-panel .fin-settings-box, #fin-panel .fin-of-docs-card, #fin-panel .fin-of-phase-item { border-color: #35565c; background: #163a42; box-shadow: none; }
#fin-panel .fin-subtab-kpi-card, #fin-panel .fin-coa-column, #fin-panel .fin-bank-card, #fin-panel .fin-of-card, #fin-panel .fin-card { border-color: #35565c; background: #193f46; box-shadow: none; }
#fin-panel td { border-color: #2d5057; }
#fin-panel th { background: #12363e; color: #9fb6a9; border-color: #35565c; }
#fin-panel .fin-dre-row-total td, #fin-panel .fin-dre-row-header td { color: #dfecd7; }
#fin-panel .fin-dre-table, #fin-panel .fin-table { color: #dbe7df; }
#fin-panel .fin-matrix-input { min-width: 85px; }
#fin-panel .finance-bar { background: linear-gradient(90deg,#72aeb4,#b8edaa); }
#fin-panel .fin-bank-balance { color: #b8edaa; font-size: 19px; text-shadow: none; }
#fin-panel .fin-bank-chart { min-height: 160px; }
#fin-panel .fin-ai-title, #fin-panel h2, #fin-panel h3 { text-shadow: none; }
#fin-panel .fin-ai-orb { box-shadow: none; }
#fin-panel .fin-subview { animation: none; }
#fin-dialog, #pluggy-dialog, #fin-csv-dialog { border: 1px solid #41636b; border-radius: 15px; }
#fin-dialog label, #fin-csv-dialog label { color: #b4c8bd; }
#fin-dialog .danger { background: #68403e; border-color: #8c5c57; color: #f2c1b8; }
body[data-role="viewer"] #fin-panel [data-fin-new] { display: none; }

/* Match the workspace's calm, light canvas, including inherited finance nodes. */
html[data-theme="light"] #fin-panel,
html[data-theme="light"] #fin-dialog,
html[data-theme="light"] #pluggy-dialog,
html[data-theme="light"] #fin-csv-dialog {
  color-scheme: light;
  --bg: #f4f6f3; --panel: #ffffff; --border: #dce6e0; --text: #173a40; --muted: #7a8f83;
  --cyan: #377765; --lime: #4b8645; --danger: #b95850;
  --neon-cyan: #377765; --neon-cyan-glow: transparent; --neon-cyan-subtle: #eaf3ed;
  --neon-lime: #4b8645; --neon-lime-glow: transparent; --neon-lime-subtle: #f0f6e9;
  --neon-blue: #527e91; --neon-purple: #8c759e; --neon-danger: #b95850;
  --neon-pink: #b95850;
  --neon-border: #dbe6db; --glass-bg: #fff; --glass-panel: #fff;
  color: #173a40; background: #fff; border-color: #dce6e0;
}
html[data-theme="light"] #fin-panel { padding: 0; background: transparent; box-shadow: none; overflow: visible; }
html[data-theme="light"] #fin-panel .fin-subnav { background: #fff; border-color: #e0e8db; padding: 5px; box-shadow: none; }
html[data-theme="light"] #fin-panel .fin-subnav-btn { color: #80917a; font-size: 10px; padding: 10px 13px; }
html[data-theme="light"] #fin-panel .fin-subnav-btn.active { background: #edf4e5; color: #3c6642; border-color: #e0ebd5; }
html[data-theme="light"] #fin-panel .fin-subnav-icon { color: #7e9b6c; }
html[data-theme="light"] #fin-panel .finance-toolbar { background: transparent; box-shadow: none; border: 0; margin-top: 16px; }
html[data-theme="light"] #fin-panel .finance-toolbar label,
html[data-theme="light"] #fin-panel .fin-filter-group label { color: #819079; font-size: 10px; }
html[data-theme="light"] #fin-panel input,
html[data-theme="light"] #fin-panel select,
html[data-theme="light"] #fin-panel textarea,
html[data-theme="light"] #fin-dialog input,
html[data-theme="light"] #fin-dialog select,
html[data-theme="light"] #fin-dialog textarea,
html[data-theme="light"] #fin-csv-dialog input,
html[data-theme="light"] #fin-csv-dialog select { color: #3b5c4c; background: #fff; border-color: #dae4d4; }
html[data-theme="light"] #fin-panel .primary,
html[data-theme="light"] #fin-dialog .primary,
html[data-theme="light"] #fin-csv-dialog .primary { color: #fff; background: #234c47; border-color: #234c47; }
html[data-theme="light"] #fin-panel .secondary,
html[data-theme="light"] #fin-dialog .secondary,
html[data-theme="light"] #pluggy-dialog .secondary,
html[data-theme="light"] #fin-csv-dialog .secondary { color: #67825e; background: #fff; border-color: #dbe5d4; }
html[data-theme="light"] #fin-panel .data-panel,
html[data-theme="light"] #fin-panel .fin-kpi-card,
html[data-theme="light"] #fin-panel .fin-subtab-kpi-card,
html[data-theme="light"] #fin-panel .fin-coa-column,
html[data-theme="light"] #fin-panel .fin-bank-card,
html[data-theme="light"] #fin-panel .fin-card,
html[data-theme="light"] #fin-panel .fin-of-card { color: #385b4b; background: #fff; border-color: #e0e8da; box-shadow: 0 3px 12px #213b2703 !important; }
html[data-theme="light"] #fin-panel .data-panel h2,
html[data-theme="light"] #fin-panel .data-panel h3 { color: #365b48; }
html[data-theme="light"] #fin-panel .fin-kpi-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
html[data-theme="light"] #fin-panel .fin-kpi-header,
html[data-theme="light"] #fin-panel .fin-kpi-header span { color: #8b9b80; font-size: 9px; line-height: 1.5; }
html[data-theme="light"] #fin-panel .fin-kpi-card small { color: #a1ad94; font-size: 8px; }
html[data-theme="light"] #fin-panel .fin-kpi-card strong { font-size: clamp(17px,1.7vw,28px) !important; font-weight: 550; }
html[data-theme="light"] #fin-panel .fin-kpi-balance strong { color: #264c42 !important; }
html[data-theme="light"] #fin-panel .fin-kpi-income strong { color: #547e45 !important; }
html[data-theme="light"] #fin-panel .fin-kpi-expense strong { color: #b27064 !important; }
html[data-theme="light"] #fin-panel .fin-kpi-pending strong { color: #97815a !important; }
html[data-theme="light"] #fin-panel .fin-range-pill { background: transparent; color: #9ca98c; }
html[data-theme="light"] #fin-panel .fin-status-bar { background: transparent; border: 0; padding: 0; }
html[data-theme="light"] #fin-panel .fin-bank-balance { color: #567e48; }
html[data-theme="light"] #fin-panel .fin-bank-chart { color: #718b62; }
html[data-theme="light"] #fin-panel .fin-settings-box,
html[data-theme="light"] #fin-panel .fin-of-docs-card,
html[data-theme="light"] #fin-panel .fin-of-phase-item,
html[data-theme="light"] #fin-panel .fin-chart-container,
html[data-theme="light"] #fin-panel .fin-forecast-chart-card { background: #f9fbf6; color: #5c7950; border-color: #e1e8da; box-shadow: none; }
html[data-theme="light"] #fin-panel .fin-legend-item,
html[data-theme="light"] #fin-panel .donut-legend-item,
html[data-theme="light"] #fin-panel .forecast-legend-pill { background: #f2f6ec !important; color: #5f7a50; border-color: #e1e8da; }
html[data-theme="light"] #fin-panel .fin-chart-container strong,
html[data-theme="light"] #fin-panel .fin-legend-item strong,
html[data-theme="light"] #fin-panel .donut-legend-val { color: #446a42; }
html[data-theme="light"] #fin-panel .forecast-line,
html[data-theme="light"] #fin-panel .donut-segment { filter: none; }
html[data-theme="light"] #fin-panel td { border-color: #e6ecdf; }
html[data-theme="light"] #fin-panel th { background: #f8faf5; color: #91a080; border-color: #e2e8da; }
html[data-theme="light"] #fin-panel .fin-dre-row-header td,
html[data-theme="light"] #fin-panel .fin-dre-row-subtotal td { background: #f0f5e9; color: #56734a; }
html[data-theme="light"] #fin-panel .fin-dre-row-total td { background: #eaf3e2; color: #3c693d; border-color: #b6cda5; }
html[data-theme="light"] #fin-dialog label,
html[data-theme="light"] #fin-csv-dialog label { color: #7b8e6a; }
html[data-theme="light"] #fin-dialog .danger { color: #a65248; background: #fff2ef; border-color: #eaccc5; }
@media(max-width:1100px) { html[data-theme="light"] #fin-panel .fin-kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width:600px) { html[data-theme="light"] #fin-panel .fin-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } html[data-theme="light"] #fin-panel .fin-kpi-card strong { font-size: 24px !important; } }

/* Secondary copy remains readable at compact dashboard sizes. */
html[data-theme="light"] #fin-panel .fin-kpi-header,
html[data-theme="light"] #fin-panel .fin-kpi-header span { color: #66785d; }
html[data-theme="light"] #fin-panel .fin-kpi-card small,
html[data-theme="light"] #fin-panel .fin-filter-group label,
html[data-theme="light"] #fin-panel .finance-toolbar label,
html[data-theme="light"] #fin-panel .data-panel .muted,
html[data-theme="light"] #fin-panel .fin-range-pill { color: #6c7c63; }
html[data-theme="light"] #fin-panel .fin-subnav-btn,
html[data-theme="light"] #fin-panel .fin-legend-item,
html[data-theme="light"] #fin-panel .donut-legend-item,
html[data-theme="light"] #fin-panel th { color: #65775d; }
html[data-theme="light"] .product-header > div > p:last-child,
html[data-theme="light"] .integration-notice,
html[data-theme="light"] .product-account small,
html[data-theme="light"] .product-panel .panel-heading p:last-child { color: #6c7c63; }
html[data-theme="light"] #fin-panel .forecast-axis-text { fill: #6c7c63; }

/* A complete dark appearance follows the same petroleum and green identity. */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #dce9e0; --ink-deep: #0c252c; --green: #b8edaa; --green-dark: #a6d899;
  --page: #10282f; --surface: #17343b; --line: #2d4b50; --quiet: #9bb6ac;
  --bg: #10282f; --panel: #17343b; --border: #2d4b50; --text: #dce9e0; --muted: #9bb6ac;
  --cyan: #a3d2c4; --lime: #b8edaa; --danger: #e7a39b;
}
html[data-theme="dark"] body { color: var(--ink); background: var(--page); }
html[data-theme="dark"] .product-sidebar { background: #143139; border-color: #2a454b; }
html[data-theme="dark"] .product-brand small,
html[data-theme="dark"] .side-label,
html[data-theme="dark"] .space-switcher label { color: #93ad9c; }
html[data-theme="dark"] .space-switcher { background: #1b3b40; border-color: #345349; }
html[data-theme="dark"] .space-switcher select { background: #1b3b40; color: #d1e2d3; }
html[data-theme="dark"] .space-switcher .subtle-button { color: #afc69b; }
html[data-theme="dark"] .product-nav .nav-button { color: #9bb8ab; }
html[data-theme="dark"] .product-nav .nav-button:hover { background: #22433f; color: #d9ebd0; }
html[data-theme="dark"] .product-nav .nav-button.active { color: #d2e8c1; background: #2c4e3f; border-color: #3e6045; }
html[data-theme="dark"] .nav-glyph { color: #b0d294; }
html[data-theme="dark"] .sidebar-note strong { color: #b9cdb3; }
html[data-theme="dark"] .sidebar-note p { color: #93ad95; }
html[data-theme="dark"] .sidebar-note > span { border-color: #4a6745; color: #b7d69a; }
html[data-theme="dark"] .product-account { border-color: #2d4a47; }
html[data-theme="dark"] .product-account strong { color: #c4d7c0; }
html[data-theme="dark"] .product-account small { color: #93ac94; }
html[data-theme="dark"] .user-avatar { background: #3b5940; color: #c7e0a9; }
html[data-theme="dark"] .product-eyebrow { color: #a1bb8e; }
html[data-theme="dark"] .product-header > div > p:last-child,
html[data-theme="dark"] .integration-notice { color: #9ab299; }
html[data-theme="dark"] .header-status { background: #1b393c; border-color: #36534a; color: #b0c99b; }
html[data-theme="dark"] .product-panel { background: #17353c; border-color: #2e4c50; }
html[data-theme="dark"] .panel-heading p:last-child { color: #9db99f; }
html[data-theme="dark"] .product-panel th { color: #acc49b; background: #1b3b3f; border-color: #34544c; }
html[data-theme="dark"] .product-panel td { color: #a2bca1; border-color: #2b4b46; }
html[data-theme="dark"] .member-person strong { color: #c0d6ba; }
html[data-theme="dark"] .member-person small { color: #96b18f; }
html[data-theme="dark"] .role-badge { background: #2c4e3e; color: #b9d49f; }
html[data-theme="dark"] .permission-legend > strong { color: #b3cdab; }
html[data-theme="dark"] .permission-legend dt { color: #b1cf97; }
html[data-theme="dark"] .permission-legend dd { color: #9db496; }
html[data-theme="dark"] .space-card,
html[data-theme="dark"] .appearance-setting { background: #1d3e41; border-color: #36564a; }
html[data-theme="dark"] .space-card p,
html[data-theme="dark"] .appearance-setting p { color: #a1b893; }
html[data-theme="dark"] .appearance-setting select { color: #c6dbb3; background: #26473f; border-color: #4c684a; }
html[data-theme="dark"] .primary,
html[data-theme="dark"] button.primary { background: #b8edaa; color: #173c35; border-color: #b8edaa; }
html[data-theme="dark"] .primary:hover:not(:disabled) { background: #c9f4b7; }
html[data-theme="dark"] .secondary { color: #b4cca1; background: #25473f; border-color: #476346; }
html[data-theme="dark"] .secondary:hover:not(:disabled) { background: #345541; }
html[data-theme="dark"] .danger { color: #efc0b5; background: #5c3d38; border-color: #83594f; }
html[data-theme="dark"] .subtle-button { color: #a0b79c; }
html[data-theme="dark"] .subtle-button:hover { color: #d2e5c1; }
html[data-theme="dark"] .notice { color: #e3c598; background: #4b4130; border-color: #6a5a3d; }
html[data-theme="dark"] .product-dialog { color: #dce9e0; background: #19383d; border-color: #3c5c52; }
html[data-theme="dark"] .product-dialog h2 { color: #d5e6cb; }
html[data-theme="dark"] .product-dialog p,
html[data-theme="dark"] .product-dialog form label { color: #a5bd9c; }
html[data-theme="dark"] .product-dialog input:not([type="checkbox"]),
html[data-theme="dark"] .product-dialog select { color: #d6e5ca; background: #24453f; border-color: #456546; }
html[data-theme="dark"] .product-dialog .form-message { color: #e7c197; }
html[data-theme="dark"] .space-profile-logo small { color: #99b087; }
html[data-theme="dark"] #fin-panel { padding: 0; background: transparent; box-shadow: none; overflow: visible; }
html[data-theme="dark"] #fin-panel .fin-kpi-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
html[data-theme="dark"] #fin-panel .fin-kpi-card strong { font-size: clamp(17px,1.7vw,28px) !important; }
html[data-theme="dark"] #fin-panel .fin-kpi-card small { color: #a1b8a3; }
html[data-theme="dark"] #fin-panel .fin-kpi-header,
html[data-theme="dark"] #fin-panel .fin-kpi-header span { color: #b0c4aa; }
@media(max-width:1100px) { html[data-theme="dark"] #fin-panel .fin-kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width:600px) {
  html[data-theme="dark"] #fin-panel .fin-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html[data-theme="dark"] #fin-panel .fin-kpi-card strong { font-size: 24px !important; }
  .appearance-setting { align-items: stretch; flex-direction: column; gap: 14px; padding: 16px; }
  .appearance-setting select { width: 100%; }
  #fin-panel .fin-actions-quick { width: 100%; }
  #fin-panel .fin-actions-quick > .primary { width: 100%; }
  #fin-panel .fin-actions-quick > label { flex-basis: 100%; }
}

@media (min-width: 1700px) {
  .product-shell { grid-template-columns: 270px minmax(0,1fr); }
  .product-main { padding: 40px 48px 0; }
  #fin-panel { padding: 30px; }
  #fin-panel .fin-subnav-btn { font-size: 12px; padding: 11px 19px; }
  #fin-panel .fin-kpi-card strong { font-size: 31px; }
}
@media (max-width: 1100px) {
  .welcome-main { gap: 38px; grid-template-columns: minmax(0,1fr) minmax(340px,.9fr); }
  .welcome-story h1 { font-size: 47px; letter-spacing: -2px; }
  .welcome-features { gap: 9px 12px; }
  .product-shell { grid-template-columns: 222px minmax(0,1fr); }
  .product-sidebar { padding: 25px 13px 18px; }
  .product-sidebar .product-brand { font-size: 15px; }
  .product-main { padding: 26px 22px 0; }
  .product-header h1 { font-size: 26px; }
  .header-status { display: none; }
  #fin-panel { padding: 16px; }
  .permission-legend dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .welcome-header { padding: 24px; }
  .welcome-main { grid-template-columns: minmax(0,1fr); gap: 30px; padding: 0 24px; margin-top: 12px; max-width: 620px; }
  .welcome-story { padding-top: 0; }
  .welcome-story h1 { font-size: clamp(42px,7vw,58px); }
  .welcome-story > p { max-width: 100%; }
  .welcome-illustration { display: none; }
  .welcome-story .welcome-signature { display: none; }
  .welcome-features { margin-top: 18px; }
  .account-card { padding: 28px; }
  .welcome-footer { padding: 20px 24px 24px; max-width: 620px; }
  .welcome-login { font-size: 10px; gap: 10px; }
  .product-shell { display: block; }
  .product-sidebar { display: grid; grid-template-columns: minmax(0,1fr) minmax(120px,200px); position: relative; gap: 15px; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 20px 10px; }
  .product-sidebar .product-brand { margin: 0; font-size: 17px; }
  .product-sidebar .product-brand small { font-size: 6px; }
  .space-switcher { background: #fff; border: 0; padding: 0; min-width: 120px; max-width: 200px; width: 100%; align-self: center; }
  .space-switcher label { display: none; }
  .space-switcher .subtle-button { display: none; }
  .space-switcher select { font-size: 11px; padding: 8px 3px; background: #f1f5ec; border: 1px solid #e3e9dc; border-radius: 8px; }
  .side-label, .sidebar-note { display: none; }
  .product-nav { display: flex; align-items: center; grid-column: 1 / -1; gap: 8px; padding-right: 33px; min-width: 0; }
  .product-nav .nav-button { white-space: nowrap; padding: 9px 10px; margin: 0; font-size: 10px; gap: 6px; width: auto; }
  .nav-glyph { font-size: 14px; }
  .product-account { position: absolute; bottom: 16px; right: 19px; border: 0; padding: 0; justify-self: end; }
  .product-account > div, .user-avatar { display: none; }
  .product-account button { font-size: 21px; }
  .product-main { padding: 25px 20px 0; }
  .product-header { margin-bottom: 18px; }
  .product-header h1 { font-size: 27px; }
  .product-eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  .panel-heading { align-items: start; flex-direction: column; }
  .product-panel { padding: 22px 17px; }
  #fin-panel { border-radius: 12px; padding: 13px; }
  #fin-panel .fin-subnav-btn { padding: 9px 11px; }
  #fin-panel .data-panel { padding: 16px; }
  #fin-panel .finance-toolbar { gap: 10px; }
  .product-footer { font-size: 8px; flex-wrap: wrap; }
}
@media (max-width: 450px) {
  .welcome-header { padding: 22px 20px; }
  .welcome-header .product-brand { font-size: 17px; gap: 9px; }
  .welcome-header .product-brand img { width: 36px; height: 36px; }
  .welcome-login { font-size: 9px; max-width: 100px; }
  .welcome-main { padding: 0 20px; }
  .welcome-story h1 { font-size: 41px; letter-spacing: -2px; }
  .welcome-pill { font-size: 7px; letter-spacing: .8px; }
  .welcome-story > p { font-size: 12px; }
  .welcome-features { font-size: 8px; gap: 9px; }
  .account-card { padding: 25px 22px; border-radius: 15px; }
  .account-card h2 { font-size: 24px; }
  .welcome-footer { padding: 12px 20px 24px; gap: 18px; flex-wrap: wrap; font-size: 9px; }
  .product-sidebar { padding: 16px 12px 10px; grid-template-columns: minmax(0,1fr) 125px; gap: 15px 9px; }
  .product-sidebar .product-brand { font-size: 15px; gap: 8px; }
  .product-sidebar .product-brand img { width: 33px; height: 33px; }
  .product-sidebar .product-brand small { font-size: 5px; }
  .space-switcher { max-width: 125px; }
  .space-switcher select { font-size: 9px; }
  .product-nav { gap: 2px; }
  .product-account { right: 13px; }
  .product-nav .nav-button { font-size: 9px; padding: 9px 7px; gap: 5px; }
  .product-main { padding: 22px 12px 0; }
  .product-header { padding: 0 4px; }
  .product-header h1 { font-size: 25px; }
  .product-header > div > p:last-child { font-size: 10px; }
  .integration-notice { font-size: 9px; padding: 0 4px; }
  #fin-panel .fin-kpi-grid { gap: 9px; }
  #fin-panel .fin-kpi-card { padding: 13px; }
  #fin-panel .fin-kpi-card strong { font-size: 23px; }
  .product-dialog { padding: 24px; }
  .product-dialog h2 { font-size: 22px; }
  .space-profile-fields { grid-template-columns: 1fr; }
  .space-profile-logo { flex-wrap: wrap; }
  .permission-legend dl { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .member-actions { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
