/* =============================================
   청구/납입 팝업 스타일
   - 청구 추가 팝업
   - 납입 추가 팝업
============================================= */

/* 오버레이 */
.charge-payment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.charge-payment-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 모달 */
.charge-payment-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 550px;
  max-width: 90%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.charge-payment-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 컨테이너 */
.charge-payment-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}

/* 헤더 */
.charge-payment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: linear-gradient(180deg, #e8f4fd 0%, #d4e9f7 100%);
  border-bottom: 1px solid #b8d4e8;
}

.charge-payment-header .popup-title {
  color: #2c5f8d;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.charge-payment-header .popup-close-btn {
  background: transparent;
  border: none;
  color: #6c757d;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.charge-payment-header .popup-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* 바디 */
.charge-payment-body {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  background: #ffffff;
}

/* 안내 문구 */
.info-notice {
  margin-bottom: 20px;
  padding: 0;
  background: transparent;
  border: none;
}

.info-notice p {
  font-size: 12px;
  color: #495057;
  line-height: 1.8;
  margin-bottom: 4px;
}

.info-notice p:last-child {
  margin-bottom: 0;
}

/* 폼 섹션 */
.form-section {
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
  color: #2c3e50;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input:readonly {
  background: #e9ecef;
  color: #6c757d;
  cursor: not-allowed;
}

.form-input::placeholder {
  color: #adb5bd;
}

/* 예상잔액 섹션 */
.balance-section {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-top: 20px;
}

.balance-title {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 12px 0;
}

.balance-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.balance-box {
  flex: 1;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.balance-amount {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.balance-amount.orange {
  color: #ff8c42;
}

.balance-amount.blue {
  color: #3498db;
}

.balance-label {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
}

.balance-arrow {
  color: #3498db;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 푸터 */
.charge-payment-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.charge-payment-footer .btn-popup-cancel,
.charge-payment-footer .btn-popup-save {
  padding: 9px 24px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.charge-payment-footer .btn-popup-save {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.charge-payment-footer .btn-popup-save:hover {
  background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.charge-payment-footer .btn-popup-cancel {
  background: #ffffff;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.charge-payment-footer .btn-popup-cancel:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

/* 반응형 */
@media (max-width: 768px) {
  .charge-payment-modal {
    width: 95%;
    max-height: 85vh;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .balance-display {
    flex-direction: column;
    gap: 12px;
  }

  .balance-arrow {
    transform: rotate(90deg);
  }
}
