/* ConfirmDialog — native <dialog> */
.confirm-dialog {
  border: none;
  border-radius: var(--radius-lg, 12px);
  padding: 0;
  max-width: 420px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.25));
  background: var(--bg-canvas, #fff);
  color: var(--text-primary, #111);
}

.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.confirm-dialog__inner {
  padding: var(--space-6, 1.5rem);
  margin: 0;
}

.confirm-dialog__title {
  margin: 0 0 var(--space-2, 0.5rem);
  font-size: var(--text-lg, 1.125rem);
  font-weight: 600;
  color: var(--text-primary, #111);
}

.confirm-dialog__message {
  margin: 0 0 var(--space-5, 1.25rem);
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
}

.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2, 0.5rem);
}

html[data-shell="light"] .confirm-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 420px;
  width: calc(100% - var(--space-8));
  box-shadow: var(--shadow-lg);
  background: var(--bg-canvas);
}

html[data-shell="light"] .confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

html[data-shell="light"] .confirm-dialog__inner {
  padding: var(--space-6);
  margin: 0;
}

html[data-shell="light"] .confirm-dialog__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

html[data-shell="light"] .confirm-dialog__message {
  margin: 0 0 var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

html[data-shell="light"] .confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* Employee import wizard (Contatti HR) */
.import-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.import-modal-card.import-wizard__dialog {
  max-width: 760px;
  width: 100%;
  max-height: 92vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}

html[data-shell="light"] .import-wizard__header {
  flex-shrink: 0;
  padding: 20px 32px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.import-wizard__stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  flex-wrap: wrap;
}

.import-wizard__step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
}

.import-wizard__step:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: #e2e8f0;
  margin-left: 4px;
}

.import-wizard__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.import-wizard__step.is-active {
  color: #7c3aed;
}

.import-wizard__step.is-active .import-wizard__step-num {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.import-wizard__step.is-done {
  color: #475569;
}

.import-wizard__step.is-done .import-wizard__step-num {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #7c3aed;
}

.import-wizard__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.import-wizard__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.import-wizard__subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: #475569;
  line-height: 1.45;
  max-width: 520px;
}

.import-wizard__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.import-wizard__chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
}

.import-wizard__chip--ok {
  background: #ecfdf5;
  color: #047857;
}

html[data-shell="light"] .import-wizard__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.import-wizard__close:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.import-wizard__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8b5cf6;
}

.import-wizard__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  min-height: 0;
}

html[data-shell="light"] .import-wizard__footer {
  flex-shrink: 0;
  padding: 16px 32px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 -1px 0 #e2e8f0;
}

.import-wizard__footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.import-wizard__footer-inner--upload {
  justify-content: flex-end;
}

.import-wizard__btn-back {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.import-wizard__btn-back:hover {
  background: #f8fafc;
}

.import-wizard__cta {
  min-width: 200px;
  max-width: 320px;
  margin-left: auto;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
}

.import-wizard__cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.import-wizard__cta.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.import-wizard__field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}

.import-wizard__map-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}

.import-wizard__status {
  font-size: 12px;
  color: #64748b;
  margin: 12px 0 0;
  min-height: 1.2em;
}

.import-dropzone {
  display: block;
  padding: 28px 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  color: #475569;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
}

.import-dropzone__hint {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

.import-dropzone:hover {
  border-color: #8b5cf6;
  background: #f5f3ff;
}

.import-wizard__paste {
  margin-top: 16px;
}

.import-mapping-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.import-mapping-section__title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.import-mapping-section__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

@media (max-width: 640px) {
  .import-mapping-section__grid {
    grid-template-columns: 1fr;
  }
  .import-wizard__header,
  .import-wizard__body,
  .import-wizard__footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

.import-map-row {
  min-width: 0;
}

.import-map-row .import-wizard__field-label {
  margin-bottom: 6px;
}

.import-wizard__select,
.import-map-row select {
  width: 100%;
  max-width: 100%;
  padding: 8px 32px 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.import-map-row.is-ignored .import-wizard__select,
.import-map-row.is-ignored select {
  border: 1px dashed #e2e8f0;
  color: #94a3b8;
  background: #f8fafc;
}

.import-map-row.is-mapped .import-wizard__select,
.import-map-row.is-mapped select {
  border-color: #cbd5e1;
  color: #0f172a;
}

.import-wizard__options {
  margin-bottom: 20px;
  padding-top: 4px;
}

.import-wizard__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  margin-bottom: 4px;
}

.import-wizard__option:hover {
  background: #f8fafc;
}

.import-wizard__option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.4;
}

.import-wizard__option small {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
}

.import-wizard input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 2px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.import-wizard input[type="checkbox"]:checked {
  background-color: #7c3aed;
  border-color: #7c3aed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 6l3 3 5-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.import-wizard input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8b5cf6;
}

.import-preview-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.import-preview__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
}

.import-preview__label {
  font-weight: 600;
  color: #475569;
}

.import-preview__range {
  color: #64748b;
}

.import-preview__scroll {
  max-height: 220px;
  overflow: auto;
}

.import-preview-table {
  width: 100%;
  font-size: 12px;
  margin: 0;
  border-collapse: collapse;
}

.import-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.import-preview-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-preview-table tbody tr:nth-child(even) td {
  background: #fafafb;
}

.import-preview-table td.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  max-width: 48px;
}

.import-preview-table td.col-email {
  max-width: 180px;
}

.import-preview-table tbody tr.import-preview-row--invalid td {
  opacity: 0.55;
}

.import-wizard__matricola-help {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 12px;
}

.import-wizard__warn {
  font-size: 13px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
}

.import-map-row--required .import-wizard__field-label::after {
  content: ' *';
  color: #ef4444;
}

.import-rejected-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: #64748b;
  max-height: 200px;
  overflow: auto;
}

.import-result-summary {
  font-size: 14px;
  line-height: 1.6;
  color: #0f172a;
}

.nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  background: #fef2f2;
  color: #dc2626;
  vertical-align: middle;
}
