/* PSK Business ERP — guided product tour */
#tour-root { position: fixed; inset: 0; z-index: 600; pointer-events: none; opacity: 0; transition: opacity .22s; }
#tour-root:empty { display: none; }
#tour-root.in { opacity: 1; }
.tour-block { position: absolute; inset: 0; pointer-events: auto; }
.tour-spot {
  position: absolute; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(9, 20, 38, .66), 0 0 0 2px rgba(255, 255, 255, .9), 0 0 0 6px rgba(37, 99, 235, .45);
  transition: top .38s var(--ease), left .38s var(--ease), width .38s var(--ease), height .38s var(--ease);
}
.tour-card {
  position: absolute; width: 400px; max-width: calc(100vw - 16px); pointer-events: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  transition: top .38s var(--ease), left .38s var(--ease), opacity .18s, transform .18s; overflow: hidden;
}
.tour-card.switching { opacity: 0; transform: translateY(6px); }
.tour-card.centered { width: 460px; }
.tour-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 12px 18px; }
.tour-head > div { flex: 1; min-width: 0; }
.tour-head small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); }
.tour-head h3 { font-size: 16px; line-height: 1.3; }
.tour-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(145deg, #2563EB, #173B68); color: #fff; }
.tour-x { align-self: flex-start; width: 30px; height: 30px; }
.tour-progress { height: 4px; background: #E9EEF5; }
.tour-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--secondary), var(--accent)); border-radius: 0 4px 4px 0; transition: width .35s var(--ease); }
.tour-body { padding: 14px 18px 4px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.tour-body > p { color: var(--text); }
.tour-point { margin-top: 12px; }
.tour-point p { margin-top: 4px; font-size: 13px; }
.tour-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tour-tag.blue { background: var(--blue-50); color: #1D4ED8; }
.tour-tag.green { background: var(--green-50); color: #15803D; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 16px; }
.tour-foot .tour-skip { color: var(--muted); font-weight: 500; }
.tour-foot .tour-skip:hover { color: var(--text); }
.tour-nav { display: flex; gap: 8px; }
.tour-card.done { width: 440px; }
.tour-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 30px 26px 22px; }
.tour-done-ic { width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center; background: var(--green-50); color: var(--success); margin-bottom: 6px; animation: tour-pop .45s var(--ease); }
.tour-done h3 { font-size: 22px; letter-spacing: -.02em; }
.tour-done p { font-size: 14px; color: var(--text); max-width: 340px; }
.tour-done p.muted { font-size: 12.5px; color: var(--muted); }
.tour-done-actions { display: flex; gap: 10px; margin: 14px 0 10px; flex-wrap: wrap; justify-content: center; }
.tour-done small { color: var(--muted); font-size: 11.5px; }
@keyframes tour-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* highlight the matching menu item while its module is being explained */
body.tour-active .sidebar { z-index: 601; pointer-events: none; }
body.tour-active .sidebar::after { content: ''; position: absolute; inset: 0; background: rgba(9, 20, 38, .5); pointer-events: none; }
body.tour-active .sidebar { position: relative; }
.nav-item.tour-on { z-index: 2; background: #fff !important; color: var(--primary) !important; font-weight: 600; box-shadow: 0 0 0 3px rgba(245, 158, 11, .85), 0 8px 24px rgba(0, 0, 0, .3); }
.nav-item.tour-on .icon { color: var(--secondary); opacity: 1; }

@media (max-width: 1024px) {
  body.tour-active .sidebar { position: fixed; z-index: 60; }
  body.tour-active .sidebar::after { display: none; }
}
@media (max-width: 760px) {
  .tour-card, .tour-card.centered, .tour-card.done { position: fixed; left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); top: auto !important; width: auto; max-width: none; max-height: 54dvh; overflow-y: auto; }
  .tour-head { padding: 12px 10px 10px 14px; }
  .tour-head h3 { font-size: 15px; }
  .tour-ic { width: 34px; height: 34px; border-radius: 10px; }
  .tour-body { padding-top: 10px; font-size: 13px; }
  .tour-point { margin-top: 8px; }
  .tour-foot { position: sticky; bottom: 0; background: #fff; padding: 10px 14px 12px; border-top: 1px solid var(--line-2); }
  .tour-done { padding: 22px 18px 16px; }
}
