:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --line: #e5e9f2;
    --line-strong: #d5dce9;
    --text: #1d2638;
    --muted: #718096;
    --brand: #5266d9;
    --brand-dark: #3d4eb6;
    --brand-soft: #eef0ff;
    --income: #15936f;
    --income-soft: #e8f7f0;
    --expense: #dd6b6b;
    --expense-soft: #fff0f0;
    --warning: #9d6e16;
    --warning-soft: #fff8d7;
    --shadow: 0 10px 28px rgba(29, 38, 56, .06);
    --radius: 14px;
    --sidebar: 250px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 14px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; }
button, a.button { cursor: pointer; }
.public-page { background: radial-gradient(circle at 10% 0%, #e9edff 0, #f6f8fd 45%, #f5f7fb 100%); }
.public-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 440px); padding: 40px; background: var(--surface); border: 1px solid rgba(229,233,242,.9); border-radius: 22px; box-shadow: 0 22px 60px rgba(61,78,182,.12); }
.install-card { width: min(100%, 650px); }
.auth-badge, .brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; color: #fff; background: linear-gradient(135deg, var(--brand), #7c88ee); border-radius: 12px; font-weight: 800; letter-spacing: -.05em; box-shadow: 0 8px 18px rgba(82,102,217,.25); }
.auth-card h1 { margin: 8px 0 8px; font-size: 28px; letter-spacing: -.04em; }
.auth-card > .muted { margin: 0 0 24px; }
.auth-footnote { margin: 24px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.eyebrow { color: var(--brand); text-transform: uppercase; font-weight: 800; font-size: 11px; letter-spacing: .13em; margin: 22px 0 6px; }
.muted { color: var(--muted); }
code { padding: 2px 5px; border-radius: 5px; background: #eef1f7; color: #4a5568; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 10; display: flex; flex-direction: column; width: var(--sidebar); height: 100vh; padding: 24px 14px 16px; background: #1e2840; color: #cbd5ed; transition: width .2s ease; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; color: #fff; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; font-size: 11px; box-shadow: none; }
.brand-label { white-space: nowrap; overflow: hidden; }
.nav-group { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 13px; min-height: 42px; padding: 0 12px; color: #aeb9d1; border-radius: 10px; transition: background .2s, color .2s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: #5366d8; color: #fff; box-shadow: 0 7px 18px rgba(22, 33, 75, .2); }
.icon { width: 18px; text-align: center; font-size: 16px; opacity: .95; }
.nav-label { white-space: nowrap; overflow: hidden; }
.nav-separator { height: 1px; margin: 20px 10px 16px; background: rgba(255,255,255,.09); }
.nav-caption { padding: 0 12px 8px; color: #7482a3; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; }
.sidebar-footer { display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 12px; color: #7886a5; font-size: 11px; }
.status-dot, .integration-status i { width: 7px; height: 7px; border-radius: 50%; background: #45cf9e; box-shadow: 0 0 0 4px rgba(69,207,158,.12); }
.main-content { width: calc(100% - var(--sidebar)); min-height: 100vh; margin-left: var(--sidebar); transition: margin-left .2s ease, width .2s ease; }
.topbar { display: flex; align-items: center; height: 78px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); backdrop-filter: blur(12px); }
.menu-toggle, .icon-button { border: 0; background: transparent; color: var(--muted); }
.menu-toggle { margin-right: 16px; font-size: 20px; }
.topbar-title { display: grid; gap: 1px; }
.topbar-title .eyebrow { margin: 0; font-size: 9px; }
.topbar-title strong { font-size: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; margin-left: auto; color: var(--text); font-weight: 700; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 50%; font-size: 12px; }
.page-content { max-width: 1520px; margin: 0 auto; padding: 32px 34px 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 30px; letter-spacing: -.05em; }
.page-heading .eyebrow { margin-top: 0; }
.page-heading .muted { margin: 5px 0 0; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; font-size: 13px; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--brand); box-shadow: 0 7px 14px rgba(82,102,217,.18); }
.button.primary:hover { color: #fff; background: var(--brand-dark); }
.button.secondary { color: #fff; background: #303d5c; }
.button.ghost { color: #5f6c83; background: #fff; border-color: var(--line-strong); }
.button.full { width: 100%; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.panel-meta, .label-hint, .field-hint, .subline { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.panel-meta { margin-top: 3px; }
.filter-panel { margin-bottom: 22px; padding: 18px 20px; }
.filter-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.filter-form label { flex: 1 1 120px; min-width: 115px; }
.filter-form .filter-title { width: 100%; margin-bottom: -2px; color: var(--text); font-weight: 800; }
.filter-form .button { min-height: 36px; }
label { display: grid; gap: 6px; color: #58657d; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; padding: 10px 11px; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(82,102,217,.12); }
textarea { resize: vertical; }
.stack-form { display: grid; gap: 15px; }
.auth-card .stack-form { margin-top: 22px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.section-label { padding-top: 9px; color: var(--brand-dark); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.content-grid { display: grid; gap: 22px; }
.entity-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 15px; margin: 0 0 22px; }.entity-card { padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }.entity-card-top { display:flex; align-items:center; justify-content:space-between; }.entity-icon { display:grid; place-items:center; width:31px; height:31px; color:var(--brand); background:var(--brand-soft); border-radius:9px; font-size:15px; }.entity-card h3 { margin:14px 0 3px; font-size:16px; letter-spacing:-.03em; }.entity-card p { min-height:17px; margin:0 0 14px; color:var(--muted); font-size:11px; }.entity-values { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding-top:12px; border-top:1px solid var(--line); }.entity-values div { display:grid; gap:3px; }.entity-values span, .entity-total span { color:var(--muted); font-size:10px; }.entity-values strong { font-size:12px; }.entity-values strong.positive { color:var(--income); }.entity-values strong.negative { color:var(--expense); }.entity-total { display:flex; justify-content:space-between; align-items:end; margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }.entity-total strong { color:var(--brand-dark); font-size:17px; }
.content-grid.with-form { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.table-panel { min-width: 0; }
.form-panel { min-width: 0; }
.narrow-panel { max-width: 540px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: #7b879a; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; font-weight: 850; }
td { color: #46536a; font-size: 12px; }
td strong { color: var(--text); font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
.align-right { text-align: right; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.inline-form { display: inline; }
.text-button, .close-link, .small-link { border: 0; padding: 0; color: var(--brand); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.danger-text { color: #c4555d; }
.close-link { font-size: 22px; line-height: 1; color: var(--muted); }
.small-link { color: var(--brand); }
.inactive-row { opacity: .6; }
.status, .type-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status.on { color: #197b5d; background: var(--income-soft); }
.status.off { color: #778197; background: #edf0f5; }
.status.planned { color: #815f11; background: #fff5cf; }
.type-pill.income { color: #177c61; background: var(--income-soft); }
.type-pill.expense { color: #b4535d; background: var(--expense-soft); }
.type-pill.transfer { color: #5965b5; background: var(--brand-soft); }
.empty-state { padding: 38px 16px; color: var(--muted); text-align: center; }
.alert { margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: 9px; font-size: 13px; }
.alert.success { color: #177c61; background: var(--income-soft); border-color: #b9ead6; }
.alert.error { color: #a7424c; background: var(--expense-soft); border-color: #f0c8cb; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card { display: grid; gap: 6px; padding: 21px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card strong { font-size: 22px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-size: 11px; }
.income-card { border-left-color: var(--income); }.expense-card { border-left-color: var(--expense); }.profit-card { border-left-color: var(--brand); }
.chart-panel { margin-bottom: 22px; }
.chart-wrap { height: 290px; padding: 18px 22px 22px; }
.chart-wrap canvas { width: 100%; height: 100%; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }.legend-dot.income { background: var(--income); }.legend-dot.expense { background: var(--expense); }.legend-dot.profit { background: var(--brand); }.legend-dot.projection { background: #b7bfd5; }
.dre-table-wrap { padding: 0 10px 8px; }
.dre-table { min-width: 980px; table-layout: fixed; }.dre-table th:first-child, .dre-table td:first-child { width: 170px; }.dre-table th:not(:first-child), .dre-table td:not(:first-child) { text-align: right; }.dre-table .numeric { color: #46536a; font-variant-numeric: tabular-nums; }.dre-table .section-row th, .dre-table .section-row td { padding-top: 17px; padding-bottom: 17px; font-size: 12px; }.income-row th { color: var(--income); }.expense-row th { color: var(--expense); }.total-row th, .total-row td { color: var(--brand-dark); font-weight: 850; border-top: 2px solid var(--line-strong); }.detail-row td { padding: 0 8px; white-space: normal; }.detail-row details { padding: 3px 7px; }.detail-row summary { cursor: pointer; padding: 9px 0; color: #52617b; font-size: 11px; font-weight: 750; list-style-position: inside; }.summary-hint { margin-left: 8px; color: #a0a8b8; font-size: 10px; font-weight: 500; }.breakdown-table { overflow-x: auto; padding: 4px 0 10px 17px; }.breakdown-table table { min-width: 900px; }.breakdown-table th, .breakdown-table td { padding: 8px 9px; font-size: 10px; }.breakdown-table td small { color: var(--muted); font-size: 9px; }
.amount { font-variant-numeric: tabular-nums; font-weight: 800; }.amount.positive { color: var(--income); }.amount.negative { color: var(--expense); }.needs-review td { background: var(--warning-soft); }.review-icon { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 6px; color: #8c6617; background: #f5d978; border-radius: 50%; font-size: 11px; font-weight: 900; }.check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 7px; }.check-label input { width: 15px; height: 15px; }
.import-hero { padding: 32px; background: linear-gradient(135deg,#fff 0%,#f3f5ff 100%); }.upload-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; color: var(--brand); background: var(--brand-soft); border-radius: 15px; font-size: 28px; }.import-hero h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.04em; }.import-hero > .muted { max-width: 530px; }.info-list { display: grid; gap: 10px; margin-top: 30px; }.info-list > div { display: flex; align-items: center; gap: 11px; }.info-list span { display: grid; place-items: center; width: 26px; height: 26px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 7px; font-size: 10px; font-weight: 850; }.info-list p { margin: 0; color: #58657d; font-size: 12px; }.file-drop { padding: 19px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-soft); }.file-drop input { margin-top: 5px; padding: 7px; border: 0; background: transparent; }
.integration-status { display: inline-flex; align-items: center; gap: 8px; color: var(--income); font-size: 11px; font-weight: 800; }.settings-note { padding: 14px; border-radius: 9px; background: var(--surface-soft); border: 1px solid var(--line); }.settings-note strong { font-size: 12px; }.settings-note p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
@media (min-width: 1050px) { body.sidebar-collapsed .sidebar { width: 72px; } body.sidebar-collapsed .main-content { width: calc(100% - 72px); margin-left: 72px; } body.sidebar-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; } body.sidebar-collapsed .brand-label, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-caption, body.sidebar-collapsed .sidebar-footer { display: none; } body.sidebar-collapsed .nav-item { justify-content: center; padding: 0; } }
@media (max-width: 1050px) { :root { --sidebar: 220px; } .content-grid.with-form { grid-template-columns: 1fr; } .form-panel { order: -1; } }
@media (max-width: 700px) { .sidebar { width: 0; padding: 24px 0; overflow: hidden; } .main-content { width: 100%; margin-left: 0; }.page-content { padding: 22px 15px 45px; }.topbar { padding: 0 16px; }.user-chip-name { display: none; }.page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }.page-heading h1 { font-size: 26px; }.metric-grid { grid-template-columns: 1fr; }.panel-header { padding: 17px 15px; }.filter-panel { padding: 15px; }.filter-form label { min-width: calc(50% - 6px); }.filter-form .button { flex: 1 1 auto; }.form-grid.two { grid-template-columns: 1fr; }.auth-card { padding: 27px 21px; }.install-card { padding: 27px 18px; }.chart-wrap { height: 235px; padding: 12px; }.legend { justify-content: flex-start; }.actions { gap: 5px; }.transactions-table th, .transactions-table td { padding-left: 11px; padding-right: 11px; } }

/* Ajustes de experiência: preferências rápidas, modais e leitura financeira */
.sidebar-quick-settings { margin-top: auto; padding: 13px 11px 11px; color: #cbd5ed; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; }
.quick-settings-heading { display:flex; align-items:center; gap:8px; margin-bottom:11px; color:#f3f6ff; font-size:10px; letter-spacing:.04em; }
.quick-settings-heading .status-dot { flex:0 0 7px; width:7px; height:7px; }
.quick-settings-form { display:grid; gap:9px; }
.quick-settings-form label { color:#aeb9d1; font-size:10px; gap:5px; }
.quick-settings-form select { padding:7px 8px; color:#e7ebf8; background:#293552; border-color:rgba(255,255,255,.14); font-size:11px; }
.quick-toggle { position:relative; display:flex; align-items:center; justify-content:space-between; gap:7px; cursor:pointer; }
.quick-toggle input { position:absolute; width:1px; height:1px; opacity:0; }
.quick-toggle i { position:relative; display:block; width:31px; height:18px; flex:0 0 31px; background:#4a5876; border-radius:999px; transition:background .18s ease; }
.quick-toggle i::after { content:""; position:absolute; top:3px; left:3px; width:12px; height:12px; background:#f6f8ff; border-radius:50%; transition:transform .18s ease; }
.quick-toggle input:checked + i { background:#5f71e1; }
.quick-toggle input:checked + i::after { transform:translateX(13px); }
.quick-toggle input:focus-visible + i { box-shadow:0 0 0 3px rgba(124,136,238,.45); }
.quick-settings-submit { width:100%; min-height:30px; padding:0 8px; color:#dfe4ff; background:transparent; border-color:rgba(255,255,255,.2); font-size:10px; }
body.sidebar-collapsed .sidebar-quick-settings { display:none; }
.filter-context { margin-left:8px; color:var(--muted); font-size:10px; font-weight:600; letter-spacing:0; text-transform:none; }
.filter-form label:has(.date-filter) { flex:0 1 145px; min-width:0; }
.date-filter { min-width:0; }
.entity-card-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:10px; margin-top:14px; }
.entity-card-heading h3 { margin:0 0 3px; }
.entity-currency, .display-currency { color:var(--muted); font-size:10px; }
.entity-currency strong { color:var(--brand-dark); }
.display-currency { white-space:nowrap; }
.entity-card-actions { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.inactive-card { opacity:.68; }
.card-empty-state { grid-column:1 / -1; background:var(--surface); border:1px dashed var(--line-strong); border-radius:var(--radius); }
.compact-action { padding-left:12px; padding-right:12px; }
.modal-backdrop { position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:24px; background:rgba(18,26,45,.62); backdrop-filter:blur(4px); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .18s ease, visibility .18s ease; }
.modal-backdrop.is-open { opacity:1; visibility:visible; pointer-events:auto; }
.modal-dialog { width:min(100%, 520px); max-height:min(88vh, 780px); overflow:auto; transform:translateY(10px) scale(.98); transition:transform .18s cubic-bezier(.23,1,.32,1); }
.modal-backdrop.is-open .modal-dialog { transform:translateY(0) scale(1); }
.modal-dialog .panel-header { position:sticky; top:0; z-index:2; padding:20px 24px 17px; background:var(--surface); }
.modal-eyebrow { margin:0 0 2px; }
.modal-form { padding:22px 24px 24px; }
.compact-modal { width:min(100%, 590px); }
.compact-modal .modal-form { padding-top:20px; }
body.modal-open { overflow:hidden; }
.page-currency-badge { display:inline-flex; align-items:center; min-height:30px; padding:0 11px; color:var(--brand-dark); background:var(--brand-soft); border:1px solid #dce1ff; border-radius:999px; font-size:11px; font-weight:800; }
.dre-parameters { margin-top:22px; }
.dre-table, .dre-breakdown-table { table-layout:fixed; }
.dre-table .dre-label-col, .dre-breakdown-table .breakdown-label-col { width:170px; }
.dre-table .dre-month-col, .dre-breakdown-table .breakdown-month-col { width:68px; }
.dre-table .dre-summary-col { width:86px; }
.dre-table th, .dre-table td, .dre-breakdown-table th, .dre-breakdown-table td { font-variant-numeric:tabular-nums; }
.dre-table .income-row td { background:rgba(232,247,240,.66); }
.dre-table .expense-row td { background:rgba(255,240,240,.78); }
.negative-number { color:var(--expense)!important; font-weight:850; }
.metric-negative strong { color:var(--expense); }
.breakdown-table { padding-left:0; }
.dre-breakdown-table { min-width:1080px; }
.dre-breakdown-table th:first-child, .dre-breakdown-table td:first-child { text-align:left; }
.dre-breakdown-table th:not(:first-child), .dre-breakdown-table td:not(:first-child) { text-align:right; }
.dre-breakdown-table td small { white-space:nowrap; }
.transactions-table th, .transactions-table td { vertical-align:top; }
.transactions-table .date-cell, .transactions-table .description-cell { white-space:normal; }
.date-cell { min-width:104px; }
.date-cell span:not(.review-icon), .date-cell small { display:block; }
.date-cell small { margin-top:2px; color:var(--muted); font-size:10px; }
.description-cell { min-width:175px; max-width:280px; }
.description-cell strong { display:block; white-space:normal; overflow-wrap:anywhere; text-wrap:balance; }
.transaction-row.transaction-expense td { background:#fff8f8; }
.transaction-row.transaction-income td { background:#f5fbf8; }
.transaction-row.needs-review td { background:var(--warning-soft); }
.crud-table .subcategory-row .category-name-cell { padding-left:34px; color:#8490a3; }
.crud-table .subcategory-row .category-name-cell strong { color:#778398; font-weight:650; }
.category-branch { display:inline-block; width:19px; margin-right:5px; color:#a6afbf; font-weight:800; }
.category-parent-cell { color:#7d889c; font-size:11px; }
.user-email { color:#5f6c83; }
.entity-filter-panel .filter-title { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px; }

@media (max-width: 700px) {
    .sidebar-quick-settings { display:none; }
    .filter-form label:has(.date-filter) { flex:1 1 calc(50% - 6px); min-width:calc(50% - 6px); }
    .filter-context { width:100%; margin:2px 0 0; }
    .modal-backdrop { align-items:end; padding:10px; }
    .modal-dialog { width:100%; max-height:92vh; border-radius:16px; }
    .modal-dialog .panel-header { padding:17px 17px 14px; }
    .modal-form { padding:18px 17px 20px; }
    .page-currency-badge { align-self:flex-start; }
    .transactions-table .description-cell { min-width:150px; max-width:220px; }
}
@media (prefers-reduced-motion: reduce) {
    .modal-backdrop, .modal-dialog, .quick-toggle i, .quick-toggle i::after { transition:none; }
}

/* Grade DRE: o resumo e todos os detalhamentos compartilham as mesmas colunas */
.dre-table { width:100%; min-width:1px; }
.dre-breakdown-table { width:100%; min-width:1px; }
.dre-table .dre-label-col, .dre-breakdown-table .breakdown-label-col { width:15%; }
.dre-table .dre-month-col, .dre-breakdown-table .breakdown-month-col { width:5.75%; }
.dre-table .dre-summary-col, .dre-breakdown-table .breakdown-summary-col { width:7.25%; }
.dre-table .detail-row > td { padding:0; }
.dre-breakdown-table th, .dre-breakdown-table td { padding:10px 8px; }
.dre-breakdown-table th:first-child, .dre-breakdown-table td:first-child { padding-left:15px; }
.breakdown-summary-empty { color:transparent; }
@media (max-width: 980px) {
    .dre-table, .dre-breakdown-table { min-width:1120px; }
    .dre-table .dre-label-col, .dre-breakdown-table .breakdown-label-col { width:170px; }
    .dre-table .dre-month-col, .dre-breakdown-table .breakdown-month-col { width:68px; }
    .dre-table .dre-summary-col, .dre-breakdown-table .breakdown-summary-col { width:86px; }
}

/* Cache cambial e leitura das taxas */
.settings-panel, .rate-cache-panel { margin-bottom:20px; }
.integration-status.pending { color:#a06b19; background:#fff6df; }
.cache-count { display:inline-flex; align-items:center; min-height:28px; padding:0 10px; color:var(--brand-dark); background:var(--brand-soft); border-radius:999px; font-size:11px; font-weight:800; }
.rate-table { width:100%; min-width:660px; }
.rate-table th, .rate-table td { padding:12px 15px; }
.rate-table th:nth-child(2), .rate-table td:nth-child(2), .rate-table th:nth-child(5), .rate-table td:nth-child(5) { text-align:right; }
.rate-value { color:var(--brand-dark); font-weight:850; font-variant-numeric:tabular-nums; }
.cache-status { display:inline-flex; align-items:center; min-height:23px; padding:0 8px; border-radius:999px; font-size:10px; font-weight:800; }
.cache-status.valid { color:#117251; background:#e8f7f0; }
.cache-status.expired { color:#aa5252; background:#fff0f0; }
.cache-empty { margin:0 20px 20px; border:1px dashed var(--line-strong); border-radius:10px; }

.rate-table { min-width:0; table-layout:fixed; }
.rate-table th, .rate-table td { overflow-wrap:anywhere; white-space:normal; }
.rate-table th:nth-child(1), .rate-table td:nth-child(1) { width:21%; }
.rate-table th:nth-child(2), .rate-table td:nth-child(2) { width:19%; }
.rate-table th:nth-child(3), .rate-table td:nth-child(3) { width:21%; }
.rate-table th:nth-child(4), .rate-table td:nth-child(4) { width:21%; }
.rate-table th:nth-child(5), .rate-table td:nth-child(5) { width:18%; }
@media (max-width: 700px) {
    .rate-table th, .rate-table td { padding:9px 6px; font-size:9px; }
    .rate-table .cache-status { padding:0 5px; font-size:9px; }
}
.currency-catalog-panel { margin-bottom:20px; }
.currency-settings-form .settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.currency-settings-form select[multiple] { min-height:168px; padding:8px; }
.settings-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; padding-top:4px; }
.currency-table { min-width:560px; table-layout:fixed; }
.currency-table th, .currency-table td { white-space:normal; overflow-wrap:anywhere; }
.currency-table th:nth-child(1), .currency-table td:nth-child(1) { width:16%; }
.currency-table th:nth-child(2), .currency-table td:nth-child(2) { width:42%; }
.currency-table th:nth-child(3), .currency-table td:nth-child(3) { width:16%; }
.currency-table th:nth-child(4), .currency-table td:nth-child(4) { width:26%; }
.currency-symbol, .primary-badge { color:var(--brand-dark); font-weight:800; }
.primary-badge { display:inline-flex; padding:2px 5px; margin-left:4px; border-radius:999px; background:var(--brand-soft); font-size:9px; }
@media (max-width:700px) {
    .currency-settings-form .settings-grid { grid-template-columns:1fr; }
    .settings-actions { display:grid; grid-template-columns:1fr; }
    .settings-actions .button { width:100%; }
}
.settings-panel { max-width:780px; }
.settings-panel .currency-settings-form { padding:24px; }
.currency-settings-form .settings-grid { grid-template-columns:1fr; }
.settings-empty-state { margin:0; padding:16px; border:1px dashed var(--line-strong); border-radius:10px; background:var(--surface-soft); text-align:left; }
.settings-actions { justify-content:flex-start; }
.settings-actions .button:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.settings-catalog-empty { margin:0 20px 20px; border:1px dashed var(--line-strong); border-radius:10px; }
@media (max-width:700px) {
    .settings-panel .currency-settings-form { padding:18px 16px 20px; }
}

/* Seleção de moedas secundárias */
.currency-checkbox-field { display:grid; gap:8px; min-width:0; margin:0; padding:0; border:0; }
.currency-checkbox-field legend { padding:0; color:#58657d; font-size:12px; font-weight:750; }
.currency-checkbox-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:4px 0; }
.currency-option { display:flex; grid-template-columns:none; align-items:center; gap:10px; min-height:48px; padding:9px 11px; color:#58657d; background:var(--surface-soft); border:1px solid var(--line); border-radius:9px; cursor:pointer; transition:border-color .15s,background .15s,box-shadow .15s; }
.currency-option:hover { border-color:#c3cbdf; background:#f4f6fc; }
.currency-option input { flex:0 0 16px; width:16px; height:16px; margin:0; accent-color:var(--brand); }
.currency-option:has(input:checked) { color:var(--brand-dark); background:var(--brand-soft); border-color:#cbd2ff; box-shadow:0 0 0 2px rgba(82,102,217,.06); }
.currency-check-copy { display:grid; gap:2px; min-width:0; }
.currency-check-copy strong { color:var(--text); font-size:12px; }
.currency-check-copy span { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.currency-checkbox-field:disabled { opacity:.65; }
.settings-inline-empty { padding:12px; text-align:left; }
@media (max-width:700px) { .currency-checkbox-list { grid-template-columns:1fr; } }

/* Seletor pesquisável de categorias em transações */
.category-picker { position:relative; display:grid; gap:7px; }
.category-picker > label { margin:0; }
.category-search { padding-right:34px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat right 11px center; }
.category-options { display:none; max-height:265px; overflow-y:auto; padding:7px; background:var(--surface); border:1px solid var(--line-strong); border-radius:10px; box-shadow:0 12px 28px rgba(29,38,56,.13); }
.category-picker.is-active .category-options { display:grid; gap:5px; }
.category-option-group { display:grid; gap:3px; min-width:0; padding:5px 0; }
.category-option-group + .category-option-group { border-top:1px solid var(--line); }
.category-group-title { padding:3px 6px 4px; }
.category-group-title .type-pill { min-height:21px; }
.category-option { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:38px; padding:7px 9px; color:var(--text); background:transparent; border:1px solid transparent; border-radius:7px; text-align:left; cursor:pointer; }
.category-option:hover, .category-option:focus-visible { background:var(--surface-soft); border-color:var(--line); outline:0; }
.category-option.is-selected { color:var(--brand-dark); background:var(--brand-soft); border-color:#cbd2ff; }
.category-option-name { overflow:hidden; font-size:12px; font-weight:750; text-overflow:ellipsis; white-space:nowrap; }
.category-option small { flex:0 0 auto; overflow:hidden; max-width:48%; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.category-selection-hint { margin-top:-1px; }
.category-no-results { padding:14px 9px; color:var(--muted); background:var(--surface-soft); border-radius:7px; font-size:11px; text-align:center; }
.category-picker.has-error .category-search { border-color:var(--expense); box-shadow:0 0 0 3px rgba(221,107,107,.12); }
.category-picker[aria-disabled='true'] { opacity:.65; }
.category-option[hidden], .category-option-group[hidden] { display:none !important; }
@media (max-width:700px) {
    .category-options { max-height:230px; }
    .category-option small { max-width:42%; }
}

/* Revisão em massa */
.bulk-review-intro { display:flex; align-items:flex-start; gap:13px; margin-bottom:22px; padding:16px 18px; background:linear-gradient(135deg,#fff 0%,#f3f5ff 100%); }
.bulk-review-intro-icon { display:grid; place-items:center; flex:0 0 30px; width:30px; height:30px; color:var(--brand-dark); background:var(--brand-soft); border-radius:9px; font-weight:900; }
.bulk-review-intro strong { display:block; margin:2px 0 3px; font-size:12px; }
.bulk-review-intro p { margin:0; color:var(--muted); font-size:12px; }
.bulk-review-layout { grid-template-columns:minmax(270px, .7fr) minmax(0, 1.8fr); align-items:start; }
.bulk-groups-panel, .bulk-detail-panel { min-width:0; overflow:hidden; }
.bulk-group-list { display:grid; gap:8px; padding:12px; max-height:690px; overflow:auto; }
.bulk-group-card { display:grid; gap:6px; padding:13px; color:var(--text); background:var(--surface-soft); border:1px solid transparent; border-radius:10px; transition:border-color .15s,background .15s,transform .15s; }
.bulk-group-card:hover { color:var(--text); background:#f2f4fc; border-color:#cdd4ee; transform:translateY(-1px); }
.bulk-group-card.is-selected { background:var(--brand-soft); border-color:#cbd2ff; }
.bulk-group-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.bulk-group-card-top strong { overflow:hidden; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.bulk-group-count { display:inline-grid; place-items:center; min-width:25px; height:22px; padding:0 6px; color:var(--brand-dark); background:#fff; border-radius:999px; font-size:10px; font-weight:850; }
.bulk-group-meta { color:var(--muted); font-size:10px; }
.bulk-group-action { color:var(--brand); font-size:10px; font-weight:800; }
.bulk-selection-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px 18px; background:var(--surface-soft); border-bottom:1px solid var(--line); }
.bulk-selection-toolbar .check-label { color:var(--text); font-size:11px; }
.bulk-selection-toolbar strong { color:var(--brand-dark); font-size:11px; }
.bulk-review-table { min-width:850px; }
.bulk-review-table th, .bulk-review-table td { padding:10px 12px; }
.bulk-review-table td { font-size:11px; }
.bulk-review-table .bulk-check-column { width:42px; padding-left:18px; padding-right:4px; text-align:center; }
.bulk-review-table .bulk-check-column input { width:15px; height:15px; margin:0; }
.bulk-review-table td small { margin-top:2px; }
.bulk-review-table .transaction-expense td { background:rgba(255,240,240,.52); }
.bulk-review-table .transaction-income td { background:rgba(232,247,240,.46); }
.bulk-fields { display:grid; gap:12px; padding:18px; border-top:1px solid var(--line); }
.bulk-fields .section-label { padding-top:0; }
.bulk-fields .form-grid { gap:12px; }
.bulk-fields select { min-height:38px; }
.bulk-fields .form-actions { margin-top:1px; }
.bulk-fields button:disabled { opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }
.bulk-review-empty { display:grid; gap:5px; place-items:center; min-height:170px; }
.bulk-review-empty strong { color:var(--text); }
.bulk-review-empty span { color:var(--muted); font-size:12px; }
@media (max-width:900px) { .bulk-review-layout { grid-template-columns:1fr; } .bulk-group-list { max-height:none; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); } }
@media (max-width:600px) { .bulk-review-intro { padding:14px; } .bulk-selection-toolbar { align-items:flex-start; flex-direction:column; } .bulk-fields { padding:15px; } }
