/* NoexpertAI — คู่มือเริ่มใช้งานในเว็บ (onboarding) */

/* โครงสร้างหัวเว็บของแอดมิน: เลือกบริษัทได้ + บอกว่าไม่ได้ดูของตัวเอง */
.dash-select {
  margin-left: 8px;
  padding: 5px 8px;
  max-width: 340px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.dash-select[hidden] { display: none; }
#dashCustomerChip { margin-left: 6px; }

.nxob-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.nxob-fab:hover { border-color: var(--gold); }
.nxob-fab .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}
.nxob-fab.all-done .dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.nxob-fab[hidden] { display: none; }

.nxob-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(3px);
  display: none;
}
.nxob-scrim.on { display: block; }

.nxob-modal {
  position: fixed;
  z-index: 81;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: none;
}
.nxob-modal.on { display: block; }

.nxob-head {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-2);
}
.nxob-title { font-size: 16px; font-weight: 700; color: var(--gold-bright); }
.nxob-sub { margin-top: 4px; font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.nxob-bar {
  margin-top: 12px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.nxob-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.3s ease; }
.nxob-bar span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-faint); }
.nxob-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.nxob-close:hover { color: var(--text); border-color: var(--gold); }

.nxob-list { padding: 8px 12px 14px; }
.nxob-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.nxob-step + .nxob-step { margin-top: 6px; }
.nxob-step.next { border-color: rgba(232, 180, 74, 0.45); background: rgba(232, 180, 74, 0.05); }
.nxob-step.done { opacity: 0.72; }
.nxob-num {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nxob-step.done .nxob-num { border-color: var(--green); color: var(--green); }
.nxob-step.next .nxob-num { border-color: var(--gold); color: var(--gold-bright); }
.nxob-body { flex: 1 1 auto; min-width: 0; }
.nxob-step-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.nxob-step-desc { margin-top: 3px; font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.nxob-sub {
  margin: 6px 0 0;
  padding-left: 16px;
  list-style: none;
}
.nxob-sub li {
  position: relative;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 3px;
}
.nxob-sub li::before {
  content: "·";
  position: absolute;
  left: -10px;
  color: var(--gold);
  font-weight: 800;
}

.nxob-state { margin-top: 7px; font-size: 11.5px; color: var(--text-faint); }
.nxob-state.ok { color: var(--green); }
.nxob-state.wait { color: var(--gold); }
.nxob-actions { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 8px; }
.nxob-btn {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.nxob-btn:hover { border-color: var(--gold); }
.nxob-btn.primary { background: var(--gold); border-color: var(--gold); color: #14181f; }
.nxob-btn.primary:hover { background: var(--gold-bright); }
.nxob-btn[hidden] { display: none; }

.nxob-foot {
  padding: 12px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.nxob-foot .hint { font-size: 11.5px; color: var(--text-faint); }
.nxob-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.nxob-link:hover { color: var(--gold); }

/* ไฮไลต์ชี้เป้าไปที่ปุ่มของจริง */
.nx-spot {
  position: relative;
  z-index: 70;
  animation: nxSpot 1.1s ease-in-out 4;
  box-shadow: 0 0 0 3px rgba(232, 180, 74, 0.85), 0 0 22px rgba(232, 180, 74, 0.55) !important;
}
@keyframes nxSpot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(232, 180, 74, 0.35), 0 0 10px rgba(232, 180, 74, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(232, 180, 74, 0.95), 0 0 26px rgba(232, 180, 74, 0.6); }
}

@media (max-width: 640px) {
  .nxob-modal { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0; }
  .nxob-fab { right: 12px; bottom: 12px; }
}
