.excel-import-modal {
  width: min(1080px, calc(100vw - 48px));
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
}

.excel-import-modal .modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.excel-import-body {
  max-height: calc(90vh - 128px);
  padding: 12px 16px;
  overflow: auto;
  background: #f7f9fb;
}

.import-section {
  margin-bottom: 10px;
  padding: 11px 12px;
  border: 1px solid #d9e1e8;
  border-radius: 7px;
  background: #fff;
}

.import-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.import-section-title strong {
  color: #243746;
  font-size: 14px;
}

.import-file-row,
.import-sheet-controls {
  display: flex;
  align-items: end;
  gap: 9px;
}

.import-file-row input[type="file"] {
  max-width: 520px;
}

.import-sheet-controls label {
  display: grid;
  gap: 4px;
}

.import-sheet-controls label:first-child {
  flex: 1 1 360px;
}

.import-sheet-controls input,
.import-sheet-controls select {
  min-height: 32px;
}

#importExcelHeaderRow,
#excelImportHeaderRow {
  width: 90px;
}

.import-mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
}

.import-mapping-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.import-mapping-grid select {
  width: 100%;
  min-height: 31px;
}

.import-preview-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.import-preview-summary {
  color: #566775;
  font-size: 12px;
  white-space: nowrap;
}

.import-preview-summary strong {
  color: #253746;
  font-variant-numeric: tabular-nums;
}

.import-preview-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #d9e1e8;
  border-radius: 6px;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.import-preview-table th,
.import-preview-table td {
  padding: 5px 7px;
  border-bottom: 1px solid #e3e8ed;
  color: #30404d;
  font-size: 11.5px;
  line-height: 1.25;
  vertical-align: top;
}

.import-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf2f6;
  color: #51606c;
  font-size: 10.5px;
  text-align: left;
}

.import-preview-table th:nth-child(1),
.import-preview-table td:nth-child(1) { width: 52px; }
.import-preview-table th:nth-child(2),
.import-preview-table td:nth-child(2) { width: 88px; }
.import-preview-table th:nth-child(3),
.import-preview-table td:nth-child(3) { width: 92px; }
.import-preview-table th:nth-child(4),
.import-preview-table td:nth-child(4) { width: 58px; }
.import-preview-table th:nth-child(5),
.import-preview-table td:nth-child(5) { width: 110px; }
.import-preview-table th:nth-child(7),
.import-preview-table td:nth-child(7) { width: 86px; }
.import-preview-table th:nth-child(8),
.import-preview-table td:nth-child(8) { width: 150px; }

.import-preview-table td.summary {
  overflow-wrap: anywhere;
}

.import-preview-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.import-preview-table tr.import-status-error td,
.import-preview-table tr.import-status-locked td {
  background: #fff9f8;
}

.import-preview-table tr.import-status-duplicate td {
  background: #fafbfc;
  color: #75818b;
}

.import-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #edf1f4;
  color: #5c6872;
  font-size: 10px;
  white-space: nowrap;
}

.import-status-badge.ready {
  background: #e7f4eb;
  color: #297044;
}

.import-status-badge.duplicate {
  background: #edf0f2;
  color: #64717b;
}

.import-status-badge.locked,
.import-status-badge.error {
  background: #f9e7e5;
  color: #a34540;
}

.import-preview-table td small {
  display: block;
  margin-top: 3px;
  color: inherit;
  font-size: 9.5px;
  line-height: 1.25;
}

.excel-import-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
}

.import-footer-message {
  flex: 1 1 auto;
  margin-right: auto;
}

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