/* Shared product demo styles — Vireon Labs portfolio */
:root {
  --bg: #f5f5f7;
  --paper: #ffffff;
  --ink: #1d1d1f;
  --graphite: #424245;
  --slate: #6e6e73;
  --fog: #d2d2d7;
  --hairline: #e8e8ed;
  --primary: #0066cc;
  --accent: #1e90ff;
  --primary-soft: #e8f0fa;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius-tile: 18px;
  --radius-card: 12px;
  --radius-chip: 999px;
  --font-display: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

/* Per-demo themes — overridden via <body data-theme="..."> */
body[data-theme="auto"] {
  --bg: #f4f4f5;
  --primary: #0a2540;
  --accent: #635bff;
  --primary-soft: #eef0fb;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}
body[data-theme="bau"] {
  --bg: #faf7f2;
  --paper: #ffffff;
  --primary: #9a3412;
  --accent: #f59e0b;
  --primary-soft: #fef3e7;
  --ink: #1c1917;
  --graphite: #44403c;
  --hairline: #ece4d8;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-tile: 8px;
  --radius-card: 6px;
}
body[data-theme="retail"] {
  --bg: #f0fdf4;
  --primary: #047857;
  --accent: #0ea5e9;
  --primary-soft: #dcfce7;
  --ink: #052e16;
  --graphite: #14532d;
  --hairline: #d1fae5;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-tile: 20px;
  --radius-card: 14px;
}
body[data-theme="lis"] {
  --bg: #fafafe;
  --primary: #6d28d9;
  --accent: #0891b2;
  --primary-soft: #ede9fe;
  --ink: #1e1b4b;
  --graphite: #312e81;
  --hairline: #e0e7ff;
  --font-display: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --radius-tile: 4px;
  --radius-card: 4px;
}
body[data-theme="lis"] .page-title,
body[data-theme="lis"] .kpi .value { font-family: var(--font-display); }

/* ============================================================
   PER-THEME LAYOUT OVERRIDES — make each demo structurally distinct
   ============================================================ */

/* ---------- AUTO: dark sidebar (Stripe / Linear console feel) ---------- */
body[data-theme="auto"] .topbar {
  background: #fafafe;
  border-bottom-color: #e4e4e7;
}
body[data-theme="auto"] .sidebar {
  background: #0a2540;
  border-right: 1px solid #0a2540;
}
body[data-theme="auto"] .nav-item { color: #adbdcc; }
body[data-theme="auto"] .nav-item:hover { background: #1a3550; color: #fff; }
body[data-theme="auto"] .nav-item.active {
  background: #635bff; color: #fff;
  box-shadow: 0 2px 8px rgba(99,91,255,0.4);
}
body[data-theme="auto"] .nav-item .dot { background: #4a5d70; }
body[data-theme="auto"] .nav-item.active .dot { background: #fff; }
body[data-theme="auto"] .kpi {
  border-left: 3px solid var(--accent);
  background: linear-gradient(180deg, #fafafe 0%, #fff 100%);
}
body[data-theme="auto"] .kpi .value { color: #0a2540; }

/* ---------- BAU: top tabs + neo-brutalist paper feel (no sidebar) ---------- */
body[data-theme="bau"] .layout {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}
body[data-theme="bau"] .topbar {
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
}
body[data-theme="bau"] .brand { font-family: Georgia, "Times New Roman", serif; letter-spacing: 0; }
body[data-theme="bau"] .sidebar {
  border-right: none;
  border-bottom: 2px solid var(--ink);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #f5efe3;
}
body[data-theme="bau"] .nav-item {
  border-radius: 0;
  padding: 14px 22px;
  border-right: 1px solid rgba(0,0,0,0.1);
  border-bottom: 3px solid transparent;
  font-weight: 500;
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
body[data-theme="bau"] .nav-item:hover { background: #ece4d8; }
body[data-theme="bau"] .nav-item.active {
  background: var(--paper);
  border-bottom-color: var(--primary);
  color: var(--primary);
  margin-bottom: -2px;
}
body[data-theme="bau"] .nav-item .dot { display: none; }
body[data-theme="bau"] .main { background: var(--bg); }
body[data-theme="bau"] .page-title { font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
body[data-theme="bau"] .kpi,
body[data-theme="bau"] .card {
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--paper);
}
body[data-theme="bau"] .kpi:hover,
body[data-theme="bau"] tr[data-detail]:hover,
body[data-theme="bau"] .row[data-detail]:hover {
  background: #fef3e7;
}
body[data-theme="bau"] th {
  background: var(--ink);
  color: #fff;
  padding: 10px 8px;
  letter-spacing: 0.06em;
}
body[data-theme="bau"] .btn {
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 600;
}
body[data-theme="bau"] .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
body[data-theme="bau"] .btn.primary { background: var(--primary); color: #fff; }
body[data-theme="bau"] .chip { border-radius: 2px; font-weight: 600; }
body[data-theme="bau"] .search { border: 2px solid var(--ink); border-radius: 0; }

/* ---------- RETAIL: pill-nav strip + gradient hero + soft card cloud ---------- */
body[data-theme="retail"] .layout {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}
body[data-theme="retail"] .topbar {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-bottom: none;
}
body[data-theme="retail"] .brand { color: #fff; font-size: 16px; }
body[data-theme="retail"] .topbar-actions { color: rgba(255,255,255,0.85); }
body[data-theme="retail"] .topbar .chip.success { background: rgba(255,255,255,0.2); color: #fff; }
body[data-theme="retail"] .search { background: rgba(255,255,255,0.18); border-color: transparent; color: #fff; }
body[data-theme="retail"] .search input { color: #fff; }
body[data-theme="retail"] .search input::placeholder { color: rgba(255,255,255,0.7); }
body[data-theme="retail"] .avatar { background: rgba(255,255,255,0.2); color: #fff; }
body[data-theme="retail"] .sidebar {
  border-right: none;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  background-attachment: fixed;
}
body[data-theme="retail"] .nav-item {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
body[data-theme="retail"] .nav-item:hover { background: rgba(255,255,255,0.28); }
body[data-theme="retail"] .nav-item.active { background: #fff; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
body[data-theme="retail"] .nav-item .dot { display: none; }
body[data-theme="retail"] .main {
  background: var(--bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  margin-top: -16px;
  position: relative;
  z-index: 1;
}
body[data-theme="retail"] .kpi {
  background: linear-gradient(135deg, #fff 0%, var(--primary-soft) 100%);
  border: none;
  box-shadow: 0 8px 32px rgba(4,120,87,0.08);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}
body[data-theme="retail"] .kpi::before {
  content: ""; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 999px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: 0.08;
}
body[data-theme="retail"] .kpi .value { color: var(--primary); font-size: 30px; }
body[data-theme="retail"] .card {
  border: none;
  box-shadow: 0 8px 32px rgba(4,120,87,0.06);
  border-radius: 20px;
}
body[data-theme="retail"] .btn.primary { box-shadow: 0 4px 16px rgba(4,120,87,0.3); }

/* ---------- LIS: dark mode terminal / scientific console ---------- */
body[data-theme="lis"] {
  --bg: #0b0a18;
  --paper: #131229;
  --ink: #e0e7ff;
  --graphite: #c7d2fe;
  --slate: #6366f1;
  --hairline: #1e1d3a;
  --primary: #a78bfa;
  --accent: #22d3ee;
  --primary-soft: #1e1b4b;
}
body[data-theme="lis"] .demo-banner {
  background: linear-gradient(90deg, #1e1b4b, #312e81);
  border-bottom: 1px solid #a78bfa;
}
body[data-theme="lis"] .app {
  border-color: var(--hairline);
}
body[data-theme="lis"] .topbar {
  background: var(--paper);
  border-bottom-color: var(--hairline);
}
body[data-theme="lis"] .brand { color: var(--ink); }
body[data-theme="lis"] .sidebar {
  background: #08071a;
  border-right-color: var(--hairline);
}
body[data-theme="lis"] .nav-item { color: var(--graphite); border-left: 2px solid transparent; border-radius: 2px; }
body[data-theme="lis"] .nav-item:hover { background: var(--primary-soft); color: var(--primary); }
body[data-theme="lis"] .nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-left-color: var(--primary);
}
body[data-theme="lis"] .nav-item .dot { background: #312e81; }
body[data-theme="lis"] .nav-item.active .dot { background: var(--primary); }
body[data-theme="lis"] .main { background: var(--bg); }
body[data-theme="lis"] .kpi,
body[data-theme="lis"] .card {
  background: var(--paper);
  border-color: var(--hairline);
}
body[data-theme="lis"] .kpi .value { color: var(--primary); }
body[data-theme="lis"] th, body[data-theme="lis"] td { border-bottom-color: var(--hairline); }
body[data-theme="lis"] th { color: var(--slate); }
body[data-theme="lis"] tr[data-detail]:hover { background: var(--primary-soft); }
body[data-theme="lis"] .row { border-bottom-color: var(--hairline); }
body[data-theme="lis"] .row[data-detail]:hover { background: var(--primary-soft); }
body[data-theme="lis"] .search {
  background: #08071a;
  border-color: var(--hairline);
}
body[data-theme="lis"] .search input { color: var(--ink); }
body[data-theme="lis"] .search input::placeholder { color: var(--slate); }
body[data-theme="lis"] .btn {
  background: var(--paper);
  border-color: var(--hairline);
  color: var(--ink);
}
body[data-theme="lis"] .btn:hover { background: var(--primary-soft); }
body[data-theme="lis"] .btn.primary { background: var(--primary); color: #0b0a18; border-color: var(--primary); }
body[data-theme="lis"] .avatar { background: var(--primary-soft); color: var(--primary); }
body[data-theme="lis"] .chip.success { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
body[data-theme="lis"] .chip.warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
body[data-theme="lis"] .chip.danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }
body[data-theme="lis"] .chip.muted { background: var(--hairline); color: var(--slate); }
body[data-theme="lis"] .chip { background: var(--primary-soft); color: var(--primary); }
body[data-theme="lis"] .bar { background: var(--hairline); }
body[data-theme="lis"] .drawer { background: var(--paper); border-left-color: var(--hairline); box-shadow: -10px 0 40px rgba(0,0,0,0.4); }
body[data-theme="lis"] .drawer-body code, body[data-theme="lis"] .drawer-body pre { background: #08071a; color: var(--accent); }
body[data-theme="lis"] .lj { background: #08071a !important; border-color: var(--hairline) !important; }
body[data-theme="lis"] .toast { background: var(--primary); color: #0b0a18; font-weight: 600; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font-display); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
.demo-banner {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  text-align: center;
  letter-spacing: -0.01em;
}
.demo-banner a { color: #fff; text-decoration: underline; }
.app {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--paper);
  min-height: calc(100vh - 33px);
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
body[data-theme="bau"] .brand-mark { border-radius: 4px; }
body[data-theme="lis"] .brand-mark { border-radius: 2px; }
body[data-theme="retail"] .brand-mark { border-radius: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--slate); }
.avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 100px); }
.sidebar { border-right: 1px solid var(--hairline); padding: 16px 12px; background: color-mix(in srgb, var(--paper) 92%, var(--primary)); }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--graphite);
  cursor: pointer;
  user-select: none;
}
.nav-item:hover { background: color-mix(in srgb, var(--primary-soft) 60%, transparent); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--fog); }
.nav-item.active .dot { background: var(--primary); }
body[data-theme="bau"] .nav-item, body[data-theme="bau"] .sidebar { border-radius: 0; }
body[data-theme="lis"] .nav-item { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; }
.main { padding: 24px 32px; }
.page-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.page-sub { color: var(--slate); font-size: 14px; margin: 0 0 24px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.kpi { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 16px; }
.kpi .label { font-size: 12px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi .value { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin-top: 4px; }
.kpi .delta { font-size: 12px; margin-top: 6px; }
.kpi .delta.up { color: var(--success); }
.kpi .delta.down { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-tile); padding: 18px; }
.card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hairline); }
th { color: var(--slate); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
tr[data-detail] { cursor: pointer; transition: background .12s ease; }
tr[data-detail]:hover { background: color-mix(in srgb, var(--primary-soft) 50%, transparent); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-chip); font-size: 12px; background: var(--primary-soft); color: var(--primary); }
.chip.success { background: #d1fae5; color: #065f46; }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.danger { background: #fee2e2; color: #991b1b; }
.chip.muted { background: #f1f1f4; color: var(--slate); }
.bar { height: 6px; background: var(--hairline); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); }
.row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; gap: 12px; }
.row:last-child { border-bottom: none; }
.row[data-detail] { cursor: pointer; padding-left: 8px; padding-right: 8px; border-radius: 6px; margin: 0 -8px; transition: background .12s; }
.row[data-detail]:hover { background: color-mix(in srgb, var(--primary-soft) 50%, transparent); }
.muted { color: var(--slate); }
button.btn, .btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--hairline);
  background: var(--paper); color: var(--ink); font-size: 13px; cursor: pointer;
  transition: background .12s, transform .08s;
}
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, black); }
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--bg);
  font-size: 13px; color: var(--slate); width: 320px;
}
.search input { border: none; outline: none; background: transparent; flex: 1; font-size: 13px; color: var(--ink); }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }

/* Drawer (clickable row detail) */
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 92vw;
  background: var(--paper); border-left: 1px solid var(--hairline);
  box-shadow: -10px 0 40px rgba(0,0,0,0.08);
  transform: translateX(100%); transition: transform .25s ease;
  z-index: 50; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 16px 20px; border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.drawer-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); font-weight: 600; }
.drawer-title { font-size: 17px; font-weight: 600; margin: 2px 0 0; letter-spacing: -0.01em; }
.drawer-body { padding: 20px; overflow: auto; flex: 1; font-size: 13px; color: var(--graphite); line-height: 1.55; }
.drawer-body h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate); margin: 18px 0 8px; font-weight: 600; }
.drawer-body h4:first-child { margin-top: 0; }
.drawer-body code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: "SF Mono", Menlo, monospace; }
.drawer-body pre { background: var(--bg); padding: 12px; border-radius: 8px; font-size: 12px; line-height: 1.5; overflow: auto; font-family: "SF Mono", Menlo, monospace; }
.drawer-body .row { padding: 8px 0; }
.drawer-close { background: none; border: none; cursor: pointer; font-size: 22px; color: var(--slate); padding: 4px 10px; line-height: 1; border-radius: 8px; }
.drawer-close:hover { background: var(--bg); color: var(--ink); }
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,15,20,0.32);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 49;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* Tab content switching */
.view { display: none; animation: fade .18s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Toast (button feedback) */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(40px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2-eq { grid-template-columns: 1fr; }
  .search { width: 200px; }
  .drawer { width: 100vw; }
}
