
.mapping-modal {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 17, 43, 0.38);
}

.mapping-modal.hidden {
  display: none;
}

.mapping-modal-card {
  width: min(560px, calc(100vw - 40px));
  max-height: min(640px, calc(100vh - 48px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(6, 17, 43, 0.24);
}

.mapping-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.mapping-modal-header h3 {
  margin: 4px 0 0;
}

.mapping-modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.mapping-panel.active {
  display: grid;
  gap: 12px;
}

.mapping-panel h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.mapping-panel.active {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.mapping-panel label {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
}

.mapping-panel .mapping-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1.1fr);
  gap: 12px;
  align-items: center;
}

.mapping-panel .mapping-row-header {
  padding: 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mapping-panel .mapping-row-field {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.mapping-panel select {
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 9;
  background: #eef4ff;
  font-weight: 900;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-tools {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.table-tools input,
.table-tools select {
  width: min(210px, 100%);
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
}

.th-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.th-menu-button {
  min-height: 18px;
  width: 19px;
  padding: 0 0 2px;
  border-radius: 5px;
  background: #eef4ff;
  color: #1f64ff;
  font-size: 11px;
  line-height: 1;
}

.th-menu {
  position: absolute;
  display: none;
  min-width: 124px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(7, 27, 52, 0.14);
  z-index: 30;
}

.th-menu.active { display: grid; gap: 5px; }
.th-menu button {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  text-align: left;
}

.th-menu input {
  width: 128px;
  min-height: 26px;
  padding: 4px 6px;
  border-radius: 7px;
  font-size: 10px;
}

.editable-table input {
  width: 100%;
  min-width: 150px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  font: inherit;
}

.editable-table input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.radio-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.radio-row label {
  display: flex;
  min-width: 86px;
  min-height: 30px;
  justify-content: center;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: #334155;
}

.radio-row input[type="radio"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--primary);
}
