.cp-module {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.cp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.cp-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cp-button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cp-button:hover {
  transform: translateY(-1px);
}

.cp-button--primary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.24), rgba(59, 130, 246, 0.2));
  border-color: rgba(56, 189, 248, 0.45);
  color: #dbeafe;
}

.cp-button--ghost {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.22);
  color: #cbd5f5;
}

.cp-button--danger {
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.cp-button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.cp-summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  min-width: 0;
}

.cp-quick-row {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 1.4fr) minmax(280px, 1fr);
  align-items: stretch;
}

.cp-guide-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 40%),
    rgba(15, 23, 42, 0.42);
}

.cp-guide-card span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #7dd3fc;
}

.cp-guide-card strong {
  font-size: 15px;
  line-height: 1.45;
}

.cp-guide-card small {
  color: var(--muted);
  font-size: 12px;
}

.cp-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.cp-shortcut {
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(15, 23, 42, 0.48);
  color: #dbeafe;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.cp-shortcut:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.36);
  background: rgba(15, 23, 42, 0.62);
}

.cp-shortcut.is-active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.24), rgba(59, 130, 246, 0.18));
  border-color: rgba(125, 211, 252, 0.44);
  color: #f8fafc;
}

.cp-shortcut--ghost {
  color: #cbd5f5;
  border-color: rgba(148, 163, 184, 0.2);
}

.cp-summary-card {
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
  min-height: 116px;
}

.cp-summary-card:not(.cp-summary-card--next) {
  grid-column: span 3;
}

.cp-summary-card--next {
  grid-column: 1 / -1;
  align-content: start;
}

.cp-summary-card strong {
  font-size: 26px;
  font-weight: 700;
}

.cp-summary-card span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.cp-summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.cp-summary-card--danger {
  border-color: rgba(248, 113, 113, 0.28);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.22), rgba(15, 23, 42, 0.52));
}

.cp-summary-card--warn {
  border-color: rgba(245, 158, 11, 0.26);
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.2), rgba(15, 23, 42, 0.52));
}

.cp-summary-card--success {
  border-color: rgba(34, 197, 94, 0.22);
  background: linear-gradient(180deg, rgba(20, 83, 45, 0.18), rgba(15, 23, 42, 0.52));
}

.cp-next-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cp-next-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.12);
  align-items: start;
}

.cp-next-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.22), rgba(30, 41, 59, 0.72));
  border: 1px solid rgba(96, 165, 250, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cp-next-icon svg {
  width: 18px;
  height: 18px;
}

.cp-next-icon--housing {
  color: #fbbf24;
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.28), rgba(30, 41, 59, 0.72));
  border-color: rgba(251, 191, 36, 0.28);
}

.cp-next-icon--energy,
.cp-next-icon--tax {
  color: #f59e0b;
}

.cp-next-icon--water,
.cp-next-icon--payroll {
  color: #38bdf8;
}

.cp-next-icon--connectivity,
.cp-next-icon--marketing {
  color: #60a5fa;
}

.cp-next-icon--logistics,
.cp-next-icon--stock {
  color: #34d399;
}

.cp-next-icon--service,
.cp-next-icon--office {
  color: #c4b5fd;
}

.cp-next-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cp-next-item strong {
  font-size: 13px;
}

.cp-next-item span {
  font-size: 12px;
  color: var(--muted);
}

.cp-next-context {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  color: #93c5fd;
}

.cp-next-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cp-mini-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.cp-mini-status--pendente {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.cp-mini-status--parcial {
  color: #fdba74;
  border-color: rgba(249, 115, 22, 0.36);
}

.cp-mini-status--pago {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

.cp-mini-status--vencido {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}

.cp-mini-status--cancelado {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

.cp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.cp-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cp-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.cp-legend-dot--warn {
  background: #f59e0b;
}

.cp-legend-dot--partial {
  background: #f97316;
}

.cp-legend-dot--danger {
  background: #ef4444;
}

.cp-legend-dot--success {
  background: #22c55e;
}

.cp-filters {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.36);
  min-width: 0;
}

.cp-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cp-field {
  display: grid;
  gap: 6px;
}

.cp-field--wide {
  grid-column: span 2;
}

.cp-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.cp-field input,
.cp-field select,
.cp-field textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.5);
  color: #e2e8f0;
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
}

.cp-field textarea {
  min-height: 100px;
  resize: vertical;
}

.cp-field input:focus,
.cp-field select:focus,
.cp-field textarea:focus {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.cp-filter-actions,
.cp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.cp-table {
  width: 100%;
  min-width: 1120px;
}

.cp-table th,
.cp-table td {
  padding: 16px 10px;
  vertical-align: top;
}

.cp-table th {
  vertical-align: bottom;
}

.cp-table .cp-col-conta {
  width: 18%;
}

.cp-table .cp-col-fornecedor {
  width: 12%;
}

.cp-table .cp-col-categoria {
  width: 10%;
}

.cp-table .cp-col-emissao {
  width: 10%;
}

.cp-table .cp-col-vencimento {
  width: 11%;
}

.cp-table .cp-col-valor {
  width: 8%;
}

.cp-table .cp-col-status {
  width: 10%;
}

.cp-table .cp-col-actions {
  width: 220px;
  min-width: 220px;
}

.cp-table td strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.cp-cell-main {
  display: inline-block;
  white-space: nowrap;
}

.cp-table td small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.cp-subline {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.35;
}

.cp-table td.cp-col-fornecedor,
.cp-table td.cp-col-categoria {
  line-height: 1.45;
  word-break: break-word;
}

.cp-table td.cp-col-emissao,
.cp-table td.cp-col-vencimento,
.cp-table td.cp-col-valor,
.cp-table td.cp-col-status {
  white-space: nowrap;
}

.cp-table td.cp-col-actions {
  white-space: normal;
  min-width: 220px;
}

.cp-due-note {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #cbd5e1;
}

.cp-due-note--danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
}

.cp-due-note--warn {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.cp-due-note--success {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.32);
}

.cp-row--danger {
  background: rgba(127, 29, 29, 0.08);
}

.cp-row--warn {
  background: rgba(120, 53, 15, 0.08);
}

.cp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.45);
}

.cp-status--pendente {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.cp-status--parcial {
  color: #fdba74;
  border-color: rgba(249, 115, 22, 0.36);
}

.cp-status--pago {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

.cp-status--vencido {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}

.cp-status--cancelado {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

.cp-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 204px;
  max-width: 220px;
  align-items: stretch;
}

.cp-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(15, 23, 42, 0.42);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.cp-actions .cp-link:first-child:last-child,
.cp-actions .cp-link--danger {
  grid-column: 1 / -1;
}

.cp-link:hover {
  color: #dbeafe;
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.32);
}

.cp-link--danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.22);
}

.cp-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.cp-modal-backdrop.is-open {
  display: flex;
}

.cp-modal {
  width: min(100%, 920px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 32px 80px rgba(2, 6, 23, 0.55);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.cp-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cp-modal-header h3 {
  margin: 0;
  font-size: 20px;
}

.cp-modal-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cp-modal-close {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.cp-detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cp-detail-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.cp-detail-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.cp-detail-card strong {
  display: block;
  font-size: 16px;
}

.cp-history {
  display: grid;
  gap: 10px;
}

.cp-history-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.35);
}

.cp-empty {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 960px) {
  .cp-quick-row {
    grid-template-columns: 1fr;
  }

  .cp-summary-card:not(.cp-summary-card--next) {
    grid-column: span 6;
  }

  .cp-filter-grid,
  .cp-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cp-toolbar,
  .cp-toolbar-actions,
  .cp-filter-actions,
  .cp-modal-actions,
  .cp-pagination,
  .cp-meta {
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
  }

  .cp-button,
  .cp-shortcut {
    min-height: 40px;
  }

  .cp-toolbar-actions .cp-button,
  .cp-filter-actions .cp-button,
  .cp-modal-actions .cp-button,
  .cp-pagination .cp-button {
    flex: 1 1 100%;
  }

  .cp-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cp-summary-grid {
    grid-template-columns: 1fr;
  }

  .cp-summary-card,
  .cp-summary-card--next {
    grid-column: auto;
  }

  .cp-next-list {
    grid-template-columns: 1fr;
  }

  .cp-filter-grid,
  .cp-detail-grid {
    grid-template-columns: 1fr;
  }

  .cp-field--wide {
    grid-column: auto;
  }

  .cp-modal {
    padding: 18px;
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100svh - 24px);
    border-radius: 18px;
  }

  .cp-modal-backdrop {
    padding: 12px;
  }

  .cp-modal-header {
    flex-direction: column;
  }

  .cp-modal-close {
    align-self: flex-end;
  }

  .cp-actions {
    grid-template-columns: 1fr;
    min-width: 160px;
  }

  .cp-table {
    min-width: 980px;
  }
}

@media (max-width: 420px) {
  .cp-shortcuts {
    grid-template-columns: 1fr;
  }

  .cp-summary-card strong {
    font-size: 22px;
    overflow-wrap: anywhere;
  }
}
