/* Data integration DI-2a: the 12 Nov design's assets/css/data-integration-import-quick.css
 * (assetsUI/data-integration-12-11-2026), unchanged except that every selector not of the page's
 * own (.iq-*) is scoped under :where(.iq-page), the page's root, so it can't reach other pages
 * (the modal, drawer, check and .layout-import rules). :where() adds no specificity. */
/* ==========================================================================
   QUICK IMPORT 3-STEP WIZARD (assets/css/data-integration-import-quick.css)
   --------------------------------------------------------------------------
   - Reuses CRM components, custom-select, modal drawers, and utilities.css
   - 100% theme variable driven (zero hardcoded colors)
   - Matches CRM design aesthetics and pages
   ========================================================================== */

.layout-import:where(.iq-page) {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.layout-import:where(.iq-page) .auth {
  padding: 0;
  margin: 0;
  max-width: 100%;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.layout-import:where(.iq-page) .auth__theme {
  display: none !important;
}

.iq-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* ------------------------------------------------------------- Header ---- */
.iq-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--sp-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.iq-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.iq-header__brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand);
}

.iq-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* ----------------------------------------------------------- Main App ---- */
.iq-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: var(--sp-8) 0 var(--sp-12);
}

.iq-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* Step Views switching */
.iq-step-view {
  display: none;
}

.iq-step-view.is-active {
  display: block;
  animation: iqFadeIn var(--fast) var(--ease);
}

@keyframes iqFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------- Step 1 (Upload File) ---- */
.iq-step1-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: var(--sp-10);
  align-items: start;
}

.iq-step-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

.iq-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 var(--sp-3) 0;
}

.iq-subtitle {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 var(--sp-3) 0;
}

.iq-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: baseline;
  transition: color var(--fast) var(--ease);
}

.iq-link:hover {
  text-decoration: underline;
  color: var(--brand-hover);
}

.iq-action-link-wrap {
  margin-bottom: var(--sp-5);
}

/* Upload Dropzone */
.iq-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-5);
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    border-color var(--fast) var(--ease),
    background-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.iq-dropzone:hover,
.iq-dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.iq-dropzone__icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--fast) var(--ease);
}

.iq-dropzone:hover .iq-dropzone__icon {
  transform: translateY(-2px);
}

.iq-dropzone__body {
  flex: 1 1 auto;
  min-width: 0;
}

.iq-dropzone__text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

.iq-dropzone__btn-text {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* File Selected Preview Card */
.iq-file-preview {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: var(--sp-4);
}

.iq-file-preview.is-visible {
  display: flex;
}

.iq-file-preview__info {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.iq-file-preview__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--success-bg);
  color: var(--success);
  flex-shrink: 0;
}

.iq-file-preview__details {
  min-width: 0;
}

.iq-file-preview__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.iq-file-preview__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.iq-file-preview__delete {
  color: var(--text-muted);
}

.iq-file-preview__delete:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Form Controls */
.iq-field {
  margin-top: var(--sp-6);
}

.iq-field__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-1);
}

.iq-field__hint {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.iq-w-100 {
  width: 100%;
}
.iq-max-w-480 {
  max-width: 480px;
}

/* Callout Box */
.iq-callout {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.iq-callout__icon {
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------------------------------------------------- Right Sidebar (Step 1) ---- */
.iq-sidebar {
  padding: var(--sp-6);
}

.iq-sidebar__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--sp-4) 0;
}

.iq-accordion {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.iq-accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  overflow: hidden;
  transition:
    border-color var(--fast) var(--ease),
    background-color var(--fast) var(--ease);
}

.iq-accordion-item.is-open {
  border-color: var(--border-strong);
  background: var(--surface);
}

.iq-accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.iq-accordion-trigger__left {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.iq-accordion-chevron {
  color: var(--text-muted);
  transition: transform var(--fast) var(--ease);
  flex-shrink: 0;
}

.iq-accordion-item.is-open .iq-accordion-chevron {
  transform: rotate(90deg);
}

.iq-accordion-content {
  display: none;
  padding: 0 var(--sp-4) var(--sp-4);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.iq-accordion-item.is-open .iq-accordion-content {
  display: block;
}

.iq-accordion-content p {
  margin: 0 0 var(--sp-3) 0;
}

/* ---------------------------------------------------- Step 2 (Mapping) ---- */
.iq-mapping-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
}

.iq-status-filter-wrapper {
  min-width: 220px;
}

.iq-clear-filters-btn {
  color: var(--brand);
  font-weight: 600;
}

/* Search Box Component */
.iq-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 260px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  box-sizing: border-box;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.iq-search-box:focus-within {
  border-color: var(--brand);
}

.iq-search-box svg,
.iq-search-box .icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex: 0 0 16px !important;
  color: var(--text-muted);
  display: block;
}

.iq-search-box input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  padding: 0 0 0 8px !important;
  width: 100% !important;
  height: 100% !important;
  font: inherit !important;
  font-size: 13.5px !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.iq-search-box input::placeholder {
  color: var(--text-muted);
}

.iq-table-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.iq-table-responsive {
  width: 100%;
  overflow-x: visible;
}

@media (max-width: 991px) {
  .iq-table-responsive {
    overflow-x: auto;
  }
}

.iq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.iq-table th {
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

.iq-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.iq-table tr:last-child td {
  border-bottom: none;
}

.iq-table tr:hover td {
  background: var(--surface-hover);
}

/* Preview Information Cell & Hover Overlap Button */
.iq-preview-cell {
  position: relative;
  min-width: 220px;
  vertical-align: middle;
}

.iq-preview-list {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  transition: opacity var(--fast) var(--ease);
}

.iq-preview-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}

.iq-edit-col-btn {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  z-index: 5;
  cursor: pointer;
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.iq-edit-col-btn:active {
  transform: translateY(-50%);
}

.iq-edit-col-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.iq-edit-col-btn:hover {
  background: var(--surface-hover);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--shadow-lg);
}

.iq-table tr:hover .iq-edit-col-btn,
.iq-preview-cell:hover .iq-edit-col-btn {
  display: inline-flex;
}

.iq-table tr:hover .iq-preview-list,
.iq-preview-cell:hover .iq-preview-list {
  opacity: 0.35;
}

/* Status Badges & Alignment */
.iq-status-cell {
  text-align: center;
  vertical-align: middle;
  min-width: 80px;
}

.iq-status-dot {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  vertical-align: middle;
}

.iq-status-dot svg {
  width: 13px;
  height: 13px;
  display: block;
}

.iq-status-dot--success {
  background: var(--success);
  color: var(--brand-contrast, #ffffff);
}

.iq-status-dot--warning {
  background: var(--warning);
  color: var(--brand-contrast, #ffffff);
}

.iq-status-dot--muted {
  background: var(--surface-3);
  color: var(--text-muted);
}

.iq-error-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--warning);
  margin-top: 4px;
  cursor: pointer;
  background: var(--warning-bg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  transition: transform var(--fast) var(--ease);
}

.iq-error-badge:hover {
  transform: scale(1.05);
}

/* Mapping Toolbar Dropdown & Search */
.iq-status-filter-wrapper {
  position: relative;
  min-width: 210px;
}

.iq-status-filter-wrapper .custom-select__trigger {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.iq-status-filter-wrapper .custom-select__trigger:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.iq-status-filter-wrapper.is-open .custom-select__trigger {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.iq-status-filter-wrapper .custom-select__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: none;
  flex-direction: column;
  animation: pop var(--fast) var(--ease);
}

.iq-status-filter-wrapper.is-open .custom-select__dropdown {
  display: flex;
}

.iq-status-filter-wrapper .custom-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.iq-status-filter-wrapper .custom-select__option:hover {
  background: var(--surface-hover);
}

.iq-status-filter-wrapper .custom-select__option.is-selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

/* Table Row Stacking & Dropdown Wrappers */
tr.iq-map-row {
  position: relative;
}

tr.iq-map-row.is-active-row,
tr.iq-map-row:has(.custom-select-wrapper.is-open) {
  position: relative;
  z-index: 60;
}

.iq-table .custom-select-wrapper {
  position: relative;
  width: 100%;
  min-width: 185px;
  max-width: 240px;
}

.iq-table .custom-select__trigger,
.iq-table-select-trigger {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease),
    background-color var(--fast) var(--ease);
}

.iq-table .custom-select__trigger:hover,
.iq-table-select-trigger:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.iq-table .custom-select-wrapper.is-open > .custom-select__trigger,
.iq-table .custom-select-wrapper.is-open > .iq-table-select-trigger {
  border-color: var(--brand) !important;
  box-shadow: var(--focus-ring) !important;
}

.iq-table .custom-select__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: pop var(--fast) var(--ease);
}

.iq-table .custom-select-wrapper.is-open > .custom-select__dropdown {
  display: flex !important;
}

.iq-table .custom-select__option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.iq-table .custom-select__option:hover {
  background: var(--surface-hover);
}

.iq-table .custom-select__option.is-selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

/* Property Menu Panel */
.iq-property-menu {
  width: 290px;
  right: 0;
  left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.iq-property-menu .custom-select__search {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.iq-property-menu .iq-prop-search-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.iq-property-menu .iq-prop-search-input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.iq-property-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.iq-property-group-title {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.iq-property-menu .custom-select__option {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.iq-property-menu .custom-select__option:hover {
  background: var(--surface-hover);
}

.iq-property-menu .custom-select__option.is-selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.iq-property-create-btn {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: none;
  border-top: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--fast) var(--ease);
}

.iq-property-create-btn:hover {
  background: var(--brand-soft);
}

/* ==========================================================================
   PROPERTY HOVER POPOVER (Fixed dead-zone & bridge for seamless hover)
   ========================================================================== */
.iq-prop-wrapper {
  position: relative;
}

.iq-property-popover {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  z-index: 1300 !important;
  width: 290px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  display: none;
  pointer-events: auto !important; /* Fully clickable and interactive */
  animation: pop var(--fast) var(--ease);
}

/* Invisible bridge spanning gap between trigger and popover so mouseover persists */
.iq-property-popover::before {
  content: "";
  position: absolute;
  top: -16px;
  bottom: -16px;
  left: 100%;
  width: 24px;
  background: transparent;
  pointer-events: auto;
}

/* Small arrow indicator pointing right to trigger */
.iq-property-popover::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  margin-top: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent transparent var(--border);
}

.iq-property-popover.is-hovered {
  display: block !important;
}

.iq-popover-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
}

.iq-popover-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0 0 10px 0;
}

.iq-popover-meta-row {
  margin-bottom: 8px;
  font-size: 12.5px;
}

.iq-popover-meta-lbl {
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.iq-popover-meta-val {
  color: var(--text);
  font-weight: 500;
}

.iq-popover-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: none;
  border: none;
  padding: 0;
  text-decoration: none;
  display: inline-block;
  margin-top: 6px;
  cursor: pointer;
  text-align: left;
}

.iq-popover-link:hover {
  text-decoration: underline;
  color: var(--brand-hover);
}

/* Empty State */
.iq-empty-state {
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.iq-empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
}

.iq-empty-state__text {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 0 var(--sp-4) 0;
}

/* ---------------------------------------------------- Step 3 (Review / Finalize) ---- */
.iq-step3-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: var(--sp-10);
  align-items: start;
  margin-top: var(--sp-6);
}

.iq-input-lg {
  height: 44px;
  font-size: 15px;
}

.iq-ready-card {
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
}

.iq-ready-card__art {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-5);
}

.iq-ready-svg {
  width: 140px;
  height: auto;
}

.iq-ready-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--sp-2) 0;
}

.iq-ready-card__desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Step 3 Date Format & Number Format Custom Dropdown Styling */
.iq-custom-select__options--stacked .custom-select__option {
  padding: 10px 14px;
}

.iq-format-opt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.iq-format-opt__title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.iq-format-opt__sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.iq-custom-select__options--scrollable {
  max-height: 220px;
  overflow-y: auto;
}

.iq-select-search-pill {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.iq-select-search-pill input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.iq-select-search-pill input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.iq-select-search-icon {
  position: absolute;
  left: 22px;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
}

/* ---------------------------------------------------- Right Drawers & Modals ---- */
:where(.iq-page) .modal-backdrop:not(.is-open),
:where(.iq-page) .modal-backdrop--drawer:not(.is-open),
:where(.iq-page) .sidedrawer:not(.is-open) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

:where(.iq-page) .modal-backdrop.is-open,
:where(.iq-page) .modal-backdrop--drawer.is-open,
:where(.iq-page) .sidedrawer.is-open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Reusable Sidedrawer Backdrop */
:where(.iq-page) .sidedrawer,
:where(.iq-page) .modal-backdrop--drawer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 1100;
  transition:
    opacity 0.25s var(--ease),
    visibility 0.25s var(--ease);
}

/* Reusable Sidedrawer Panel */
:where(.iq-page) .sidedrawer__panel,
:where(.iq-page) .modal-backdrop--drawer .modal {
  width: min(560px, 100vw);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0 !important;
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  transform: translateX(40px);
  transition: transform 0.25s var(--ease);
  display: flex;
  flex-direction: column;
}

:where(.iq-page) .sidedrawer.is-open .sidedrawer__panel,
:where(.iq-page) .modal-backdrop--drawer.is-open .modal {
  transform: none;
}

/* Reusable Sidedrawer Header */
:where(.iq-page) .sidedrawer__header,
:where(.iq-page) .modal-backdrop--drawer .modal__header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  background: var(--surface);
  flex-shrink: 0;
}

:where(.iq-page) .sidedrawer__title,
:where(.iq-page) .modal-backdrop--drawer .modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Reusable Sidedrawer Close Button */
:where(.iq-page) .drawer-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--gray-bg);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  flex: 0 0 38px;
  padding: 0;
}

:where(.iq-page) .drawer-close:hover {
  background: var(--gray);
  color: var(--surface);
  transform: rotate(90deg);
}

:where(.iq-page) .drawer-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Reusable Sidedrawer Body */
:where(.iq-page) .sidedrawer__body,
:where(.iq-page) .modal-backdrop--drawer .modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--sp-6);
}

/* Reusable Sidedrawer Footer */
:where(.iq-page) .sidedrawer__footer,
:where(.iq-page) .modal-backdrop--drawer .modal__footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-6);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  background: var(--surface);
  flex-shrink: 0;
}

/* Reusable Sidedrawer Sections */
:where(.iq-page) .sidedrawer__section,
.iq-drawer-section {
  margin-bottom: var(--sp-6);
}

:where(.iq-page) .sidedrawer__section:last-child,
.iq-drawer-section:last-child {
  margin-bottom: 0;
}

:where(.iq-page) .sidedrawer__section-title,
.iq-drawer-section__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--sp-3) 0;
}

/* Reusable Custom Select in Sidedrawers & Step 3 */
/* Reusable Custom Select (Consistent with page, table, Step 3, & drawer dropdowns) */
:where(.iq-page) .sidedrawer .custom-select-wrapper,
:where(.iq-page) .modal-backdrop--drawer .custom-select-wrapper,
.iq-step3-main .custom-select-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

:where(.iq-page) .sidedrawer .custom-select__trigger,
:where(.iq-page) .modal-backdrop--drawer .custom-select__trigger,
.iq-step3-main .custom-select__trigger {
  width: 100%;
  height: 44px;
  min-height: 36px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease),
    background-color var(--fast) var(--ease);
}

:where(.iq-page) .sidedrawer .custom-select__trigger:hover,
:where(.iq-page) .modal-backdrop--drawer .custom-select__trigger:hover,
.iq-step3-main .custom-select__trigger:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

:where(.iq-page) .sidedrawer .custom-select-wrapper.is-open > .custom-select__trigger,
:where(.iq-page) .modal-backdrop--drawer
  .custom-select-wrapper.is-open
  > .custom-select__trigger,
.iq-step3-main .custom-select-wrapper.is-open > .custom-select__trigger {
  border-color: var(--brand) !important;
  background: var(--surface);
}

:where(.iq-page) .sidedrawer .custom-select__icon,
:where(.iq-page) .modal-backdrop--drawer .custom-select__icon,
.iq-step3-main .custom-select__icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--fast) var(--ease);
}

:where(.iq-page) .sidedrawer
  .custom-select-wrapper.is-open
  > .custom-select__trigger
  .custom-select__icon,
:where(.iq-page) .modal-backdrop--drawer
  .custom-select-wrapper.is-open
  > .custom-select__trigger
  .custom-select__icon,
.iq-step3-main
  .custom-select-wrapper.is-open
  > .custom-select__trigger
  .custom-select__icon {
  transform: rotate(180deg);
}

:where(.iq-page) .sidedrawer .custom-select__dropdown,
:where(.iq-page) .modal-backdrop--drawer .custom-select__dropdown,
.iq-step3-main .custom-select__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 100%;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1250;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  animation: pop var(--fast) var(--ease);
}

:where(.iq-page) .sidedrawer .custom-select-wrapper.is-open > .custom-select__dropdown,
:where(.iq-page) .modal-backdrop--drawer
  .custom-select-wrapper.is-open
  > .custom-select__dropdown,
.iq-step3-main .custom-select-wrapper.is-open > .custom-select__dropdown {
  display: flex !important;
}

:where(.iq-page) .sidedrawer .custom-select__options,
:where(.iq-page) .modal-backdrop--drawer .custom-select__options,
.iq-step3-main .custom-select__options {
  max-height: 220px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

:where(.iq-page) .sidedrawer .custom-select__option,
:where(.iq-page) .modal-backdrop--drawer .custom-select__option,
.iq-step3-main .custom-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

:where(.iq-page) .sidedrawer .custom-select__option:hover,
:where(.iq-page) .modal-backdrop--drawer .custom-select__option:hover,
.iq-step3-main .custom-select__option:hover {
  background: var(--surface-hover);
}

:where(.iq-page) .sidedrawer .custom-select__option.is-selected,
:where(.iq-page) .modal-backdrop--drawer .custom-select__option.is-selected,
.iq-step3-main .custom-select__option.is-selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

/* Bulk Table Replacement */
.iq-bulk-table-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

.iq-bulk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.iq-bulk-col {
  flex: 1 1 0%;
  min-width: 0;
}

.iq-bulk-rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.iq-bulk-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.iq-bulk-row .input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.iq-bulk-row .input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.iq-bulk-arrow {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 var(--sp-1);
  margin-top: 6px;
  line-height: 24px;
}

.iq-bulk-row-remove {
  flex: 0 0 auto;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.iq-bulk-row-remove:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Radio variant using design system check structure */
:where(.iq-page) .check--radio .check__box {
  border-radius: 50%;
}

:where(.iq-page) .check--radio .check__box::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-contrast);
  border: none;
  transform: scale(0);
  transition: transform var(--fast) var(--ease);
}

:where(.iq-page) .check--radio input:checked + .check__box::after {
  transform: scale(1);
}

/* Error Alert Box in Fix Drawer */
.iq-error-box {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

.iq-error-box__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.iq-error-box__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.iq-error-box__desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

.iq-table--sm th,
.iq-table--sm td {
  padding: 8px 12px;
  font-size: 12.5px;
}

/* Tab Bar inside Drawer */
.iq-tab-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--sp-2);
}

.iq-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.iq-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.iq-tab.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

/* Property Details rows */
.iq-detail-rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.iq-detail-row {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--sp-3);
}

.iq-detail-row:last-child {
  border-bottom: none;
}

.iq-detail-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.iq-detail-value {
  font-size: 14px;
  color: var(--text);
}

/* ------------------------------------------------------------ Footer ---- */
.iq-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px !important;
  padding: 0 var(--sp-6);
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 10px;
}

.iq-footer__left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.iq-footer__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
}

.iq-footer-unmapped {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.iq-footer-unmapped__text {
  font-size: 13.5px;
  color: var(--text);
}

.iq-footer-tip {
  font-size: 13px;
  color: var(--text-muted);
}

.iq-tip-hidden {
  display: none !important;
}

.iq-border-top {
  border-top: 1px solid var(--border);
}

.iq-cursor-pointer {
  cursor: pointer;
}

.iq-check-align {
  margin-top: 3px;
}

.iq-req-list {
  line-height: 1.6;
  padding-left: 20px;
}

.iq-paste-textarea {
  height: 140px;
  padding: 10px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
}

/* -------------------------------------------------------- Responsive ---- */
@media (max-width: 767px) {
  .iq-step1-grid,
  .iq-step3-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .iq-sidebar,
  .iq-step3-sidebar {
    order: 2;
  }
}

@media (max-width: 640px) {
  .iq-header,
  .iq-footer {
    padding: 0 var(--sp-4);
  }

  .iq-container {
    padding: 0 var(--sp-4);
  }

  .iq-title {
    font-size: 22px;
  }

  .iq-mapping-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .iq-search-box {
    width: 100%;
  }

  .iq-status-filter-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .iq-footer-unmapped {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}

/* DI-2a fix (not in the design): the Create property drawer wraps its header, body and footer in
   a stage (#iqScanningStage, #iqCreatePropStage), so the panel's flex column (.sidedrawer__panel)
   never reached its body and the footer fell below a short window (Create property at 737px of 666).
   The shown stage is the same flex column, so the body scrolls and the footer stays in view. */
:where(.iq-page) #iqScanningStage:not([hidden]),
:where(.iq-page) #iqCreatePropStage:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
/* end DI-2a fix */

/* QA 18 Nov (#743): at narrow widths a mapping dropdown's label ends with an ellipsis instead of
   being cut mid-word; the full label is the trigger's tooltip. */
.iq-table-select-trigger { min-width: 0; overflow: hidden; }
.iq-table-select-trigger > .custom-select__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.iq-table-select-trigger > .custom-select__value > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iq-table-select-trigger > svg, .iq-table-select-trigger > .custom-select__icon { flex: none; }
