/* setupwizard.css - all styles scoped under .sw-* */

/* Overlay */
.sw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Modal shell - fixed size */
.sw-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  width: min(1375px, calc(100vw - 32px));
  height: min(920px, calc(100vh - 24px));
  overflow: hidden;
}

/* Header */
.sw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: #fff;
}

.sw-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-blue);
  letter-spacing: -0.01em;
}

.sw-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.sw-close-btn:hover {
  color: #333;
  background: var(--bg-light);
}

/* Body */
.sw-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Sidebar */
.sw-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  background: var(--bg-light);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-phase {
  padding: 0 0 4px;
}

.sw-phase-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.sw-phase-active .sw-phase-label {
  color: var(--navy-blue);
}

.sw-phase-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sw-phase-active .sw-phase-icon {
  color: var(--fiserv-orange);
}

.sw-phase-steps {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sw-step-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 7px 16px 7px 30px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  line-height: 1.3;
}

.sw-step-btn:hover {
  background: #eceef0;
  color: var(--navy-blue);
}

.sw-step-btn.sw-step-active {
  background: #fff;
  color: var(--fiserv-orange);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--fiserv-orange);
}

.sw-step-btn-label {
  flex: 1;
}

/* Counts */
.sw-count {
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.sw-count-loading {
  color: #ccc;
}

.sw-count-zero {
  background: #f1f1f1;
  color: #aaa;
}

.sw-count-has {
  background: #e8f5e9;
  color: #2e7d32;
}

/* Content area */
.sw-content {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
  background: #fff;
}

/* Step shell */
.sw-step-shell {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
  box-sizing: border-box;
}

.sw-step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-shrink: 0;
}

.sw-step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-blue);
  margin: 0 0 4px;
}

.sw-step-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.sw-step-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Footer */
.sw-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  background: #fff;
}

.sw-footer-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Two-column layout */
.sw-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.sw-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sw-col-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 0;
}

/* Form elements */
.sw-form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sw-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sw-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.sw-input {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.sw-input:focus {
  border-color: var(--fiserv-orange);
}

.sw-select {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  width: 100%;
}

.sw-select:focus {
  border-color: var(--fiserv-orange);
}

.sw-select-inline {
  padding: 5px 8px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  cursor: pointer;
  max-width: 240px;
}

.sw-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sw-filter-row .sw-input {
  flex: 1;
}

/* Drop zone */
.sw-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.sw-dropzone:hover,
.sw-dropzone-over {
  border-color: var(--fiserv-orange);
  background: #fff8f5;
}

.sw-dropzone:hover .sw-dropzone-icon,
.sw-dropzone-over .sw-dropzone-icon {
  color: var(--fiserv-orange);
}

.sw-dropzone-icon {
  color: #ccc;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.sw-dropzone-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.sw-dropzone-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* Preview */
.sw-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-preview-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #166534;
}

/* Table */
.sw-table-wrap {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sw-table thead th {
  background: var(--bg-light);
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1;
}

.sw-table tbody tr {
  border-bottom: 1px solid #f3f3f3;
  transition: background 0.1s;
}

.sw-table tbody tr:last-child {
  border-bottom: none;
}

.sw-table tbody tr:hover {
  background: #fafafa;
}

.sw-table td {
  padding: 8px 12px;
  color: var(--text-primary);
  vertical-align: middle;
}

.sw-row-assigned {
  background: #f8fff8;
}

.sw-cell-muted {
  color: var(--text-muted);
  font-size: 12px;
}

.sw-cell-mono {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* List wrap */
.sw-list-wrap {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  max-height: 340px;
  overflow-y: auto;
}

.sw-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Progress bar */
.sw-progress-wrap {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.sw-progress-bar {
  height: 100%;
  background: var(--fiserv-orange);
  border-radius: 3px;
  transition: width 0.2s;
}

.sw-progress-label {
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Result summary */
.sw-result-summary {
  display: flex;
  gap: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  flex-shrink: 0;
}

.sw-result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  flex: 1;
}

.sw-result-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.sw-result-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
}

.sw-result-ok .sw-result-num {
  color: #166534;
}

.sw-result-error .sw-result-num {
  color: #991b1b;
}

/* Alerts */
.sw-alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  flex-shrink: 0;
}

.sw-alert-ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.sw-alert-error {
  background: #fff0f0;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Badges */
.sw-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sw-badge-ok {
  background: #f0fdf4;
  color: #166534;
}

.sw-badge-error {
  background: #fff0f0;
  color: #991b1b;
}

.sw-badge-neutral {
  background: #f1f1f1;
  color: var(--text-muted);
}

/* Brand badge — matches management console BRAN group-badge (amber) */
.sw-badge-brand {
  background: #fde8c0;
  color: #7a3a00;
}

/* ── Access-level type badges (mirrors .access-badge in admintables.css) ── */
.sw-access-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sw-access-badge-1,
.sw-access-badge-2,
.sw-access-badge-10 {
  background: #dbeafe;
  color: #1e3a5f;
}

/* SPCA/SPCW/FSVA */
.sw-access-badge-20 {
  background: #ff6b00;
  color: #fff;
}

/* CORP — orange */
.sw-access-badge-30 {
  background: #b45309;
  color: #fff;
}

/* BRAN — amber  */
.sw-access-badge-40 {
  background: #99e6df;
  color: #064e47;
}

/* FRAN — teal   */
.sw-access-badge-50 {
  background: #dde1e7;
  color: #2d3748;
}

/* STOR — slate  */

/* ── Group code badges (mirrors .group-badge in admintables.css) ── */
.sw-group-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  font-family: monospace;
}

.sw-group-badge-1,
.sw-group-badge-2 {
  background: #ccd6e8;
  color: #002244;
}

.sw-group-badge-10 {
  background: #bcd4ec;
  color: #0f2f50;
}

.sw-group-badge-20 {
  background: #ffd5b8;
  color: #7a2900;
}

/* CORP */
.sw-group-badge-30 {
  background: #fde8c0;
  color: #7a3a00;
}

/* BRAN */
.sw-group-badge-40 {
  background: #99e6df;
  color: #064e47;
}

/* FRAN */
.sw-group-badge-50 {
  background: #dde1e7;
  color: #2d3748;
}

/* STOR */

/* Buttons */
.sw-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--fiserv-orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.sw-btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.sw-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sw-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.sw-btn-secondary:hover:not(:disabled) {
  border-color: var(--fiserv-orange);
  color: var(--fiserv-orange);
}

.sw-btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sw-btn-ghost {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.sw-btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-light);
}

.sw-link-btn {
  background: none;
  border: none;
  color: var(--fiserv-orange);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.sw-link-btn:hover {
  text-decoration: underline;
}

/* Spinner */
.sw-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: sw-spin 0.6s linear infinite;
  flex-shrink: 0;
}

.sw-spinner-light {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

@keyframes sw-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Utilities */
.sw-muted {
  font-size: 12px;
  color: var(--text-muted);
}

.sw-row-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.sw-billing-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-account-display {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-light);
  font-size: 13px;
  min-width: 160px;
}

.sw-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}

.sw-toggle-text {
  font-size: 13px;
}

.sw-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.sw-toggle-on {
  background: #dcfce7;
  color: #166534;
}

.sw-toggle-off {
  background: #f1f1f1;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .sw-sidebar {
    display: none;
  }

  .sw-two-col {
    grid-template-columns: 1fr;
  }
}

/* Confirm/edit inline box */
.sw-confirm-box {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px 22px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Icon buttons (edit/delete in table rows) */
.sw-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.sw-icon-btn:hover {
  color: var(--navy-blue);
  background: #f0f0f0;
}

.sw-icon-btn-danger {
  color: #dc3545;
}

.sw-icon-btn-danger:hover {
  color: #991b1b;
  background: #fff0f0;
}

/* Danger button */
.sw-btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dc3545;
  color: #fff;
  border: 1px solid #dc3545;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.sw-btn-danger:hover:not(:disabled) {
  background: #c82333;
  border-color: #c82333;
}

.sw-btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Field labels inside forms */
.sw-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ── Global step progress bar ────────────────────────────────────── */
.sw-global-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  margin-right: 16px;
}

.sw-global-progress-bar {
  flex: 1;
  height: 4px;
  background: #e9ecef;
  border-radius: 99px;
  overflow: hidden;
  max-width: 240px;
}

.sw-global-progress-fill {
  height: 100%;
  background: var(--fiserv-orange, #ff6b00);
  border-radius: 99px;
  transition: width 0.35s ease;
}

.sw-global-progress-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 600;
}

/* Billing section spacing */
.sw-billing-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
}

.sw-account-display {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}