.cicp {
  position: relative;
  font-size: 14px;
  color: #3D4631;
}

.cicp__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cicp__title {
  margin: 0 0 .25rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

.cicp__subtitle,
.cicp__modal-meta {
  margin: 0;
  color: #5A613C;
}

.cicp__table-wrap,
.cicp__detail-wrap {
  overflow: auto;
  border: 1px solid #C8CDB5;
  border-radius: 14px;
  background: #ffffff;
}

.cicp__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.cicp__table th,
.cicp__table td {
  padding: .85rem .9rem;
  border-bottom: 1px solid #e8edf2;
  text-align: left;
  vertical-align: middle;
}

.cicp__table thead th {
  background: #3D4631;
  color: #ffffff;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.cicp__table tbody tr:nth-child(even) {
  background: #F3F5EC;
}

.cicp__table tbody tr:hover {
  background: #E8ECD8;
}

.cicp__numeric {
  text-align: right !important;
}

.cicp__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 40px;
  padding: .65rem 1rem;
  border: 1px solid #9FA64C;
  border-radius: 10px;
  background: #9FA64C;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.cicp__button:hover,
.cicp__button:focus {
  background: #7F8B56;
  border-color: #7F8B56;
  color: #ffffff;
}

.cicp__button--secondary {
  background: #5A613C;
  border-color: #5A613C;
}

.cicp__button--secondary:hover,
.cicp__button--secondary:focus {
  background: #3D4631;
  border-color: #3D4631;
}

.cicp__button--ghost {
  background: #fff;
  color: #1f3b5b;
}

.cicp__empty,
.cicp__loading,
.cicp__error {
  padding: 1rem;
  text-align: center;
}

.cicp__error {
  color: #8a1c1c;
}

/* Modal anclado al bloque del plugin */
.cicp__modal {
  position: absolute;
  inset: 0;
  z-index: 999;
}

.cicp__modal[hidden] {
  display: none;
}

.cicp__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.cicp__dialog {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  width: calc(100% - 2rem);
  max-width: 1280px;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;

  /* Ajustes clave */
  max-height: 85vh;
  overflow: hidden;
}

.cicp__modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #C8CDB5;
  background: #F7F8F3;
}

.cicp__modal-title {
  margin: 0 0 .2rem;
  font-size: 1.25rem;
}

.cicp__actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}

.cicp__modal-body {
  padding: 1rem 1.25rem 1.25rem;
  overflow: hidden;
}

/* Scroll interno del detalle */
.cicp__table--detail {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1100px;
}

.cicp__table--detail thead,
.cicp__table--detail tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.cicp__table--detail tbody {
  display: block;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
}

.cicp__table--detail thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.cicp__table--detail tbody::-webkit-scrollbar {
  width: 10px;
}

.cicp__table--detail tbody::-webkit-scrollbar-thumb {
  background: #9FA64C;
  border-radius: 10px;
}

body.cicp-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .cicp__modal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .cicp__actions {
    width: 100%;
    flex-direction: column;
  }

  .cicp__actions form,
  .cicp__actions .cicp__button {
    width: 100%;
  }

  .cicp__dialog {
    width: calc(100% - 1rem);
  }

  .cicp__table--detail tbody {
    max-height: 380px;
  }
}