/* ══════════════════════════════════════════════════════════════
   Alasta v5.17.T167 — Integration Wizard + AI Suggestions
   ══════════════════════════════════════════════════════════════ */

/* ─── Loading state ───────────────────────────────────────────── */
.t167-loading {
  padding: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ─── Unified module panel ───────────────────────────────────── */
.t167-module-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ─── Active connections panel ───────────────────────────────── */
.t167-conn-wrap {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.t167-conn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.t167-conn-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.t167-conn-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.t167-conn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 0 6px;
}
.t167-conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 16px;
}
.t167-conn-grid .t167-active-card {
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-xs);
  padding: 14px 16px;
}
.t167-conn-grid .t167-active-card:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.t167-conn-grid .t167-active-card-err:hover {
  background: var(--red-soft);
}
.t167-conn-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}
.t167-conn-empty-icon { font-size: 20px; }

/* ─── Section divider ────────────────────────────────────────── */
.t167-panel-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 16px;
}
.t167-panel-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.t167-panel-divider span {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Active integrations strip ──────────────────────────────── */
.t167-active-strip {
  margin-bottom: 24px;
}
.t167-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.t167-active-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.t167-active-card {
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .15s var(--ease-out), transform .15s var(--ease-spring);
}
.t167-active-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.t167-active-card-err {
  border-color: rgba(220,38,38,.3);
  background: var(--red-soft);
}
.t167-active-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.t167-active-info {
  flex: 1;
  min-width: 0;
}
.t167-active-info strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t167-active-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.t167-active-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.t167-active-err {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(220,38,38,.1);
  color: var(--red);
  font-size: 12px;
  line-height: 1.4;
}
.t167-sync-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.t167-sync-row span:first-child { flex: 0 0 auto; }
.t167-sync-row span:nth-child(2) { flex: 1; color: var(--text-2); }
.t167-sync-count {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
}

/* Status dots */
.t167-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.t167-dot-ok  { background: var(--green); }
.t167-dot-bad { background: var(--red);   }
.t167-dot-warn { background: var(--amber);}
.t167-dot-dim { background: var(--muted-2); }

/* Platform badge */
.t167-plat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  font-size: 20px;
  flex-shrink: 0;
}
.t167-plat-badge-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

/* ─── Section title ───────────────────────────────────────────── */
.t167-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.t167-section-title h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 0;
}
.t167-section-sub {
  font-size: 13px;
  color: var(--muted);
}

/* ─── Wizard container ────────────────────────────────────────── */
.t167-wizard-wrap {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Step indicator */
.t167-wz-steps {
  display: flex;
  align-items: center;
  padding: 20px 28px 0;
  gap: 0;
}
.t167-wz-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 60px;
}
.t167-wz-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--muted);
  border: 2px solid var(--border);
  transition: background .2s var(--ease-out), border-color .2s, color .2s;
}
.t167-wz-step span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.t167-wz-step.active .t167-wz-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.t167-wz-step.active span { color: var(--accent); font-weight: 650; }
.t167-wz-step.done .t167-wz-dot {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.t167-wz-step.done span { color: var(--green); }
.t167-wz-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-bottom: 16px;
  min-width: 20px;
}

#t167-wz-body {
  padding: 20px 28px 28px;
}

/* ─── Step common ─────────────────────────────────────────────── */
.t167-step-body {
  animation: alasta-content-in .22s var(--ease-spring) both;
}
.t167-step-hint {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px;
}

/* ─── Step 0: Platform grid ───────────────────────────────────── */
.t167-step-platforms {}
.t167-cat-section {
  margin-bottom: 20px;
}
.t167-cat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.t167-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.t167-platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 16px 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition:
    border-color .12s var(--ease-out),
    background   .12s var(--ease-out),
    transform    .15s var(--ease-spring),
    box-shadow   .15s var(--ease-out);
  position: relative;
}
.t167-platform-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.t167-platform-card:active { transform: scale(.97); }
.t167-plat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  font-size: 24px;
}
.t167-platform-card strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.2;
}
.t167-plat-tag {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.t167-plat-active {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.4;
}
/* Kafelek platformy już połączonej — lekko przygaszony */
.t167-platform-card-conn {
  opacity: .72;
}
.t167-platform-card-conn:hover {
  opacity: 1;
}
.t167-plat-connected {
  background: var(--accent-soft, rgba(99,102,241,.12));
  color: var(--accent, #6366f1);
}

/* ─── Step 1: Info ────────────────────────────────────────────── */
.t167-info-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.t167-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 18px;
  font-size: 32px;
  flex-shrink: 0;
}
.t167-info-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
  margin: 0 0 3px;
}
.t167-info-tag {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.t167-what-list {
  list-style: none;
  padding: 0; margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.t167-what-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.t167-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Step 2: Connect form ────────────────────────────────────── */
.t167-connect-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}
.t167-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.t167-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.t167-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.t167-field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.t167-ai-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
  animation: alasta-content-in .2s var(--ease-spring) both;
}
.t167-ai-hint-ok {
  border-color: rgba(5,150,105,.3);
  background: var(--green-soft);
  color: var(--green);
}
.t167-ai-hint-warn {
  border-color: rgba(217,119,6,.3);
  background: var(--amber-soft);
  color: var(--amber);
}
.t167-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Step 3: Done ────────────────────────────────────────────── */
.t167-step-done {
  text-align: center;
  padding: 16px 0;
}
.t167-done-icon {
  font-size: 56px;
  margin-bottom: 12px;
  animation: alasta-done-bounce .5s var(--ease-spring) both;
}
@keyframes alasta-done-bounce {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.t167-done-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
  margin: 0 0 6px;
}
.t167-done-sub {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 20px;
}
.t167-done-list {
  text-align: left;
  margin: 0 auto 24px;
  max-width: 420px;
}
.t167-done-footer { justify-content: center; }

/* ─── Wizard footer (nav buttons) ────────────────────────────── */
.t167-wz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ─── AI Diagnostics modal ────────────────────────────────────── */
.t167-diag-modal {
  max-width: 480px;
  width: min(480px, calc(100vw - 32px));
}
.t167-diag-body {
  padding: 8px 0 16px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  white-space: pre-line;
}

/* ─── Contextual AI suggestions (dashboard) ──────────────────── */
.t167-suggestions-loading {
  padding: 10px 0;
  font-size: 13px;
  color: var(--muted);
  animation: alasta-content-in .2s var(--ease-spring) both;
}
.t167-suggestions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  animation: alasta-content-in .22s var(--ease-spring) both;
}
.t167-suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background    .1s var(--ease-out),
    border-color  .1s var(--ease-out),
    transform     .12s var(--ease-spring),
    box-shadow    .12s var(--ease-out);
}
.t167-suggestion-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.t167-suggestion-chip:active { transform: scale(.97); }
.t167-chip-icon {
  font-size: 15px;
  line-height: 1;
}
.t167-suggestions-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: background .1s, color .1s, transform .2s var(--ease-spring);
  flex-shrink: 0;
}
.t167-suggestions-refresh:hover {
  background: var(--surface-3);
  color: var(--accent);
  transform: rotate(90deg);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .t167-platform-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  .t167-wz-steps {
    padding: 16px 16px 0;
  }
  .t167-wz-step span { display: none; }
  #t167-wz-body { padding: 16px 16px 20px; }
  .t167-active-cards { grid-template-columns: 1fr; }
  .t167-wz-connector { min-width: 10px; }
  .t167-suggestions-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .t167-suggestion-chip { flex-shrink: 0; }
}
@media (max-width: 480px) {
  .t167-platform-grid { grid-template-columns: repeat(2, 1fr); }
  .t167-info-hero { flex-direction: column; text-align: center; }
  .t167-wz-footer { flex-direction: column; }
  .t167-wz-footer .btn { width: 100%; justify-content: center; }
}
