/* ─── Demo-only styles · layered on top of crm-shell.css + theme-brand.css ─── */

/* Disabled / locked nav items in the demo sidebar */
.nav-item.locked {
  cursor: default;
  opacity: .42;
  position: relative;
}
.nav-item.locked:hover { background: transparent; }
.nav-item.locked .badge {
  background: var(--surface-2);
  color: var(--muted-2);
  border: 1px solid var(--line);
}
.nav-item.locked .lock {
  margin-left: auto;
  width: 13px; height: 13px;
  color: var(--muted-2);
  flex-shrink: 0;
}
.nav-item.locked .lock svg { width: 100%; height: 100%; display: block; }
.nav-item.locked .badge + .lock { margin-left: 8px; }

/* clickable (enabled) nav items in demo get pointer */
.nav-item.demo-enabled { cursor: pointer; }

/* "Demo" pill next to the CRM tag */
.demo-pill {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

/* List view toolbar */
.lv-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.lv-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  flex: 1; max-width: 340px;
  color: var(--muted-2);
}
.lv-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.lv-search input {
  border: 0; outline: 0; background: transparent;
  font-family: var(--font-sans); font-size: 13px; color: var(--ink);
  width: 100%;
}
.lv-tabs { display: flex; gap: 2px; margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 3px; }
.lv-tab {
  font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 6px 13px; border-radius: 5px; cursor: pointer;
  border: 0; background: transparent; font-family: var(--font-sans);
  white-space: nowrap;
}
.lv-tab:hover { color: var(--ink); }
.lv-tab.active { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.lv-tab .c { font-family: var(--font-mono); font-size: 10px; color: var(--muted-2); margin-left: 5px; }

/* Card wrapper around table */
.lv-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.lv-card-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
}
.lv-card-hd h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.lv-card-hd .sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.lv-card-hd .right { margin-left: auto; display: flex; gap: 6px; }

/* Make table rows feel interactive */
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .avatar-sm {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--ink-2); color: #fff;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  display: inline-grid; place-items: center;
  margin-right: 10px; vertical-align: middle;
}
.tbl .avatar-sm.alt { background: var(--accent); }
.tbl .name-cell { display: flex; align-items: center; }
.tbl .score {
  display: inline-flex; align-items: center; gap: 7px;
  font-variant-numeric: tabular-nums;
}
.tbl .score .track { width: 46px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.tbl .score .track > span { display: block; height: 100%; background: var(--accent); }
.tbl .score b { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; }
.src-tag {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 4px; white-space: nowrap;
}
.src-tag.snap { color: var(--accent); border-color: rgba(50,105,180,.3); background: rgba(50,105,180,.07); }
.src-tag.web  { color: #4D4F69; border-color: rgba(110,113,145,.3); background: rgba(110,113,145,.08); }
.src-tag.sv   { color: #7A5A0F; border-color: rgba(253,189,26,.4); background: rgba(253,189,26,.12); }
.status-pill {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.status-pill.new  { background: rgba(50,105,180,.1); color: var(--accent); }
.status-pill.work { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.status-pill.qual { background: rgba(93,169,83,.12); color: #2E7D46; }

/* Slide-over detail */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(31,30,29,.32);
  z-index: 60; opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw;
  background: var(--bg); border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px -24px rgba(31,30,29,.4);
  z-index: 61; transform: translateX(100%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-hd {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 18px 22px; display: flex; align-items: flex-start; gap: 14px;
}
.drawer-hd .av {
  width: 44px; height: 44px; border-radius: 9px; background: var(--ink-2); color: #fff;
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  display: grid; place-items: center; flex-shrink: 0;
}
.drawer-hd .av.alt { background: var(--accent); }
.drawer-hd .t b { font-size: 16px; font-weight: 600; color: var(--ink); display: block; letter-spacing: -.01em; }
.drawer-hd .t span { font-size: 12.5px; color: var(--muted); display: block; margin-top: 2px; }
.drawer-hd .x {
  margin-left: auto; width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  display: grid; place-items: center; color: var(--muted); flex-shrink: 0;
}
.drawer-hd .x:hover { background: var(--surface-2); color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }
.drawer-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.drawer-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.drawer-kpi .k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.drawer-kpi .v { font-size: 19px; font-weight: 600; color: var(--ink); margin-top: 4px; letter-spacing: -.01em; }
.drawer-kpi .v small { font-size: 12px; color: var(--muted); font-weight: 400; }
.drawer-sec { margin-bottom: 22px; }
.drawer-sec h4 {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2);
}
.drawer-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 13px; }
.drawer-row .l { color: var(--muted); }
.drawer-row .r { color: var(--ink); font-weight: 500; text-align: right; }
.drawer-line {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 11px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.drawer-line:last-child { border-bottom: 0; }
.drawer-line .ic { width: 28px; height: 28px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.drawer-line .ic svg { width: 15px; height: 15px; }
.drawer-line .m b { font-weight: 600; color: var(--ink); display: block; font-size: 13px; }
.drawer-line .m span { font-size: 11.5px; color: var(--muted); }
.drawer-line .end { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); text-align: right; }
.drawer-foot {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 14px 22px; display: flex; gap: 8px; align-items: center;
}
.drawer-foot .note { font-size: 11.5px; color: var(--muted-2); font-family: var(--font-mono); }
.drawer-foot .right { margin-left: auto; display: flex; gap: 8px; }

/* Demo hint banner under header */
.demo-hint {
  display: flex; align-items: center; gap: 10px;
  background: rgba(50,105,180,.06);
  border: 1px solid rgba(50,105,180,.22);
  border-radius: 8px;
  padding: 9px 14px;
  margin-bottom: 18px;
  font-size: 12.5px; color: var(--ink-2);
}
.demo-hint .d { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.demo-hint b { font-weight: 600; }
.demo-hint .spacer { margin-left: auto; }
.demo-hint a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Home overview tiles */
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.ov-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 22px; cursor: pointer; transition: border-color .15s, transform .15s;
  display: flex; flex-direction: column;
}
.ov-card:hover { border-color: var(--accent-3); transform: translateY(-2px); }
.ov-card .ov-ic {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-tint); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 16px;
}
.ov-card .ov-ic svg { width: 21px; height: 21px; }
.ov-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.ov-card p { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.ov-card .ov-stat { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.ov-card .ov-stat .n { font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.ov-card .ov-stat .l { font-size: 12px; color: var(--muted); }
.ov-card .ov-go {
  margin-top: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.ov-locked-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: 9px;
}
.ov-locked-row .lbl { font-size: 12px; color: var(--muted); font-weight: 500; margin-right: 4px; }
.ov-locked-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px;
}
.ov-locked-chip svg { width: 11px; height: 11px; }

/* ─── Embedded prototype stage (iframe) ─────────────────────── */
.demo-stage-wrap {
  position: fixed;
  top: var(--topbar-h);
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  background: var(--bg);
  overflow: hidden;
}
.demo-stage {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--bg);
}
.demo-loading {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  z-index: 5;
}
.demo-spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: demo-spin .7s linear infinite;
}
@keyframes demo-spin { to { transform: rotate(360deg); } }

