:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --sidebar: #0b1120;
  --sidebar-card: rgba(255, 255, 255, 0.05);
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-subtle: #eef2f6;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --cyan: #0891b2;
  --cyan-soft: #ecfeff;
  --green: #059669;
  --green-bright: #10b981;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --purple: #6d28d9;
  --purple-soft: #f5f3ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.22);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.24);
}
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); color: #fff; transform: translateY(-1px); }
.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-color: #059669;
}
.btn-success:hover { background: #047857; color: #fff; }
.btn-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; border-color: #d97706; }
.btn-dark { background: #0f172a; color: #fff; border-color: #0f172a; }
.btn-dark:hover { background: #1e293b; color: #fff; }
.btn-vr-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.18);
}
.btn-vr-outline:hover { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn-ghost { background: transparent; border-color: transparent; color: #94a3b8; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; padding: 11px 16px; font-size: 14px; }
.icon-btn {
  background: transparent; border: none; font-size: 17px; color: var(--text-muted);
  cursor: pointer; width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.18), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.14), transparent 45%),
    #0b1120;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-brand h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.login-brand p { margin: 3px 0 0; font-size: 12px; color: var(--text-muted); }
.brand-emblem {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.brand-emblem svg { width: 26px; height: 26px; }
.brand-emblem.sm { width: 36px; height: 36px; border-radius: 10px; }
.brand-emblem.sm svg { width: 20px; height: 20px; }
.demo-box { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.demo-title { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-chip {
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: #f8fafc; cursor: pointer; font-weight: 500;
}
.demo-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* Layout Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px;
  background: linear-gradient(180deg, #0b1120 0%, #111c33 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 30;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-header {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.brand-name { font-weight: 800; font-size: 15px; color: #fff; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.nav-section-label {
  font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 16px 18px 6px;
}
.nav-list { padding: 4px 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 10px;
  background: transparent; color: #94a3b8; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-align: left; position: relative; transition: all 0.15s;
}
.nav-svg { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-svg svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--sidebar-hover); color: #f8fafc; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.92), rgba(37, 99, 235, 0.72));
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.nav-badge {
  margin-left: auto; background: var(--rose); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}
.sidebar-footer {
  padding: 14px; border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, 0.16);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-mini { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #94a3b8; }

.main-wrap { flex: 1; margin-left: 236px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-left h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.subtitle { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.duty-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); cursor: pointer; transition: all 0.15s;
}
.duty-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.duty-pill.on { background: var(--green-soft); color: #047857; border-color: #a7f3d0; }
.duty-pill.on .dot { background: var(--green-bright); animation: pulse-ring 1.8s infinite; }
.duty-pill.off { background: #f1f5f9; color: var(--text-muted); }
.duty-pill.off .dot { background: #94a3b8; }

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.page-content { padding: 20px 24px 44px; max-width: 1460px; width: 100%; margin: 0 auto; }

/* Hero Executive Banner */
.hero-banner {
  background: linear-gradient(125deg, #0b1120 0%, #172554 58%, #0f172a 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
.hero-banner::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25), transparent 68%);
  pointer-events: none;
}
.hero-title { font-size: 18px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }
.hero-sub { font-size: 12.5px; color: #94a3b8; }
.hero-actions { display: flex; gap: 10px; z-index: 1; flex-wrap: wrap; }

/* Premium KPI Cards */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.kpi-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #475569;
}
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-card.blue .kpi-icon { background: var(--primary-soft); color: var(--primary); }
.kpi-card.urgent .kpi-icon { background: var(--rose-soft); color: var(--rose); }
.kpi-card.ok .kpi-icon { background: var(--green-soft); color: var(--green); }
.kpi-card.warn .kpi-icon { background: var(--amber-soft); color: var(--amber); }
.kpi-card.purple .kpi-icon { background: var(--purple-soft); color: var(--purple); }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 7px; }
.kpi-card.urgent .kpi-value { color: var(--rose); }
.kpi-card.warn .kpi-value { color: var(--amber); }
.kpi-card.ok .kpi-value { color: var(--green); }
.kpi-card.blue .kpi-value { color: var(--primary); }

/* Funnel Bars */
.funnel-list { display: flex; flex-direction: column; gap: 11px; }
.funnel-row { display: grid; grid-template-columns: 82px 1fr 78px; align-items: center; gap: 12px; font-size: 12.5px; }
.funnel-label { font-weight: 600; color: var(--text-secondary); }
.funnel-track { height: 11px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.funnel-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

/* Cards & Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-title { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.card-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Tabs & Filters */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab-btn {
  padding: 10px 16px; border: none; background: transparent; color: var(--text-muted);
  font-weight: 600; font-size: 13.5px; cursor: pointer; border-bottom: 2.5px solid transparent;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count {
  background: #f1f5f9; color: var(--text-muted); font-size: 11px;
  padding: 1px 7px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tab-btn.active .tab-count { background: var(--primary-soft); color: var(--primary); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.input, select, textarea {
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text); outline: none;
}
.input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.search-input { min-width: 220px; flex: 1; max-width: 340px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 12px; font-size: 11.5px; color: var(--text-muted);
  background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
td { padding: 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
tr.clickable-row { cursor: pointer; transition: background 0.12s; }
tr.clickable-row:hover { background: #f8fafc; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-cyan { background: var(--cyan-soft); color: var(--cyan); }
.badge-green { background: var(--green-soft); color: #047857; }
.badge-amber { background: var(--amber-soft); color: #b45309; }
.badge-rose { background: var(--rose-soft); color: #be123c; }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Stage Stepper (Lead Drawer) */
.stepper { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 4px 0 8px; margin-bottom: 12px; }
.step-chip {
  flex: 1; min-width: 70px; text-align: center; padding: 6px 8px;
  border-radius: 8px; font-size: 11.5px; font-weight: 700;
  border: 1px solid var(--border); background: #f8fafc; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.step-chip:hover { border-color: var(--primary); color: var(--primary); }
.step-chip.done { background: var(--green-soft); color: #047857; border-color: #a7f3d0; }
.step-chip.current { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25); }

/* Staff Duty Cards */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 12px; }
.staff-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; background: #fff;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.staff-card.on-duty {
  border-color: #6ee7b7;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 38%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}
.staff-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.staff-name { font-weight: 800; font-size: 14px; }
.staff-meta { font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 10px; }

/* Showroom Luxury Vehicle Cards */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.vehicle-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.vehicle-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.vehicle-stage-thumb {
  height: 158px;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(56, 189, 248, 0.22), transparent 62%),
    linear-gradient(160deg, #0b1120 0%, #1e293b 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.vehicle-stage-thumb::after {
  content: "";
  position: absolute;
  bottom: 18px;
  width: 76%;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.35);
}
.vr-pill-tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
  backdrop-filter: blur(6px);
}
.vr-status-tag { position: absolute; top: 12px; right: 12px; }
.car-silhouette { width: 225px; height: 96px; z-index: 2; transition: transform 0.3s ease; }
.vehicle-stage-thumb:hover .car-silhouette { transform: scale(1.05); }
.vr-hover-hint {
  position: absolute; bottom: 8px; font-size: 11px; color: #94a3b8;
  letter-spacing: 0.04em; z-index: 3;
}
.vehicle-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.vehicle-price { font-size: 22px; font-weight: 800; color: var(--rose); font-variant-numeric: tabular-nums; }
.spec-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.spec-pill {
  background: #f1f5f9; color: #334155; font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
}
.vehicle-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 4px; }

/* 360° VR Fullscreen Showroom Modal */
.vr-backdrop {
  position: fixed; inset: 0; background: rgba(3, 7, 18, 0.86);
  backdrop-filter: blur(10px);
  z-index: 80; display: flex; align-items: center; justify-content: center; padding: 18px;
}
.vr-shell {
  width: 100%; max-width: 1120px; max-height: 92vh;
  background: #0b1120; color: #f8fafc;
  border-radius: 20px; border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column; overflow: hidden;
}
.vr-topbar {
  padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.vr-title-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vr-title-group h3 { margin: 0; font-size: 16px; font-weight: 800; color: #fff; }
.vr-live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(14, 165, 233, 0.16); color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #38bdf8; animation: pulse-ring 1.6s infinite; }
.vr-topbar-actions { display: flex; align-items: center; gap: 8px; }
.vr-close-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06); color: #cbd5e1; cursor: pointer; font-size: 16px;
}
.vr-close-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
.vr-content {
  display: grid; grid-template-columns: 1.55fr 1fr;
  overflow-y: auto; flex: 1; min-height: 480px;
}
.vr-stage-col {
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.vr-mode-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.vr-mode-btn {
  padding: 6px 13px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04); color: #94a3b8; font-size: 12px; font-weight: 600; cursor: pointer;
}
.vr-mode-btn.active { background: #2563eb; color: #fff; border-color: #3b82f6; }
.vr-stage {
  flex: 1; min-height: 340px; border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(37, 99, 235, 0.25), transparent 55%),
    radial-gradient(ellipse at 50% 88%, rgba(6, 182, 212, 0.16), transparent 45%),
    #060a14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  user-select: none;
  cursor: grab;
}
.vr-stage:active { cursor: grabbing; }
.vr-turntable {
  position: absolute; bottom: 34px; width: 78%; height: 64px;
  border-radius: 50%;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  background: radial-gradient(ellipse, rgba(56, 189, 248, 0.12), transparent 72%);
  pointer-events: none;
}
.vr-angle-hud {
  position: absolute; top: 14px; left: 14px;
  background: rgba(15, 23, 42, 0.8); border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px; border-radius: 8px; font-size: 12px; color: #7dd3fc; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.vr-drag-tip {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.78); color: #cbd5e1;
  padding: 4px 12px; border-radius: 999px; font-size: 11.5px; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.vr-car-wrap {
  position: relative; width: 88%; max-width: 520px; aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease-out;
}
.vr-hotspot {
  position: absolute;
  width: 24px; height: 24px; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  cursor: pointer; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  transition: transform 0.15s;
}
.vr-hotspot:hover, .vr-hotspot.active { transform: translate(-50%, -50%) scale(1.24); }
.vr-hotspot.ok { background: #10b981; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.28); }
.vr-hotspot.warn { background: #f59e0b; box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.28); }
.vr-angle-bar { display: flex; align-items: center; gap: 10px; }
.vr-angle-bar input[type="range"] { flex: 1; accent-color: #38bdf8; }
.vr-info-col { padding: 18px; display: flex; flex-direction: column; gap: 14px; background: rgba(15, 23, 42, 0.55); }
.vr-spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.vr-spec-item {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px; padding: 10px 12px;
}
.vr-spec-item small { display: block; font-size: 11px; color: #94a3b8; }
.vr-spec-item strong { font-size: 14px; color: #fff; }
.vr-inspect-box {
  background: rgba(30, 41, 59, 0.72); border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px; padding: 13px 14px;
}
.vr-point-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; }
.vr-point-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent; cursor: pointer; font-size: 12.5px;
}
.vr-point-row:hover, .vr-point-row.active {
  background: rgba(37, 99, 235, 0.18); border-color: rgba(56, 189, 248, 0.45);
}

/* Scripts */
.script-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px;
  background: #f8fafc; margin-bottom: 10px; transition: border-color 0.15s;
}
.script-card:hover { border-color: #cbd5e1; }
.script-content { font-size: 13px; color: var(--text); margin: 7px 0 0; white-space: pre-wrap; line-height: 1.6; }

/* Forms & Alerts */
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.field input, .field select, .field textarea { width: 100%; }
.alert-error { background: var(--rose-soft); color: #be123c; padding: 10px 13px; border-radius: 10px; font-size: 12.5px; border: 1px solid #fecdd3; }
.alert-info { background: var(--primary-soft); color: #1e40af; padding: 11px 14px; border-radius: 10px; font-size: 12.5px; border: 1px solid #bfdbfe; }
.alert-warn { background: var(--amber-soft); color: #92400e; padding: 11px 14px; border-radius: 10px; font-size: 12.5px; border: 1px solid #fde68a; }

/* Drawer & Modal */
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(3px); z-index: 50; }
.lead-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 700px; max-width: 96vw;
  background: var(--surface); z-index: 60; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.drawer-header, .modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.drawer-header h3, .modal-header h3 { margin: 0; font-size: 16px; font-weight: 800; }
.drawer-body { padding: 18px 20px 32px; overflow-y: auto; flex: 1; }

.modal-backdrop { display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card {
  width: 100%; max-width: 580px; max-height: 90vh; background: var(--surface);
  border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.modal-body { padding: 18px 20px 24px; overflow-y: auto; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 12px; border-left: 2px solid #dbeafe; padding-left: 16px; margin-left: 6px; }
.tl-item { position: relative; }
.tl-item::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--primary);
  border: 2px solid #fff; box-shadow: 0 0 0 2px #bfdbfe;
  position: absolute; left: -21.5px; top: 4px;
}
.tl-time { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tl-text { font-size: 13px; margin-top: 2px; color: var(--text); }

/* Code Box */
.code-box {
  background: #0b1120; color: #e2e8f0; padding: 11px 14px; border-radius: 10px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  word-break: break-all; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid #1e293b;
}

/* Toast */
.toast-container { position: fixed; top: 18px; right: 18px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 11px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 380px;
}
.toast.ok { background: #047857; }
.toast.err { background: #be123c; }

.empty-state { text-align: center; padding: 36px 16px; color: var(--text-muted); font-size: 13px; }
.mobile-nav { display: none; }

@media (max-width: 960px) {
  .vr-content { grid-template-columns: 1fr; }
  .vr-stage-col { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .main-wrap { margin-left: 0; padding-bottom: 68px; }
  .topbar { padding: 0 14px; }
  .subtitle { display: none; }
  .page-content { padding: 12px 12px 28px; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 60px;
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); z-index: 40;
    justify-content: space-around; align-items: center;
  }
  .mnav-item {
    border: none; background: transparent; display: flex; flex-direction: column;
    align-items: center; gap: 3px; color: var(--text-muted); cursor: pointer; padding: 4px 10px;
  }
  .mnav-item svg { width: 20px; height: 20px; }
  .mnav-item small { font-size: 10.5px; font-weight: 700; }
  .mnav-item.active { color: var(--primary); }
}
