:root {
  color-scheme: light;
  --ink: #152622;
  --muted: #687773;
  --brand: #173f35;
  --brand-soft: #dcebe6;
  --accent: #d89b45;
  --paper: #f5f2ea;
  --white: #fff;
  --line: #dfe3de;
  --danger: #a6483e;
  font-family: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
.auth-loading > .topbar, .auth-loading > .tabs, .auth-loading > main { visibility: hidden; }
.auth-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #102e27, #24584a); }
.auth-screen.hidden { display: none; }
.login-card { width: min(100%, 420px); display: grid; gap: 16px; padding: 30px; border-radius: 22px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.3); }
.login-card h1 { color: var(--brand); }
.login-card p { color: var(--muted); }
.login-message { min-height: 20px; color: var(--danger) !important; font-size: 13px; }
button, input, select, textarea { font-family: Arial, Helvetica, sans-serif; font-size: inherit; }
button { cursor: pointer; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 24px max(20px, calc((100vw - 1180px) / 2)); background: var(--brand); color: white; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.notification-button { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.26); border-radius: 12px; background: transparent; color: white; font-weight: 750; }
.notification-button.has-alerts { border-color: #f0b55f; background: rgba(216,155,69,.18); }
.notification-button span { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #241b0d; font-size: 11px; }
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(26px, 4vw, 40px); }
h2 { font-family: Georgia, serif; font-size: 28px; }
.eyebrow { display: block; margin-bottom: 6px; color: inherit; opacity: .7; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 12px max(20px, calc((100vw - 1180px) / 2)); background: rgba(245,242,234,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.tab { padding: 10px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); white-space: nowrap; }
.tab.active { background: var(--brand); color: white; }
main { max-width: 1180px; margin: auto; padding: 28px 20px 64px; }
.view { display: none; }
.view.active { display: block; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 32px; border-radius: 24px; background: linear-gradient(135deg, #173f35, #285f50); color: white; box-shadow: 0 18px 50px rgba(23,63,53,.18); }
.hero-value { display: block; margin: 8px 0; font-family: Georgia, serif; font-size: clamp(38px, 8vw, 66px); }
.hero p { opacity: .72; }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dashboard-inner-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); gap: 8px; margin-bottom: 14px; }
.dashboard-inner-tabs button, .period-shortcuts button { padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--brand); font-weight: 800; }
.dashboard-inner-tabs button.active, .period-shortcuts button.active { border-color: var(--brand); background: var(--brand); color: white; }
.dashboard-period-controls { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #f9faf8; }
.period-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; }
.period-dates { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 8px; }
.period-dates label { color: var(--muted); font-size: 11px; }
.period-dates input { padding: 8px; }
.period-heading { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 10px; }
.period-heading h3 { margin: 4px 0 0; font-size: 18px; }
.dashboard-status-card { border-top-width: 4px; }
.metric-pending { border-top-color: #d9902f; }
.metric-done { border-top-color: #4b8fc9; }
.metric-delivered { border-top-color: #318b5c; }
.service-donut { background: conic-gradient(#d9902f 0 var(--pending), #4b8fc9 var(--pending) var(--done), #318b5c var(--done) 360deg); }
.legend-service-pending { background: #d9902f; }
.legend-service-done { background: #4b8fc9; }
.legend-service-delivered { background: #318b5c; }
.compact-bar-chart { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.horizontal-bar { display: grid; grid-template-columns: 28px 1fr 30px; gap: 8px; align-items: center; font-size: 11px; }
.horizontal-bar div { height: 8px; overflow: hidden; border-radius: 999px; background: #eef2ef; }
.horizontal-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.client-ranking { display: grid; gap: 3px; }
.ranking-row { display: grid; grid-template-columns: 28px minmax(140px, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); }
.ranking-row:first-child { border-top: 0; }
.ranking-position { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.ranking-track { height: 5px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: #eef2ef; }
.ranking-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { display: block; overflow: hidden; margin: 9px 0 5px; color: var(--ink); font-size: clamp(20px, 2.5vw, 30px); text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { color: var(--muted); }
.metric-card.metric-main { background: var(--brand); color: white; border-color: var(--brand); }
.metric-card.metric-main span, .metric-card.metric-main small { color: rgba(255,255,255,.72); }
.metric-card.metric-main strong { color: white; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.quick-actions button { display: grid; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--brand); text-align: left; }
.quick-actions button:hover { background: white; }
.quick-actions span { color: var(--muted); font-size: 12px; }
.primary, .secondary { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 750; }
.primary { background: var(--accent); color: #241b0d; }
.secondary { background: white; color: var(--brand); }
.full { width: 100%; margin-top: 8px; }
.hidden { display: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; }
.stats article, .panel, .client-card, .billing-card, .payment-method-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.stats span { color: var(--muted); }
.stats strong { display: block; margin-top: 8px; font-size: 24px; }
.panel-title, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading { margin-top: 4px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.date-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.section-note { margin: -8px 0 20px; color: var(--muted); }
.account-list { display: grid; gap: 2px; }
.account-row { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.account-row:last-child { border-bottom: 0; }
.account-row span, .meta, .hint { color: var(--muted); font-size: 14px; }
.amount.negative { color: var(--danger); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.client-card h3, .billing-card h3, .price-table-card h3 { margin: 0 0 8px; font-size: 20px; }
.badge { display: inline-block; margin-top: 14px; padding: 6px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.filters-compact { grid-template-columns: minmax(240px, 520px); }
.payment-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.receivable-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 28px; }
.receivable-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.receivable-overdue { border-color: #dca59f; box-shadow: inset 4px 0 0 var(--danger); }
.receivable-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.receivable-heading h3 { margin: 0; }
.billing-status { padding: 5px 8px; border-radius: 999px; background: #eef0ec; font-size: 11px; font-weight: 800; }
.billing-history { margin: 8px 0; color: var(--muted); font-size: 11px; }
.billing-aberta { color: #a45b10; background: #fff5e8; }
.billing-parcial { color: #1768ad; background: #eef6ff; }
.billing-paga { color: #117440; background: #edf9f2; }
.billing-cancelada { color: var(--danger); background: #fde8e5; }
.receivable-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.receivable-values span { color: var(--muted); font-size: 11px; }
.receivable-values strong { display: block; margin-top: 5px; color: var(--ink); font-size: 16px; }
.receivable-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.overdue-message { margin-top: 12px; color: var(--danger); font-size: 12px; font-weight: 750; }
.subsection-heading { margin: 24px 0 14px; }
.subsection-heading h3 { margin: 0; font-size: 20px; }
.filters input, .filters select, label input, label select, label textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); }
.timeline { display: grid; gap: 10px; }
.timeline-item { display: grid; grid-template-columns: 100px 1fr auto auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.timeline-item h3 { margin: 0 0 4px; font-size: 17px; }
.payment-origin { display: inline-block; margin-top: 5px; color: var(--brand); font-size: 11px; font-weight: 750; }
.status { font-size: 12px; font-weight: 800; color: var(--brand); }
.status-a-fazer { color: #a45b10; }
.status-pronto { color: #1768ad; }
.status-entregue { color: #117440; }
.status-cancelado { color: var(--danger); }
.overdue-label { display: inline-block; margin-left: 8px; padding: 4px 7px; border-radius: 999px; background: #fde8e5; color: var(--danger); font-size: 11px; font-weight: 800; }
.confirmation-label, .delivered-label { display: inline-block; margin: 6px 0 0 8px; padding: 4px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.confirmation-label { background: #fff5e8; color: #a45b10; }
.delivered-label { background: #edf9f2; color: #117440; }
.cancellation-reason { margin-top: 8px; padding: 9px 11px; border-radius: 10px; background: #fdecea; color: #8d3d35; font-size: 12px; line-height: 1.4; }
.service-overdue { border-color: #dca59f; background: #fffafa; box-shadow: inset 4px 0 0 var(--danger); }
.service-actions { display: grid; gap: 8px; justify-items: end; }
.status-actions { display: flex; gap: 8px; }
.table-action.success { border-color: #b8dcc7; background: #edf9f2; color: #117440; }
.alert-panel { margin: 16px 0; }
.alert-panel.has-alerts { border-color: #dca59f; background: #fffafa; }
.alert-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); gap: 10px; margin-bottom: 14px; }
.alert-summary article { padding: 14px; border-radius: 12px; background: #f2f6f4; }
.alert-summary span { display: block; color: var(--muted); font-size: 12px; }
.alert-summary strong { display: block; margin-top: 4px; font-size: 24px; }
.alert-summary small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.alert-summary .alert-danger { background: #fde8e5; color: var(--danger); }
.alert-list { display: grid; gap: 8px; }
.alert-list div { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.alert-list span { color: var(--muted); font-size: 12px; text-align: right; }
.finance-alert-summary { grid-template-columns: repeat(2, minmax(0, 240px)); }
.finance-alert-summary strong { font-size: clamp(18px, 3vw, 24px); }
.alert-link { margin-top: 14px; }
.dashboard-charts { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin: 16px 0; }
.chart-panel { min-width: 0; }
.chart-panel .panel-title { align-items: flex-start; }
.chart-total { color: var(--brand); font-size: 18px; white-space: nowrap; }
.bar-chart { display: grid; grid-template-columns: repeat(var(--bar-count, 7), minmax(30px, 1fr)); gap: 8px; height: 190px; padding-top: 10px; overflow-x: auto; }
.bar-column { display: grid; grid-template-rows: 22px 1fr 18px; gap: 5px; min-width: 0; text-align: center; }
.bar-column > span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.bar-column > strong { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.bar-track { position: relative; overflow: hidden; border-radius: 8px; background: #eef2ef; }
.bar-track i { position: absolute; right: 0; bottom: 0; left: 0; min-height: 2px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent), #b97925); }
.status-chart { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: center; min-height: 190px; }
.donut-chart { display: grid; place-items: center; width: 145px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(#318b5c 0 var(--paid), #4b8fc9 var(--paid) var(--partial), var(--accent) var(--partial) 360deg); }
.donut-chart::before { content: ""; grid-area: 1 / 1; width: 96px; aspect-ratio: 1; border-radius: 50%; background: white; }
.donut-chart div { z-index: 1; grid-area: 1 / 1; text-align: center; }
.donut-chart strong, .donut-chart span { display: block; }
.donut-chart strong { font-size: 28px; }
.donut-chart span { color: var(--muted); font-size: 11px; }
.chart-legend { display: grid; gap: 8px; }
.chart-legend button { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.chart-legend button:hover { background: #f2f6f4; }
.chart-legend i { width: 10px; height: 10px; border-radius: 50%; }
.legend-paid { background: #318b5c; }
.legend-partial { background: #4b8fc9; }
.legend-open { background: var(--accent); }
.empty { display: grid; place-items: center; min-height: 180px; color: var(--muted); text-align: center; }
.empty strong { color: var(--ink); }
dialog { width: min(92vw, 480px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(12,31,26,.58); backdrop-filter: blur(4px); }
dialog form { display: grid; gap: 14px; padding: 24px; }
.notification-dialog { width: min(92vw, 620px); }
.notification-content { padding: 24px; }
.notification-daily-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.notification-daily-summary article { padding: 14px; border-radius: 12px; background: #f2f6f4; }
.notification-daily-summary span { display: block; color: var(--muted); font-size: 11px; }
.notification-daily-summary strong { display: block; margin-top: 5px; font-size: 19px; }
.notification-list { display: grid; gap: 8px; max-height: min(55vh, 460px); overflow-y: auto; }
.notification-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); text-align: left; }
.notification-item:hover { background: #f8faf8; }
.notification-item i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.notification-service i { background: var(--danger); }
.notification-item span, .notification-item strong, .notification-item small { display: block; }
.notification-item small { margin-top: 4px; color: var(--muted); }
.notification-item b { color: var(--brand); font-size: 12px; }
.notification-empty { display: grid; gap: 5px; padding: 26px; border-radius: 12px; background: #f2f6f4; text-align: center; }
.notification-empty span { color: var(--muted); font-size: 13px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eef0ec; font-size: 24px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 750; }
.method-selector { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.method-selector legend { padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.method-selector > div { display: grid; gap: 9px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.access-box { display: grid; gap: 8px; margin-top: 16px; padding: 12px; border-radius: 12px; background: #f2f6f4; font-family: ui-monospace, monospace; font-size: 13px; }
.access-data { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.access-data span { min-width: 0; }
.access-data small { display: block; color: var(--muted); font-family: Arial, Helvetica, sans-serif; font-size: 11px; }
.access-data strong { display: block; overflow-wrap: anywhere; user-select: all; }
.access-data button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--brand); font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: 750; }
.access-note { color: var(--muted); font-family: Arial, Helvetica, sans-serif; font-size: 11px; }
.catalog-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: white; }
.catalog-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.catalog-table th, .catalog-table td { padding: 16px; border-bottom: 1px solid var(--line); text-align: left; }
.catalog-table th { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.catalog-table tr:last-child td { border-bottom: 0; }
.table-action { padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--brand); font-weight: 750; }
.table-action.danger { color: var(--danger); }
.whatsapp-action { border-color: #a9ddbd; background: #edf9f2; color: #117440; }
.card-actions, .row-actions { display: flex; gap: 8px; margin-top: 16px; }
.row-actions { margin-top: 0; }
.billing-card .card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.billing-card .card-actions .table-action { width: 100%; min-width: 0; white-space: normal; }
.billing-card .card-actions .table-action:last-child { grid-column: 1 / -1; }
.price-table-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.price-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.field-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.reference-entry-row { display: grid; grid-template-columns: 1fr 48px; gap: 8px; align-items: stretch; }
.reference-entry-row textarea { min-height: 92px; resize: vertical; }
.reference-entry-row button { min-height: 46px; padding: 8px; font-size: 22px; }
.reference-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: -5px; }
.reference-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 999px; background: #eaf3ef; color: var(--brand); font-size: 12px; font-weight: 750; }
.reference-chip button { padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; }
.additional-service-toggle { grid-template-columns: auto 1fr; align-items: center; padding: 12px; border: 1px solid #d8d0eb; border-radius: 12px; background: #faf8ff; color: #654697; }
.additional-service-toggle input { width: auto; }
.additional-services-section { display: grid; gap: 12px; padding: 14px; border: 1px solid #d8d0eb; border-radius: 12px; background: #faf8ff; }
.additional-services-section.hidden { display: none; }
.additional-service-entry-row { display: grid; grid-template-columns: 1fr 48px; gap: 8px; }
.additional-service-entry-row button { min-height: 46px; padding: 8px; font-size: 22px; }
.additional-service-list { display: grid; gap: 7px; }
.additional-service-item { display: grid; grid-template-columns: 1fr auto auto; gap: 9px; align-items: center; padding: 9px 10px; border-radius: 10px; background: #eee8fa; color: #51347e; font-size: 12px; font-weight: 750; }
.additional-service-item button { padding: 3px 6px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.supplier-service-toggle { grid-template-columns: auto 1fr; align-items: center; padding: 12px; border: 1px solid #b9d9ca; border-radius: 12px; background: #f2faf6; color: #176647; }
.supplier-service-toggle input { width: auto; }
.supplier-service-section { display: grid; gap: 12px; padding: 14px; border: 1px solid #b9d9ca; border-radius: 12px; background: #f2faf6; }
.supplier-service-section.hidden { display: none; }
.secondary-service { border-color: #cbbbe8; background: #fcfaff; box-shadow: inset 4px 0 0 #7654a8; }
.secondary-service-label { display: inline-block; margin: 6px 0 0 8px; padding: 4px 7px; border-radius: 999px; background: #eee8fa; color: #654697; font-size: 11px; font-weight: 800; }
.dialog-form-actions { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 10px; }
.dialog-form-actions button { width: 100%; }
.continue-entry-dialog { width: min(420px, 88vw); padding: 24px; }
.continue-entry-actions { display: grid; gap: 10px; margin-top: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; }
.checkbox-label.hidden { display: none; }
.checkbox-label input { width: auto; }
.method-type { display: inline-block; margin-bottom: 10px; color: var(--brand); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.report-dialog { width: min(96vw, 900px); max-width: 900px; }
.report { padding: 30px; background: white; }
.report-header, .report-actions { display: flex; justify-content: space-between; gap: 16px; }
.report-header { align-items: start; padding-bottom: 22px; border-bottom: 2px solid var(--brand); }
.report-actions { flex-wrap: wrap; margin-bottom: 22px; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin: 24px 0; }
.report-summary article { padding: 16px; border-radius: 14px; background: #f2f6f4; }
.report-summary strong { display: block; margin-top: 6px; font-size: 22px; }
.chart { display: grid; gap: 12px; margin: 22px 0; }
.chart-row { display: grid; grid-template-columns: 130px 1fr 110px; gap: 12px; align-items: center; }
.chart-track { height: 18px; overflow: hidden; border-radius: 999px; background: #e7ece9; }
.chart-bar { height: 100%; min-width: 3px; border-radius: inherit; background: var(--brand); }
.chart-bar.credit { background: var(--accent); }
.report-table { width: 100%; border-collapse: collapse; margin: 22px 0; }
.report-table th, .report-table td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; }
.report-table th:last-child, .report-table td:last-child { text-align: right; }
.report-service-grid { display: grid; grid-template-columns: repeat(2, minmax(420px, 1fr)); gap: 10px; margin: 18px 0 24px; overflow-x: auto; }
.report-service-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.report-service-table th, .report-service-table td { padding: 8px 6px; overflow: hidden; border-bottom: 1px solid var(--line); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.report-service-table th { color: var(--brand); background: #eef4f1; }
.report-service-table th:nth-child(1), .report-service-table td:nth-child(1) { width: 70px; }
.report-service-table th:nth-child(3), .report-service-table td:nth-child(3) { width: 72px; }
.report-service-table th:nth-child(4), .report-service-table td:nth-child(4) { width: 82px; text-align: right; }
.payment-options { display: grid; gap: 10px; }
.payment-option { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.payment-option strong { display: block; margin-bottom: 5px; }
.supplier-tabs { display: flex; gap: 8px; margin: 0 0 20px; padding: 6px; overflow-x: auto; border-radius: 14px; background: #e9efec; }
.supplier-tabs button { padding: 10px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; white-space: nowrap; }
.supplier-tabs button.active { color: white; background: var(--brand); }
.supplier-panel { min-height: 260px; }
.supplier-split { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(440px, 1.15fr); gap: 24px; }
.supplier-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 0; }
.supplier-search { width: 100%; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.supplier-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.supplier-status-grid article { padding: 22px; border-radius: 14px; background: #f2f6f4; }
.supplier-status-grid span, .supplier-status-grid strong { display: block; }
.supplier-status-grid span { color: var(--muted); font-size: 12px; }
.supplier-status-grid strong { margin-top: 8px; font-size: 32px; }
.supplier-entry-closed { background: #f7f8f6; }
.supplier-entry-closed::before { content: "Fechado"; align-self: center; padding: 4px 7px; border-radius: 999px; background: #e7ece9; color: var(--muted); font-size: 10px; font-weight: 800; }
.supplier-payable-actions { justify-content: flex-end; margin-bottom: 14px; }
.supplier-payable-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.supplier-payable-buttons button { width: 100%; }
.help-heading { align-items: flex-start; }
.help-heading .meta { margin-top: 7px; }
.help-start { display: grid; grid-template-columns: minmax(200px, .55fr) 1.45fr; gap: 24px; margin-bottom: 18px; padding: 24px; border-radius: 18px; background: var(--brand); color: white; }
.help-start h3 { margin: 0; font-family: Georgia, serif; font-size: 24px; }
.help-start ol { display: grid; gap: 8px; margin: 0; padding-left: 22px; color: rgba(255,255,255,.88); }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.help-grid details { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; }
.help-grid summary { padding: 17px 19px; color: var(--brand); font-weight: 800; cursor: pointer; }
.help-grid details[open] summary { border-bottom: 1px solid var(--line); background: #f4f8f6; }
.help-content { display: grid; gap: 11px; padding: 18px 19px; }
.help-content p { color: var(--muted); line-height: 1.5; }
.help-content .table-action { justify-self: start; }
.shortcut-list { display: grid; gap: 10px; }
.shortcut-list div { display: grid; grid-template-columns: minmax(92px, auto) 1fr; gap: 12px; align-items: center; }
.shortcut-list span { color: var(--muted); font-size: 13px; }
kbd { display: inline-block; min-width: 28px; padding: 5px 7px; border: 1px solid #cdd5d1; border-bottom-width: 3px; border-radius: 7px; background: #f7f9f8; color: var(--ink); font-family: ui-monospace, monospace; font-size: 11px; font-weight: 800; text-align: center; }
@media (max-width: 700px) {
  .topbar { align-items: flex-start; }
  .topbar-actions { align-items: stretch; flex-direction: column; }
  .notification-button { justify-content: center; }
  .topbar { padding: 16px 18px; }
  .topbar .eyebrow { display: none; }
  h1 { font-size: 26px; }
  main { padding: 20px 14px 88px; }
  .tabs { padding: 9px 14px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .tab { min-width: 0; padding: 9px 4px; border-radius: 10px; font-size: 11px; white-space: normal; touch-action: manipulation; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .dashboard-heading .primary { width: 100%; }
  .dashboard-inner-tabs { grid-template-columns: 1fr 1fr; }
  .dashboard-period-controls { align-items: stretch; flex-direction: column; }
  .period-dates { width: 100%; }
  .ranking-row { grid-template-columns: 28px 1fr auto; }
  .ranking-row > strong:last-child { grid-column: 2 / -1; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .payment-summary { grid-template-columns: 1fr; }
  .dashboard-charts { grid-template-columns: 1fr; }
  .status-chart { grid-template-columns: 120px 1fr; gap: 14px; }
  .donut-chart { width: 120px; }
  .donut-chart::before { width: 78px; }
  .payment-filters { grid-template-columns: 1fr; }
  .receivable-values { grid-template-columns: 1fr; }
  .metric-card { padding: 15px; }
  .metric-card strong { font-size: 20px; }
  .metric-card small { display: none; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quick-actions button { padding: 13px; }
  .panel { padding: 16px !important; }
  .panel-title { align-items: flex-start; }
  .panel-title h2 { font-size: 22px; }
  .hero { align-items: stretch; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: 1fr auto; }
  .account-row .meta { display: none; }
  .filters { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr auto; }
  .timeline-item > time { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
  .timeline-item .row-actions { grid-column: 1 / -1; }
  .service-actions { grid-column: 1 / -1; width: 100%; justify-items: stretch; }
  .service-actions .row-actions, .status-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-actions button { width: 100%; }
  .alert-summary { grid-template-columns: 1fr 1fr; }
  .alert-list div { align-items: flex-start; flex-direction: column; }
  .alert-list span { text-align: left; }
  .notification-daily-summary { grid-template-columns: 1fr; }
  .price-fields { grid-template-columns: 1fr; }
  .report { padding: 18px; }
  .supplier-split { grid-template-columns: 1fr; }
  .supplier-tabs { margin-right: -14px; margin-left: -14px; border-radius: 0; }
  .supplier-section-title { align-items: stretch; flex-direction: column; }
  .supplier-status-grid { grid-template-columns: 1fr 1fr; }
  .help-heading { align-items: stretch; flex-direction: column; }
  .help-start, .help-grid { grid-template-columns: 1fr; }
  .report-header { flex-direction: column; }
  .chart-row { grid-template-columns: 90px 1fr; }
  .chart-row strong { grid-column: 2; }
}
.whatsapp-connection-result {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
  background: #f7faf8;
}

.whatsapp-connection-result img {
  width: min(280px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 12px;
  background: white;
}

@media print {
  body * { visibility: hidden; }
  #reportDialog[open], #reportDialog[open] * { visibility: visible; }
  #reportDialog[open] { position: absolute; inset: 0; width: 100%; max-width: none; margin: 0; border: 0; box-shadow: none; }
  .report-actions, .icon-button { display: none !important; }
}
