/* Financeiro: organização visual inspirada no Mercado Turbo, identidade EW. */
body.ew-app-financeiro{--fin-purple:#70509a;--fin-lavender:#f3eff7;--fin-line:#ded8e8;--fin-ink:#203047;--fin-muted:#798297}
body.ew-app-financeiro #main{padding:24px 32px;max-width:1880px}
body.ew-app-financeiro .title-row{align-items:center;margin-bottom:18px}
body.ew-app-financeiro #views{gap:0;background:#e6e0ee;border:1px solid #d1c5df;border-radius:7px;overflow:hidden;margin:0 0 18px}
body.ew-app-financeiro #views button{border:0;border-radius:0;background:transparent;padding:11px 15px;border-bottom:3px solid transparent;color:#65527a;white-space:nowrap}
body.ew-app-financeiro #views button[aria-current=page]{background:#f7f4fb;border-bottom-color:var(--fin-purple);color:#5d3985;font-weight:750}
body.ew-app-financeiro .panel{box-shadow:none;border-color:var(--fin-line);border-radius:8px}
body.ew-app-financeiro #finance-kpis:empty{display:none}
body.ew-app-financeiro .cards{gap:12px;margin:0 0 14px}
body.ew-app-financeiro .fin-primary-cards,body.ew-app-financeiro .fin-secondary-cards{grid-template-columns:repeat(5,minmax(0,1fr))}
body.ew-app-financeiro .card{--accent:var(--fin-purple);position:relative;padding:15px 17px;border-top:3px solid var(--accent);overflow:hidden;min-width:0}
body.ew-app-financeiro .card span{font-weight:650;color:#536176;margin:0;letter-spacing:.02em}
body.ew-app-financeiro .card strong{color:var(--accent);margin:8px 0 5px;white-space:normal;overflow-wrap:anywhere}
body.ew-app-financeiro .card small{display:block;color:#647085;line-height:1.5}
body.ew-app-financeiro .fin-coral{--accent:#cc5268}
body.ew-app-financeiro .fin-yellow{--accent:#a87813}
body.ew-app-financeiro .fin-blue{--accent:#377cac}
body.ew-app-financeiro .fin-green{--accent:#208e62}
body.ew-app-financeiro .fin-primary-cards .fin-purple{background:#eee7f6}
body.ew-app-financeiro .fin-primary-cards .fin-coral{background:#fae9ed}
body.ew-app-financeiro .fin-primary-cards .fin-yellow{background:#fff6db}
body.ew-app-financeiro .fin-primary-cards .fin-blue{background:#e8f2fa}
body.ew-app-financeiro .fin-primary-cards .fin-green{background:#e8f5ee}
body.ew-app-financeiro .fin-secondary-cards .card{border-top-width:1px;padding:12px 17px}
body.ew-app-financeiro .fin-secondary-cards .card strong{font-size:var(--ew-font-h2)!important}
body.ew-app-financeiro #finance-filter-grid{display:grid;grid-template-columns:1fr;gap:14px;min-width:0}
body.ew-app-financeiro[data-finance-view=summary] #finance-filter-grid{grid-template-columns:minmax(0,1.6fr) minmax(350px,1fr)}
body.ew-app-financeiro #filters{margin:0;align-content:center;align-items:end;grid-template-columns:minmax(150px,1.2fr) repeat(2,minmax(140px,1fr)) auto auto auto;gap:12px;padding:18px;background:#fff}
body.ew-app-financeiro[data-finance-view=summary] #filters{grid-template-columns:repeat(3,minmax(0,1fr));align-content:center}
body.ew-app-financeiro label{font-weight:500;color:#5a667b;letter-spacing:.015em}
body.ew-app-financeiro input,body.ew-app-financeiro select{min-width:0;width:100%;background:#fdfcff;border-color:#d4cbe0;padding:8px 10px}
body.ew-app-financeiro button{padding:8px 12px;border-color:#d4c7e3;color:#64458a;background:#f1ebf8}
body.ew-app-financeiro button:hover{background:#e7dcf3}
body.ew-app-financeiro .primary,body.ew-app-financeiro #filters>button:first-of-type{background:var(--fin-purple);border-color:var(--fin-purple);color:white}
body.ew-app-financeiro button:focus-visible,body.ew-app-financeiro .table-wrap:focus-visible{outline:2px solid var(--fin-purple);outline-offset:3px}
body.ew-app-financeiro #finance-chart{margin:0;padding:16px 18px}
body.ew-app-financeiro #finance-chart h2{margin:0 0 10px}
body.ew-app-financeiro #finance-chart p{margin:10px 0 0}
body.ew-app-financeiro .fin-chart-content{display:grid;grid-template-columns:135px minmax(0,1fr);gap:14px;align-items:center}
body.ew-app-financeiro .fin-ring{position:relative;max-width:135px;aspect-ratio:1}
body.ew-app-financeiro .fin-ring svg{width:100%;display:block}
body.ew-app-financeiro .fin-ring>div{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;color:var(--fin-purple)}
body.ew-app-financeiro .fin-ring b{font-size:16px}
body.ew-app-financeiro .fin-ring small{color:#7f748d}
body.ew-app-financeiro .fin-legend{list-style:none;margin:0;padding:0;min-width:0}
body.ew-app-financeiro .fin-legend li{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:4px 0}
body.ew-app-financeiro .fin-legend b{font-weight:650;white-space:nowrap}
body.ew-app-financeiro .fin-key:before{content:'';display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:6px;background:var(--key)}
body.ew-app-financeiro .fin-key-cost{--key:#ee7185}body.ew-app-financeiro .fin-key-tax{--key:#ab79be}body.ew-app-financeiro .fin-key-fees{--key:#e6b747}body.ew-app-financeiro .fin-key-seller_freight{--key:#5c99d5}body.ew-app-financeiro .fin-key-margin{--key:#35a979}
body.ew-app-financeiro #notice{margin:12px 2px;color:#7c8699}
body.ew-app-financeiro .section{padding:18px;margin:0 0 14px;min-width:0}
body.ew-app-financeiro .fin-section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:15px}
body.ew-app-financeiro .fin-section-heading h2{margin:0}
body.ew-app-financeiro .fin-section-heading>span{color:#857b93}
body.ew-app-financeiro .fin-section-heading a{color:var(--fin-purple);text-decoration:none;white-space:nowrap}
body.ew-app-financeiro .table-wrap{max-height:65vh;max-width:100%;border-color:var(--fin-line)}
body.ew-app-financeiro th{background:#eee9f4;color:#6a5380;font-weight:650;letter-spacing:.04em;z-index:1}
body.ew-app-financeiro th,body.ew-app-financeiro td{padding:12px;border-bottom-color:#ebe6f0}
body.ew-app-financeiro tbody tr:nth-child(even){background:#faf8fc}
body.ew-app-financeiro tbody tr:hover{background:#f2edf8}
body.ew-app-financeiro td small{color:#8791a3}
body.ew-app-financeiro .positive{color:#199261}
body.ew-app-financeiro .negative{color:#d44c66}
body.ew-app-financeiro .neutral{color:#7d8594}
body.ew-app-financeiro .fin-management-grid{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(380px,1fr);gap:16px;align-items:start}
body.ew-app-financeiro .entry-form{grid-template-columns:1.2fr 1fr 1fr;align-items:end;padding:16px;border-radius:6px;background:var(--fin-lavender)}
body.ew-app-financeiro .entry-form .check{padding:8px 0}
body.ew-app-financeiro .entry-form .primary{justify-self:start;min-width:110px}
body.ew-app-financeiro .fin-category{display:inline-block;padding:3px 7px;border-radius:4px;background:#eee5f7;color:#785299;font-weight:650}
body.ew-app-financeiro .fin-dre-preview table{min-width:360px}
body.ew-app-financeiro .fin-dre-preview .table-wrap{max-height:none}
body.ew-app-financeiro .fin-dre-preview th,body.ew-app-financeiro .fin-dre-preview td{padding:10px 8px}
body.ew-app-financeiro .fin-dre-preview tr.fin-current-month{background:#eee5f7;font-weight:750}
body.ew-app-financeiro .dre-table{min-width:100%}
body.ew-app-financeiro .dre-table th:not(:first-child){min-width:7rem;text-align:right}
body.ew-app-financeiro .dre-table td:first-child{min-width:250px;background:#fbfafc;z-index:1}
body.ew-app-financeiro .dre-table th:first-child{background:#eee9f4;z-index:2}
body.ew-app-financeiro .dre-table td:last-child{font-weight:750;border-left:1px solid #d7cce1;background:#f1ebf8}
body.ew-app-financeiro .dre-table tr.fin-dre-total_income td{background:#289469;color:white;font-weight:750}
body.ew-app-financeiro .dre-table tr.fin-dre-contribution td{background:#e2f2e9;font-weight:750;color:#1f7551}
body.ew-app-financeiro .dre-table tr.fin-dre-net_result td{background:#76569a;color:white;font-weight:750}
body.ew-app-financeiro .dre-table tr.fin-dre-net_result td.negative{color:#ffe5eb}
body.ew-app-financeiro .fin-year{background:#f0eaf7;border:1px solid #dacfe6;border-radius:5px;padding:6px 10px}
body.ew-app-financeiro .fin-payment-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
body.ew-app-financeiro[data-finance-view=mercadopago] .fin-payment-cards,body.ew-app-financeiro[data-finance-view=pending] .fin-payment-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
body.ew-app-financeiro .fin-layout-controls{display:flex;gap:0}
body.ew-app-financeiro .fin-layout-controls button{border-radius:0}
body.ew-app-financeiro .fin-layout-controls button:first-child{border-radius:5px 0 0 5px}
body.ew-app-financeiro .fin-layout-controls button:last-child{border-radius:0 5px 5px 0}
body.ew-app-financeiro .fin-layout-controls button[aria-pressed=true]{background:var(--fin-purple);color:white}
body.ew-app-financeiro .fin-payment{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(160px,.7fr) minmax(260px,1fr);align-items:center;gap:20px;padding:22px 14px;border-top:1px solid #e3ddeb}
body.ew-app-financeiro .fin-payment:nth-child(even){background:#faf8fc}
body.ew-app-financeiro .fin-payment-description small,body.ew-app-financeiro .fin-payment-description span{color:#8a809a}
body.ew-app-financeiro .fin-payment-description h3{margin:7px 0;font-weight:700;line-height:1.45}
body.ew-app-financeiro .fin-payment-description p{margin:5px 0;color:#62748f;overflow-wrap:anywhere}
body.ew-app-financeiro .fin-payment-amount{display:flex;flex-direction:column;align-items:center;gap:6px;color:#8c8298}
body.ew-app-financeiro .fin-payment-amount strong{font-size:var(--ew-font-h2);color:#249367;white-space:nowrap}
body.ew-app-financeiro .fin-payment-labels{display:grid;gap:6px}
body.ew-app-financeiro .fin-payment-labels>div{padding:7px 10px;border-radius:4px;text-align:center;background:#f0edf4;line-height:1.4}
body.ew-app-financeiro .fin-payment-labels .fin-payment-date{background:#eaf1fa;color:#4c749f}
body.ew-app-financeiro .fin-payment-labels .fin-payment-release{background:#e8f5ec;color:#308452}
body.ew-app-financeiro .fin-payment-labels .fin-payment-release.neutral{background:#f0edf4;color:#7d8594}
body.ew-app-financeiro .status.approved{background:#dff2e8;color:#238a5c}
body.ew-app-financeiro .status.pending,body.ew-app-financeiro .status.in_process,body.ew-app-financeiro .status.authorized{background:#fff3d4;color:#946519}
body.ew-app-financeiro .status.refunded,body.ew-app-financeiro .status.rejected,body.ew-app-financeiro .status.cancelled,body.ew-app-financeiro .status.charged_back{background:#fae4eb;color:#b24260}
body.ew-app-financeiro .fin-freight-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
body.ew-app-financeiro[data-finance-view=freight] #screen .filters{grid-template-columns:minmax(150px,.6fr) minmax(220px,1fr) auto auto;background:#f3eff7;padding:14px;border-radius:5px}
body.ew-app-financeiro[data-finance-view=freight] [data-check]{background:#e8f4ec;color:#2a8655;border-color:#c8e1d2}
body.ew-app-financeiro[data-finance-view=freight] [data-check]:disabled{color:#799185;background:#f0f5f1;cursor:default}
body.ew-app-gestao[data-screen=tax] #main{max-width:1600px}
body.ew-app-gestao[data-screen=tax] #filters,body.ew-app-gestao[data-screen=tax] #counts,body.ew-app-gestao[data-screen=tax] #unlocated,body.ew-app-gestao[data-screen=tax] #empty,body.ew-app-gestao[data-screen=tax] #source-context{display:none}
body.ew-app-gestao[data-screen=tax] #tax-screen{background:#fff;border:1px solid #dcd5e7;border-radius:8px;padding:24px;box-shadow:none}
body.ew-app-gestao[data-screen=tax] #tax-title{margin:0 0 12px}
body.ew-app-gestao[data-screen=tax] #tax-context{padding:12px 15px;border-radius:5px;background:#eee7f7;color:#684b89}
body.ew-app-gestao[data-screen=tax] #tax-screen details{margin-top:22px;border:0;padding:0}
body.ew-app-gestao[data-screen=tax] #tax-screen summary{font-weight:700;padding:12px 15px;background:#eee9f4;border-radius:5px;color:#674985;cursor:pointer}
body.ew-app-gestao[data-screen=tax] #tax-history{list-style:none;padding:0;margin:18px 0;display:grid;gap:8px}
body.ew-app-gestao[data-screen=tax] #tax-history li{padding:13px 15px;border:1px solid #e1daea;border-left:3px solid #6e4e98;border-radius:5px;background:#faf8fc;color:#60718a;line-height:1.6}
body.ew-app-gestao[data-screen=tax] #tax-form{display:grid;grid-template-columns:minmax(220px,1.4fr) minmax(150px,1fr) minmax(180px,1fr);padding:20px;gap:15px;background:#f3eff7;border-radius:6px}
body.ew-app-gestao[data-screen=tax] #tax-form label{display:grid;gap:6px;color:#6e627d}
body.ew-app-gestao[data-screen=tax] #tax-form input,body.ew-app-gestao[data-screen=tax] #tax-form select{width:100%;min-width:0;background:#fff;border-color:#d6c9e2}
body.ew-app-gestao[data-screen=tax] #tax-form p{grid-column:1/-1;margin:4px 0;color:#7b7387;line-height:1.6}
body.ew-app-gestao[data-screen=tax] #tax-save{justify-self:start;background:#70509a;border-color:#70509a;color:#fff}
@media(max-width:1200px){
 body.ew-app-financeiro .fin-primary-cards,body.ew-app-financeiro .fin-secondary-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.ew-app-financeiro #filters{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.ew-app-financeiro .fin-management-grid{grid-template-columns:minmax(0,1fr)}
 body.ew-app-financeiro .fin-dre-preview table{min-width:600px}
 body.ew-app-financeiro .fin-freight-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
 body.ew-app-financeiro #main{padding:20px 16px}
 body.ew-app-financeiro[data-finance-view=summary] #finance-filter-grid{grid-template-columns:minmax(0,1fr)}
 body.ew-app-financeiro .fin-payment{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 body.ew-app-financeiro .fin-payment-labels{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr))}
 body.ew-app-financeiro[data-finance-view=freight] #screen .filters{grid-template-columns:1fr 1fr}
}
@media(max-width:650px){
 body.ew-app-financeiro #views{flex-wrap:nowrap;overflow:auto}
 body.ew-app-financeiro #views button{flex-shrink:0}
 body.ew-app-financeiro .fin-primary-cards,body.ew-app-financeiro .fin-secondary-cards,body.ew-app-financeiro .fin-payment-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.ew-app-financeiro .card{padding:12px}
 body.ew-app-financeiro #filters,body.ew-app-financeiro[data-finance-view=summary] #filters{grid-template-columns:minmax(0,1fr)}
 body.ew-app-financeiro .section{padding:14px}
 body.ew-app-financeiro .fin-section-heading{flex-wrap:wrap}
 body.ew-app-financeiro .entry-form{grid-template-columns:minmax(0,1fr)}
 body.ew-app-financeiro .fin-chart-content{grid-template-columns:110px minmax(0,1fr);gap:10px}
 body.ew-app-financeiro .fin-payment{grid-template-columns:minmax(0,1fr);gap:16px;padding:18px 4px}
 body.ew-app-financeiro .fin-payment-amount{align-items:flex-start}
 body.ew-app-financeiro .fin-payment-labels{grid-template-columns:minmax(0,1fr)}
 body.ew-app-financeiro[data-finance-view=freight] #screen .filters{grid-template-columns:minmax(0,1fr)}
 body.ew-app-gestao[data-screen=tax] #tax-screen{padding:16px}
 body.ew-app-gestao[data-screen=tax] #tax-form{grid-template-columns:minmax(0,1fr);padding:14px}
 body.ew-app-gestao[data-screen=tax] #tax-save{justify-self:stretch}
}
@media(max-width:450px){
 body.ew-app-financeiro .fin-primary-cards,body.ew-app-financeiro .fin-payment-cards,body.ew-app-financeiro[data-finance-view=mercadopago] .fin-payment-cards,body.ew-app-financeiro[data-finance-view=pending] .fin-payment-cards{grid-template-columns:minmax(0,1fr)}
}
/* A cascata usa a mesma base financeira em todas as barras. */
body.ew-app-financeiro[data-finance-view=summary] #finance-filter-grid{grid-template-columns:minmax(0,1fr)}
body.ew-app-financeiro[data-finance-view=summary] #filters{grid-template-columns:minmax(150px,1.2fr) repeat(2,minmax(140px,1fr)) auto auto auto}
.fin-waterfall-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.fin-waterfall-result{text-align:right;display:grid;gap:3px}.fin-waterfall-result strong{font-size:24px}.fin-waterfall-result span{font-size:12px}
.fin-waterfall{display:grid;gap:6px;max-width:1320px;margin:0 auto}
.fin-waterfall-row{display:grid;grid-template-columns:minmax(150px,230px) minmax(60px,1fr) minmax(110px,150px);align-items:center;gap:16px;padding:7px 0;min-width:0}
.fin-waterfall-label{font-size:13px}.fin-waterfall-value{text-align:right;font-variant-numeric:tabular-nums;font-size:14px;overflow-wrap:anywhere}
.fin-waterfall-track{height:24px;position:relative;background:#f7f5fa;border-radius:3px}
.fin-waterfall-zero{position:absolute;height:calc(100% + 14px);top:-7px;border-left:1px dashed #9b8aaa;z-index:1}
.fin-waterfall-bar{position:absolute;height:100%;border-radius:3px;background:#73529b}
.fin-waterfall-bar.negative{background:#c77486}.fin-waterfall-bar.positive{background:#70509a}.fin-waterfall-bar.total{background:#218968}.fin-waterfall-bar.total.negative{background:#c94059}
.fin-waterfall-total{border-top:1px solid #ddd5e7;margin-top:4px;padding-top:13px;font-weight:700}
.fin-waterfall-pending{margin-top:16px;padding:13px 16px;border-left:3px solid #ad791b;border-radius:5px;background:#fff7e5;color:#775a1f;line-height:1.6;font-size:12px}
@media(max-width:900px){body.ew-app-financeiro[data-finance-view=summary] #filters{grid-template-columns:repeat(3,minmax(0,1fr))}.fin-waterfall-row{grid-template-columns:minmax(120px,180px) minmax(50px,1fr) minmax(95px,120px);gap:10px}}
@media(max-width:600px){body.ew-app-financeiro[data-finance-view=summary] #filters{grid-template-columns:minmax(0,1fr)}.fin-waterfall-row{grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:8px 0}.fin-waterfall-track{grid-column:1/-1;grid-row:2;height:18px}.fin-waterfall-value{font-size:13px}.fin-waterfall-label{font-size:12px}.fin-waterfall-zero{height:calc(100% + 12px);top:-6px}.fin-waterfall-result{text-align:left}.fin-waterfall-result strong{font-size:22px}}
