:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel2: #f1f5f9;
  --panel-hover: #f8fafc;
  --fg: #0f172a;
  --fg-sec: #334155;
  --mut: #64748b;
  --line: #e2e8f0;
  --line-focus: #cbd5e1;
  --acc: #4f46e5;
  --acc-hover: #4338ca;
  --acc-fg: #ffffff;
  --acc-soft: #eef2ff;
  --acc-border: #c7d2fe;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --ok-border: #a7f3d0;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  --bad: #e11d48;
  --bad-soft: #fff1f2;
  --bad-border: #fecdd3;
  --sky: #0284c7;
  --sky-soft: #f0f9ff;
  --sky-border: #bae6fd;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --purple-border: #ddd6fe;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --r: 12px;
  --r-sm: 8px;
  --r-lg: 16px;
  --sidebar-w: 260px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090d16;
    --panel: #111827;
    --panel2: #1a2232;
    --panel-hover: #1f293d;
    --fg: #f8fafc;
    --fg-sec: #cbd5e1;
    --mut: #94a3b8;
    --line: #1e293b;
    --line-focus: #334155;
    --acc: #6366f1;
    --acc-hover: #818cf8;
    --acc-fg: #ffffff;
    --acc-soft: rgba(99, 102, 241, 0.14);
    --acc-border: rgba(99, 102, 241, 0.3);
    --ok: #10b981;
    --ok-soft: rgba(16, 185, 129, 0.14);
    --ok-border: rgba(16, 185, 129, 0.28);
    --warn: #f59e0b;
    --warn-soft: rgba(245, 158, 11, 0.14);
    --warn-border: rgba(245, 158, 11, 0.28);
    --bad: #f43f5e;
    --bad-soft: rgba(244, 63, 94, 0.14);
    --bad-border: rgba(244, 63, 94, 0.28);
    --sky: #38bdf8;
    --sky-soft: rgba(56, 189, 248, 0.14);
    --sky-border: rgba(56, 189, 248, 0.28);
    --purple: #a855f7;
    --purple-soft: rgba(168, 85, 247, 0.14);
    --purple-border: rgba(168, 85, 247, 0.28);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f19;
  --panel: #111827;
  --panel2: #1c1f2a;
  --panel-hover: #1f2937;
  --fg: #dfe2f1;
  --fg-sec: #c7c4d7;
  --mut: #908fa0;
  --line: rgba(30, 41, 59, 0.85);
  --line-focus: #6366f1;
  --acc: #4f46e5;
  --acc-hover: #6366f1;
  --acc-fg: #ffffff;
  --acc-soft: rgba(99, 102, 241, 0.12);
  --acc-border: rgba(99, 102, 241, 0.4);
  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.12);
  --ok-border: rgba(16, 185, 129, 0.3);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.3);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, 0.12);
  --bad-border: rgba(239, 68, 68, 0.35);
  --sky: #00a6e0;
  --sky-soft: rgba(0, 166, 224, 0.14);
  --sky-border: rgba(0, 166, 224, 0.3);
  --purple: #8083ff;
  --purple-soft: rgba(128, 131, 255, 0.14);
  --purple-border: rgba(128, 131, 255, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.75);
}

* {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font: 14px/1.55 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--fg);
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  transition: grid-template-columns 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-collapsed {
  --sidebar-w: 68px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

svg.i {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

svg.sm-i {
  width: 14px;
  height: 14px;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--fg);
}

.mut { color: var(--mut); }
.sm { font-size: 12.5px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------------- SIDEBAR ---------------- */
.side {
  height: 100vh;
  width: var(--sidebar-w);
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 14px;
  border-bottom: 1px solid var(--line);
  min-height: 52px;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.15s ease, max-width 0.2s ease;
  flex: 1;
}

.brand-title {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.015em;
  color: var(--fg);
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 550;
  color: var(--ok);
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulse-dot 2s infinite ease-in-out;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.brand-dot.error {
  background: var(--bad);
  box-shadow: 0 0 8px var(--bad);
}

.brand-dot.checking {
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 550;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--fg-sec);
  transition: all 0.2s ease;
}

.topbar-pill.ok {
  border-color: var(--ok-border);
  color: var(--ok);
}

.topbar-pill.error {
  border-color: var(--bad-border);
  background: var(--bad-soft);
  color: var(--bad);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mut);
  padding: 8px 8px 4px;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--mut);
  font-weight: 550;
  font-size: 13.5px;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.nav button:hover {
  background: var(--panel2);
  color: var(--fg);
}

.nav button.on {
  background: var(--acc-soft);
  color: var(--acc);
  font-weight: 500;
}

.nav button.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--acc);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel2);
  color: var(--mut);
}

.nav button.on .nav-badge {
  background: rgba(99, 102, 241, 0.2);
  color: var(--acc);
}

.side-spacer {
  flex: 1;
}

.side .foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.user-header-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
}

.user-badge-pill {
  font-size: 10.5px;
  padding: 1px 6px;
  text-transform: capitalize;
}

.user-meta-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--mut);
}

.mode-bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
}

.user-mode {
  text-transform: capitalize;
}

.foot-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--mut);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--fg);
  background: var(--panel2);
  border-color: var(--line-focus);
}

/* ---------------- SIDEBAR COLLAPSED STATE ---------------- */
body.sidebar-collapsed .brand-info,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav button span,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .user-details,
body.sidebar-collapsed #sidebar-collapse-btn span {
  display: none !important;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding: 2px 0 14px;
}

body.sidebar-collapsed .side {
  padding: 16px 8px;
  align-items: center;
}

body.sidebar-collapsed .nav {
  width: 100%;
  align-items: center;
}

body.sidebar-collapsed .nav button {
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
}

body.sidebar-collapsed .user-card {
  padding: 6px;
  background: none;
  border: 0;
  justify-content: center;
}

body.sidebar-collapsed .foot-actions {
  flex-direction: column;
  gap: 6px;
}

/* ---------------- TOPBAR & SIDEBAR TOGGLE ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.toggle-sidebar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg-sec);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.toggle-sidebar-btn:hover {
  background: var(--panel2);
  color: var(--fg);
  border-color: var(--line-focus);
}

.topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mut);
}

.topbar-breadcrumbs span.active {
  color: var(--fg);
  font-weight: 500;
}

.topbar-spacer {
  flex: 1;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--mut);
}

/* ---------------- MAIN CONTENT ---------------- */
main {
  padding: 24px clamp(20px, 3.5vw, 40px) 80px;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.head {
  margin-bottom: 20px;
}

.head-left {
  display: flex;
  flex-direction: column;
}

.head-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 2px;
}

.head-title-row h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.head-title-row .btn.pri {
  padding: 6px 14px;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.25);
}

.head-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--acc);
}

.head p {
  margin: 5px 0 0;
  color: var(--mut);
  font-size: 13.5px;
  max-width: 720px;
}

.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  padding: 8px 15px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn:hover {
  background: var(--panel2);
  border-color: var(--line-focus);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn.pri {
  background: linear-gradient(135deg, var(--acc) 0%, #4338ca 100%);
  border-color: rgba(79, 70, 229, 0.5);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn.pri:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
}

.btn.sm {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 7px;
  box-shadow: none;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---------------- STATS DASHBOARD ---------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 1220px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-focus);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
}

.stat-icon svg {
  width: 15px;
  height: 15px;
}

.icon-env { background: var(--acc-soft); color: var(--acc); }
.icon-ready { background: var(--ok-soft); color: var(--ok); }
.icon-health { background: var(--sky-soft); color: var(--sky); }
.icon-sec.ok { background: var(--ok-soft); color: var(--ok); }
.icon-sec.bad { background: var(--bad-soft); color: var(--bad); }
.icon-time { background: var(--warn-soft); color: var(--warn); }

.stat-tag {
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--panel2);
  color: var(--mut);
}

.stat-tag.ok { background: var(--ok-soft); color: var(--ok); }
.stat-tag.bad { background: var(--bad-soft); color: var(--bad); }

.stat .n {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.stat .n.bad { color: var(--bad); }
.stat .n.ok { color: var(--ok); }

.stat .l {
  color: var(--fg-sec);
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}

.stat-sub {
  color: var(--mut);
  font-size: 11px;
  margin-top: 2px;
}

/* ---------------- CARD & SEARCH ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-card {
  border: 1px solid var(--line);
}

.tools {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  background: var(--panel);
}

.search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  color: var(--mut);
  transition: all 0.15s ease;
}

.search:focus-within {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
  background: var(--panel);
}

.search input {
  flex: 1;
  border: 0;
  background: none;
  outline: 0;
  padding: 9px 0;
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  min-width: 0;
}

.search-kbd {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: inherit;
  color: var(--mut);
  font-weight: 600;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--mut);
  transition: all 0.15s ease;
}

.chip:hover {
  background: var(--panel2);
  color: var(--fg);
}

.chip.on {
  background: var(--acc-soft);
  border-color: var(--acc-border);
  color: var(--acc);
  font-weight: 500;
}

.chip-count {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--panel2);
  color: var(--mut);
}

.chip.on .chip-count {
  background: rgba(99, 102, 241, 0.2);
  color: var(--acc);
}

.chip-count.warn { background: var(--warn-soft); color: var(--warn); }
.chip-count.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------------- TABLE ---------------- */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  text-align: left;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mut);
  font-weight: 600;
  padding: 11px 18px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
}

td {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

tr.row {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

tr.row:hover td {
  background: var(--panel2);
}

.nm {
  font-weight: 500;
  font-size: 14px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.env-tags {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--panel2);
  color: var(--mut);
}

.tag-badge.dev { background: var(--sky-soft); color: var(--sky); }
.tag-badge.test { background: var(--purple-soft); color: var(--purple); }
.tag-badge.prod { background: var(--warn-soft); color: var(--warn); }

.sub {
  color: var(--mut);
  font-size: 12.5px;
}

/* ---------------- STATUS PILLS ---------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel2);
  color: var(--mut);
  white-space: nowrap;
}

.pill.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.pill.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-border); }
.pill.acc { background: var(--acc-soft); color: var(--acc); border: 1px solid var(--acc-border); }

.dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: currentColor;
}

.dot.pulse {
  animation: pulse-dot 1.2s infinite ease-in-out;
}

/* Pipeline Segments */
.seg {
  display: flex;
  gap: 3px;
  margin-top: 7px;
  align-items: center;
}

.seg i {
  width: 13px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  transition: all 0.2s ease;
}

.seg i.d { background: var(--ok); }
.seg i.c { background: var(--warn); animation: pulse-bar 1s infinite alternate; }
.seg i.f { background: var(--bad); }

@keyframes pulse-bar {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.sev {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.sev b {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 5px;
}

.sev .h { background: var(--bad-soft); color: var(--bad); }
.sev .m { background: var(--warn-soft); color: var(--warn); }
.sev .lo { background: var(--panel2); color: var(--mut); }

/* ---------------- EMPTY STATE ---------------- */
.empty-state {
  padding: 60px 24px;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-icon-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
}

.empty-icon-halo {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--acc-soft) 0%, transparent 70%);
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--panel2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--acc);
}

.empty-icon svg {
  width: 30px;
  height: 30px;
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fg);
}

.empty-state p {
  color: var(--mut);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.empty-cta {
  padding: 9px 18px;
  font-size: 14px;
}

.empty-suggestions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.empty-sugg-title {
  font-size: 12px;
  color: var(--mut);
  font-weight: 550;
}

.sugg-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--fg-sec);
  transition: all 0.15s ease;
}

.sugg-chip:hover {
  background: var(--acc-soft);
  color: var(--acc);
  border-color: var(--acc-border);
}

/* ---------------- DRAWER ---------------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 25;
}

.scrim.on {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(680px, 100vw);
  max-width: 100vw;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  visibility: hidden;
}

.drawer.on {
  transform: none;
  visibility: visible;
}

.drawer.on {
  transform: none;
}

.dh {
  padding: 22px 24px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.dh .top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.dh h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.acts {
  display: flex;
  gap: 8px;
  margin: 12px 0 0;
  flex-wrap: wrap;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.tabs button {
  border: 0;
  background: none;
  padding: 10px 14px;
  color: var(--mut);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tabs button:hover {
  color: var(--fg);
}

.tabs button.on {
  color: var(--acc);
  border-color: var(--acc);
}

.db {
  padding: 22px 24px 50px;
  overflow-y: auto;
  flex: 1;
}

.fgroup {
  margin-bottom: 20px;
}

.fgroup h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mut);
  margin-bottom: 10px;
  font-weight: 600;
}

details.f {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.15s ease;
}

details.f:hover {
  border-color: var(--line-focus);
}

details.f summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

details.f summary::-webkit-details-marker {
  display: none;
}

details.f[open] summary {
  border-bottom: 1px solid var(--line);
}

.fbody {
  padding: 12px 14px;
  font-size: 13px;
}

.fix {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--acc-soft);
  color: var(--fg);
  border: 1px solid var(--acc-border);
  font-size: 12.5px;
}

.fix b {
  color: var(--acc);
}

.crow {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.crow:last-child {
  border: 0;
}

.ok-t { color: var(--ok); font-weight: 500; }
.bad-t { color: var(--bad); font-weight: 500; }
.warn-t { color: var(--warn); font-weight: 500; }
.acc-t { color: var(--acc); font-weight: 500; }

.step {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}

.step .b {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--panel2);
  color: var(--mut);
  flex: none;
  z-index: 1;
}

.step.d .b { background: var(--ok); color: #fff; }
.step.c .b { background: var(--warn); color: #fff; }
.step.f .b { background: var(--bad); color: #fff; }

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 36px;
  bottom: -6px;
  width: 2px;
  background: var(--line);
}

pre {
  white-space: pre-wrap;
  font-size: 12px;
  background: var(--panel2);
  padding: 12px 14px;
  border-radius: 9px;
  overflow: auto;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--line);
}

/* ---------------- DIALOG ---------------- */
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  width: min(600px, calc(100% - 32px));
  max-width: 600px;
  max-height: calc(100vh - 40px);
  background: var(--panel);
  color: var(--fg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--acc-border);
  outline: none;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dlg {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  box-sizing: border-box;
}

.dlg-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.dlg-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--acc-soft);
  color: var(--acc);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.dlg-icon svg {
  width: 22px;
  height: 22px;
}

.dlg h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.dlg-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-right: -4px;
  display: flex;
  flex-direction: column;
}

.fld {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-sec);
  min-width: 0;
}

.fld-label {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.req {
  color: var(--bad);
}

.fld-hint {
  font-size: 11.5px;
  color: var(--mut);
  font-weight: 400;
  line-height: 1.35;
  margin-top: 2px;
}

.fld input, .fld select {
  font: inherit;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-weight: 400;
  font-size: 13.5px;
  outline: 0;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.fld select {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.fld input:focus, .fld select:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
  background: var(--panel);
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 620px) {
  .two {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.err {
  margin-top: 12px;
  color: var(--bad);
  font-size: 13px;
  font-weight: 550;
  min-height: 18px;
  line-height: 1.4;
}

.dfoot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* ---------------- SECTIONS / ROLLOUTS / DOCS ---------------- */
.sect {
  margin-bottom: 28px;
}

.sect-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.sect > h2 {
  font-size: 16px;
  font-weight: 600;
}

.rollout-card {
  padding: 18px 20px;
}

.run {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

.run:first-child {
  border: 0;
}

.run .rh {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.rec {
  display: grid;
  grid-template-columns: 85px 1fr auto;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  align-items: start;
}

.callout-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--r);
  background: var(--acc-soft);
  border: 1px solid var(--acc-border);
  color: var(--fg);
  font-size: 13px;
  margin-top: 20px;
}

.callout-card svg {
  color: var(--acc);
  margin-top: 2px;
}

.callout-card strong {
  color: var(--acc);
  display: block;
  margin-bottom: 2px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.flow-card {
  padding: 18px 20px;
}

.flow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.flow .num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--acc-soft);
  color: var(--acc);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
}

.flow-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.flow b {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.cover {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.check-card {
  padding: 16px 18px;
}

.check-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.check-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.check-card p {
  margin: 0;
  color: var(--mut);
  font-size: 12.5px;
  line-height: 1.5;
}

.note {
  background: var(--warn-soft);
  color: var(--fg);
  border: 1px solid var(--warn-border);
  border-radius: var(--r);
  padding: 14px 18px;
  font-size: 13px;
  margin-top: 24px;
  line-height: 1.55;
}

/* ---------------- TOAST & SPINNER ---------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: var(--fg);
  color: var(--bg);
  padding: 11px 20px;
  border-radius: 10px;
  opacity: 0;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  font-weight: 600;
  font-size: 13.5px;
  pointer-events: none;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}

.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spin {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: sp 0.7s linear infinite;
  display: inline-block;
}

@keyframes sp {
  to { transform: rotate(360deg); }
}

/* ---------------- MOBILE & RESPONSIVE ---------------- */
@media (max-width: 920px) {
  body {
    grid-template-columns: 1fr;
  }
  body.sidebar-collapsed {
    --sidebar-w: 100%;
  }
  .side {
    position: static;
    height: auto;
    width: 100% !important;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 12px;
    overflow-x: auto;
  }
  .brand {
    padding: 0 10px 0 0;
    border-bottom: 0;
  }
  .brand-sub, .nav-label {
    display: none;
  }
  .nav {
    flex-direction: row;
    width: auto !important;
  }
  .nav button {
    width: auto !important;
    height: auto !important;
    padding: 8px 12px !important;
  }
  .nav button.on::before {
    display: none;
  }
  .side .foot {
    margin: 0 0 0 auto;
    padding: 0;
    border-top: 0;
    flex-direction: row;
  }
  .user-card {
    display: none;
  }
  .col-t, .col-c {
    display: none;
  }
  .m-only {
    display: block;
    margin-top: 8px;
  }
  .toggle-sidebar-btn {
    display: none;
  }
}

.m-only {
  display: none;
}

.rbar {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.chk {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--fg-sec);
  cursor: pointer;
}

.who-id {
  font-weight: 500;
  color: var(--fg);
  word-break: break-all;
}

[hidden] {
  display: none !important;
}
/* -----------------------------------------------------------------------------
   AI Platform Copilot Chatbot Widget
----------------------------------------------------------------------------- */
#chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: inherit;
}

#chatbot-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  padding: 10px 18px 10px 12px;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35), 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

#chatbot-trigger:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.45);
}

.chatbot-trigger-icon {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-trigger-icon svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
}

.chatbot-trigger-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chatbot-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 380px;
  height: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cbSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cbSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
}

.chatbot-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar {
  width: 32px;
  height: 32px;
  background: var(--acc-soft);
  color: var(--acc);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-name {
  font-size: 14px;
  font-weight: 600;
}

.chatbot-sub {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.chatbot-quick-chips {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--panel2);
  scrollbar-width: none;
}

.cb-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cb-chip:hover {
  background: var(--acc-soft);
  color: var(--acc);
  border-color: var(--acc);
}

.chatbot-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.cb-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.cb-msg.user {
  align-self: flex-end;
}

.cb-msg.bot {
  align-self: flex-start;
}

.cb-bubble {
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cb-msg.user .cb-bubble {
  background: var(--acc);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.cb-msg.bot .cb-bubble {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 3px;
}

.cb-time {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  align-self: flex-end;
}

.chatbot-input-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  background: var(--panel);
}

.chatbot-input-row input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
}

.chatbot-input-row input:focus {
  border-color: var(--acc);
}

.chatbot-input-row button {
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stitch Button Highlights */
.btn.pri {
  background: var(--acc);
  border: 1px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 14px rgba(79, 70, 229, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn.pri:hover {
  background: var(--acc-hover);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.55);
}

/* ---------------- STITCH TOPBAR NAV & ACCOUNT CONTROLS ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 15;
}

.topbar-user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
}

.topbar-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-account-btn:hover {
  background: var(--panel-hover);
  border-color: var(--acc-border);
  color: var(--acc);
}

.topbar-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--bad-soft);
  border: 1px solid var(--bad-border);
  color: var(--bad);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-logout-btn:hover {
  background: var(--bad);
  color: #ffffff;
  border-color: var(--bad);
}

:root[data-theme="dark"] .side {
  background: #0f131d;
  border-right: 1px solid rgba(46, 52, 68, 0.55);
}

:root[data-theme="light"] .side {
  background: #ffffff;
  border-right: 1px solid var(--line);
}

:root[data-theme="dark"] .side .brand {
  border-bottom: 1px solid rgba(46, 52, 68, 0.55);
}

:root[data-theme="light"] .side .brand {
  border-bottom: 1px solid var(--line);
}

:root[data-theme="dark"] .user-card {
  background: #151a28;
  border: 1px solid rgba(46, 52, 68, 0.6);
}

:root[data-theme="light"] .user-card {
  background: #f8fafc;
  border: 1px solid var(--line);
}

:root[data-theme="dark"] .user-card:hover {
  background: #1c2235;
  border-color: rgba(99, 102, 241, 0.4);
}

:root[data-theme="light"] .user-card:hover {
  background: #f1f5f9;
  border-color: var(--line-focus);
}

/* Topbar Brand Toggle in Sidebar Header */
.brand-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--mut);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  margin-left: auto;
}

.brand-toggle-btn:hover {
  background: var(--panel-hover);
  color: var(--fg);
  border-color: var(--line-focus);
}

body.sidebar-collapsed .brand-toggle-btn {
  margin-left: 0;
  margin-top: 6px;
}

/* Avatar Badge Button in Nav Bar */
.avatar-badge-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc) 0%, #7c3aed 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.avatar-badge-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--acc-border), var(--shadow-md);
}

/* User Profile / Settings / Theme Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 6px;
  z-index: 100;
  animation: ddFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ddFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dd-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.user-dd-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--acc) 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-dd-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.user-dd-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--fg);
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-dd-role {
  font-size: 11px;
  color: var(--mut);
  text-transform: capitalize;
}

.user-dd-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.user-dd-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 0;
  transition: all 0.12s ease;
}

.user-dd-item:hover {
  background: var(--panel2);
  color: var(--acc);
}

.user-dd-item svg {
  color: var(--mut);
  transition: color 0.12s ease;
}

.user-dd-item:hover svg {
  color: var(--acc);
}

.user-dd-logout {
  color: var(--bad) !important;
}

.user-dd-logout svg {
  color: var(--bad) !important;
}

.user-dd-logout:hover {
  background: var(--bad-soft) !important;
  color: var(--bad) !important;
}

/* ---------------- ENTERPRISE CONSOLE UTILITY & STATUS BAR ---------------- */
.app-console-bar {
  margin-top: 48px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--mut);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.console-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.csb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
}

.csb-pill.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
}

.csb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}

.csb-sep {
  color: var(--line-focus);
  opacity: 0.7;
}

.csb-item {
  color: var(--mut);
  font-size: 11.5px;
}

.csb-item strong {
  color: var(--fg);
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.csb-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--mut);
  background: var(--panel2);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.console-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-right: 140px; /* Leave generous breathing room so the floating Copilot trigger never overlaps */
}

.csb-link {
  color: var(--mut);
  text-decoration: none;
  font-size: 11.5px;
  transition: color 0.15s ease;
  cursor: pointer;
}

.csb-link:hover {
  color: var(--acc);
}

.csb-bullet {
  color: var(--line-focus);
  font-size: 10px;
}

.csb-copy {
  color: var(--mut);
  opacity: 0.85;
}

@media (max-width: 900px) {
  .console-bar-right {
    padding-right: 0;
  }
}

/* ---------------- SIDEBAR BOTTOM COLLAPSE ACTION BUTTON ---------------- */
.side-foot-action {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
}

.sidebar-collapse-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--mut);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-collapse-action-btn:hover {
  background: var(--panel-hover);
  color: var(--fg);
  border-color: var(--line-focus);
}

body.sidebar-collapsed .sidebar-collapse-action-btn {
  justify-content: center;
  padding: 8px 0;
  width: 44px;
  margin: 0 auto;
}

body.sidebar-collapsed .collapse-label {
  display: none !important;
}

/* ---------------- SMOOTH SHADCN-STYLE MOTION & EXPANSION ---------------- */
.side {
  height: 100vh;
  width: var(--sidebar-w);
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
              padding 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  flex-shrink: 0;
  will-change: width, transform;
}

/* Nav Item Motion & Hover micro-interactions */
.nav button {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav button:hover {
  transform: translateX(3px);
}

.nav button:active {
  transform: scale(0.98);
}

.nav button svg {
  transition: transform 0.18s ease;
}

.nav button:hover svg {
  transform: scale(1.1);
}

/* Hover-to-expand behavior in collapsed rail mode */


body.sidebar-collapsed.sidebar-hover-expanded {
  --sidebar-w: 260px;
}

body.sidebar-collapsed.sidebar-hover-expanded .side {
  width: 260px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 16px 12px !important;
}

body.sidebar-collapsed.sidebar-hover-expanded .brand-info,
body.sidebar-collapsed.sidebar-hover-expanded .nav-label,
body.sidebar-collapsed.sidebar-hover-expanded .nav button span,
body.sidebar-collapsed.sidebar-hover-expanded .nav-badge,
body.sidebar-collapsed.sidebar-hover-expanded .collapse-label {
  display: inline-block !important;
  opacity: 1;
  animation: navFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.sidebar-collapsed.sidebar-hover-expanded .brand {
  justify-content: flex-start !important;
  padding: 2px 4px 14px !important;
}

body.sidebar-collapsed.sidebar-hover-expanded .nav {
  align-items: stretch !important;
}

body.sidebar-collapsed.sidebar-hover-expanded .nav button {
  justify-content: flex-start !important;
  width: 100% !important;
  padding: 9px 12px !important;
}

body.sidebar-collapsed.sidebar-hover-expanded .sidebar-collapse-action-btn {
  justify-content: flex-start !important;
  padding: 8px 12px !important;
  width: 100% !important;
}

@keyframes navFadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Card hover elevations */
.card, .stat {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.card:hover {
  border-color: var(--line-focus);
}

/* ---------------- COMPACT AUTH MODAL SIZING ---------------- */
/* ---------------- PREMIUM ENTERPRISE AUTH MODAL ---------------- */
#auth-dlg {
  width: min(420px, calc(100% - 32px)) !important;
  max-width: 420px !important;
  border-radius: 18px !important;
  padding: 0 !important;
  border: 1px solid var(--line) !important;
  background: var(--panel) !important;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  overflow: hidden;
  position: relative;
}

#auth-dlg::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#auth-dlg .dlg {
  width: 100% !important;
  max-width: 100% !important;
  padding: 28px 28px 24px !important;
  box-sizing: border-box;
}

.auth-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
}

.auth-modal-close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--mut);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-modal-close-btn:hover {
  background: var(--panel2);
  border-color: var(--line);
  color: var(--fg);
}

.auth-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--acc), #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.45);
}

.auth-modal-icon svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
}

.auth-tabs-segmented {
  display: flex;
  background: var(--panel2);
  padding: 4px;
  border-radius: 11px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  position: relative;
}

.auth-tab-btn {
  flex: 1;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--mut);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tab-btn.active {
  color: var(--fg);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-weight: 600;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--mut);
  pointer-events: none;
  stroke-width: 2;
}

.auth-input-field {
  width: 100%;
  padding: 10px 12px 10px 38px !important;
  font-size: 13.5px !important;
  border-radius: 9px !important;
  background: var(--panel2) !important;
  border: 1px solid var(--line) !important;
  color: var(--fg) !important;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.auth-input-field:focus {
  border-color: var(--acc) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
  outline: none;
}

.auth-pwd-toggle-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--mut);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.auth-pwd-toggle-btn:hover {
  color: var(--fg);
}

.auth-submit-btn {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* Quick Fill Preset Pills */
.auth-demo-presets {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.auth-demo-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-preset-chips {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.auth-preset-pill {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-preset-pill:hover {
  border-color: var(--acc);
  color: var(--acc);
  background: rgba(99, 102, 241, 0.1);
}


/* ---------------- WORLD-CLASS LANDING PAGE & PATENT SHOWCASE ---------------- */

.landing-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 10px 48px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  animation: landingFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes landingFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Section */
.landing-hero {
  position: relative;
  text-align: center;
  padding: 48px 24px 36px;
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.15) 0%, rgba(13, 18, 30, 0) 70%), var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc), transparent);
  opacity: 0.8;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--acc);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 22px;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
  animation: pulsePill 3s infinite;
}

@keyframes pulsePill {
  0%, 100% { box-shadow: 0 0 16px rgba(99, 102, 241, 0.2); }
  50% { box-shadow: 0 0 24px rgba(99, 102, 241, 0.45); }
}

.landing-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 8px var(--acc);
  animation: dotBlink 1.8s infinite;
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.landing-title {
  font-size: clamp(32px, 4.5vw, 54px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 auto 18px;
  max-width: 900px;
  color: var(--fg);
}

.landing-gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-subtitle {
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.6;
  color: var(--mut);
  max-width: 760px;
  margin: 0 auto 32px;
}

.landing-cta-group {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.landing-btn-hero {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.landing-btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.55);
}

.landing-btn-secondary {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.landing-btn-secondary:hover {
  background: var(--line);
  color: var(--acc);
}

.landing-demo-tags {
  font-size: 12.5px;
  color: var(--mut);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel2);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Metric Ticker Bar */
.landing-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

@media (max-width: 860px) {
  .landing-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.landing-metric-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.landing-metric-box:hover {
  transform: translateY(-3px);
  border-color: var(--line-focus);
}

.landing-metric-num {
  font-size: 28px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.landing-metric-num span.unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--acc);
}

.landing-metric-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}

.landing-metric-sub {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.4;
}

/* Section Common Styling */
.landing-section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 32px;
}

.landing-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--acc);
  margin-bottom: 8px;
}

.landing-section-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0 0 12px;
}

.landing-section-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--mut);
  margin: 0;
}

/* Patent Showcase Hero Card */
.landing-patent-hero {
  background: linear-gradient(145deg, var(--panel), var(--panel2));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.landing-patent-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--acc);
  color: var(--fg);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 16px;
}

.landing-patent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

@media (max-width: 900px) {
  .landing-patent-grid {
    grid-template-columns: 1fr;
  }
}

.landing-patent-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  position: relative;
  transition: all 0.25s ease;
}

.landing-patent-card:hover {
  transform: translateY(-4px);
  border-color: var(--acc);
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.3);
}

.landing-patent-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--acc);
}

.landing-patent-card h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}

.landing-patent-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--mut);
}

/* Feature 3-Pillar Cards */
.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .landing-feature-grid {
    grid-template-columns: 1fr;
  }
}

.landing-feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-focus);
  box-shadow: 0 14px 28px -12px rgba(0, 0, 0, 0.3);
}

.landing-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-feature-icon.indigo {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--acc);
}

.landing-feature-icon.emerald {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--ok);
}

.landing-feature-icon.cyan {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
}

.landing-feature-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

.landing-feature-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--mut);
}

.landing-feature-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--fg);
}

.landing-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-feature-list li svg {
  color: var(--ok);
  flex-shrink: 0;
}

/* 10-Stage Pipeline Visualizer */
.landing-pipeline-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 24px;
}

.landing-pipeline-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .landing-pipeline-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

.landing-step-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.landing-step-card:hover {
  border-color: var(--acc);
  transform: translateY(-2px);
}

.landing-step-num {
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--acc);
  background: rgba(99, 102, 241, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  align-self: center;
}

.landing-step-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
}

.landing-step-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--mut);
}

/* Bottom CTA Banner */
.landing-bottom-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(13, 18, 30, 0.8) 100%), var(--panel);
  border: 1px solid var(--line-focus);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.5);
}

.landing-bottom-cta h3 {
  font-size: 26px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}

.landing-bottom-cta p {
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 620px;
  margin: 0;
  color: var(--mut);
}


/* ---------------- PRE-AUTH / GUEST LANDING PAGE VIEW ---------------- */
body.is-guest {
  grid-template-columns: 1fr !important;
}

body.is-guest .side {
  display: none !important;
}

body.is-guest .topbar {
  display: none !important;
}

body.is-guest main {
  padding: 0 0 48px 0 !important;
  max-width: 100vw !important;
  width: 100vw !important;
}

/* Landing Floating Sticky Header */
.landing-top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(13, 18, 30, 0.78);
  border-bottom: 1px solid var(--line);
  padding: 14px clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.25s ease;
}

[data-theme="light"] .landing-top-nav {
  background: rgba(255, 255, 255, 0.85);
}

.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
}

.landing-nav-brand .logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--acc), #4f46e5);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.landing-nav-brand .logo svg {
  width: 17px;
  height: 17px;
  stroke: #ffffff;
}

.landing-nav-brand-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.landing-nav-patent-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--acc);
  background: rgba(99, 102, 241, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

@media (max-width: 768px) {
  .landing-nav-patent-pill {
    display: none;
  }
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-theme-toggle-btn {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-sec);
  cursor: pointer;
  transition: all 0.15s ease;
}

.landing-theme-toggle-btn:hover {
  background: var(--line);
  color: var(--fg);
}

.landing-nav-signin-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
}

.landing-nav-signin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

/* Landing footer override when full width */
body.is-guest .app-console-bar {
  max-width: 1180px;
  margin: 48px auto 0;
  width: calc(100% - 32px);
  box-sizing: border-box;
}


/* ==================== WORLD-CLASS LANDING MOTIONS & ANIMATIONS ==================== */

/* Ambient Glowing Background Orb in Hero */
.landing-hero {
  position: relative;
  text-align: center;
  padding: 56px 28px 42px;
  background: radial-gradient(circle at 50% 15%, rgba(99, 102, 241, 0.18) 0%, rgba(13, 18, 30, 0) 70%), var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--acc), #38bdf8, transparent);
  background-size: 200% 100%;
  animation: shineLine 4s linear infinite;
  opacity: 0.85;
}

@keyframes shineLine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Shimmering Animated Gradient Headline */
.landing-gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 35%, #38bdf8 70%, #a5b4fc 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 6s ease infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Staggered Scroll-In Reveal Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered transition delays for children */
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }
.delay-5 { transition-delay: 0.40s; }

/* Interactive Hover Lift & Glow on Cards */
.landing-metric-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.landing-metric-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--acc), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.landing-metric-box:hover {
  transform: translateY(-5px);
  border-color: var(--line-focus);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.35);
}

.landing-metric-box:hover::after {
  opacity: 1;
}

/* Patent Card Floating Effect */
.landing-patent-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.35s ease;
}

.landing-patent-card:hover {
  transform: translateY(-6px);
  border-color: var(--acc);
  box-shadow: 0 14px 30px -10px rgba(99, 102, 241, 0.35);
}

.landing-patent-card:hover .landing-patent-card-icon {
  transform: scale(1.1) rotate(4deg);
  background: rgba(99, 102, 241, 0.22);
}

.landing-patent-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--acc);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Feature 3-Pillars Card Animations */
.landing-feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.35s ease;
}

.landing-feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-focus);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.4);
}

.landing-feature-card:hover .landing-feature-icon {
  transform: scale(1.12);
}

.landing-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 10-Stage Pipeline Active Sequence Wave */
.landing-step-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.landing-step-card:hover {
  border-color: var(--acc);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.25);
}

.landing-step-card.active-pulse {
  border-color: var(--acc);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

/* Button Subtle Glow & Interactive Press */
.landing-btn-hero {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.landing-btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.6);
}

.landing-btn-hero:active {
  transform: translateY(0);
}
