:root {
  color-scheme: light;
  --paper: #f7f8fa;
  --white: #fff;
  --ink: #233542;
  --muted: #536574;
  --line: #dce1e6;
  --primary: #0033cc;
  --dark: #020c44;
  --primary-soft: #e9f1ff;
  --radius: 8px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #488af5;
  outline-offset: 3px;
}
a { color: var(--primary); }
h1, h2, p { margin: 0; }
svg { display: block; flex: none; }
.icon { width: 19px; height: 19px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0,1fr); }
.shell.nav-hidden { grid-template-columns: minmax(0,1fr); }
.shell.nav-hidden .sidebar { display: none; }
.work { min-width: 0; }
.sidebar { background: white; color: var(--ink); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100dvh; padding: 0 14px 24px; display: flex; flex-direction: column; }
.brand { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 84px; color: var(--primary); text-decoration: none; font-size: 1.57rem; font-weight: 750; letter-spacing: -.055em; }
.brand small { display: block; font-size: .59rem; letter-spacing: .15em; line-height: 1; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--primary); border-radius: 9px; font-size: 1.5rem; font-weight: 750; }
.sidebar nav { overflow-y: auto; }
.sidebar .nav-create { width: 100%; margin: 2px 0 23px; }
.nav-item, .nav-group summary { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 43px; border-radius: 24px; margin: 3px 0; font-size: .92rem; text-decoration: none; color: #415767; cursor: pointer; }
.nav-item:hover, .nav-group summary:hover { color: var(--primary); background: #f1f5fd; }
.nav-item[aria-current="page"] { color: #002eae; background: #dce7ff; font-weight: 650; }
.nav-group summary { list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary .icon:last-child { width: 13px; height: 13px; margin-left: auto; transform: rotate(90deg); }
.nav-group[open] summary .icon:last-child { transform: rotate(-90deg); }
.nav-group .nav-item { min-height: 34px; padding: 7px 12px 7px 44px; font-size: .86rem; }
.nav-group .nav-item svg { display: none; }
.charge-toolbar { align-items: flex-start; }
.charge-toolbar details summary { cursor: pointer; display: list-item; }
.charge-toolbar details[open] { flex-basis: 100%; }
.charge-toolbar details[open] summary { width: fit-content; }
.charge-toolbar details .filters, .charge-toolbar details .form-actions { margin: 10px 0 0; }
#applied-filters:not(:empty) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 12px; }
.filter-chip { background: var(--primary-soft); border-radius: 20px; padding: 4px 10px; font-size: .82rem; overflow-wrap: anywhere; }
.task-list { display: grid; gap: 3px; }
.task-row { display: flex; justify-content: space-between; align-items: center; text-align: left; background: white; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px; }
.task-row:hover { background: var(--primary-soft); }
.task-row strong { color: var(--primary); }
.review-grid { grid-column: 1 / -1; margin: 0; }
.charge-summary p { margin: 8px 0; }
.charge-summary, .charge-history, .charge-documents { padding: 18px; margin-bottom: 16px; }
.charge-summary .panel-head, .charge-history .panel-head { padding: 0 0 10px; }
.charge-history .history li { padding: 12px 0; overflow-wrap: anywhere; }
.charge-documents h3 { margin: 14px 0 8px; font-size: .95rem; }
.summary-controls { margin-bottom: 16px; }
.summary-controls .muted { padding: 8px 16px; font-size: .83rem; }
.metrics.balances { grid-template-columns: repeat(auto-fit,minmax(min(180px,100%),1fr)); }
.task-list { margin: 0 16px 10px; }
#applied-filters:not(:empty) { padding: 10px 16px; }
.topbar { display: flex; align-items: center; gap: 16px; background: white; border-bottom: 1px solid var(--line); min-height: 64px; padding: 8px clamp(16px,2vw,32px); }
.workspace-label { min-width: 0; }
.workspace-label strong,.workspace-label small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-label strong { font-size: .94rem; }
.workspace-label small { color: var(--muted); font-size: .73rem; }
.workspace-avatar { display: grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 50%; color: white; background: #294250; font-size: .78rem; font-weight: 650; text-decoration: none; }
.integration { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; border: 0; background: transparent; color: var(--muted); padding: 8px; font-size: .84rem; }
.integration:empty { visibility: hidden; }
.integration:hover { color: var(--primary); }
.integration[data-configured="true"] { color: #187052; }
.breadcrumb,.breadcrumb a { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--muted); text-decoration: none; }
.breadcrumb { margin-bottom: 9px; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .icon { width: 13px; height: 13px; }
main { max-width: 1600px; margin: 0 auto; padding: 24px clamp(16px,2vw,32px) 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.35rem,2vw,1.7rem); line-height: 1.2; font-weight: 650; letter-spacing: -.028em; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: .9rem; line-height: 1.45; }
.page-head p:empty { display: none; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; min-height: 39px; border: 1px solid #a8bbdc; border-radius: 5px; background: var(--white); color: #153fa9; font-weight: 650; font-size: .88rem; white-space: nowrap; }
.button:hover { background: #edf3ff; }
.button .icon { width: 17px; height: 17px; }
.button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.button.primary:hover { background: #0036b8; }
.button.danger { color: #963d35; border-color: #e7c9c5; }
.button.danger:hover { background: #fbefed; }
.period-controls { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 0 18px 18px; }
.metric { --tone: var(--primary); display: flex; flex-direction: column; align-items: stretch; background: white; border: 1px solid var(--line); border-radius: 6px; padding: 16px; text-align: left; min-width: 0; color: var(--ink); }
.metric.received { --tone: #087653; }
.metric.due { --tone: #a65300; }
.metric.late { --tone: #c22d3f; }
.metric.expense { --tone: #645194; }
.metric:hover { border-color: var(--tone); background: #fafcff; }
.metric-label { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; font-size: .9rem; font-weight: 650; }
.metric-label .icon { color: var(--tone); width: 16px; height: 16px; }
.metric-value { color: var(--tone); margin: 14px 0 6px; font-size: clamp(1.15rem,1.6vw,1.55rem); line-height: 1.2; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-hint { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.metric-detail { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--tone); padding-top: 10px; border-top: 3px solid color-mix(in srgb,var(--tone) 32%,white); font-size: .78rem; font-weight: 600; }
.metric-detail .icon { width: 12px; height: 12px; }
.metric-main,.metric-shortcut { font: inherit; text-align: left; background: transparent; border: 0; padding: 0; color: inherit; }
.metric-main { display: flex; flex: 1; flex-direction: column; align-items: stretch; }
.metric-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; padding: 7px 0; color: var(--primary); font-size: .8rem; font-weight: 600; }
.metric-shortcut .icon { width: 12px; height: 12px; }
.metric-shortcut:hover { text-decoration: underline; }
.coverage-heading,.coverage-provider { display: block; font-size: .79rem; }
.coverage-heading { font-weight: 650; }
.coverage-provider { margin: 4px 0 7px; }
.coverage-provider small { display: block; color: var(--muted); font-size: .74rem; }
.agenda-gaps,.agenda-pagination { padding: 12px 17px; }
.agenda-gaps h3 { margin: 0; font-size: .95rem; }
.agenda-gaps ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: .88rem; }
.agenda-pagination { justify-content: space-between; font-size: .86rem; }
@media (max-width: 700px) {
  .daily-agenda,.daily-agenda tbody { display: block; width: 100%; }
  .daily-agenda thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .daily-agenda tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
  .daily-agenda tbody td { padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .daily-agenda td:nth-child(2),.daily-agenda td:nth-child(6) { grid-column: span 2; }
  .daily-agenda .amount::before { display: block; font-size: .73rem; font-weight: 400; color: var(--muted); }
  .daily-agenda td:nth-child(3)::before { content: "Previsto"; }
  .daily-agenda td:nth-child(4)::before { content: "Creditado"; }
  .daily-agenda td:nth-child(5)::before { content: "Ainda a cair"; }
}
.method-bar { display: block; width: 100%; height: 5px; margin-top: 10px; border-radius: 3px; overflow: hidden; }
.wallet-total { padding: 12px 17px; color: var(--muted); font-size: .9rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.18fr) minmax(255px, 1fr); gap: 16px; margin-bottom: 17px; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.report-panel { margin-bottom: 16px; padding-bottom: 6px; }
@media (min-width:821px) { .sidebar nav { overflow-y: auto; } }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 17px 17px 14px; }
.panel h2 { font-size: 1.07rem; letter-spacing: -.02em; font-weight: 700; }
.panel-head p, .section-copy { color: var(--muted); font-size: .85rem; margin-top: 4px; line-height: 1.45; }
.chart-legend { display: flex; gap: 11px; flex-wrap: wrap; color: var(--muted); font-size: .79rem; }
.chart-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.swatch { width: 8px; height: 8px; border-radius: 3px; background: #0038e5; }
.swatch.out { background: #8fbbff; }
.chart { padding: 0 13px 10px; }
.chart svg { width: 100%; max-height: 178px; }
.chart text { fill: #505c72; font-family: inherit; font-size: 12px; }
.summary-balance { padding: 9px 17px 13px; border-bottom: 1px solid var(--line); }
.summary-balance strong { display: block; font-size: clamp(1.45rem, 2.5vw, 2rem); letter-spacing: -.04em; }
.summary-balance span { color: var(--muted); font-size: .81rem; }
.summary-list { padding: 12px 17px 15px; display: grid; gap: 10px; }
.summary-row { display: flex; gap: 9px; justify-content: space-between; color: var(--muted); font-size: .86rem; }
.summary-row strong { color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.card-estimate { min-width: 0; margin-block: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; white-space: nowrap; }
th { text-align: left; color: #405170; background: #f5f7f9; font-weight: 650; }
th, td { padding: 11px 14px; border-bottom: 1px solid #e5eaf2; }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { padding-right: 17px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8faff; }
.table-main { display: block; font-weight: 650; }
.table-sub { display: block; margin-top: 2px; font-size: .79rem; color: var(--muted); }
.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.amount { font-variant-numeric: tabular-nums; font-weight: 650; }
.row-open { border: 0; background: transparent; color: var(--primary); font-size: .84rem; font-weight: 650; padding: 6px 3px; }
.row-open:hover { text-decoration: underline; }
.tag { display: inline-flex; border-radius: 20px; padding: 4px 8px; font-size: .76rem; font-weight: 650; background: #edf2f9; color: #485a75; white-space: nowrap; }
.tag.paid, .tag.accepted { background: #e3f3e8; color: #176143; }
.tag.open, .tag.sending { background: #eaf1f9; color: #365580; }
.tag.overdue, .tag.failed { background: #fae9e4; color: #903e30; }
.tag.partial, .tag.uncertain { background: #fbf0d9; color: #775413; }
.filters { border-bottom: 1px solid var(--line); padding: 13px 16px; display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.filters input[type="search"] { min-width: 160px; flex: 1 1 240px; }
input:not([type="checkbox"]), select, textarea { border: 1px solid #ccd7e9; border-radius: 8px; background: #fff; color: var(--ink); padding: 8px 10px; min-height: 38px; font-size: .88rem; }
select { appearance: none; padding-right: 32px; background: #fff no-repeat right 10px center / 13px 13px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23505c72' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
.empty { padding: 29px 19px; color: var(--muted); text-align: center; line-height: 1.45; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.empty .button { margin-top: 11px; }
.notice { margin-bottom: 17px; background: #edf4ff; border: 1px solid #c7e0ff; border-radius: 10px; padding: 10px 12px; color: #244478; font-size: .88rem; }
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings .panel { padding: 17px; }
.settings form { margin-top: 15px; }
.form-grid { display: grid; gap: 13px; }
.client-preferences, .client-channel { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.client-preferences legend, .client-channel legend { padding: 0 5px; font-weight: 650; }
.client-channel { display: grid; gap: 9px; margin-top: 12px; }
.form-grid label { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; }
.muted { color: var(--muted); font-size: .84rem; line-height: 1.45; font-weight: 400; }
.form-grid label.checkbox { display: flex; align-items: start; gap: 8px; font-weight: 500; }
input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
textarea { resize: vertical; min-height: 75px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.error { color: #8b362b; font-size: .88rem; line-height: 1.4; }
.form-error:empty { display: none; }
.loading { color: var(--muted); }
dialog { width: min(565px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid var(--line); padding: 0; border-radius: 17px; color: var(--ink); box-shadow: 0 25px 100px #08163e52; }
dialog::backdrop { background: #08163e85; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.21rem; overflow-wrap: anywhere; }
.dialog-body { padding: 16px 20px 20px; }
.icon-button { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); width: 30px; height: 30px; }
.icon-button:hover { background: var(--primary-soft); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 11px 0 14px; }
.detail-grid div { padding: 8px 10px; background: #f2f6fc; border-radius: 8px; overflow-wrap: anywhere; }
.detail-grid span { color: var(--muted); font-size: .8rem; display: block; }
.detail-grid strong { font-size: .93rem; }
.pix-qr { display: block; width: min(264px, 100%); height: auto; margin: 1rem auto; image-rendering: pixelated; }
.pix-code { display: grid; gap: .4rem; }
.pix-code textarea { width: 100%; font-family: monospace; overflow-wrap: anywhere; }
.dialog-body h3 { font-size: .92rem; margin: 17px 0 7px; }
.history { margin: 0; padding: 0; list-style: none; }
.history li { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.history small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 2; right: 18px; bottom: 18px; max-width: min(440px, calc(100% - 36px)); background: #020c44; color: #fff; border-radius: 10px; padding: 11px 15px; box-shadow: 0 8px 24px #101d4933; font-size: .91rem; }
.toast[data-error="true"] { background: #7b342e; }

.billing-summary { margin-bottom: 16px; }
.summary-head { align-items: center; }
.summary-head select { color: var(--primary); font-weight: 600; }
.period-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.period-fields label,.summary-controls label,.filters label { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.period-fields input { min-width: 0; }
.summary-controls { margin-inline: 18px; border: 1px solid var(--line); border-radius: 6px; }
.dashboard-grid { grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); }
.dashboard-grid .report-panel { margin: 0; }
.dashboard-grid .chart svg { max-height: 230px; }
.panel { box-shadow: 0 1px 2px #1026380a; }
.task-row strong { min-width: 26px; text-align: center; background: #eff4fb; padding: 2px 6px; border-radius: 12px; font-size: .83rem; }
.refresh-link { color: var(--primary); border-color: transparent; background: transparent; }
.mobile-shortcuts { display: none; }
#menu-dialog { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(290px,87vw); height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
#menu-dialog .sidebar { border: 0; }
#menu-close { position: absolute; right: 8px; top: 9px; z-index: 1; }
.signed-out .sidebar,.signed-out .topbar { display: none; }
.signed-out .shell { display: block; }
.login-panel { max-width: 410px; margin: 7vh auto; padding: 28px; }
.login-panel h1 { font-size: 1.4rem; margin-block: 16px 20px; }
.login-brand { color: var(--primary); }
.login-panel button { width: 100%; margin-top: 16px; }
@media (max-width: 1150px) {
  .shell { grid-template-columns: 210px minmax(0,1fr); }
  .billing-summary .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .shell > .sidebar { display: none; }
  .topbar { gap: 10px; min-height: 54px; }
  .mobile-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
}
@media (max-width: 600px) {
  .page-head { flex-wrap: wrap; align-items: center; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric-value { font-size: 1.28rem; }
  .dashboard-grid, .settings { grid-template-columns: minmax(0, 1fr); }
  .panel-head { flex-wrap: wrap; }
  .topbar { padding-inline: 13px; }
  main { padding-inline: 13px; }
  .chart { overflow: auto; }
  .metrics { padding: 0 12px 12px; }
  .metric { padding: 11px; }
  .metric-label { font-size: .82rem; }
  .metric-value { margin-top: 10px; }
  .workspace-label { flex: 1; }
  .integration { font-size: 0; gap: 0; }
  .charge-list,.charge-list tbody { display: block; width: 100%; }
  .charge-list thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .charge-list tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .charge-list td { border: 0; padding: 0; white-space: normal; overflow-wrap: anywhere; }
  .charge-list td:first-child,.charge-list td:last-child { grid-column: 1/-1; padding: 0; }
  .charge-list td:first-child .clip { max-width: none; }
  .charge-list td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }
  .charge-list td:last-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
  .charge-list .row-open,.charge-list summary { min-height: 32px; }
}

.client-tabs {display:flex;gap:.5rem;flex-wrap:wrap;margin:1rem 0}
.client-tabs a,.share-charge summary {color:var(--primary,#005eb8);cursor:pointer}
.client-tabs {border-bottom:1px solid var(--line)}
.client-tabs a {padding:.55rem .8rem;border-bottom:2px solid transparent;text-decoration:none}
.client-tabs [aria-current="page"] {border-bottom-color:var(--primary);font-weight:650}
.share-charge {margin-top:.4rem}
.share-charge small,.share-charge button {display:block;white-space:normal;margin:.4rem 0}
.preview-message {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit}
@media(max-width:760px) {
 .wallet-list .table-scroll,.wallet-list table,.wallet-list tbody {display:block;width:100%;min-width:0;overflow:visible}
 .wallet-list thead {position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
 .wallet-list tbody tr {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);margin:.65rem 0;padding:.75rem;border:1px solid #d7e1ed;border-radius:.65rem;background:white}
 .wallet-list tbody td {display:block;padding:.3rem;border:0;min-width:0;white-space:normal;overflow-wrap:anywhere}
 .wallet-list td:first-child,.wallet-list td:last-child {grid-column:1/-1}
 .wallet-list td:first-child {font-weight:650}
 .wallet-list td:nth-child(3),.wallet-list td:nth-child(5) {display:none}
 .wallet-list td:nth-child(2)::before,.wallet-list td:nth-child(4)::before {display:block;font-size:.78rem;color:#42576d}
 .wallet-list td:nth-child(2)::before {content:"Saldo vencido"}
 .wallet-list td:nth-child(4)::before {content:"Vencimento mais antigo"}
}
