/* 5.37 management: one status palette (D5), phone cards (D4), dashboard comparison (D6), growth bridge (M1) and new analyses. */
:root{--st-paid:#17744a;--st-paid-bg:#e3f3ea;--st-offered:#183e86;--st-offered-bg:#e8eefb;--st-due:#8a4f00;--st-due-bg:#fdf1df;--st-unknown:#526580;--st-unknown-bg:#f1f3f7;--st-bad:#a20e1a;--st-bad-bg:#fbe9eb}

/* D5 · the same four colours wherever a payment state appears */
.status-chip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:700;line-height:1.5;border:1px solid transparent;white-space:nowrap}
.status-chip::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.status-chip.is-paid,.wiin-staff .pay-paid,.wiin-staff .badge.paid,.wiin-staff .state-paid,.wiin-staff .month-cross-status.success{color:var(--st-paid)!important;background:var(--st-paid-bg)!important;border-color:#bfe3cf!important}
.status-chip.is-offered,.wiin-staff .pay-offered,.wiin-staff .badge.offered{color:var(--st-offered)!important;background:var(--st-offered-bg)!important;border-color:#c9d6f1!important}
.status-chip.is-due,.wiin-staff .pay-unpaid,.wiin-staff .state-debtor,.wiin-staff .month-cross-status.warning{color:var(--st-due)!important;background:var(--st-due-bg)!important;border-color:#f0d4a8!important}
.status-chip.is-unknown,.status-chip.is-pending,.status-chip.is-muted,.status-chip.is-none,.wiin-staff .pay-justified{color:var(--st-unknown)!important;background:var(--st-unknown-bg)!important;border:1px dashed #b8c3d6!important}
.wiin-staff .month-cross-status.danger{color:var(--st-bad)!important;background:var(--st-bad-bg)!important}
.status-legend{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}

/* D6 · comparison with the previous month on each KPI */
.kpi-delta{display:inline-flex;align-items:baseline;gap:5px;font-style:normal;font-size:12.5px;font-weight:700;margin-top:2px}
.kpi-delta span{font-weight:500;color:var(--muted,#526580)}
.kpi-delta.is-good{color:var(--st-paid)}.kpi-delta.is-bad{color:var(--st-bad)}.kpi-delta.is-flat{color:var(--st-unknown)}

/* M1 · growth bridge */
.bridge-net{display:inline-block;font-size:.8em;padding:2px 10px;border-radius:999px;background:var(--st-unknown-bg);color:var(--st-unknown);vertical-align:middle}
.bridge-net.is-up{background:var(--st-paid-bg);color:var(--st-paid)}.bridge-net.is-down{background:var(--st-bad-bg);color:var(--st-bad)}
.bridge-chart{overflow-x:auto}
.bridge-chart svg{width:100%;min-width:620px;height:auto;display:block}
.bridge-axis{stroke:#dfe5ef}
.bridge-link{stroke:#9fb0cc;stroke-dasharray:3 3}
.bridge-col{cursor:pointer;outline:none}
.bridge-col rect{transition:opacity .15s}
.bridge-col:hover rect,.bridge-col:focus-visible rect{opacity:.82}
.bridge-col:focus-visible rect{stroke:#183e86;stroke-width:2}
.bridge-total rect{fill:#183e86}.bridge-gain rect{fill:#2f8f5b}.bridge-loss rect{fill:#c2414b}
.bridge-value{font:700 15px Inter,system-ui,sans-serif;fill:#183e86}
.bridge-label{font:500 11.5px/1.25 Inter,system-ui,sans-serif;color:#526580;text-align:center}
.bridge-sub{margin:22px 0 10px;font-size:15px}
.bridge-months{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:6px;align-items:end}
.bridge-month{display:grid;grid-template-rows:90px 60px auto auto;justify-items:center;gap:2px;font-size:11px;color:#526580}
.bridge-month .bm-up{display:flex;flex-direction:column-reverse;justify-content:flex-start;width:70%;height:90px;border-bottom:1px solid #c9d3e6}
.bridge-month .bm-down{display:flex;flex-direction:column;width:70%;height:60px}
.bridge-month i{display:block;width:100%;min-height:0}
.bm-new{background:#2f8f5b}.bm-react{background:#6d5bd0}.bm-unc{background:#a9b6cc}.bm-down i,.bm-lost{background:#c2414b}
.bridge-month b{font-size:12px;color:#526580}.bridge-month b.is-up{color:var(--st-paid)}.bridge-month b.is-down{color:var(--st-bad)}
.bridge-month.is-partial{opacity:.6}
.bridge-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:#526580;margin-top:10px}
.bridge-legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:5px;vertical-align:-1px}

/* M5 · year comparison */
.compare-table .is-up{color:var(--st-paid);font-weight:700}.compare-table .is-down{color:var(--st-bad);font-weight:700}
.ytd-strip{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.ytd-strip>div{border:1px solid #dfe5ef;border-radius:12px;padding:12px 14px;display:grid;gap:2px}
.ytd-strip span{font-size:12px;color:#526580}.ytd-strip strong{font-size:24px;color:#183e86}.ytd-strip small{font-size:12px;color:#526580}

/* New analyses */
.insights-area{margin-left:auto}.insights-area label{display:flex;gap:8px;align-items:center;font-size:12px;color:#526580}
.insight-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:12px 0 16px}
.insight-kpis article{border:1px solid #dfe5ef;border-radius:12px;padding:12px 14px;background:#fff;display:grid;gap:2px}
.insight-kpis span{font-size:12px;color:#526580}.insight-kpis strong{font-size:24px;color:#183e86}.insight-kpis small{font-size:12px;color:#526580}
.insight-kpis .aging-d15{border-left:4px solid #e0a43a}.insight-kpis .aging-d30{border-left:4px solid #d97706}.insight-kpis .aging-d30plus{border-left:4px solid #c2414b}.insight-kpis .aging-within{border-left:4px solid #9fb0cc}
.insight-kpis.compact strong{font-size:20px}
.insight-grid{display:grid;grid-template-columns:1.3fr 1fr;gap:20px;margin-top:16px}.insight-grid>div{min-width:0}
.insight-total th,.insight-total td{font-weight:800;background:#f7f8fb}
.insight-bars{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.insight-bars li{display:grid;grid-template-columns:minmax(90px,140px) 1fr 34px;gap:10px;align-items:center;font-size:13px}
.insight-bars i{display:block;height:12px;border-radius:4px;background:#6d5bd0;width:var(--w)}
.insight-rate{font-weight:800;color:#183e86}
.close-record{background:var(--st-paid-bg);color:var(--st-paid);border-radius:10px;padding:10px 14px}
.close-steps{list-style:none;margin:12px 0 18px;padding:0;display:grid;gap:8px}
.close-steps li{display:grid;grid-template-columns:34px 1fr auto;gap:12px;align-items:center;border:1px solid #dfe5ef;border-radius:12px;padding:12px 14px;background:#fff}
.close-steps li p{margin:2px 0 0;font-size:13px;color:#526580}
.close-mark{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-weight:900;color:#fff}
.close-steps .is-ok .close-mark{background:#2f8f5b}.close-steps .is-todo .close-mark{background:#c2414b}.close-steps .is-soft .close-mark{background:#d99a2b}
.close-steps .is-todo{border-color:#f1c7cb}
.close-form{display:grid;gap:10px;max-width:720px}.close-form small{color:#526580}
.contact-list{display:grid;gap:10px}
.contact-card{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid #dfe5ef;border-left:4px solid #9fb0cc;border-radius:12px;padding:12px 14px;background:#fff}
.contact-card.p1{border-left-color:#d97706}.contact-card.p2{border-left-color:#c2414b}.contact-card.p3{border-left-color:#6d5bd0}
.contact-card p{margin:3px 0;font-size:13px}.contact-card small{color:#526580;font-size:12px}
.notice-row{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;border-top:1px solid #dfe5ef;padding:14px 0}
.notice-row:first-of-type{border-top:0}.notice-row h3{margin:6px 0 2px}.notice-row p{margin:4px 0}.notice-row.is-off{opacity:.6}
.notice-body,.notice-check{display:flex;flex-direction:column;gap:6px;margin:10px 0}.notice-check{flex-direction:row;align-items:center}
.team-optional{margin:10px 0}.team-optional summary{cursor:pointer;color:#183e86;font-weight:600}
.profile-password{margin:12px 0}.profile-password summary{cursor:pointer;color:#183e86;font-weight:600}

/* The client's areas next to the number are only for the phone list (the table has its own columns). */
.client-areas{display:none}

/* D4 · tables become cards on a phone */
@media(max-width:700px){
  table.cards-ready,table.cards-ready tbody,table.cards-ready tr,table.cards-ready td,table.cards-ready th{display:block;width:100%}
  table.cards-ready{min-width:0!important;border:0}
  table.cards-ready thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  table.cards-ready caption{display:block;text-align:left}
  table.cards-ready tr{border:1px solid #dfe5ef;border-radius:12px;padding:8px 12px;margin:0 0 10px;background:#fff}
  table.cards-ready tbody th{border:0;padding:6px 0 8px;font-size:14px;background:none}
  table.cards-ready td{display:flex;justify-content:space-between;gap:12px;border:0;border-top:1px solid #eef2f8;padding:7px 0;text-align:right}
  table.cards-ready td[data-label]::before{content:attr(data-label);font-weight:600;color:#526580;text-align:left;flex:0 0 45%}
  table.cards-ready td:empty{display:none}
  /* 5.52: the first cell (the client) is the card's title; nothing may be wider than the phone. */
  table.cards-ready td{min-width:0;overflow-wrap:break-word}
  table.cards-ready .client-cell{min-width:0;text-align:left}
  /* 5.53: on a phone the client list is a short list (name and state); tapping a client opens the full ficha. */
  .wiin-staff table.cards-ready.clients-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;row-gap:4px;margin:0;padding:11px 14px;border:0;border-bottom:1px solid #e6ebf3;border-radius:0}
  .wiin-staff table.cards-ready.clients-table tr:last-child{border-bottom:0}
  .wiin-staff table.cards-ready.clients-table td{display:none;padding:0;border:0}
  .wiin-staff table.cards-ready.clients-table td::before{display:none}
  .wiin-staff table.cards-ready.clients-table td:first-child{display:block;grid-column:1;text-align:left}
  .wiin-staff table.cards-ready.clients-table td:nth-child(6){display:block;grid-column:2;grid-row:1}
  .wiin-staff table.cards-ready.clients-table td.empty{display:block;grid-column:1/-1}
  /* One line for the name and one for the number and the areas; long text ends in «…» instead of wrapping. */
  .wiin-staff table.cards-ready.clients-table .client-cell>span:last-child{min-width:0;flex:1}
  .wiin-staff table.cards-ready.clients-table .client-cell .avatar{flex:0 0 auto}
  .wiin-staff table.cards-ready.clients-table .client-cell :is(strong,small){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
  .wiin-staff table.cards-ready.clients-table .client-cell strong{font-size:14.5px;line-height:1.3}
  .wiin-staff table.cards-ready.clients-table .client-cell small{font-size:12px;margin-top:2px}
  .wiin-staff table.cards-ready.clients-table .client-cell small{display:flex;align-items:center;gap:5px;text-overflow:clip}
  .wiin-staff table.cards-ready.clients-table .client-areas{display:flex;gap:4px;min-width:0;overflow:hidden}
  .wiin-staff table.cards-ready.clients-table .client-areas .badge{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:10.5px;line-height:1.3;padding:2px 7px;white-space:nowrap}
  .wiin-staff .client-table-card:has(table.cards-ready){overflow:hidden;padding:0}
  .mg-table-wrap:has(table.cards-ready){overflow:visible;border:0}
  .insight-grid,.ytd-strip{grid-template-columns:1fr}
  .bridge-months{gap:3px}.bridge-month{font-size:9.5px}
  .close-steps li{grid-template-columns:30px 1fr}.close-steps li .btn{grid-column:1/-1}
  .contact-card{flex-direction:column;align-items:stretch}
  .insights-area{margin-left:0}
}

.discount-table td,.discount-table th{white-space:nowrap}@media(max-width:700px){.discount-table td{white-space:normal}}

.holiday-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.holiday-head nav{display:flex;gap:8px}
.holiday-toggle{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0}.holiday-table tr.is-past{opacity:.55}
.holiday-add{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin-top:14px}.holiday-add label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#526580}

.proj-main{color:#a20e1a}.proj-bar{position:relative;height:22px;background:#eef2fa;border-radius:6px;margin:6px 0 4px;overflow:hidden}.proj-bar i,.proj-bar b{position:absolute;top:0;bottom:0}.proj-now{left:0;background:#183e86;border-radius:6px}.proj-range{background:#a20e1a40;border-left:2px solid #a20e1a;border-right:2px solid #a20e1a}.proj-bar b{width:3px;background:#a20e1a;margin-left:-1px}.bridge-legend .proj-now,.bridge-legend .proj-range,.bridge-legend .proj-mark{position:static;display:inline-block}.bridge-legend .proj-mark{background:#a20e1a;width:3px}

.season{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:6px;align-items:end;margin:6px 0 14px}.season-month{display:grid;grid-template-rows:90px auto auto;justify-items:center;gap:3px;font-size:11px;color:#526580}.season-bar{display:flex;align-items:flex-end;width:70%;height:90px;border-bottom:1px solid #c9d3e6}.season-bar i{display:block;width:100%}.season-bar i.is-up{background:#2f8f5b}.season-bar i.is-down{background:#c2414b}.season-month b.is-up{color:#17744a}.season-month b.is-down{color:#a20e1a}
.data-progress{display:grid;gap:6px;margin:8px 0 16px}.data-progress>div{height:12px;background:#eef2fa;border-radius:6px;overflow:hidden}.data-progress i{display:block;height:100%;background:#2f8f5b}.data-progress span{font-size:13px;color:#526580}.data-task summary{cursor:pointer;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.sim-input{max-width:110px}.sim-diff.is-up{color:#17744a;font-weight:700}.sim-diff.is-down{color:#a20e1a;font-weight:700}
.summary-push{background:#eef2fa;border-radius:10px;padding:10px 14px;font-size:13.5px;color:#183e86}

/* 5.39 (N1) · access requests for the reception */
.access-row{display:flex;justify-content:space-between;gap:16px;align-items:center;border-top:1px solid #e3e8ef;padding:14px 0}
.access-row:first-of-type{border-top:0}.access-row h3{margin:0 0 4px}.access-row p{margin:0 0 4px}
.access-actions{display:flex;gap:8px;flex-wrap:wrap}.access-actions form{margin:0}
.access-generated{border-left:4px solid #17744a}.access-password{font-size:34px;font-weight:800;letter-spacing:6px;margin:6px 0}
.access-generated textarea{width:100%;margin:8px 0;font:inherit}
.nav-badge{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#a20e1a;color:#fff;font-size:11px;font-weight:800;margin-left:6px}
@media(max-width:720px){.access-row{flex-direction:column;align-items:stretch}}

/* 5.41 (R2) · data requests */
.data-answer{align-items:center}.data-answer input{min-width:260px;padding:8px 10px;border:1px solid #d3dbe6;border-radius:8px;font:inherit}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media(max-width:720px){.data-answer input{min-width:0;width:100%}}

/* 5.50 · role permissions */
.perm-table td small{display:block;color:#5c6b80;font-size:12px;font-weight:400;margin-top:2px}
.perm-cell{text-align:center;vertical-align:middle}
.perm-check{display:inline-flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer}
.perm-check input{width:20px;height:20px;accent-color:#183e86}
.perm-changed{font-size:10px;font-weight:700;color:#8a4f00;text-transform:uppercase;letter-spacing:.04em}
.perm-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}

/* 5.51 · second factor */
.tfa-setup{display:flex;gap:20px;align-items:center;flex-wrap:wrap}
.tfa-qr{background:#fff;padding:10px;border:1px solid #d9e0ec;border-radius:12px;width:240px;height:240px}
.tfa-qr svg{width:220px;height:220px}
.tfa-key{font-size:17px;letter-spacing:2px;word-break:break-all}
.tfa-form{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}.tfa-form input{max-width:200px}
.tfa-list{columns:2;font-size:18px;line-height:1.9}

/* 5.56 · import page */
.import-mode{border:1px solid #dfe5ef;border-radius:10px;padding:10px 14px;margin:14px 0;display:grid;gap:10px}
.import-mode legend{font-weight:700;color:#183e86;padding:0 4px}
.import-mode label{display:flex;gap:10px;align-items:flex-start;font-size:14px;line-height:1.4}
.import-mode input{margin-top:3px}
.import-effect{margin:8px 0 14px;padding-left:20px;line-height:1.7}
.import-form>label{display:block;margin:12px 0}.import-form>label input[type=password],.import-form>label input[type=file]{display:block;width:100%;margin-top:6px}
.import-form details,.card details{margin:8px 0 14px}

/* 5.57 · «Cliente de teste» */
.badge.test-badge{background:#fff4d6;color:#8a5a00;border:1px dashed #e0b44c;font-weight:700}
.test-client-switch{display:flex;gap:12px;align-items:flex-start;margin:14px 16px 0;padding:12px 14px;border:1px dashed #e0b44c;border-radius:12px;background:#fffbef;cursor:pointer}
.test-client-switch input{width:20px;height:20px;margin-top:2px;flex:0 0 auto}
.test-client-switch span{display:flex;flex-direction:column;gap:3px}.test-client-switch strong{color:#8a5a00}.test-client-switch small{color:#6b5a2e;font-size:12.5px;line-height:1.4}

/* 5.58 · Relatórios: espaçamentos */
.report-kpis{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.report-kpi{padding:12px 14px}
.report-kpi span{font-size:11.5px;white-space:normal;overflow:visible;line-height:1.3}
.report-kpi strong{font-size:21px;white-space:nowrap;margin-top:6px}
.report-kpi small{font-size:10.5px;line-height:1.35;margin-top:4px}
.report-scope-banner{font-size:12px}
.report-definition{font-size:11.5px;padding:12px 14px}
.data-table td:has(> strong:only-child), .report-table td, .compact-report td{white-space:nowrap}
.compact-report td:first-child, .report-table td:first-child{white-space:normal}
.report-register .register-sort{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;padding:16px 20px 0;margin:0}
.report-register .register-sort label{display:flex;flex-direction:column;gap:6px;flex:1 1 260px;max-width:440px;margin:0;font-size:13px}
.report-register .register-sort select{width:100%;max-width:100%}
.report-register .register-note{padding:0 20px;margin:12px 0 16px;font-size:13px;line-height:1.5}
.report-grid-wide>.card+.card, .report-section+.report-section{margin-top:0}
section.card+.report-grid-wide, .report-register+.report-grid-wide, .report-grid-wide+section.card{margin-top:14px}
.followup-list strong{font-size:11.5px}.followup-list small{font-size:10.5px}
.movement-stats a{font-size:12.5px;padding:9px 0}
.retention-bar-row{font-size:11.5px;grid-template-columns:52px 1fr 46px 44px}
.report-section-head p,.exports-card p{font-size:11px}
@media(max-width:700px){
  table.cards-ready td{display:block;position:relative;padding:9px 0 9px 42%;text-align:right}
  table.cards-ready td[data-label]::before{position:absolute;left:0;top:9px;width:40%;text-align:left;font-size:13px}
  table.cards-ready:not(.clients-table) td[data-label]{padding-left:42%!important;padding-right:0!important}
  table.cards-ready td:not([data-label]){padding-left:0;text-align:left}
  table.cards-ready td .row-actions{justify-content:flex-end}
  table.cards-ready td small{display:block}
  table.cards-ready td .btn{margin-top:2px}
  .card .table-wrap:has(> table.cards-ready){margin-left:0;margin-right:0;padding:0 0 8px;overflow:visible}
  .billing-simple .table-wrap:has(> table.cards-ready){padding:0 16px 12px}
  .compact-report .data-table.compact{min-width:0}
  .compact-report .data-table.compact :is(th,td){padding:8px 4px;font-size:11.5px}
  .compact-report .data-table.compact :is(th,td):first-child{padding-left:8px}
  .report-register .register-sort{padding:14px 16px 0}
  .report-register .register-note{padding:0 16px}
  .report-kpi strong{font-size:19px}
}
