/* Faturamento POC */

.poc-page {
  --ink: #1a2136;
  --muted: #6b7589;
  --line: #e4e8f0;
  --canvas: #eef1f7;
  --surface: #fff;
  --brand: #334785;
  --neg: #8f2438;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --num: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
}

.poc-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px 24px;
  max-width: 1680px;
  margin: 0 auto;
  box-sizing: border-box;
}

.poc-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.poc-toolbar h2 {
  margin: 0;
  font-size: 16px;
}

.poc-meta,
.poc-status {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.poc-status.err { color: var(--neg); }
.poc-status.ok { color: #0b6b52; }

.poc-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.poc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.poc-field input {
  width: 88px;
  padding: 6px 8px;
  border: 1px solid var(--line);
}

.poc-btn {
  padding: 7px 12px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.poc-btn-ghost {
  background: #fff;
  color: var(--brand);
}

.poc-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.poc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #e8edf8;
  border: 1px solid #c5d0ea;
}

.poc-panel {
  background: var(--surface);
  border: 1px solid var(--line);
}

.poc-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.poc-panel-head h3 {
  margin: 0;
  font-size: 14px;
}

.poc-panel-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.poc-badge {
  font-size: 12px;
  color: var(--muted);
}

.poc-scroll {
  overflow: auto;
  max-height: 42vh;
}

.poc-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 12px;
}

.poc-table th,
.poc-table td {
  border: 1px solid var(--line);
  padding: 5px 8px;
  white-space: nowrap;
}

.poc-table th {
  background: #f4f6fb;
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 600;
}

.poc-table .sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  min-width: 220px;
  text-align: left;
}

.poc-table thead .sticky {
  z-index: 4;
  background: #f4f6fb;
}

.poc-table .num {
  text-align: right;
  font-family: var(--num);
}

.poc-table .neg { color: var(--neg); }
.poc-muted { color: var(--muted); }

.poc-table tbody tr {
  cursor: pointer;
}

.poc-table tbody tr:hover td {
  background: #f7f9fc;
}

.poc-table tbody tr.sel td {
  background: #e8edf8;
}

.poc-year-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--brand);
}

.poc-table tfoot td {
  font-weight: 700;
  background: #f4f6fb;
}

.poc-cell-det {
  cursor: zoom-in;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.poc-cell-det:hover {
  background: #e8edf8 !important;
}

.poc-modal[hidden] { display: none !important; }

.poc-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.poc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 48, 0.45);
}

.poc-modal-box {
  position: relative;
  width: min(640px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.poc-modal-box.poc-modal-wide {
  width: min(1080px, 98vw);
}

.poc-det-block {
  margin-top: 14px;
}

.poc-det-block h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.poc-det-hint {
  margin: 8px 0 0;
  font-size: 11px;
}

.poc-det-scroll {
  overflow: auto;
  max-height: 42vh;
  border: 1px solid var(--line);
}

.poc-det-parcelas {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.poc-det-parcelas th,
.poc-det-parcelas td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.poc-det-parcelas th {
  position: sticky;
  top: 0;
  background: #f4f6fb;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
}

.poc-det-parcelas td.num,
.poc-det-parcelas th.num {
  text-align: right;
  font-family: var(--num);
}

.poc-det-parcelas tbody tr:hover td {
  background: #f7f9fc;
}

.poc-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.poc-modal-head h3 { margin: 0; font-size: 15px; }
.poc-modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

.poc-modal-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.poc-modal-body {
  padding: 12px 14px;
  overflow: auto;
  font-size: 13px;
}

.poc-modal-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.poc-det-formula {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f4f6fb;
  border-left: 3px solid var(--brand);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.poc-det-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.poc-det-table th,
.poc-det-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.poc-det-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  width: 52%;
}

.poc-det-table td.num {
  text-align: right;
  font-family: var(--num);
}

.poc-det-table tr.poc-det-result td {
  font-weight: 700;
  border-top: 2px solid var(--line);
}

.poc-det-avisos {
  margin-top: 12px;
  padding: 0;
  list-style: none;
  font-size: 11px;
  color: #9a3412;
}

.poc-det-avisos li + li { margin-top: 4px; }

.poc-ano-filtro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.poc-ano-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.poc-ano-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.poc-ano-chip {
  padding: 3px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  cursor: pointer;
  color: var(--ink);
}

.poc-ano-chip:hover {
  border-color: var(--brand);
}

.poc-ano-chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.poc-table tr.poc-grupo-tipo td {
  background: #e8ecf5;
  font-weight: 600;
}

.poc-table tr.poc-grupo-tipo .sticky {
  background: #e8ecf5;
}

.poc-table tr.poc-grupo-obra td {
  background: #fff;
}

.poc-table tr.poc-grupo-obra .sticky {
  background: #fff;
  padding-left: 28px;
}

.poc-grupo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  vertical-align: middle;
}

.poc-grupo-btn:hover {
  border-color: var(--brand);
}
