/* ══════════════════════════════════════════
   Disbursement Accounts — Unified Modal
   ══════════════════════════════════════════ */

/* ── Unified Layout ── */
.disbursement-account__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--bs-gray-200);
  margin-bottom: 1rem;
}

.disbursement-account__vessel-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--bs-dark);
}


.disbursement-account__section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--bs-gray-200);
}

.disbursement-account__section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.disbursement-account__section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bs-gray-500);
  margin-bottom: 0.75rem;
}

.disbursement-account__section--summary {
  background: var(--bs-gray-100);
  border-radius: 0.5rem;
  padding: 1rem;
  border-bottom: none;
}

.disbursement-account__section--vouchers {
  border-bottom: none;
  padding-bottom: 0;
}

.disbursement-account__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-top: 2px solid var(--bs-gray-200);
  background: #fff;
  position: sticky;
  bottom: 0;
  margin: 1rem -1.5rem -1.5rem;
  z-index: 10;
}

/* ── Voucher Card List ── */
.voucher-card-list {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* ── Voucher Card ── */
.voucher-card {
  border: 1px solid var(--bs-gray-300);
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.voucher-card:focus-within {
  border-color: var(--bs-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 2px rgba(var(--bs-primary-rgb), 0.1);
}

/* ── Card Header ── */
.voucher-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bs-primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.voucher-card__title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.voucher-card__group-select {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.25rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  max-width: 170px;
}

.voucher-card__group-select option {
  background: var(--bs-primary);
  color: #fff;
}

.voucher-card__separator {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

.voucher-card__number {
  white-space: nowrap;
}

.voucher-card__controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.voucher-card__compulsory-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  white-space: nowrap;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.15s;
}

.voucher-card__compulsory-label:hover {
  background: rgba(255, 255, 255, 0.2);
}

.voucher-card__compulsory-label .form-check-input {
  margin-top: 0;
  width: 1em;
  height: 1em;
  border-color: rgba(255, 255, 255, 0.5);
  background-color: transparent;
}

.voucher-card__compulsory-label .form-check-input:checked {
  background-color: #fff;
  border-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%232A2B5A' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.voucher-card__delete-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.82rem;
  line-height: 1;
  transition: color 0.15s, background-color 0.15s;
}

.voucher-card__delete-btn:hover {
  color: #fff;
  background: rgba(220, 53, 69, 0.7);
}

/* ── Voucher Name Row ── */
.voucher-card__name-row {
  padding: 0.5rem 0.75rem 0;
}

/* ── Card Body / Table ── */
.voucher-card__body {
  padding: 0;
}

.voucher-card__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.voucher-card__col-desc { width: 55%; }
.voucher-card__col-amount { width: 22.5%; }

.voucher-card__table thead th {
  border-bottom: 1px solid var(--bs-gray-300);
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-gray-500);
}

.voucher-card__table tbody td {
  padding: 0.2rem 0.6rem;
  vertical-align: middle;
}

/* ── Inputs (inline, minimal chrome) ── */
.voucher-card__input {
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--bs-gray-300);
  padding: 0.25rem 0;
  width: 100%;
  font-size: 0.875rem;
  color: var(--bs-body-color);
  transition: border-color 0.15s, background-color 0.15s;
  border-radius: 0;
}

.voucher-card__input:focus {
  outline: none;
  border-bottom-color: var(--bs-primary);
  border-bottom-style: solid;
  background: rgba(var(--bs-primary-rgb), 0.03);
}

.voucher-card__input::placeholder {
  color: var(--bs-gray-400);
  font-style: italic;
}

.voucher-card__input--name {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--bs-gray-300);
  text-underline-offset: 3px;
  font-size: 0.925rem;
}

.voucher-card__input--name:focus {
  text-decoration-color: var(--bs-primary);
}

.voucher-card__input--notes {
  font-size: 0.825rem;
  color: var(--bs-gray-600);
}

/* ── Amount Cells ── */
.voucher-card__amount-cell {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  padding-right: 0.75rem !important;
}

.voucher-card__preview {
  color: var(--bs-gray-500);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.voucher-card__preview--total {
  font-weight: 700;
  color: var(--bs-body-color);
}

/* ── Service Row ── */
.voucher-card__service-row td {
  padding: 0.15rem 0.6rem !important;
}

.voucher-card__remove-service-btn {
  background: none;
  border: none;
  color: var(--bs-gray-400);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}

.voucher-card__remove-service-btn:hover {
  color: var(--bs-danger);
}

.voucher-card__add-service-btn {
  background: none;
  border: none;
  color: var(--bs-body-emphasis-color);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0;
  margin-left: 1.1rem;
  transition: color 0.15s;
}

.voucher-card__add-service-btn:hover {
  color: var(--bs-body-emphasis-color);
  text-decoration: underline;
}

/* ── Notes Field Group ── */
.voucher-card__field-group--notes {
  flex: 1;
  min-width: 0;
}

.voucher-card__field-group--notes .voucher-card__input--notes {
  flex: 1;
}

/* ── Total Row ── */
.voucher-card__total-row td {
  border-top: 1px solid var(--bs-gray-300);
  font-weight: 600;
  font-size: 0.875rem;
  padding-top: 0.35rem !important;
  padding-bottom: 0.3rem !important;
}

.voucher-card__total-label {
  letter-spacing: 0.02em;
  color: var(--bs-gray-700);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.voucher-card__total-label::after {
  content: " .......................................................................................................................";
  letter-spacing: 0.15em;
  color: var(--bs-gray-400);
}

.voucher-card__meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--bs-gray-200);
}

.voucher-card__field-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.voucher-card__meta-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-gray-600);
  white-space: nowrap;
}

.voucher-card__input--value {
  width: 100px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--bs-gray-100);
  border: 1px solid var(--bs-gray-300);
  border-radius: 0.25rem;
  padding: 0.2rem 0.4rem;
  border-bottom-style: solid;
}

.voucher-card__input--value:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
  background: #fff;
}

.voucher-card__input--roe {
  width: 90px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--bs-gray-100);
  border: 1px solid var(--bs-gray-300);
  border-radius: 0.25rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
  border-bottom-style: solid;
}

.voucher-card__input--roe:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
  background: #fff;
}

/* ── Mobile Responsive ── */
@media (max-width: 767.98px) {
  .voucher-card-list {
    max-height: none;
  }

  .voucher-card__header {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
  }

  .voucher-card__col-desc { width: 40%; }
  .voucher-card__col-amount { width: 30%; }

  .voucher-card__table thead th,
  .voucher-card__table tbody td {
    padding: 0.25rem 0.3rem;
  }

  .voucher-card__service-row td {
    padding: 0.15rem 0.3rem !important;
  }

  .voucher-card__amount-cell {
    padding-right: 0.3rem !important;
  }

  .voucher-card__input--value {
    width: 100%;
    min-width: 0;
    padding: 0.2rem 0.3rem;
    font-size: 0.8rem;
  }

  .voucher-card__total-label::after {
    content: "";
  }

  .voucher-card__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .voucher-card__group-select {
    max-width: 130px;
    font-size: 0.68rem;
  }

  .disbursement-account__footer {
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem -1rem -1rem;
    padding: 0.75rem 1rem;
  }

  .disbursement-account__footer .d-flex:first-child {
    width: 100%;
    justify-content: center;
  }

  .disbursement-account__footer button[type="submit"] {
    width: 100%;
  }
}
