/* The standalone cheque workspace shares controls, but not page geometry, with credits. */
.amanta-cheques-workspace.amanta-cheques-general { gap: 16px; }
.amanta-cheques-workspace .amanta-cheques-heading h1 { margin: 0; }
.amanta-cheques-workspace .amanta-cheques-heading p { display: none; }
.amanta-cheques-workspace .amanta-cheques-tabs { gap: 8px; }
.amanta-cheques-workspace .amanta-cheques-section-title {
  margin: 0;
  padding: 14px 18px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.amanta-cheques-workspace .amanta-cheques-entry.amanta-cheques-card {
  margin: 0; padding: 0; border-radius: 20px;
}
.amanta-cheques-workspace .amanta-cheques-entry-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.amanta-cheques-workspace .amanta-cheques-entry-heading .amanta-cheques-bank-choice { padding: 8px 16px; }
.amanta-cheques-workspace .amanta-cheques-entry-heading .amanta-cheques-bank-choice label { display: flex; align-items: center; gap: 12px; width: auto; }
.amanta-cheques-workspace .amanta-cheques-entry-heading .amanta-cheques-bank-choice label > span { white-space: nowrap; }
.amanta-cheques-workspace .amanta-cheques-entry-heading .amanta-cheques-bank-choice [role="combobox"] { width: 220px; }
.amanta-cheques-workspace .amanta-cheques-entry-grid {
  grid-auto-flow: row;
  grid-template-columns: 1.05fr 1.5fr 1.5fr 1fr 1fr;
}
.amanta-cheques-workspace .amanta-cheques-entry-grid > label { grid-template-rows: 36px 50px; gap: 0; }
.amanta-cheques-workspace .amanta-cheques-entry-grid > label > span {
  justify-content: flex-start; text-align: left; padding: 8px 12px; font-size: 11px;
}
.amanta-cheques-workspace .amanta-cheques-entry-grid input,
.amanta-cheques-workspace .amanta-cheques-entry-grid [role="combobox"] {
  text-align: left; padding: 8px 12px !important; font-size: 13px;
}
.amanta-cheques-workspace .amanta-cheques-document { grid-column: 1 / -1; }
.amanta-cheques-workspace .amanta-cheques-document .amanta-cheques-extra-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; padding: 0;
}
.amanta-cheques-workspace .amanta-cheques-entry-extra { margin: 8px 16px; }
.amanta-cheques-workspace .amanta-supplemental-sheet { padding: 8px; gap: 0; }
.amanta-cheques-workspace .amanta-supplemental-heading { padding: 8px 12px; }
.amanta-cheques-workspace .amanta-cheques-history-controls { border-radius: 20px 20px 0 0; }
.amanta-cheques-workspace .amanta-cheques-inline-form > p { align-self: center; }
.amanta-cheques-workspace .amanta-cheques-issued-entry > .amanta-cheque-allocation { grid-column: 1 / -1; }
.amanta-cheques-workspace .amanta-cheques-issued-entry > .mt-7 { grid-column: 1 / -1; }
.amanta-cheques-workspace .amanta-cheques-bank-choice { padding: 0 16px 12px; }
.amanta-cheques-workspace .amanta-cheques-history { padding: 0; }
.amanta-cheques-workspace .amanta-cheques-history-controls { padding: 0 16px; }
.amanta-cheques-workspace .amanta-cheques-history-controls h2 { padding-left: 0; padding-bottom: 2px; }
.amanta-cheques-workspace .amanta-cheques-summary { padding: 8px 0 12px; }
.amanta-cheques-workspace .amanta-cheques-summary > div { background: none; padding: 0; min-width: 0; }
.amanta-cheques-workspace .amanta-cheques-summary strong { font-size: 19px; }
.amanta-cheques-workspace .amanta-cheques-history-scroll { max-height: 75vh; }
.amanta-cheques-workspace tbody td:last-child .amanta-cheques-button {
  width: 32px; min-height: 32px; padding: 6px; margin: 2px; vertical-align: middle;
}
.amanta-cheques-workspace tbody td { padding-top: 8px; padding-bottom: 8px; }
.amanta-cheques-workspace .amanta-cheques-history > footer { padding: 12px 16px; }
@media (max-width: 1000px) {
  .amanta-cheques-workspace .amanta-cheques-entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .amanta-cheques-workspace .amanta-cheques-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 8px; }
  .amanta-cheques-workspace .amanta-cheques-inline-form { display: block; }
}
@media (max-width: 650px) {
  .amanta-cheques-workspace .amanta-cheques-entry-grid,
  .amanta-cheques-workspace .amanta-cheques-extra-grid,
  .amanta-cheques-workspace .amanta-cheques-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.amanta-cheques-general {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.amanta-cheques-card {
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 2px 3px #0f172a08;
  min-width: 0;
}
.amanta-cheques-heading,
.amanta-cheques-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.amanta-cheques-heading h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 4px 0 16px;
}
.amanta-cheques-heading p {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #f04420;
}
.amanta-cheques-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.amanta-cheques-button {
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  min-height: 40px;
  padding: 9px 13px;
  background: #f8fafc;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.amanta-cheques-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.amanta-cheques-primary {
  background: #f04420;
  color: white;
  border-color: #f04420;
  font-weight: 600;
}
.amanta-cheques-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid #dbe3ef;
}
.amanta-cheques-tabs button {
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
}
.amanta-cheques-tabs [aria-selected="true"] {
  border-color: #f04420;
  color: #dd3818;
  font-weight: 600;
}
.amanta-cheques-filter {
  display: grid;
  grid-template-columns:
    minmax(150px, 2fr) repeat(3, minmax(95px, 1fr)) minmax(140px, 1.3fr)
    42px;
  gap: 10px;
  align-items: center;
  min-height: 66px;
}
.amanta-cheques-filter > * {
  min-width: 0;
}
.amanta-cheques-filter input,
.amanta-cheques-fields input,
.amanta-cheques-fields [role="combobox"] {
  min-height: 46px;
  width: 100%;
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
}
.amanta-cheques-summary {
  padding: 12px 0;
  font-size: 13px;
  color: #64748b;
}
.amanta-cheques-summary > div {
  background: #fff4e8;
  border-radius: 12px;
  min-width: 220px;
  text-align: center;
  padding: 10px 18px;
}
.amanta-cheques-summary small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
}
.amanta-cheques-summary strong {
  font-size: 22px;
  color: #0f172a;
  display: block;
}
.amanta-cheques-table-scroll {
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
}
.amanta-cheques-general table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.amanta-cheques-general th {
  background: #f8fafc;
  font-size: 11px;
  color: #64748b;
  position: sticky;
  top: 0;
  z-index: 2;
}
.amanta-cheques-general :is(th, td) {
  padding: 10px 7px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
.amanta-cheques-general td {
  font-size: 12px;
}
.amanta-cheques-general th:nth-child(3) {
  width: 15%;
}
.amanta-cheques-general th:nth-child(8) {
  width: 12%;
}
.amanta-cheques-general th:nth-child(9) {
  width: 14%;
}
.amanta-cheques-general th:last-child {
  width: 60px;
}
.amanta-cheques-table-scroll .amanta-status-badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.amanta-cheques-general small {
  display: block;
}
.amanta-cheques-general [data-cancelled="true"] {
  background: #fff1f2;
  color: #94a3b8;
}
.amanta-cheques-general footer {
  padding-top: 12px;
}
.amanta-cheques-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.amanta-cheques-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
.amanta-cheques-fields label {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
}
.amanta-cheques-form [role="alert"] {
  color: #b91c1c;
  background: #fff1f2;
  padding: 12px;
  border-radius: 10px;
}
.amanta-cheques-form h3 {
  font-weight: 600;
}
.amanta-cheques-general .amanta-status-badge {
  font-size: 11px;
  padding: 5px 6px;
}
@media (max-width: 1000px) {
  .amanta-cheques-card {
    padding: 12px;
  }
  .amanta-cheques-filter {
    gap: 5px;
    grid-template-columns:
      minmax(110px, 1.6fr) repeat(3, minmax(70px, 1fr))
      minmax(100px, 1fr) 36px;
  }
  .amanta-cheques-general :is(td, th) {
    padding: 8px 4px;
    font-size: 11px;
  }
  .amanta-cheques-general td button {
    font-size: 10px;
    padding: 6px;
  }
}
@media (max-width: 650px) {
  .amanta-cheques-fields {
    grid-template-columns: 1fr;
  }
  .amanta-cheques-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .amanta-cheques-heading {
    flex-wrap: wrap;
  }
}

/* Carga superior y consulta inferior; una única superficie de scroll nativo. */
.amanta-cheques-entry {
  margin: 14px -18px -18px;
}
.amanta-cheques-inline-form {
  min-width: 0;
}
.amanta-cheques-entry-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border-top: 1px solid #dbe3ef;
  border-bottom: 1px solid #dbe3ef;
}
.amanta-cheques-entry-grid > label {
  min-width: 0;
  display: grid;
  grid-template-rows: 44px 54px;
  gap: 0;
  border-right: 1px solid #dbe3ef;
  align-content: start;
}
.amanta-cheques-entry-grid > label:last-child {
  border-right: 0;
}
.amanta-cheques-entry-grid > label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5px;
  background: #f8fafc;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #dbe3ef;
  overflow-wrap: anywhere;
}
.amanta-cheques-entry-grid > label > :not(span) {
  min-width: 0;
  align-self: center;
}
.amanta-cheques-entry-grid input,
.amanta-cheques-entry-grid [role="combobox"] {
  width: 100%;
  min-width: 0;
  height: 50px !important;
  min-height: 0;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 8px 6px !important;
  font-size: 12px;
  text-align: center;
  background: white;
}
.amanta-cheques-entry-grid input:focus-visible,
.amanta-cheques-entry-grid [role="combobox"]:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}
.amanta-cheques-entry-grid label > button {
  width: 100%;
}
.amanta-cheques-entry-extra {
  margin: 10px 16px;
  font-size: 12px;
  color: #475569;
}
.amanta-cheques-entry-extra summary {
  cursor: pointer;
  padding: 6px 0;
}
.amanta-cheques-extra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 12px;
  padding: 8px 0;
}
.amanta-cheques-extra-grid label,
.amanta-cheques-bank-choice label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #64748b;
  font-size: 12px;
}
.amanta-cheques-extra-grid input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
}
.amanta-cheques-inline-form > p {
  margin: 8px 16px;
  font-size: 12px;
  color: #64748b;
}
.amanta-cheques-inline-form > footer,
.amanta-cheques-issued-entry > .mt-7 {
  margin: 0;
  padding: 10px 16px 14px;
}
.amanta-income-cheque-complement {
  border-top: 1px solid #dbe3ef;
  background: #fff;
}
.amanta-income-cheque-complement__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #f8fafc;
}
.amanta-income-cheque-complement__heading strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
}
.amanta-income-cheque-complement__heading p,
.amanta-income-cheque-complement__note {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
}
.amanta-income-cheque-complement__mode {
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  padding: 8px 12px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}
.amanta-income-cheque-complement > .amanta-cheques-entry-grid {
  grid-auto-columns: minmax(150px, 1fr);
}
.amanta-income-cheque-complement > [role="alert"] {
  margin: 10px 16px 0;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
}
.amanta-income-cheque-complement__note {
  padding: 10px 16px 12px;
}
.amanta-cheques-bank-choice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px 12px;
}
.amanta-cheques-bank-choice label {
  width: 260px;
}
.amanta-cheques-bank-choice > span {
  font-size: 12px;
  color: #64748b;
}
.amanta-cheques-issued-entry > .amanta-cheque-allocation {
  margin: 10px 16px;
  padding: 10px;
}
.amanta-cheques-issued-entry .amanta-cheque-allocation p {
  font-size: 12px;
}
.amanta-cheques-history-scroll {
  max-height: 65vh;
  min-height: 270px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-gutter: stable;
}
.amanta-cheques-history-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  background: white;
}
.amanta-cheques-history .amanta-cheques-table-scroll {
  overflow: visible;
  max-height: none;
  border-radius: 0;
}
.amanta-cheques-history .amanta-cheques-table-scroll > table > thead {
  position: sticky;
  top: var(--cheque-controls-height, 160px);
  z-index: 4;
}
.amanta-cheques-history th {
  position: static;
}
@media (max-width: 1000px) {
  .amanta-cheques-entry {
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -12px;
  }
  .amanta-cheques-entry-grid > label > span {
    font-size: 9px;
    letter-spacing: 0;
  }
  .amanta-cheques-entry-grid input,
  .amanta-cheques-entry-grid [role="combobox"] {
    font-size: 11px;
    padding: 6px 3px !important;
  }
}
@media (max-width: 700px) {
  .amanta-cheques-entry-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .amanta-cheques-extra-grid {
    grid-template-columns: 1fr;
  }
  .amanta-cheques-bank-choice {
    flex-wrap: wrap;
  }
  .amanta-income-cheque-complement__heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.amanta-cheques-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.amanta-cheques-inline-form > .amanta-cheques-entry-grid,
.amanta-cheques-inline-form > .amanta-cheques-entry-extra {
  grid-column: 1/-1;
}
.amanta-cheques-inline-form > footer,
.amanta-cheques-issued-entry > .mt-7 {
  grid-column: 2;
  align-self: end;
}
.amanta-cheques-issued-entry > label {
  grid-column: 1/-1;
  margin: 8px 16px;
}
.amanta-cheques-heading .amanta-cheques-bank-choice {
  padding: 0;
}
.amanta-cheques-heading .amanta-cheques-bank-choice label {
  width: 230px;
}
.amanta-cheques-choose-bank-note {
  padding: 8px 18px 20px;
  color: #64748b;
  font-size: 13px;
}
@media (max-width: 900px) {
  .amanta-cheques-inline-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .amanta-cheques-inline-form > footer,
  .amanta-cheques-issued-entry > .mt-7 {
    grid-column: 1;
  }
}

/* Créditos comparte los dos cuadros y el historial fijo de Cheques. */
.amanta-credit-filter {
  grid-template-columns: minmax(150px, 2fr) minmax(110px, 1fr) minmax(
      100px,
      1fr
    ) minmax(150px, 1.3fr) 42px;
}
.amanta-credit-entry {
  margin: 8px -18px -6px;
}
.amanta-credit-entry > div > :not(.amanta-credit-entry-fields) {
  margin-left: 16px;
  margin-right: 16px;
}
.amanta-credit-entry > div > [role="tablist"] {
  display: flex;
  background: white;
  border-bottom: 1px solid #dbe3ef;
  border-radius: 0;
  padding: 0;
}
.amanta-credit-entry > div > [role="tablist"] button {
  border-radius: 0;
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
}
.amanta-credit-entry > div > [role="tablist"] button[aria-selected="true"] {
  border-bottom-color: #f04420;
  box-shadow: none;
}
.amanta-credit-entry > div > [role="tablist"] small {
  display: none;
}
.amanta-credit-entry-fields > label {
  grid-template-rows: 52px 52px;
}
.amanta-credit-entry-fields > label > small {
  display: none;
}
.amanta-credit-entry-fields > label > :not(span) {
  margin: 0 !important;
}
.amanta-credit-entry > div > .grid.gap-3 > div {
  padding: 8px 12px;
}
.amanta-credit-entry-hint {
  color: #64748b;
  font-size: 13px;
}
.amanta-credit-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}
.amanta-credit-row-actions > button {
  padding: 6px;
  min-height: 32px;
  width: 32px;
}
.amanta-credits-general th:nth-child(2) {
  width: 22%;
}
.amanta-credits-general th:nth-child(3),
.amanta-credits-general th:nth-child(8) {
  width: 13%;
}
.amanta-credit-schedule-cell {
  text-align: left !important;
}
.amanta-credit-schedule-cell [style*="grid-template-columns"] {
  grid-template-columns: 44px minmax(85px, 1fr) repeat(4, minmax(0, 1fr)) minmax(90px, 1fr) 70px !important;
}
.amanta-credit-schedule-cell [style*="grid-template-columns"] > * {
  min-width: 0;
  padding-left: 5px;
  padding-right: 5px;
  overflow-wrap: anywhere;
}
@media (max-width: 1000px) {
  .amanta-credit-entry {
    margin-left: -12px;
    margin-right: -12px;
  }
}
@media (max-width: 650px) {
  .amanta-credit-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* El módulo web reutiliza las tarjetas y la retícula de cheques Amanta. */
.amanta-appweb-supplier-cheques .amanta-cheques-entry form { padding: 0 16px 14px; }
.amanta-appweb-supplier-cheques .amanta-cheques-entry-grid { padding: 0; }
.amanta-appweb-supplier-cheques .amanta-cheques-entry-grid > label:last-child { grid-column: auto; }
.amanta-appweb-supplier-cheques .amanta-cheques-entry-extra { margin: 12px 0; }
.amanta-appweb-supplier-cheques .amanta-appweb-cheque-invoices { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 8px; padding: 12px; }
.amanta-appweb-supplier-cheques .amanta-appweb-cheque-invoice { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #dbe2ea; border-radius: 8px; }
.amanta-appweb-supplier-cheques .amanta-appweb-cheque-invoice input { width: 18px; height: 18px; flex: none; }
.amanta-appweb-supplier-cheques .amanta-cheques-history > .amanta-management-scroll { max-height: 65vh; }
.amanta-appweb-supplier-cheques .amanta-cheques-history .amanta-management-scroll table { min-width: 960px; }
.amanta-appweb-supplier-cheques .amanta-cheques-entry-extra .amanta-management-muted { padding: 0 12px; }

.amanta-appweb-cheque-status .amanta-management-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
.amanta-appweb-cheque-status .amanta-cheque-reason-row { grid-template-columns: minmax(0,1fr); }
@media (max-width:760px) { .amanta-appweb-cheque-status .amanta-management-row { grid-template-columns: minmax(0,1fr); } }

.amanta-appweb-supplier-cheques .amanta-cheques-entry-grid {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr));
}

.amanta-appweb-cheques .amanta-cheques-tabs { align-self: start; }
.amanta-appweb-client-cheques .amanta-cheques-history .amanta-management-scroll table { min-width: 960px; }
.amanta-appweb-client-cheques .amanta-appweb-client-cheque-note { margin: 8px 16px 14px; }

/* Complemento de cheque dentro del cuadro de Ingresos: respeta el ancho disponible. */
.amanta-appweb-income-cheque { min-width: 0; max-width: 100%; }
.amanta-appweb-income-cheque > .amanta-cheques-entry-grid {
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  grid-auto-columns: minmax(0, 1fr);
}
.amanta-appweb-income-cheque > .amanta-cheques-entry-grid > label:last-child { grid-column: auto; }

.amanta-economy .amanta-income-credit-operation { grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
.amanta-economy .amanta-income-credit-pair { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media (max-width:1199px) {
 .amanta-economy .amanta-income-credit-operation,
 .amanta-economy .amanta-income-credit-pair { grid-template-columns:minmax(0,1fr); }
 .amanta-economy .amanta-income-credit-receipt { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .amanta-economy .amanta-income-credit-receipt > label:last-child { grid-column:span 2; }
}
@media (max-width:760px) {
 .amanta-economy .amanta-income-credit-receipt { grid-template-columns:minmax(0,1fr); }
 .amanta-economy .amanta-income-credit-receipt > label:last-child { grid-column:auto; }
}
