/* WSS ERP popups — minex-e2s k-modal language + WSS brown/navy gradient */

.modal-backdrop {
  background:
    radial-gradient(800px 420px at 50% 0%, rgba(132, 60, 11, 0.28), transparent 58%),
    radial-gradient(640px 360px at 90% 100%, rgba(32, 56, 100, 0.35), transparent 55%),
    rgba(16, 28, 48, 0.52) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-backdrop.show {
  opacity: 1 !important;
}

.modal .modal-dialog {
  max-width: 560px;
}

.modal .modal-dialog.modal-lg,
.modal .modal-dialog.modal-xl {
  max-width: 720px;
}

.modal .modal-dialog.modal-xl {
  max-width: 920px;
}

.modal .modal-dialog.modal-xl.wss-role-modal {
  max-width: min(1080px, calc(100vw - 24px));
}

.modal.fade .modal-dialog {
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-content,
.modal-content.wss-k-modal {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(231, 229, 224, 0.95) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(520px 220px at 100% 0%, rgba(132, 60, 11, 0.14), transparent 55%),
    radial-gradient(420px 200px at 0% 100%, rgba(32, 56, 100, 0.1), transparent 50%),
    #fff !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 24px 64px rgba(16, 24, 40, 0.22),
    0 8px 20px rgba(16, 24, 40, 0.1) !important;
}

.modal-content > .k-modal__glow,
.modal-content::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 16%;
  right: 16%;
  height: 90px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(132, 60, 11, 0.42),
    rgba(160, 82, 45, 0.28),
    rgba(32, 56, 100, 0.32),
    transparent
  );
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.modal-content > .k-modal__glow {
  content: none;
}

.modal-header {
  position: relative;
  z-index: 1;
  border-bottom: 0 !important;
  background: transparent !important;
  padding: 22px 24px 8px !important;
  align-items: flex-start !important;
  gap: 14px;
}

.modal-header .k-modal__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(160deg, #f6eee8 0%, #ead9cc 100%);
  border: 1px solid #d4b39a;
  color: #843c0b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.modal-header .k-modal__head-text {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.modal-header .k-modal__eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #843c0b;
  margin: 0 0 4px;
}

.modal-title {
  margin: 0 !important;
  font-family: "Outfit", system-ui, sans-serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: #141414 !important;
  line-height: 1.2 !important;
}

.modal-header .btn-close {
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0 0 0 8px;
  border-radius: 8px;
  opacity: 1;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2371717a'%3E%3Cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: none;
  flex-shrink: 0;
}

.modal-header .btn-close:hover {
  background-color: #f3f1ed;
}

.modal-body {
  position: relative;
  z-index: 1;
  padding: 16px 24px 20px !important;
  background: transparent !important;
}

.modal-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid #e7e5e0 !important;
  background: linear-gradient(180deg, #f6eee8 0%, #f4f1ed 48%, #eef1f6 100%) !important;
  padding: 14px 24px 18px !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-footer .k-modal__foot-hint {
  font-size: 12px;
  color: #a1a1aa;
  margin-right: auto;
}

.modal-footer .k-modal__foot-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.modal-footer .btn-primary,
.modal-content .btn-primary {
  background: var(--wss-primary, #843c0b) !important;
  border-color: var(--wss-primary, #843c0b) !important;
  color: #fff !important;
  box-shadow: none;
}

.modal-footer .btn-primary:hover,
.modal-content .btn-primary:hover {
  background: var(--wss-primary-deep, #6a3009) !important;
  border-color: var(--wss-primary-deep, #6a3009) !important;
  color: #fff !important;
}

.modal-footer .btn-light,
.modal-footer .btn-secondary,
.modal-footer .btn-soft-secondary {
  background: #fff !important;
  border: 1px solid #d6d3cd !important;
  color: #3f3f46 !important;
}

/* Delete / danger popups keep a warmer glow */
.modal-content:has(.btn-danger) .k-modal__icon,
.modal-content:has(.text-danger) .k-modal__icon {
  background: linear-gradient(160deg, #fee2e2 0%, #fecaca 100%);
  border-color: #f0b4b4;
  color: #dc2626;
}

.modal-content:has(.btn-danger)::before,
.modal-content:has(.btn-danger) > .k-modal__glow {
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.28), rgba(132, 60, 11, 0.25), transparent);
}

/* SweetAlert2 */
.swal2-container {
  background:
    radial-gradient(800px 420px at 50% 0%, rgba(132, 60, 11, 0.22), transparent 58%),
    rgba(16, 28, 48, 0.45) !important;
  backdrop-filter: blur(8px);
}

.swal2-popup {
  border-radius: 18px !important;
  border: 1px solid #e7e5e0 !important;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(132, 60, 11, 0.12), transparent 55%),
    #fff !important;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.22) !important;
}

.swal2-confirm.swal2-styled {
  background: var(--wss-primary, #843c0b) !important;
  border: 0 !important;
}

.offcanvas {
  border: 0 !important;
}

.offcanvas-header {
  background: linear-gradient(180deg, #f6eee8 0%, #fff 100%);
  border-bottom: 1px solid #e7e5e0;
}

@media (max-width: 576px) {
  .modal .modal-dialog {
    margin: 12px;
    max-width: calc(100% - 24px);
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer .k-modal__foot-actions {
    width: 100%;
    margin-left: 0;
  }

  .modal-footer .k-modal__foot-actions .btn {
    flex: 1;
  }
}

.modal-header .k-modal__head-text .text-muted {
  margin: 4px 0 0 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #71717a !important;
}

/* Notes thread: keep chat body flush; header uses the shared k-modal header */
#leadNotesModal .modal-body {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#leadDocumentsUploadWrap {
  border-top: 0 !important;
}

#leadDocumentsList .table-responsive,
#leadDocumentsList.wss-lead-docs-table,
.wss-lead-docs-table {
  overflow-x: auto;
  max-width: 100%;
}

#leadDocumentsList table,
#leadDocumentsList th,
#leadDocumentsList td,
.wss-lead-docs-table table,
.wss-lead-docs-table th,
.wss-lead-docs-table td {
  white-space: nowrap !important;
}

.wss-quo-lines {
  border: 1px solid #eceae6;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.wss-quo-lines__head,
.wss-quo-line {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 72px 118px 118px 36px;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 14px;
}

.wss-quo-lines__head {
  align-items: center;
  background: #f7f4f1;
  border-bottom: 1px solid #eceae6;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #71717a;
}

.wss-quo-lines__head .is-end,
.wss-quo-line-total {
  text-align: right;
}

.wss-quo-line {
  border-bottom: 1px solid #f1efec;
  background: #fff;
}

.wss-quo-line:nth-child(even) {
  background: #fcfbfa;
}

.wss-quo-line__item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.wss-quo-line__item .form-select,
.wss-quo-line .wss-quo-qty,
.wss-quo-line .wss-quo-unit {
  height: 36px !important;
  min-height: 36px;
  box-sizing: border-box;
  border-color: #e7e5e0;
  font-size: 13px;
  padding-top: 0;
  padding-bottom: 0;
}

.wss-quo-sku-label {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f4efe9;
  color: #843c0b;
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1;
}

.wss-quo-sku-label.is-empty {
  background: #f4f4f5;
  color: #a1a1aa;
}

.wss-quo-line .form-control {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wss-quo-line-total,
.wss-quo-remove-line {
  height: 36px;
  display: flex;
  align-items: center;
}

.wss-quo-line-total {
  justify-content: flex-end;
  font-weight: 700;
  color: #203864;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.wss-quo-remove-line {
  width: 36px;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a1a1aa;
}

.wss-quo-remove-line:hover {
  background: #fef2f2;
  color: #dc2626;
}

.wss-quo-lines__add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-top: 1px dashed #e7e5e0;
  background: #fff;
  color: #843c0b;
  font-size: 13px;
  font-weight: 650;
  padding: 11px 14px;
}

.wss-quo-lines__add:hover {
  background: #faf6f2;
}

.wss-quo-lines__foot {
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px 16px;
  background: #faf8f6;
  border-top: 1px solid #eceae6;
}

.wss-quo-summary {
  width: 280px;
  max-width: 100%;
}

.wss-quo-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: #52525b;
  padding: 4px 0;
}

.wss-quo-summary-row strong {
  font-variant-numeric: tabular-nums;
  color: #141414;
}

.wss-quo-discount-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wss-quo-discount-field input {
  width: 72px;
  height: 32px;
  text-align: right;
  font-size: 13px;
}

.wss-quo-summary-row.is-total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #e7e5e0;
  font-weight: 700;
  color: #843c0b;
}

.wss-quo-summary-row.is-total strong {
  font-size: 16px;
  color: #843c0b;
}

@media (max-width: 700px) {
  .wss-quo-lines__head {
    display: none;
  }

  .wss-quo-line {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "item item"
      "qty rate"
      "amt act";
  }

  .wss-quo-line__item { grid-area: item; }
  .wss-quo-qty { grid-area: qty; }
  .wss-quo-unit { grid-area: rate; }
  .wss-quo-line-total { grid-area: amt; text-align: left; }
  .wss-quo-remove-line { grid-area: act; justify-self: end; }
}

