:root {
  --petrol-950: #082f2d;
  --petrol-900: #0d3b38;
  --petrol-800: #164a45;
  --petrol-700: #236159;
  --petrol-100: #dfece8;
  --ivory-50: #fbf8f0;
  --ivory-100: #f4efe3;
  --paper: #fffdf8;
  --ink: #19322f;
  --muted: #6b7772;
  --line: #dedfd7;
  --amber: #a96725;
  --amber-soft: #f5e9d6;
  --red: #a34538;
  --red-soft: #f4e2dc;
  --green: #28705c;
  --green-soft: #deeee6;
  --blue-strong: #1261d6;
  --green-strong: #0b7d25;
  --orange-strong: #b65f00;
  --red-strong: #c6281f;
  --teal-strong: #08747c;
  --purple-strong: #6f2a9b;
  --shadow: 0 12px 34px rgba(9, 47, 44, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; background: var(--ivory-50); }
body { margin: 0; min-width: 0; min-height: 100vh; overflow-x: hidden; color: var(--ink); background: var(--ivory-50); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(35,97,89,.28); outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 17px 20px; color: #f5f2e9; background: var(--petrol-950); border-right: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 28px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: #f1ddae; font-family: Georgia, serif; font-size: 21px; }
.brand strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; letter-spacing: .02em; }
.brand small, .nav-item small, .sidebar-foot small { display: block; color: rgba(245,242,233,.57); font-size: 11px; letter-spacing: .04em; }
.main-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 8px; font-size: 14px; text-decoration: none; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.10); box-shadow: inset 3px 0 #d8bd82; }
.nav-item.disabled { color: rgba(245,242,233,.43); cursor: default; }
.nav-item small { text-align: right; font-size: 9px; text-transform: uppercase; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.09); font-size: 12px; }
.sidebar-pilot { display: grid; gap: 7px; margin-bottom: 14px; padding: 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; color: rgba(245,242,233,.82); }
.sidebar-pilot > strong { color: #fff; font-size: 10px; letter-spacing: .03em; }
.sidebar-pilot > span { font-size: 9px; }
.sidebar-pilot b { margin-left: 4px; padding: 2px 5px; border-radius: 3px; color: #fff; background: var(--green-strong); font-size: 7px; }
.sidebar-pilot small { font-size: 8px; }
.sidebar-session { position: relative; display: grid; gap: 1px; min-width: 0; }
.sidebar-session-label { color: rgba(245,242,233,.50); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-session strong { overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.logout-action { justify-self: start; margin-top: 9px; padding: 4px 0; border: 0; border-bottom: 1px solid transparent; color: rgba(245,242,233,.78); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.logout-action:hover { color: #fff; border-bottom-color: rgba(216,189,130,.72); }

.workspace { min-width: 0; width: 100%; max-width: 1680px; margin: 0 auto; padding: 22px clamp(16px,2vw,30px) 44px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.eyebrow { margin: 0 0 7px; color: var(--petrol-700); font-size: 10px; line-height: 1.2; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow.light { color: #d8bd82; }
h1, h2, h3 { margin: 0; color: var(--petrol-950); font-weight: 700; }
h1 { font-size: clamp(27px,2.4vw,38px); font-weight: 850; line-height: 1.08; letter-spacing: -.025em; }
h2 { font-size: 23px; line-height: 1.15; }
h3 { font-size: 18px; }
.subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.as-of, .result-count { color: var(--muted); font-size: 11px; }

.glance-actions { align-items: flex-end; }
.header-filter { display: grid; gap: 3px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.header-filter select, .header-filter input { min-width: 145px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--paper); font-size: 11px; font-weight: 650; }

.kpi-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; }
.kpi { display: flex; min-width: 0; min-height: 128px; flex-direction: column; padding: 15px 15px 14px; overflow: hidden; border: 0; border-radius: 9px; color: #fff; background: var(--petrol-800); box-shadow: 0 8px 20px rgba(9,47,44,.10); }
.kpi-value { display: block; margin-top: 17px; overflow: hidden; color: #fff; font-size: clamp(18px,1.65vw,27px); font-weight: 850; line-height: 1; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.kpi-label { display: block; color: #fff; font-size: 10px; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.kpi-note { display: block; margin-top: auto; color: rgba(255,255,255,.88); font-size: 9px; font-weight: 700; }
.kpi.total { background: var(--blue-strong); }
.kpi.paid { background: var(--green-strong); }
.kpi.pending { background: var(--orange-strong); }
.kpi.overdue { background: var(--red-strong); }
.kpi.fixed { background: var(--teal-strong); }
.kpi.variable { background: var(--purple-strong); }

.forecast-section { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 5px 18px rgba(9,47,44,.035); }
.forecast-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 11px 14px 9px; border-bottom: 1px solid var(--line); }
.forecast-heading .eyebrow { margin-bottom: 3px; }
.forecast-heading h2 { font-size: 17px; }
.forecast-heading > span { color: var(--muted); font-size: 10px; }
.time-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.time-card { display: grid; min-width: 0; min-height: 86px; padding: 13px 17px; border-left: 1px solid var(--line); background: #fffdf8; }
.time-card:first-child { border-left: 0; }
.time-card span { font-size: 10px; font-weight: 850; text-transform: uppercase; }
.time-card strong { margin-top: 4px; font-size: clamp(19px,2vw,27px); line-height: 1.05; }
.time-card small { margin-top: 5px; font-size: 9px; font-weight: 700; }
.time-card.today { color: #c9251c; background: #fff5f2; }
.time-card.week { color: #9b5d00; background: #fffaf0; }
.time-card.month { color: #145bc0; background: #f4f8ff; }

.main-section { margin-top: 14px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 9px; }
.filter-toolbar { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,.42fr); align-items: start; gap: 10px; }
.quick-filters { display: flex; gap: 5px; margin-bottom: 8px; overflow-x: auto; padding: 1px 1px 3px; scrollbar-width: thin; }
.quick-filter { flex: 0 0 auto; min-height: 34px; padding: 6px 11px; border: 1px solid transparent; border-radius: 6px; color: #fff; background: var(--petrol-800); cursor: pointer; font-size: 9px; font-weight: 850; }
.quick-filter:hover { filter: brightness(.92); }
.quick-filter.active { box-shadow: 0 0 0 3px rgba(8,47,45,.18); }
.quick-filter.filter-FIXO { background: var(--teal-strong); }
.quick-filter.filter-VARIAVEL { background: var(--purple-strong); }
.quick-filter.filter-COM_DOCUMENTO { background: var(--blue-strong); }
.quick-filter.filter-SEM_DOCUMENTO { background: #68737c; }
.quick-filter.filter-PAGO { background: var(--green-strong); }
.quick-filter.filter-PENDENTE { background: var(--orange-strong); }
.quick-filter.filter-PARCIAL { background: #d99700; }
.quick-filter.filter-VENCIDO { background: var(--red-strong); }
.filters { display: grid; align-items: center; gap: 9px; margin-bottom: 12px; }
.filters-primary { grid-template-columns: 1fr; }
.filters-advanced { grid-template-columns: repeat(5,minmax(150px,1fr)); margin: 10px 0 0; }
.filter-details { margin-bottom: 12px; }
.filter-details summary { width: fit-content; padding: 4px 0; color: var(--petrol-700); cursor: pointer; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.search-box { position: relative; display: block; min-width: 0; }
.search-box input, .filter-select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); }
.search-box input { padding-left: 38px; }
.search-box::before { position: absolute; top: 10px; left: 13px; content: "⌕"; color: var(--muted); font-size: 17px; }
.filter-check { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--paper); font-size: 11px; font-weight: 700; white-space: nowrap; }
.filter-check input { accent-color: var(--petrol-800); }

.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: var(--shadow); }
.payable-head, .payable-row { display: grid; grid-template-columns: minmax(140px,1.15fr) 92px minmax(150px,1.15fr) 95px 95px 95px 92px 82px 50px; gap: 8px; align-items: center; }
.payable-head { min-height: 35px; padding: 0 10px; color: #44534f; background: #f0f1ef; font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.payable-row { width: 100%; min-height: 48px; padding: 7px 10px; border: 0; border-top: 1px solid #e4e7e4; color: var(--muted); background: transparent; cursor: pointer; text-align: left; text-decoration: none; font-size: 9px; }
.payable-row:nth-child(even) { background: #fafbf9; }
.payable-row:hover { background: #edf5f2; }
.payable-row strong { color: var(--ink); font-size: 11px; }
.payable-identity strong, .payable-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payable-identity strong { color: #12334c; font-size: 11px; }
.payable-identity small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.nature-cell { display: flex; flex-wrap: wrap; gap: 3px; }
.expense-cell > strong { display: block; }
.expense-cell > small { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-action { color: var(--petrol-700); font-size: 9px; font-weight: 850; text-decoration: underline; text-underline-offset: 2px; }

.status-pill, .due-pill { display: inline-flex; width: fit-content; max-width: 100%; min-height: 21px; align-items: center; padding: 3px 7px; overflow: hidden; border-radius: 4px; color: #fff; background: #2674be; font-size: 8px; font-weight: 850; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.status-pill.PARCIAL, .due-pill.today { color: #fff; background: #d98900; }
.status-pill.PAGO { color: #fff; background: var(--green-strong); }
.status-pill.VENCIDO { color: #fff; background: var(--red-strong); }
.status-pill.CANCELADO { color: var(--muted); background: #ecece7; }
.due-pill { color: var(--ink); background: transparent; }
.due-pill.overdue { color: var(--red-strong); background: #fff0ed; }
.nature-badge, .category-badge, .document-badge { display: inline-flex; align-items: center; width: fit-content; min-height: 18px; padding: 2px 6px; border-radius: 4px; font-size: 7px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.nature-badge.FIXO { color: #fff; background: var(--teal-strong); }
.nature-badge.VARIAVEL { color: #fff; background: var(--purple-strong); }
.nature-badge.NAO_CLASSIFICADO { color: var(--muted); background: #ecece7; }
.category-badge { color: #72551f; background: #f3ead1; }
.document-badge { color: #4f5d6b; background: #e9edf0; }
.document-badge.present { color: #315f5c; background: #deeceb; }
.review-badge { display: inline-flex; margin-top: 4px; padding: 2px 6px; border-radius: 4px; color: var(--amber); background: var(--amber-soft); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.origin-badge { display: inline-flex; margin-left: 6px; padding: 2px 6px; border-radius: 4px; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.origin-badge.IMPORTADO { color: var(--petrol-800); background: var(--petrol-100); }
.origin-badge.PILOTO { color: #6c4a22; background: var(--amber-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: none; }
.btn:disabled { cursor: not-allowed; opacity: .62; }
.btn-primary { border-color: var(--petrol-800); color: #fff; background: var(--petrol-800); }
.btn-primary:hover:not(:disabled) { background: var(--petrol-950); }
.btn-secondary { border-color: var(--line); color: var(--petrol-800); background: var(--paper); }
.btn-secondary:hover:not(:disabled) { border-color: #aebdb7; background: #faf8f1; }
.btn-danger { border-color: var(--red); color: #fff; background: var(--red); }
.btn-full { width: 100%; margin-top: 8px; }
.back-link { display: inline-flex; margin-bottom: 20px; color: var(--petrol-700); font-size: 12px; font-weight: 800; text-decoration: none; }

.workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.workspace-header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.workspace-actions { align-items: flex-start; flex: 0 0 auto; }
.btn-edit { min-width: 112px; box-shadow: 0 7px 18px rgba(8,47,45,.12); }
.version-card { flex: 0 0 190px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,253,248,.78); }
.version-card span, .version-card small { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.version-card strong { display: block; margin: 3px 0; color: var(--petrol-950); font-size: 22px; }
.money-trio { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 20px; }
.money-trio > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.money-trio span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.money-trio strong { display: block; margin-top: 5px; color: var(--petrol-950); font-size: 18px; }
.tabs { position: sticky; top: 0; z-index: 10; display: flex; gap: 2px; margin: 0; padding: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px 10px 0 0; background: rgba(251,248,240,.96); backdrop-filter: blur(12px); }
.tab { flex: 0 0 auto; padding: 8px 13px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; }
.tab:hover { color: var(--petrol-800); background: var(--petrol-100); }
.tab[aria-selected="true"] { color: #fff; background: var(--petrol-800); }
.tab-panel { min-height: 340px; padding: 24px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 11px 11px; background: rgba(255,253,248,.54); }
.card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); box-shadow: 0 8px 28px rgba(9,47,44,.04); }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; margin: 0; }
.detail-row { min-width: 0; padding: 11px 0; border-bottom: 1px solid #ece9df; }
.detail-row dt { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.detail-row dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; white-space: pre-wrap; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }

table.dense { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); font-size: 12px; }
table.dense thead th { padding: 9px 12px; color: var(--muted); background: #f7f4eb; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
table.dense tbody td { padding: 10px 12px; border-top: 1px solid #e9e7df; color: var(--ink); }
table.dense tbody tr:nth-child(even) { background: #faf8f1; }
table.dense td.money, table.dense th.money { text-align: right; }
.timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline::before { position: absolute; top: 8px; bottom: 12px; left: 5px; width: 1px; content: ""; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 12px minmax(0,1fr); gap: 12px; padding-bottom: 18px; }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 3px solid var(--paper); border-radius: 50%; background: var(--petrol-700); box-shadow: 0 0 0 1px var(--petrol-700); }
.timeline-date { display: block; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.timeline-item strong { display: block; margin-top: 2px; color: var(--ink); font-size: 12px; }
.timeline-item p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(5,28,27,.34); backdrop-filter: blur(1px); }
.drawer { position: fixed; z-index: 21; top: 0; right: 0; width: min(570px,96vw); height: 100vh; overflow-y: auto; padding: 34px 31px 50px; border-left: 1px solid rgba(255,255,255,.4); background: var(--paper); box-shadow: -24px 0 70px rgba(4,35,33,.17); }
.drawer-close { position: absolute; top: 20px; right: 20px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; font-size: 22px; }
.drawer-header { padding-right: 38px; }
.drawer-header h2 { margin: 6px 0 8px; font-size: 28px; }
.drawer-form { display: grid; gap: 14px; margin-top: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px; }
.span-2 { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 13px; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input.invalid { border-color: var(--red); background: #fff8f6; }
.field-error, .form-error { color: var(--red); font-size: 10px; font-weight: 700; }
.drawer-form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.confirm-box { display: grid; gap: 10px; padding: 13px 14px; border: 1px solid #dfc992; border-left: 3px solid var(--amber); border-radius: 4px 8px 8px 4px; color: #705716; background: #fbf4df; font-size: 12px; }

.empty-state, .error-state { display: grid; place-items: center; min-height: 260px; padding: 35px; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 13px; border-radius: 50%; color: var(--petrol-700); background: var(--petrol-100); font-family: Georgia, serif; font-size: 21px; }
.empty-state p, .error-state p { max-width: 460px; margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.loading-lines { display: grid; gap: 1px; }
.loading-lines span { display: block; height: 58px; background: linear-gradient(90deg,#eeeae0 25%,#f7f4ec 44%,#eeeae0 65%); background-size: 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.toast-container { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; max-width: min(380px,90vw); }
.toast { padding: 12px 15px; border-radius: 9px; font-size: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(9,47,44,.16); }
.toast.success { border: 1px solid #bed8cc; color: var(--green); background: var(--green-soft); }
.toast.error { border: 1px solid #e6c9c4; color: var(--red); background: var(--red-soft); }
.notice { margin-bottom: 18px; padding: 13px 16px; border: 1px solid #ddc8a4; border-radius: 9px; color: #6c4a22; background: var(--amber-soft); font-size: 13px; }
.pilot-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 7px 11px; border: 1px solid #ddc8a4; border-radius: 7px; color: #6c4a22; background: #fff4d8; font-size: 9px; }
.pilot-banner strong { flex: 0 0 auto; font-size: 10px; letter-spacing: .08em; }
.pilot-banner span { line-height: 1.45; }
.scope-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; padding: 8px 12px; border: 1px solid #b8d0ca; border-radius: 7px; color: var(--petrol-800); background: #f1f8f6; font-size: 10px; }
.scope-notice span { color: var(--muted); text-align: right; }
.scope-coverage { display: flex; align-items: stretch; gap: 7px; margin: 10px 0; }
.scope-coverage > div { display: grid; gap: 2px; min-width: 155px; padding: 9px 12px; border: 1px solid #b8d0ca; border-radius: 8px; color: var(--petrol-800); background: #f1f8f6; }
.scope-coverage > div:first-child { flex: 1; }
.scope-coverage > div.excluded { border-color: #ead5ad; color: #735416; background: #fff8e5; }
.scope-coverage span, .scope-coverage small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.scope-coverage strong { font-size: 11px; }
.coverage-state { align-items: flex-start; }
.coverage-state > span:last-child { margin-top: 8px; color: var(--muted); font-size: 10px; font-weight: 750; }

.company-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin: 10px 0; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,253,248,.78); }
.company-tab { display: grid; place-items: center; min-height: 46px; padding: 7px 10px; border: 1px solid transparent; border-radius: 7px; color: var(--petrol-800); background: transparent; cursor: pointer; }
.company-tab strong { font-size: 11px; letter-spacing: .04em; }
.company-tab small { margin-top: 2px; color: var(--muted); font-size: 7px; font-weight: 850; letter-spacing: .08em; }
.company-tab:hover { background: var(--petrol-100); }
.company-tab.active { border-color: var(--petrol-800); color: #fff; background: var(--petrol-800); box-shadow: 0 5px 14px rgba(8,47,45,.14); }
.company-tab.active small { color: rgba(255,255,255,.8); }
.company-tab.construction:not(.active) { color: #735416; background: #fff8e5; }

.financial-layer-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 10px 0; }
.financial-layer { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--petrol-800); background: var(--paper); cursor: pointer; text-align: left; }
.financial-layer strong, .financial-layer small { display: block; }
.financial-layer strong { font-size: 12px; }
.financial-layer small { color: var(--muted); font-size: 9px; }
.financial-layer.active { border-color: var(--petrol-800); color: #fff; background: var(--petrol-800); }
.financial-layer.active small { color: rgba(255,255,255,.8); }
.financial-layer.informational.active { border-color: #7d4aa5; background: #6f2a9b; }

.open-equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1.1fr; align-items: stretch; gap: 6px; margin-top: 9px; }
.open-equation > div { display: grid; min-width: 0; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.open-equation > b { align-self: center; color: var(--muted); font-size: 17px; }
.open-equation span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.open-equation strong { overflow: hidden; color: var(--petrol-950); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.open-equation small { color: var(--muted); font-size: 8px; }
.open-equation .open-result { border-color: #d98b24; color: #fff; background: var(--orange-strong); }
.open-equation .open-result span, .open-equation .open-result strong, .open-equation .open-result small { color: #fff; }

.informational-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 9px; padding: 11px 14px; border: 1px solid #d8c2e5; border-radius: 9px; background: #faf4ff; }
.informational-summary > div { display: flex; align-items: center; gap: 10px; }
.informational-summary h2 { color: #5f247f; font-size: 19px; }
.informational-summary .eyebrow { margin-bottom: 2px; color: #6f2a9b; }
.informational-summary > p { max-width: 650px; margin: 0; color: #674b72; font-size: 10px; text-align: right; }
.info-symbol { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: #6f2a9b; font-family: Georgia,serif; font-size: 17px; font-weight: 800; }
.info-boundary { display: flex; gap: 10px; margin-bottom: 9px; padding: 9px 11px; border-left: 4px solid #6f2a9b; color: #674b72; background: #faf4ff; font-size: 10px; }
.info-row-badge { display: inline-flex; margin-left: 5px; padding: 2px 5px; border-radius: 3px; color: #5f247f; background: #efe0f6; font-size: 7px; }
.nature-badge.INFO, .status-pill.INFORMATIVO { color: #fff; background: #6f2a9b; }
.quick-filter.filter-info, .quick-filter.filter-EM_ABERTO, .quick-filter.filter-A_VENCER, .quick-filter.filter-SEM_DATA { background: #6f2a9b; }
.quick-filter.filter-VENCIDO { background: var(--red-strong); }

.construction-panel { display: grid; min-height: 260px; place-items: center; align-content: center; margin-top: 10px; padding: 36px; border: 1px dashed #c8b06f; border-radius: 12px; color: #6c5827; background: #fff9e9; text-align: center; }
.construction-panel h2 { margin-top: 12px; font-size: 24px; }
.construction-panel p { max-width: 650px; margin: 9px 0 0; color: #756746; font-size: 12px; }
.construction-panel.source-ready { border-color: #8eb4aa; color: var(--petrol-800); background: #f0f8f5; }
.construction-tag { padding: 5px 9px; border-radius: 4px; color: #fff; background: #8a6820; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.source-ready .construction-tag { background: var(--petrol-700); }

.information-boundary-detail { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 20px; }
.information-boundary-detail > div { padding: 14px 16px; border: 1px solid #d8c2e5; border-radius: 9px; background: #faf4ff; }
.information-boundary-detail span { display: block; color: #765184; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.information-boundary-detail strong { display: block; margin-top: 5px; color: #5f247f; font-size: 17px; }
.field input[readonly] { color: var(--muted); background: #f0f0eb; cursor: not-allowed; }

.login-screen { display: grid; grid-template-columns: minmax(320px,.85fr) minmax(480px,1.15fr); min-height: 100vh; }
.login-editorial { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(34px,6vw,90px); color: #f5f2e9; background: var(--petrol-950); }
.login-editorial h1 { color: #fff; font-size: clamp(46px,6vw,78px); }
.login-editorial > p:not(.eyebrow) { max-width: 420px; margin: 18px 0 0; color: rgba(245,242,233,.7); font-size: 16px; }
.login-editorial footer { position: absolute; right: clamp(34px,6vw,90px); bottom: 36px; left: clamp(34px,6vw,90px); display: flex; justify-content: space-between; color: rgba(245,242,233,.5); font-size: 10px; letter-spacing: .12em; }
.login-brand { position: absolute; top: 34px; left: clamp(34px,6vw,90px); display: flex; align-items: center; gap: 12px; font-family: Georgia,serif; }
.login-side { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(28px,5vw,72px); background: var(--ivory-50); }
.login-wrap { width: 100%; max-width: 440px; margin: auto; }
.login-kicker { margin: 0 0 10px; color: #708179; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.login-card { padding: clamp(29px,4vw,44px); border: 1px solid rgba(92,106,97,.18); border-radius: 26px; background: var(--paper); box-shadow: 0 30px 82px rgba(25,47,43,.1); }
.login-card h2 { font-family: Georgia,"Times New Roman",serif; font-size: 32px; font-weight: 400; }
.login-sub { margin: 9px 0 28px; color: var(--muted); font-size: 13px; }
.login-card .field { margin-top: 15px; }
.login-footer { display: flex; justify-content: space-between; gap: 18px; width: 100%; max-width: 440px; margin: 24px auto 0; color: var(--muted); font-size: 10px; letter-spacing: .08em; }

@media (max-width: 1450px) {
  .kpi { padding-inline: 10px; }
  .kpi-value { font-size: clamp(16px,1.45vw,21px); }
}
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 210px minmax(0,1fr); }
  .sidebar { padding-inline: 14px; }
  .workspace { padding-inline: 18px; }
  .kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .filters-advanced { grid-template-columns: repeat(3,minmax(150px,1fr)); }
  .payable-head, .payable-row { grid-template-columns: minmax(135px,1.1fr) 85px minmax(145px,1.1fr) 90px 90px 90px 80px 46px; }
  .payable-head > :nth-child(5), .payable-row > :nth-child(5) { display: none; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 13px 18px; flex-direction: row; align-items: center; gap: 18px; }
  .brand { padding: 0; }
  .brand small { display: none; }
  .main-nav { display: flex; min-width: 0; margin-left: auto; overflow-x: auto; }
  .nav-item { flex: 0 0 auto; padding: 8px 10px; }
  .nav-item.disabled { display: none; }
  .nav-item small { display: none; }
  .sidebar-foot { margin: 0; padding: 0 0 0 10px; border: 0; border-left: 1px solid rgba(255,255,255,.12); }
  .sidebar-pilot { display: none; }
  .sidebar-session-label, .sidebar-session > strong, .sidebar-session > small { display: none; }
  .logout-action { margin: 0; padding: 8px 4px; }
  .workspace { padding: 28px 22px 48px; }
  .glance-header { display: block; }
  .glance-actions { justify-content: flex-start; margin-top: 14px; }
  .filter-toolbar { grid-template-columns: 1fr; }
  .open-equation { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .open-equation > b { display: none; }
  .open-equation .open-result { grid-column: 1 / -1; }
  .login-screen { grid-template-columns: 1fr; }
  .login-editorial { min-height: 280px; }
  .login-editorial footer { display: none; }
}
@media (max-width: 780px) {
  .page-header, .workspace-header { display: block; }
  .page-actions, .version-card { margin-top: 17px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .time-grid { grid-template-columns: 1fr; }
  .time-card { border-top: 1px solid var(--line); border-left: 0; }
  .time-card:first-child { border-top: 0; }
  .forecast-heading { align-items: flex-start; flex-direction: column; }
  .filters-primary, .filters-advanced { grid-template-columns: 1fr; }
  .payable-head { display: none; }
  .panel { border: 0; background: transparent; box-shadow: none; }
  .payable-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .payable-row { display: grid; grid-template-columns: 1fr; gap: 8px; min-height: 0; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
  .payable-row > span:not(.payable-identity):not(.status-pill):not(.row-action) { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 8px; text-align: left; }
  .payable-row > span:not(.payable-identity):not(.status-pill):not(.row-action)::before { content: attr(data-label); color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: 1; }
  .money-trio { grid-template-columns: 1fr; }
  .information-boundary-detail { grid-template-columns: 1fr; }
  .informational-summary { align-items: flex-start; flex-direction: column; }
  .informational-summary > p { text-align: left; }
  table.dense thead { display: none; }
  table.dense, table.dense tbody, table.dense tr, table.dense td { display: block; width: 100%; }
  table.dense tbody td { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 8px; border-top: 0; }
  table.dense tbody td::before { content: attr(data-label); color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
  table.dense tbody tr { border-top: 1px solid #e9e7df; }
}
@media (max-width: 600px) {
  .sidebar { gap: 9px; padding-inline: 12px; }
  .brand > span:last-child { display: none; }
  .brand-mark { width: 35px; height: 35px; }
  .main-nav { gap: 2px; }
  .nav-item { padding: 7px 8px; font-size: 12px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .payable-list { grid-template-columns: 1fr; }
  .glance-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .company-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scope-coverage { display: grid; }
  .financial-layer-tabs { grid-template-columns: 1fr; }
  .open-equation { grid-template-columns: 1fr; }
  .open-equation .open-result { grid-column: auto; }
  .header-filter select, .header-filter input { width: 100%; min-width: 0; }
  .drawer { width: 100vw; max-width: 100%; padding-inline: 22px; }
  .login-editorial { display: none; }
  .login-side { min-height: 100vh; padding: 22px 16px; }
  .login-card { padding: 30px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
