/* -------- Base Styles -------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #ffffff;
}

/* -------- Main Container -------- */
.batch-fee-settings {
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.batch-fee-settings h2 {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.batch-fee-settings p {
  font-size: 16px;
  color: #666;
  margin-bottom: 25px;
}

/* -------- Fee Table -------- */
.fee-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}

.fee-table thead {
  background-color: #f5f5f5;
}

.fee-table th {
  padding: 15px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  border-bottom: 2px solid #ddd;
}

.fee-table tbody tr {
  border-bottom: 1px solid #ddd;
  transition: background-color 0.2s ease;
}

.fee-table tbody tr:hover {
  background-color: #f9f9f9;
}

.fee-table tbody tr:last-child {
  border-bottom: none;
}

.fee-table td {
  padding: 12px;
  vertical-align: middle;
  font-size: 14px;
}

.fee-table td:first-child {
  font-weight: 500;
  color: #333;
}

.fee-table td:not(:first-child):not(:last-child) {
  text-align: right;
  font-weight: 500;
  color: #2c5aa0;
}

.fee-table td:nth-last-child(2) {
  font-weight: 600;
  color: #d63384;
  text-align: right;
}

.fee-table td:last-child {
  text-align: center;
}

/* -------- Edit Icon -------- */
.edit-icon {
  color: #007bff;
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-block;
  width: 28px;
  height: 28px;
  text-align: center;
  line-height: 16px;
}

.edit-icon:hover {
  background-color: #e7f3ff;
  color: #0056b3;
}

/* -------- Popup Overlay -------- */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-overlay.show {
  display: flex;
}

/* -------- Popup Content -------- */
.popup-content {
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* -------- Popup Header -------- */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

.popup-header strong {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.close-popup {
  cursor: pointer;
  font-size: 24px;
  color: #666;
  transition: color 0.2s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.close-popup:hover {
  color: #dc3545;
  background-color: #f8d7da;
}

/* -------- Popup Form -------- */
.popup-form {
  padding: 24px;
}

.popup-form p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* -------- Form Rows -------- */
.form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.form-row label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.form-row input,
.form-row select {
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(56, 131, 211, 0.25);
}

.form-row select {
  cursor: pointer;
  background-color: white;
}

/* -------- Popup Actions -------- */
.popup-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.save-btn {
  padding: 10px 24px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.save-btn:hover {
  background-color: #218838;
}

.save-btn:active {
  background-color: #1e7e34;
}

/* -------- Finish Button Container -------- */
.batch-fee-settings + div {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

/* -------- Finish Button -------- */
.finish-btn {
  background-color: #6c757d !important;
  color: white !important;
  padding: 12px 24px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
}

.finish-btn:hover {
  background-color: #5a6268 !important;
}

.finish-btn:active {
  background-color: #545b62 !important;
}

/* -------- Responsive Design -------- */
@media (max-width: 768px) {
  .batch-fee-settings {
    padding: 20px;
  }

  .batch-fee-settings h2 {
    font-size: 20px;
  }

  .batch-fee-settings p {
    font-size: 14px;
  }

  .fee-table {
    font-size: 13px;
  }

  .fee-table th,
  .fee-table td {
    padding: 10px 8px;
  }

  .popup-content {
    width: 95%;
  }

  .popup-header {
    padding: 16px 20px;
  }

  .popup-form {
    padding: 20px;
  }

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

  .form-row label {
    font-size: 13px;
  }

  .form-row input,
  .form-row select {
    padding: 9px 10px;
    font-size: 13px;
  }

  .batch-fee-settings + div {
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .batch-fee-settings {
    padding: 16px;
  }

  .batch-fee-settings h2 {
    font-size: 18px;
  }

  .fee-table {
    font-size: 12px;
  }

  .fee-table th,
  .fee-table td {
    padding: 8px 6px;
  }

  .edit-icon {
    font-size: 14px;
    width: 24px;
    height: 24px;
    line-height: 12px;
  }

  .popup-content {
    width: 98%;
    margin: 10px;
  }

  .popup-header {
    padding: 14px 16px;
  }

  .popup-header strong {
    font-size: 14px;
  }

  .popup-form {
    padding: 16px;
  }

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

  .form-row label {
    font-size: 12px;
    font-weight: 600;
  }

  .form-row input,
  .form-row select {
    padding: 8px 10px;
    font-size: 12px;
  }

  .save-btn {
    width: 100%;
    padding: 12px;
    font-size: 13px;
  }

  .finish-btn {
    width: 100% !important;
    padding: 14px !important;
    font-size: 13px !important;
  }

  .batch-fee-settings + div {
    padding: 0 16px;
  }
}

/* -------- Print Styles -------- */
@media print {
  .batch-fee-settings {
    padding: 20px !important;
  }

  .popup-overlay,
  .edit-icon,
  .finish-btn {
    display: none !important;
  }

  .fee-table {
    border: 2px solid #000 !important;
  }

  .fee-table th,
  .fee-table td {
    border: 1px solid #000 !important;
  }
}

/* -------- Loading State -------- */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* -------- Accessibility -------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* -------- Popup Mobile Fix -------- */
@media (max-width: 480px) {
  .popup-overlay {
    align-items: flex-start; /* Start from top for scroll */
    padding: 20px 10px;
    overflow-y: auto;
  }

  .popup-content {
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    border-radius: 6px;
  }

  .popup-form {
    padding: 12px;
  }

  .form-row {
    display: flex;
    flex-direction: column; /* label on top */
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 14px;
  }

  .form-row label {
    font-size: 13px;
    font-weight: 600;
  }

  .form-row input,
  .form-row select {
    width: 100%;
    font-size: 13px;
    padding: 9px 10px;
  }

  .popup-header {
    padding: 14px;
  }

  .popup-header strong {
    font-size: 15px;
  }

  .save-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }
}
.finish-btn {
  padding: 10px 25px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: #007bff;
  color: #fff;
  cursor: pointer;
}

/* Mobile View */
@media (max-width: 768px) {
  .finish-btn {
    display: block;
    margin: 0 auto;   /* Centers the button */
    width: fit-content; /* Keeps button short */
  }
}
