/* ============================================================
   ACCOUNTS VERIFICATION - PREMIUM ERP THEME
   Consistent with My Orders / Quotation / Deleted Quotations
   (Teal primary, clean cards, polished modals)
   Duplicates removed, all selectors consolidated.
============================================================ */

:root {
  --primary: #108082;
  --primary-dark: #0d6668;
  --primary-light: #e6f4f4;
  --teal-lt: #f0fdfa;

  --green: #16a34a;
  --green-dark: #15803d;
  --green-lt: #ecfdf5;

  --amber: #d97706;
  --amber-lt: #fffaf2;

  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-lt: #fef2f2;

  --blue: #2563eb;
  --blue-lt: #eff6ff;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 16px rgba(0, 0, 0, .07);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .18);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f4f7fb;
  color: var(--gray-900);
}

.main-content {
  padding: 25px;
}

/* ============================================================
   TOPBAR
============================================================ */

.topbar {
  background: #fff;
  padding: 20px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--primary);

  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;

  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar p {
  color: var(--gray-500);
  font-size: 13px;
  margin-top: 4px;
}

/* ============================================================
   SECTION CARD
============================================================ */

.section-card {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-card > h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.section-card > h2 i {
  color: var(--primary);
}

/* ============================================================
   FILTER BAR
============================================================ */

.order-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.filter-input,
.filter-select {
  padding: 9px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--gray-700);
  background: #fff;
  outline: none;
  height: 40px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.filter-input {
  flex: 1 1 200px;
  min-width: 160px;
}

.filter-select {
  flex: 1 1 160px;
  min-width: 150px;
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 128, 130, .12);
}

.filter-input::placeholder {
  color: var(--gray-400);
  font-size: 13px;
}

.btn-filter-search {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  transition: background .15s, transform .15s;
  white-space: nowrap;
}

.btn-filter-search:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-filter-reset {
  background: #fff;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  height: 40px;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}

.btn-filter-reset:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

/* ============================================================
   TABLE
============================================================ */

.table-wrap {
  overflow-x: auto;
  margin-top: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1.5px solid var(--gray-200);
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--primary-light);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   SELECT (status dropdown inside table)
============================================================ */

select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  font-size: 13px;
  color: var(--gray-700);
  background: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}

select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 128, 130, .12);
}

select:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
}

/* ============================================================
   BUTTONS
============================================================ */

.btn {
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: background .15s, transform .15s, opacity .15s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.success {
  background: var(--green);
  color: #fff;
}

.btn.success:hover {
  background: var(--green-dark);
}

.btn.secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn.secondary:hover {
  background: var(--gray-200);
}

/* Action cell layout */

td .btn {
  margin-right: 6px;
}

td .btn:last-child {
  margin-right: 0;
}

/* ============================================================
   BADGES (status pills in table)
============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.pending {
  background: var(--amber-lt);
  color: var(--amber);
}

.badge.confirmed {
  background: var(--green-lt);
  color: var(--green-dark);
}

.badge.partial {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge.cancelled {
  background: var(--red-lt);
  color: var(--red);
}

.badge.hold {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ============================================================
   FOOTER
============================================================ */

.footer {
  margin-top: 28px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}

/* ============================================================
   ORDER DETAILS MODAL
============================================================ */

.order-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.order-modal.show {
  display: flex;
}

.order-modal-box {
  width: 90%;
  max-width: 1300px;
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalZoom .25s ease;
}

@keyframes modalZoom {
  from {
    transform: scale(.96);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1.5px solid var(--gray-100);
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.modal-head h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-head p {
  margin-top: 4px;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 600;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.modal-close:hover {
  background: var(--gray-200);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.detail-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-card.wide {
  grid-column: span 2;
}

.detail-card.full {
  grid-column: span 4;
}

.detail-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.detail-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  word-break: break-word;
}

.amount-card {
  background: linear-gradient(135deg, var(--green-lt), #d1fae5);
  border: 1px solid #86efac;
}

.amount-card .detail-value {
  color: #047857;
  font-size: 22px;
  font-weight: 800;
}

.pdf-card {
  background: var(--blue-lt);
  border-color: #93c5fd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pdf-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}

.pdf-btn:hover {
  background: #1d4ed8;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ============================================================
   REASON HIGHLIGHT CARD
============================================================ */

.reason-highlight {
  grid-column: 1 / -1;
  background: #fff8e1;
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 14px;
  text-align: center;
}

.reason-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.reason-text {
  font-size: 15px;
  font-weight: 600;
  color: #78350f;
}

/* Payment history table inside detail-card.full */

.detail-card.full table {
  font-size: 13px;
}

.detail-card.full th {
  background: #fff;
  border-bottom: 1.5px solid var(--gray-200);
}

.detail-card.full td {
  border-bottom: 1px solid var(--gray-100);
}

/* ============================================================
   REASON MODAL (Hold / Cancel)
============================================================ */

.reason-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 16px;
}

.reason-modal.show {
  display: flex;
}

.reason-box {
  background: #fff;
  width: 100%;
  max-width: 440px;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: modalZoom .22s ease;
}

.reason-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.reason-head h2 {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-900);
}

.reason-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-100);
  border-radius: 9px;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 15px;
  transition: background .15s;
}

.reason-close:hover {
  background: var(--gray-200);
}

.reason-textarea {
  width: 100%;
  height: 100px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: var(--gray-50);
  transition: border-color .15s, box-shadow .15s;
}

.reason-textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16, 128, 130, .12);
}

.reason-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   UNLOCK MODAL
============================================================ */

.unlock-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 16px;
}

.unlock-modal.show {
  display: flex;
}

.unlock-box {
  background: #fff;
  width: 100%;
  max-width: 400px;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: modalZoom .22s ease;
  overflow: hidden;
}

.unlock-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1.5px solid var(--gray-100);
}

.unlock-head h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-900);
}

.unlock-close {
  border: none;
  background: var(--gray-100);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 15px;
  cursor: pointer;
  color: var(--gray-600);
  transition: background .15s;
}

.unlock-close:hover {
  background: var(--gray-200);
}

.unlock-body {
  padding: 20px 22px;
}

.unlock-body p {
  font-size: 13.5px;
  color: var(--gray-600);
  margin-bottom: 10px;
}

.unlock-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--gray-50);
  transition: border-color .15s, box-shadow .15s;
}

.unlock-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16, 128, 130, .12);
}

.unlock-footer {
  padding: 16px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1.5px solid var(--gray-100);
}

/* ============================================================
   SUCCESS / WARNING POPUPS
============================================================ */

#confirmSuccessPopup,
#statusWarningPopup {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  animation: fadeIn .2s ease;
}

.confirm-popup-card {
  background: #fff;
  border-radius: 18px;
  padding: 30px 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--green);
  animation: scaleIn .22s ease;
}

.confirm-popup-icon {
  font-size: 46px;
  color: var(--green);
  margin-bottom: 12px;
}

.confirm-popup-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.confirm-popup-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 20px;
}

.confirm-popup-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.confirm-popup-btn:hover {
  background: var(--primary-dark);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================
   PAYMENT MODAL (Received / Partial Received)
============================================================ */

#partialPaymentModal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

#partialPaymentModal.show {
  display: flex;
  animation: fadeIn .22s ease;
}

.payment-modal-box {
  width: 100%;
  max-width: 540px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalZoom .25s ease;
}

.payment-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 22px 0;
}

.payment-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.payment-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--teal-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.payment-icon i {
  font-size: 20px;
  color: var(--primary);
}

.payment-title-wrap h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0;
}

.payment-title-wrap p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--gray-500);
}

.payment-close-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--gray-100);
  cursor: pointer;
  font-size: 15px;
  color: var(--gray-600);
  transition: background .15s;
}

.payment-close-btn:hover {
  background: var(--gray-200);
}

.payment-modal-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Summary card (Grand Amount / Already Received) */

.payment-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--teal-lt);
  border: 1px solid #c7ede8;
  border-radius: var(--radius);
  padding: 18px;
}

.summary-item {
  flex: 1;
}

.summary-divider {
  width: 1px;
  height: 50px;
  background: #c7ede8;
  margin: 0 18px;
}

.summary-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--primary);
  margin-bottom: 8px;
}

.summary-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}

/* Input group */

.payment-input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.payment-input-wrap {
  display: flex;
  align-items: center;
  height: 52px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

.payment-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 128, 130, .12);
}

.payment-input-wrap span {
  width: 48px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.payment-input-wrap input,
#receivedAmountInput {
  flex: 1;
  border: none;
  outline: none;
  height: 100%;
  font-size: 16px;
  font-weight: 600;
  padding-right: 14px;
  font-family: inherit;
  color: var(--gray-900);
}

.payment-input-wrap input::placeholder,
#receivedAmountInput::placeholder {
  color: var(--gray-400);
  font-weight: 500;
}

/* Pending card */

.pending-card {
  background: var(--amber-lt);
  border: 1.5px solid #ffd98a;
  border-radius: var(--radius);
  padding: 16px 18px;
}

.pending-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--amber);
  margin-bottom: 8px;
}

.pending-value {
  font-size: 22px;
  font-weight: 800;
  color: #b45309;
  margin-bottom: 8px;
}

.pending-note {
  font-size: 13px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Footer */

.payment-modal-footer {
  border-top: 1.5px solid var(--gray-100);
  padding: 18px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel,
.btn-confirm {
  min-width: 120px;
  height: 46px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .15s;
}

.btn-cancel {
  background: var(--gray-100);
  color: var(--gray-900);
}

.btn-cancel:hover {
  background: var(--gray-200);
}

.btn-confirm {
  background: var(--green);
  color: #fff;
  min-width: 150px;
}

.btn-confirm:hover {
  background: var(--green-dark);
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 900px) {
  .modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-card.full,
  .detail-card.wide {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .order-filters {
    flex-direction: column;
  }

  .filter-input,
  .filter-select,
  .btn-filter-search,
  .btn-filter-reset {
    width: 100%;
    flex: none;
  }

  .btn-filter-search {
    justify-content: center;
  }

  .payment-summary-card {
    flex-direction: column;
    gap: 15px;
  }

  .summary-divider {
    width: 100%;
    height: 1px;
    margin: 0;
  }

  .payment-modal-footer {
    flex-direction: column;
  }

  .btn-cancel,
  .btn-confirm {
    width: 100%;
  }

  td .btn {
    margin-bottom: 6px;
  }
}

@media (max-width: 520px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .detail-card.full,
  .detail-card.wide {
    grid-column: span 1;
  }
}
