/* Gestão de Verbas Processuais — Acordo Fase de Conhecimento, Execução e Alvará */
#recebiveis-view {
  --recebiveis-purple: #7c3aed;
  --recebiveis-purple-dark: #6d28d9;
  --recebiveis-purple-soft: #f5f1ff;
  --recebiveis-border: #e7e4ee;
}

body.recebiveis-layout-active .main-content {
  padding: var(--content-pad-y);
}

body.recebiveis-layout-active .main-content > .container {
  max-width: none;
}

.recebiveis-shell {
  width: 100%;
  min-width: 0;
}

#recebiveis-view .recebiveis-page-card.card,
.recebiveis-page-card,
#recebiveis-view .recebiveis-content-card.card,
.recebiveis-content-card {
  width: 100%;
  overflow: visible;
  margin: 0;
  margin-inline: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#recebiveis-view .recebiveis-page-card.card:hover,
.recebiveis-page-card:hover,
#recebiveis-view .recebiveis-content-card.card:hover,
.recebiveis-content-card:hover {
  transform: none;
  box-shadow: none;
}

.recebiveis-content-card {
  overflow: visible;
  border: 1px solid var(--recebiveis-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 28px rgba(46, 16, 101, 0.05) !important;
  background: var(--surface) !important;
}

.recebiveis-content-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--recebiveis-border);
  background: #fcfbfe;
}

.recebiveis-content-card__heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.recebiveis-page-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--recebiveis-purple-soft);
  color: var(--recebiveis-purple);
  font-size: 20px;
}

.recebiveis-content-card__heading h1 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-page-title);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.recebiveis-page-header {
  padding: 0 0 14px;
  border: 0;
  background: transparent;
}

.recebiveis-page-header .card-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #1f2937;
}

.recebiveis-page-header .card-title i {
  color: var(--recebiveis-purple);
}

#recebiveis-view .recebiveis-tabs-container {
  margin: 0;
  width: 100%;
}

#recebiveis-view .recebiveis-tabs-header {
  min-height: 50px;
  gap: 8px;
  padding: 0 12px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--recebiveis-border);
  border-radius: 0;
  background: #fcfbfe;
}

#recebiveis-view .recebiveis-tabs-header .tab-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #626a79;
  font-size: 14px;
  font-weight: 700;
}

#recebiveis-view .recebiveis-tabs-header .tab-button:hover {
  color: var(--recebiveis-purple);
}

#recebiveis-view .recebiveis-tabs-header .tab-button.active {
  border-bottom-color: var(--recebiveis-purple);
  color: var(--recebiveis-purple);
}

#recebiveis-view .recebiveis-tabs-content {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.recebiveis-tab-panel {
  width: 100%;
}

.recebiveis-content-card .recebiveis-link-grid {
  margin: 0;
  padding: 16px 20px 0;
}

.recebiveis-content-card .recebiveis-form-hint {
  padding: 8px 20px 0;
}

.recebiveis-section,
#recebiveis-view .execucao-wrap {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#recebiveis-view .tab-pane,
#recebiveis-view .recebiveis-table-wrap,
#recebiveis-view .execucao-table-scroll {
  width: 100%;
}

.recebiveis-section + .recebiveis-section {
  margin-top: 16px;
}

.recebiveis-section-header {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.recebiveis-section-header .card-title {
  color: #1f2937;
  font-size: 18px;
  font-weight: 800;
}

.recebiveis-section-header .card-title i {
  margin-right: 6px;
  color: var(--recebiveis-purple);
}

.recebiveis-count {
  color: #737b8a;
  font-size: 11px;
  font-weight: 700;
}

.recebiveis-form {
  display: grid;
  gap: 16px;
}

#recebiveis-view .form-group {
  min-width: 0;
  margin: 0;
}

#recebiveis-view .form-group label {
  color: #374151;
  font-size: 14px;
  font-weight: 750;
}

#recebiveis-view input:not([type="hidden"]),
#recebiveis-view select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #e2e5ee;
  border-radius: 10px;
  background: var(--surface);
  color: #1f2937;
  font-size: 14px;
  outline: 0;
  box-shadow: none;
}

#recebiveis-view input:not([type="hidden"]):focus,
#recebiveis-view select:focus {
  border-color: var(--recebiveis-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.recebiveis-form-hint {
  margin: 0;
  color: #737b8c;
  font-size: 13px;
  line-height: 1.55;
}

.recebiveis-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.recebiveis-action-primary,
.recebiveis-action-clear,
.recebiveis-add-grid-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.recebiveis-action-primary,
.recebiveis-add-grid-button {
  padding: 0 18px;
  border: none;
  background: var(--recebiveis-purple);
  color: #fff;
  box-shadow: 0 7px 16px rgba(124, 58, 237, 0.18);
}

.recebiveis-action-primary:hover,
.recebiveis-add-grid-button:hover {
  background: var(--recebiveis-purple-dark);
  transform: translateY(-1px);
}

.recebiveis-action-clear {
  padding: 0 16px;
  border: 1px solid #dfe2eb;
  background: #fff;
  color: #52647e;
}

.recebiveis-action-clear:hover {
  background: #f7f7fb;
  color: #52647e;
  text-decoration: none;
}

/* Execução e Alvará */
#recebiveis-view .execucao-wrap {
  overflow: visible;
}

#recebiveis-view .execucao-panel-body {
  padding: 0;
}

.recebiveis-section-heading {
  margin-bottom: 16px;
}

.recebiveis-section-heading h2 {
  margin: 0;
  color: #1f2937;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.recebiveis-section-heading p {
  max-width: 980px;
  margin: 5px 0 0;
  color: #737b8c;
  font-size: 13px;
  line-height: 1.55;
}

.recebiveis-link-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(200px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 0;
}

.recebiveis-toolbar,
.recebiveis-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  align-items: end;
  gap: 10px;
  margin: 0;
  padding: 16px 20px 10px;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: #fcfbfe;
}

.recebiveis-alphabet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--recebiveis-border);
  background: #fcfbfe;
}

.recebiveis-alphabet__btn {
  width: auto;
  min-width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid #e2e5ee;
  border-radius: 7px;
  background: #fff;
  color: #5b6578;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.recebiveis-alphabet__btn:hover {
  border-color: #c4b0e4;
  background: #faf8ff;
  color: var(--recebiveis-purple);
}

.recebiveis-alphabet__btn.is-active {
  border-color: var(--recebiveis-purple);
  background: var(--recebiveis-purple);
  color: #fff;
}

.recebiveis-alphabet__btn[data-letra=""] {
  min-width: 48px;
  padding: 0 8px;
}

.recebiveis-table-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--recebiveis-border);
  background: #fcfbfe;
  color: #6f7a8d;
  font-size: var(--text-meta);
}

.recebiveis-table-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.recebiveis-table-footer > span i {
  color: var(--recebiveis-purple);
}

.recebiveis-table-footer__right {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}

.recebiveis-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #687386;
  font-size: var(--text-meta);
  font-weight: 700;
  white-space: nowrap;
}

.recebiveis-page-size select {
  min-width: 64px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #dfe2eb;
  border-radius: 7px;
  background: #fff;
  color: #4b5565;
  font-size: var(--text-meta);
  font-weight: 700;
  outline: 0;
  cursor: pointer;
}

.recebiveis-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recebiveis-pagination button,
.recebiveis-pagination span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe2eb;
  border-radius: 7px;
  background: #fff;
  color: #657084;
  font-size: var(--text-meta);
}

.recebiveis-pagination span {
  border-color: var(--recebiveis-purple);
  background: var(--recebiveis-purple);
  color: #fff;
  font-weight: 800;
}

.recebiveis-pagination button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.recebiveis-toolbar .form-group > label,
.recebiveis-filters .form-group > label {
  color: #687386;
  font-size: 10px;
  font-weight: 750;
}

.recebiveis-toolbar input,
.recebiveis-toolbar select,
.recebiveis-filters input,
.recebiveis-filters select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #dfe2eb;
  border-radius: 8px;
  font-size: 12px;
}

.recebiveis-content-card .recebiveis-table-wrap,
.recebiveis-content-card .execucao-table-scroll {
  border: 0;
  border-radius: 0;
  margin: 0;
}

#recebiveis-view .recebiveis-table-wrap,
#recebiveis-view .execucao-table-scroll {
  width: 100%;
  max-height: min(62vh, 720px);
  overflow: auto !important;
  border: 1px solid var(--recebiveis-border);
  border-radius: 0;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

/* Tabelas unificadas */
#recebiveis-view .recebiveis-table,
#recebiveis-view .execucao-table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0;
  table-layout: auto;
}

#recebiveis-view #table-acordos,
#recebiveis-view #table-execucao,
#recebiveis-view #table-alvara {
  min-width: 980px;
}

#recebiveis-view .recebiveis-table thead th,
#recebiveis-view .execucao-table thead th,
#recebiveis-view .execucao-table thead tr.execucao-head-main th {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--recebiveis-border);
  background: #fafafe !important;
  color: #697386;
  font-size: var(--text-meta);
  font-weight: 800;
  letter-spacing: 0.035em;
  line-height: 1.35;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: 0 1px 0 var(--recebiveis-border);
}

#recebiveis-view .recebiveis-table tbody td,
#recebiveis-view .execucao-table tbody td {
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #ececf3;
  background: var(--surface);
  color: #344054;
  font-size: 11.5px;
  line-height: 1.45;
  vertical-align: middle;
}

#recebiveis-view .recebiveis-table tbody tr:last-child td,
#recebiveis-view .execucao-table tbody tr:last-child td {
  border-bottom: 0;
}

#recebiveis-view .recebiveis-table tbody tr:not(.recebiveis-empty-row):hover td,
#recebiveis-view .execucao-table tbody tr:not(.recebiveis-empty-row):hover td {
  background: #fcfbff;
}

#recebiveis-view .execucao-table tbody tr:nth-child(even) td {
  background: var(--surface);
}

#recebiveis-view .execucao-table .execucao-cell-input {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
}

#recebiveis-view .execucao-table thead th.execucao-th-acoes {
  text-align: center;
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes {
  padding: 11px 12px;
  text-align: center;
}

#recebiveis-view .execucao-table .table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

#recebiveis-view .execucao-table .table-actions .btn {
  width: 29px;
  height: 29px;
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #dfe2eb;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 11px;
  box-shadow: none;
}

#recebiveis-view .execucao-table .table-actions .btn-primary {
  border-color: var(--recebiveis-purple);
  background: var(--recebiveis-purple);
  color: #fff;
}

#recebiveis-view .execucao-table .table-actions .btn-danger {
  border-color: #fecaca;
  background: #fff;
  color: #ef4444;
}

#recebiveis-view .execucao-table .table-actions .btn:hover {
  transform: translateY(-1px);
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes .btn {
  width: 29px;
  height: 29px;
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes .btn-primary,
#recebiveis-view .recebiveis-table tbody .btn-primary {
  border-color: var(--recebiveis-purple);
  background: var(--recebiveis-purple);
  color: #fff;
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes .table-actions .btn-secondary {
  border: 1px solid #dfe2eb;
  background: #fff;
  color: #344054;
  box-shadow: none;
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes .table-actions .btn-secondary:hover {
  background: #f7f7fb;
  color: #344054;
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes .table-actions .btn-danger {
  border: 1px solid #fecaca;
  background: #fff;
  color: #ef4444;
  box-shadow: none;
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes .table-actions .btn-danger i {
  font-weight: 900;
  color: #ef4444;
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes .table-actions .btn-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

#recebiveis-view .execucao-table tbody td.execucao-td-acoes .table-actions .btn-danger:hover i {
  color: #dc2626;
}

.recebiveis-empty-row td {
  padding: 0 !important;
}

.recebiveis-empty {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: #9299a7;
  text-align: center;
}

.recebiveis-empty i {
  color: #b6adca;
  font-size: 24px;
}

.recebiveis-empty span {
  font-size: 13px;
  font-weight: 650;
}

:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-content-card__header,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-tabs-header,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-toolbar,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-filters,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-alphabet,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-table-footer,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-table thead th,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .execucao-table thead th,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .execucao-table thead tr.execucao-head-main th {
  background: var(--bg-secondary);
}

:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-section,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .execucao-wrap,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-table-wrap,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view input:not([type="hidden"]),
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view select {
  background: var(--surface);
  color: var(--text);
}

:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-alphabet__btn,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-page-size select,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-pagination button {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-section-heading h2,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-section-header .card-title,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .form-group label,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .recebiveis-table tbody td,
:is([data-theme="dark"], [data-theme="blue"]) #recebiveis-view .execucao-table tbody td {
  color: var(--text);
}

@media (max-width: 900px) {
  .recebiveis-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recebiveis-add-grid-button {
    grid-column: 1 / -1;
  }

  .recebiveis-filters,
  .recebiveis-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.recebiveis-layout-active .main-content {
    padding: 16px 16px 20px;
  }

  #recebiveis-view .recebiveis-tabs-header {
    padding: 0;
    overflow-x: auto;
  }

  #recebiveis-view .recebiveis-tabs-header .tab-button {
    flex: 1 0 auto;
    justify-content: center;
  }

  #recebiveis-view .recebiveis-tabs-content {
    padding: 0;
  }

  .recebiveis-section,
  #recebiveis-view .execucao-wrap {
    padding: 0;
  }

  .recebiveis-toolbar,
  .recebiveis-filters {
    grid-template-columns: 1fr;
  }

  .recebiveis-form-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .recebiveis-action-primary {
    flex: 1;
  }

  .recebiveis-action-clear {
    width: 100%;
    order: 2;
    margin: 2px 0 0;
  }
}

/* Acordo — detalhe: campos de parcelas ocultos quando não parcelado */
#modal-acordo-detalhes #acordo-detalhes-bloco-parcelado-qtd[hidden],
#modal-acordo-detalhes #acordo-detalhes-bloco-parcelado-data[hidden],
#modal-acordo-detalhes #acordo-detalhes-bloco-registro[hidden] {
  display: none !important;
}
