:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #182033;
  --muted: #657084;
  --line: #dfe5ef;
  --primary: #126f77;
  --primary-dark: #0d5258;
  --accent: #c6922e;
  --project-accent: #c6922e;
  --enterprise-soft: #edf7f5;
  --enterprise-sidebar: #101827;
  --enterprise-sidebar-active: #1d293c;
  --enterprise-sidebar-text: #ffffff;
  --enterprise-sidebar-muted: #aab5c7;
  --enterprise-logo-bg: #ffffff;
  --good: #12805c;
  --warn: #b76b00;
  --bad: #b42318;
  --info: #2f5f9f;
  --shadow: 0 16px 38px rgba(25, 40, 70, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f6f8fb 0%, #e9eef6 100%);
}
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(25, 40, 70, 0.16);
  padding: 28px;
}
.login-company,
.selection-company {
  display: grid;
  justify-items: start;
  gap: 8px;
}
.login-company img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}
.login-company strong,
.selection-company strong {
  color: var(--ink);
  font-size: 15px;
}
.login-card h1 {
  font-size: 30px;
  margin-bottom: 0;
}
.login-subtitle,
.login-message {
  color: var(--muted);
  margin: 0;
}
.local-demo-badge {
  justify-self: start;
  margin: -2px 0 0;
  padding: 5px 9px;
  border: 1px solid #d8eadf;
  border-radius: 999px;
  background: #f1fbf5;
  color: #227047;
  font-size: 12px;
  font-weight: 800;
}
.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}
.dev-test-button {
  background: #fff8ec;
  color: #8a5a05;
  border-color: #efd29c;
}
.dev-test-button:hover {
  background: #ffefcf;
}
.link-button {
  min-height: auto;
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 4px;
}
body.auth-locked .project-selection,
body.auth-locked .sidebar,
body.auth-locked .shell {
  display: none;
}
body.authenticated .login-screen {
  display: none;
}

.project-selection {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #f5f7fb;
  display: grid;
  place-items: center;
  padding: 28px;
}
.project-selection.hidden { display: none; }
.project-selection__panel {
  width: min(860px, 100%);
}
.selection-company {
  margin-bottom: 14px;
}
.selection-company img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}
.project-selection__panel h1 {
  font-size: 34px;
  margin-bottom: 8px;
}
.selection-subtitle {
  color: var(--muted);
  margin-bottom: 22px;
}
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.project-card {
  background: var(--card-background, #fff);
  border: 1px solid var(--line);
  border-top: 5px solid var(--card-accent, var(--accent));
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.project-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 18px;
}
.project-card button { width: 100%; }
.project-card .primary {
  background: var(--card-primary, var(--primary));
  border-color: var(--card-primary, var(--primary));
}
.project-card .primary:hover {
  background: color-mix(in srgb, var(--card-primary, var(--primary)) 82%, #000000);
}
.project-card.has-logo {
  display: grid;
  gap: 14px;
}
.project-logo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--card-logo-bg, #fff);
  border: 1px solid color-mix(in srgb, var(--card-primary, var(--primary)) 22%, #ffffff);
  border-radius: 8px;
  padding: 12px;
}
.project-switcher {
  display: grid;
  gap: 8px;
}
.project-switcher label {
  color: var(--enterprise-sidebar-muted);
  font-size: 11px;
  font-weight: 900;
}
.project-switcher select {
  width: 100%;
  background: #fff;
}
.project-switcher .ghost {
  background: var(--enterprise-sidebar-active);
  border-color: color-mix(in srgb, var(--enterprise-sidebar-active) 76%, #ffffff);
  color: var(--enterprise-sidebar-text);
  text-align: center;
}
.form-context, .import-target {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--primary-dark);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}
body.selecting-project .sidebar,
body.selecting-project .shell {
  display: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: var(--enterprise-sidebar);
  color: var(--enterprise-sidebar-text);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.company-brand {
  display: grid;
  gap: 8px;
  color: var(--enterprise-sidebar-text);
}
.company-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #fff;
  padding: 5px;
}
.company-brand strong {
  font-size: 14px;
  line-height: 1.25;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--enterprise-sidebar);
  font-weight: 800;
  border-radius: 7px;
}
.brand-mark--logo {
  background: var(--enterprise-logo-bg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
}
.brand-mark--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.brand img {
  display: block;
}
.brand small { display: block; color: var(--enterprise-sidebar-muted); margin-top: 3px; }
nav { display: grid; gap: 6px; }
nav button {
  border: 0;
  color: color-mix(in srgb, var(--enterprise-sidebar-text) 78%, var(--enterprise-sidebar-muted));
  background: transparent;
  text-align: left;
  padding: 12px 13px;
  border-radius: 6px;
}
nav button.active, nav button:hover {
  background: var(--enterprise-sidebar-active);
  color: var(--enterprise-sidebar-text);
}

.shell { margin-left: 260px; min-height: 100vh; padding: 26px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; }
h2 { font-size: 18px; margin-bottom: 14px; }
.top-actions, .toolbar, .section-actions, .button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.user-menu strong,
.user-menu small {
  display: block;
  line-height: 1.2;
}
.user-menu strong {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.user-menu small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.user-menu button {
  min-height: 30px;
  padding: 5px 8px;
}
.section-actions { justify-content: space-between; margin-bottom: 14px; }
.back-dashboard {
  min-height: auto;
  padding: 0 0 8px;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  min-height: 40px;
}
textarea { min-height: 88px; resize: vertical; }
#globalSearch { width: min(360px, 42vw); }
button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 13px;
  font-weight: 700;
}
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-dark); }
.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.danger { background: #fff0ef; color: var(--bad); border-color: #f2b8b5; }
.danger:hover { background: #ffe1df; }
.split-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.action-spacer { flex: 1; }

.view { display: none; }
.view.active { display: block; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi, .panel, .client-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.kpi { padding: 14px; min-height: 96px; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 700; }
.kpi strong { display: block; margin-top: 8px; font-size: 22px; }
.kpi small { display: block; margin-top: 6px; color: var(--muted); }
.kpi:first-child {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
}
.kpi:first-child span, .kpi:first-child small { color: #c8d6df; }
.restricted-kpi {
  background: #101827;
  color: #fff;
  border-color: #101827;
}
.restricted-kpi .lock-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
}
.restricted-kpi span,
.restricted-kpi small {
  color: #cbd5e1;
}
.restricted-kpi strong {
  color: #fff;
  font-size: 19px;
}
.forecast-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.forecast-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.forecast-head h2 {
  font-size: 22px;
  margin-bottom: 0;
  text-transform: uppercase;
}
.monthly-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-behavior: smooth;
}
.month-card {
  flex: 0 0 176px;
  text-align: left;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 116px;
  box-shadow: 0 8px 24px rgba(25, 40, 70, 0.05);
}
.month-card span {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}
.month-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 21px;
  color: var(--ink);
}
.month-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}
.month-card.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--enterprise-soft) 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px var(--accent), 0 14px 26px rgba(198, 146, 46, 0.15);
}
.dashboard-details {
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.dashboard-details .table-wrap {
  max-height: 340px;
}
.details-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.details-head h3 { margin: 0; font-size: 18px; }
.details-head strong { font-size: 24px; color: var(--primary-dark); }
.compact-table table { min-width: 860px; }
.compact-table th, .compact-table td { padding: 8px 10px; }
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.table-actions button {
  min-height: 32px;
  padding: 5px 8px;
}
.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.insight-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: 150px;
}
.insight-card h3 { margin-bottom: 8px; font-size: 18px; }
.insight-card p { color: var(--muted); margin-bottom: 10px; }
.insight-card > strong { display: block; font-size: 24px; margin-bottom: 8px; }
.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mini-metrics span {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.mini-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  margin-top: 5px;
}
.mini-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.mini-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.mini-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  display: block;
}
.mini-kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}
.mini-kpi.negative strong, .mini-kpi.warning strong { color: var(--bad); }
.mini-kpi.positive strong { color: var(--good); }
.mini-kpi.restricted-mini {
  background: #f8fafc;
  border-style: dashed;
}
.mini-kpi.restricted-mini strong,
.restricted-inline {
  color: var(--muted);
  font-size: 13px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
}
.dashboard-grid.secondary {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  align-items: stretch;
}
.panel { padding: 16px; margin-bottom: 14px; }
.summary-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
}
.summary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}
.summary-metrics span {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.summary-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.summary-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  margin-top: 7px;
}
.summary-metrics em {
  display: block;
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 800;
  margin-top: 3px;
}
.panel.wide { grid-column: span 1; }
.panel-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.toolbar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
th {
  color: var(--muted);
  background: #f9fbfe;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  user-select: none;
}
th.sortable { cursor: pointer; }
td.money, th.money { text-align: right; }
tbody tr:hover { background: #fbfcff; }
.clickable-row { cursor: pointer; }
.clickable-row.selected { background: #fff8e8; box-shadow: inset 4px 0 0 var(--accent); }
.inline-edit {
  width: 86px;
  padding: 7px 8px;
  min-height: 34px;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 5px;
  font-weight: 800;
  font-size: 12px;
}
.badge.ativo { color: var(--info); background: #eaf1ff; }
.badge.finalizado { color: var(--good); background: #e9f8f0; }
.badge.atrasado { color: var(--bad); background: #fff0ef; }
.badge.vence-em-breve { color: var(--warn); background: #fff7e6; }
.badge.dados-incompletos { color: #805100; background: #fff3cc; }
.badge.a-vencer { color: var(--info); background: #eaf1ff; }
.badge.paga { color: var(--good); background: #e9f8f0; }
.badge.paga-em-atraso { color: var(--warn); background: #fff7e6; }
.badge.parcial { color: var(--warn); background: #fff7e6; }
.badge.atrasada { color: var(--bad); background: #fff0ef; }
.badge.paga-a-maior { color: #6f4ab5; background: #f3ecff; }
.badge.importado { color: var(--primary-dark); background: #edf7f5; }
.badge.inativo,
.badge.desativado { color: var(--muted); background: #edf1f6; }
.badge.convite-enviado,
.badge.convite-pendente { color: var(--warn); background: #fff7e6; }
.muted { color: var(--muted); }
.alert {
  border: 1px solid #f1c27d;
  background: #fff8e8;
  color: #6b4300;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.hidden { display: none !important; }

body.scope-current-month #dashboard .forecast-hero:first-of-type,
body.scope-current-month #dashboard .insight-grid,
body.scope-current-month #dashboard .dashboard-grid.secondary {
  display: none;
}

body.scope-current-month #forecastRangeButtons,
body.scope-current-month #flowButtons {
  display: none;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.client-card { padding: 15px; }
.client-card strong { display: block; margin-bottom: 8px; }
.client-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.client-card dt { color: var(--muted); font-size: 12px; }
.client-card dd { margin: 0; font-weight: 800; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.segmented button {
  border: 0;
  border-radius: 0;
  background: #fff;
  border-right: 1px solid var(--line);
}
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--primary); color: #fff; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.calendar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.calendar-nav select {
  min-height: 38px;
}
.day {
  min-height: 118px;
  background: #fff;
  padding: 9px;
}
.day strong { display: block; color: var(--muted); margin-bottom: 7px; }
.event {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #edf7f5;
  color: var(--primary-dark);
  padding: 6px;
  min-height: auto;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
}
.event span {
  display: block;
  font-size: 10px;
  font-weight: 900;
}
.event small {
  display: block;
  margin-top: 3px;
  line-height: 1.25;
}
.event.expected { background: #edf7f5; color: var(--primary-dark); }
.event.received { background: #e9f8f0; color: var(--good); box-shadow: inset 3px 0 0 var(--good); }
.report {
  background: #eef2f6;
  border: 0;
  border-radius: 8px;
  padding: 24px;
  box-shadow: inset 0 0 0 1px #e1e7f0;
}
.report-builder {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.report-builder-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.report-builder fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px;
}
.report-builder legend {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 0 6px;
}
.report-builder label,
.check-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}
.check-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.check-grid label {
  grid-template-columns: auto 1fr;
  align-items: center;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
}
.report-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  border-top: 5px solid var(--primary);
  padding-top: 12px;
}
.report-document {
  width: min(100%, 980px);
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 22px 52px rgba(25, 40, 70, 0.14);
  padding: 28px;
}
.report-document.landscape {
  width: min(100%, 1180px);
}
.report-doc-header {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-top: 5px solid var(--accent);
  padding-top: 14px;
  margin-bottom: 24px;
}
.report-doc-header h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}
.report-doc-header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}
.report-doc-header small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.report-doc-logo {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.report-doc-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.report-doc-logo span {
  color: var(--primary);
  font-weight: 900;
  font-size: 20px;
}
.report-section {
  margin-bottom: 22px;
}
.report-section h3 {
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-size: 15px;
  text-transform: uppercase;
}
.report-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.report-card {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfe;
}
.report-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.report-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.report-card.warning strong,
.report-card.negative strong {
  color: var(--bad);
}
.report-table-wrap {
  box-shadow: none;
  max-width: 100%;
}
.report-table {
  min-width: 760px;
}
.report-document.landscape .report-table {
  min-width: 1080px;
}
.report-table th,
.report-table td {
  white-space: normal;
  line-height: 1.35;
  vertical-align: top;
}
.report-table th.center,
.report-table td.center {
  text-align: center;
}
.empty-report {
  color: var(--muted);
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfe;
}
.report-notes {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}
.report-notes li {
  margin-bottom: 6px;
}
.report-doc-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.logo-placeholder {
  min-width: 92px;
  height: 52px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}
.logo-placeholder img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

body[data-project="recanto-das-aguias"] .sidebar {
  background: var(--enterprise-sidebar);
  border-right: 3px solid #d5a21f;
}
body[data-project="recanto-das-aguias"] .project-switcher .ghost {
  background: #191919;
  border-color: #3a2a08;
}
body[data-project="recanto-das-aguias"] nav button.active {
  background: #d5a21f;
  color: #111;
}
body[data-project="recanto-das-aguias"] .kpi strong,
body[data-project="recanto-das-aguias"] .forecast-head h2,
body[data-project="recanto-das-aguias"] .report h2 {
  color: #111;
}
body[data-project="recanto-das-aguias"] .primary {
  background: #111;
  border-color: #111;
  color: #f8f4e8;
}
body[data-project="recanto-das-aguias"] .primary:hover {
  background: #2a2108;
  border-color: #d5a21f;
}
body[data-project="recanto-das-aguias"] .month-card.active,
body[data-project="recanto-das-aguias"] .clickable-row.selected {
  background: #fff8e5;
  box-shadow: inset 4px 0 0 #d5a21f;
}

body[data-project="buriti"] .sidebar {
  background: var(--enterprise-sidebar);
  border-right: 3px solid #f0b429;
}
body[data-project="buriti"] .project-switcher .ghost {
  background: var(--enterprise-sidebar-active);
  border-color: #176b2e;
}
body[data-project="buriti"] nav button.active,
body[data-project="buriti"] nav button:hover {
  background: var(--enterprise-sidebar-active);
  color: #fff;
}
body[data-project="buriti"] .brand-mark--logo {
  background: var(--enterprise-logo-bg);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
body[data-project="buriti"] .brand-mark--logo img {
  object-fit: contain;
}
body[data-project="buriti"] .primary {
  background: #0a5a20;
  border-color: #0a5a20;
}
body[data-project="buriti"] .primary:hover {
  background: #063e16;
}
body[data-project="buriti"] .kpi:first-child {
  background: #063e16;
  border-color: #063e16;
}
body[data-project="buriti"] .month-card.active,
body[data-project="buriti"] .clickable-row.selected {
  background: #eef8f0;
  box-shadow: inset 4px 0 0 #f0b429;
}
body[data-project="buriti"] th {
  background: #f4f6f5;
}
body[data-project="buriti"] tbody tr:hover {
  background: #f8fbf8;
}
.status-stack {
  display: grid;
  gap: 6px;
  align-items: start;
}
.status-stack small {
  color: var(--muted);
  white-space: normal;
  max-width: 260px;
}
.client-detail { grid-column: 1 / -1; }
.client-data {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.client-data span {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
}
.client-data strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}
.import-panel p, .settings p { color: var(--muted); }
.settings label, .modal-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--muted);
}
.modal-form label.hidden { display: none; }
.modal-form label.missing-input {
  color: #8a4d00;
}
.modal-form label.missing-input input,
.modal-form label.missing-input select {
  border-color: #d48b00;
  background: #fff8e8;
}
.adjustment-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.adjustment-summary {
  margin-top: 12px;
}
.adjustment-summary .compact-table {
  margin-top: 10px;
}
.settings { display: grid; gap: 13px; max-width: 760px; }
.settings-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.settings-section h3 {
  margin-bottom: 10px;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
.modal-panel {
  background: #fff;
  padding: 18px;
}
.modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.password-result {
  display: grid;
  gap: 14px;
  max-width: 520px;
}
.password-result label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}
.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}
.detail-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}
.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}
.detail-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.modal-form > h2, .modal-form > label:last-of-type, .modal-form > menu { grid-column: 1 / -1; }
.modal-form fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.modal-form fieldset,
.modal-form fieldset:last-of-type {
  grid-column: 1 / -1;
}
.modal-form fieldset.disabled-field {
  opacity: 0.62;
}
.modal-form fieldset.disabled-field input {
  pointer-events: none;
}
.modal-form legend {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 0 6px;
}
.modal-form fieldset:last-of-type label { grid-column: 1 / -1; }
menu { display: flex; justify-content: flex-end; gap: 10px; padding: 0; margin: 8px 0 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.row-actions button { min-height: 32px; padding: 6px 8px; }
input[readonly] {
  background: #f5f7fa;
  color: var(--ink);
}
.payment-details summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 900;
}
.payment-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
  min-width: 430px;
}
.payment-details div {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
}
.payment-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.payment-details dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 800;
}
.link {
  background: transparent;
  color: var(--primary-dark);
  border: 0;
  padding: 0;
  min-height: auto;
  font-weight: 800;
}

@media (max-width: 980px) {
  .sidebar { position: static; width: auto; }
  .shell { margin-left: 0; padding: 18px; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  #globalSearch { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid.secondary, .insight-grid { grid-template-columns: 1fr; }
  .mini-kpi-grid, .client-data { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forecast-head { flex-direction: column; }
  .calendar { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 620px) {
  .project-cards { grid-template-columns: 1fr; }
  nav, .kpi-grid { grid-template-columns: 1fr; }
  .mini-kpi-grid, .client-data { grid-template-columns: 1fr; }
  .month-card { flex-basis: 78vw; }
  .modal-form { grid-template-columns: 1fr; }
  .modal-form fieldset { grid-template-columns: 1fr; }
  .calendar { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .toolbar, .section-actions button, dialog { display: none !important; }
  .shell { margin: 0; padding: 0; }
  .view { display: none !important; }
  #relatorios { display: block !important; }
  .report { box-shadow: none; border: 0; }
}
