/* ═══════════════════════════════════════════════════
   EyedeaHub — hub.css  v3.0
   Premium design system · fluid · no-scroll
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cabinet+Grotesk:wght@400;500;600;700;800;900&family=Instrument+Serif:ital@0;1&family=DM+Mono:wght@400;500&display=swap');

/* ── Tokens ─────────────────────────────────────── */
:root {
  /* Brand */
  --ink:         #7A1BF2;
  --ink-1:       #9542F5;
  --ink-2:       #5C12B8;
  --ink-glass:   rgba(122,27,242,.08);
  --ink-glow:    rgba(122,27,242,.22);
  --azure:       #0055FF;
  --aurora:      linear-gradient(135deg,#7A1BF2 0%,#0055FF 100%);
  --aurora-45:   linear-gradient(45deg,#7A1BF2 0%,#0055FF 100%);

  /* Surface */
  --bg:          #F5F4FF;
  --bg-2:        #EEF0FB;
  --bg-3:        #E4E7F6;
  --surface:     rgba(255,255,255,.96);
  --surface-2:   rgba(249,249,255,.9);
  --surface-3:   rgba(240,240,252,.85);
  --glass:       rgba(255,255,255,.60);
  --glass-border:rgba(255,255,255,.50);

  /* Text */
  --text:        #12111A;
  --text-2:      #3D3C52;
  --text-3:      #8C8A9E;

  /* Status */
  --green:       #00C37A;
  --green-bg:    rgba(0,195,122,.10);
  --amber:       #F59E0B;
  --amber-bg:    rgba(245,158,11,.10);
  --red:         #EF4444;
  --red-bg:      rgba(239,68,68,.10);
  --blue:        #3B82F6;
  --blue-bg:     rgba(59,130,246,.10);

  /* Borders */
  --border:      rgba(18,17,26,.07);
  --border-2:    rgba(18,17,26,.13);
  --border-3:    rgba(18,17,26,.20);

  /* Geometry */
  --sidebar-w:   256px;
  --topbar-h:    60px;
  --r-sm:        6px;
  --r-md:        10px;
  --r-lg:        16px;
  --r-xl:        22px;
  --r-2xl:       30px;

  /* Elevation */
  --shadow-sm:   0 1px 3px rgba(18,17,26,.06), 0 1px 2px rgba(18,17,26,.04);
  --shadow-md:   0 4px 16px rgba(18,17,26,.08), 0 2px 8px rgba(18,17,26,.06);
  --shadow-lg:   0 12px 40px rgba(18,17,26,.12), 0 4px 16px rgba(18,17,26,.08);
  --shadow-glow: 0 0 0 1px var(--ink-glass), 0 8px 32px var(--ink-glow);

  /* Motion */
  --ease:   cubic-bezier(.4,0,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --fast:   .12s var(--ease);
  --mid:    .22s var(--ease);
  --slow:   .38s var(--ease);
}

/* Dark theme */
[data-theme="twilight"] {
  color-scheme: dark;
  --bg:          #0E0D18;
  --bg-2:        #13111F;
  --bg-3:        #1A1828;
  --surface:     rgba(22,20,35,.97);
  --surface-2:   rgba(28,26,42,.92);
  --surface-3:   rgba(36,33,54,.88);
  --glass:       rgba(22,20,35,.65);
  --glass-border:rgba(255,255,255,.08);
  --text:        #F0EEFF;
  --text-2:      #C8C4DE;
  --text-3:      #6E6B86;
  --border:      rgba(240,238,255,.07);
  --border-2:    rgba(240,238,255,.13);
  --border-3:    rgba(240,238,255,.20);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.25);
  --shadow-md:   0 4px 20px rgba(0,0,0,.32);
  --shadow-lg:   0 16px 48px rgba(0,0,0,.40);
}

[data-theme="light"] {
  --bg:      #F7F7FE;
  --surface: #ffffff;
}

/* ── Reset ──────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin:0; padding:0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust:100%; }

body {
  font-family: 'Cabinet Grotesk', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Body noise grain */
body::before {
  content:'';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

h1,h2,h3,h4,h5 {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

a { color: inherit; text-decoration: none; }

/* ── Layout Shell ───────────────────────────────── */
.hub-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.hub-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  transition: margin-left var(--slow);
}

.hub-main.sidebar-collapsed { margin-left: 64px; }

.hub-content {
  flex: 1;
  padding: clamp(16px,2.5vw,32px) clamp(16px,3vw,40px);
  min-height: calc(100vh - var(--topbar-h) - 52px);
  max-width: 100%;
  overflow-x: hidden;
}

/* launcher override */
.launcher-layout .hub-main { margin-left: 0; }
.launcher-layout .hub-content { min-height: 100vh; padding: 0; }

/* ── Sidebar ────────────────────────────────────── */
.hub-sidebar {
  position: fixed;
  inset-block: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 900;
  transition: width var(--slow), transform var(--slow);
  overflow: hidden;
  will-change: width;
}

.hub-sidebar.collapsed { width: 64px; }

/* sidebar header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}

.brand-icon,
.system-brand-icon {
  position: relative;
  width: 34px; height: 34px;
  background: var(--aurora);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--ink-glow);
}

.brand-logo-img, .auth-logo-img, .public-logo-img, .launcher-logo-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.brand-dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 9px; height: 9px;
  background: var(--green);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.brand-text { overflow: hidden; min-width: 0; }
.brand-name {
  display: block;
  font-size: 14px; font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-name strong { color: var(--ink-1); }
.brand-tagline {
  display: block;
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  width: 28px; height: 28px;
  background: none; border: none;
  color: var(--text-3);
  cursor: pointer; padding: 4px;
  border-radius: var(--r-sm);
  transition: var(--mid);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.sidebar-toggle-btn:hover { background: var(--bg-2); color: var(--text); }

/* system switch */
.sidebar-system-switch {
  padding: 10px 10px 0;
}
.system-switch-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
  transition: var(--mid);
}
.system-switch-link:hover { border-color: var(--border-2); color: var(--text); }

/* sidebar search */
.sidebar-search { padding: 10px 10px 6px; flex-shrink: 0; }
.sidebar-search-wrap { position: relative; display: flex; align-items: center; }
.sidebar-search-icon { position: absolute; left: 9px; color: var(--text-3); font-size: 12px; pointer-events: none; }
.sidebar-search-input {
  width: 100%; padding: 7px 9px 7px 28px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); font-size: 12.5px;
  font-family: inherit; transition: var(--mid);
}
.sidebar-search-input::placeholder { color: var(--text-3); }
.sidebar-search-input:focus { outline: none; border-color: rgba(122,27,242,.35); background: var(--bg-3); }

/* nav */
.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 6px 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-3) transparent;
}

.nav-section { margin-bottom: 4px; }
.nav-section-label {
  display: block; padding: 6px 6px 3px;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-3); white-space: nowrap; overflow: hidden;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: var(--r-md);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: var(--mid);
  cursor: pointer; white-space: nowrap; overflow: hidden;
  position: relative;
}
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active {
  background: var(--ink-glass);
  color: var(--ink-1);
  border: 1px solid rgba(122,27,242,.15);
}
.nav-item.active::before {
  content:'';
  position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 2.5px;
  background: var(--aurora);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-3);
  transition: var(--mid);
}
.nav-item.active .nav-icon { color: var(--ink-1); }
.nav-item:hover .nav-icon { color: var(--text); }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  background: var(--bg-3); color: var(--text-3);
  border-radius: 20px; flex-shrink: 0;
}
.nav-badge-urgent { background: rgba(239,68,68,.15); color: var(--red); }

/* sidebar user */
.sidebar-user { border-top: 1px solid var(--border); padding: 10px 8px; flex-shrink: 0; }
.sidebar-user-card {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: var(--r-md);
  transition: var(--mid); overflow: hidden; cursor: pointer;
}
.sidebar-user-card:hover { background: var(--bg-2); }

.user-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  background: var(--ink-glass); border: 2px solid rgba(122,27,242,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--ink-1);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; overflow: hidden; }
.user-name { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 10.5px; color: var(--text-3); white-space: nowrap; text-transform: capitalize; }
.user-menu-icon { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

/* collapsed */
.hub-sidebar.collapsed .brand-text,
.hub-sidebar.collapsed .sidebar-search,
.hub-sidebar.collapsed .sidebar-system-switch span,
.hub-sidebar.collapsed .nav-section-label,
.hub-sidebar.collapsed .nav-label,
.hub-sidebar.collapsed .nav-badge,
.hub-sidebar.collapsed .user-info,
.hub-sidebar.collapsed .user-menu-icon { display: none; }
.hub-sidebar.collapsed .nav-item { justify-content: center; padding: 8px; }
.hub-sidebar.collapsed .sidebar-system-switch { padding: 10px 8px 0; }
.hub-sidebar.collapsed .system-switch-link { justify-content: center; padding: 8px; }
.hub-sidebar.collapsed .nav-icon { width: 30px; height: 30px; font-size: 16px; }
.hub-sidebar.collapsed .sidebar-user-card { justify-content: center; }
.hub-sidebar.collapsed .sidebar-toggle-btn { transform: rotate(180deg); }

/* system sidebar color var */
.system-sidebar { --system-color: var(--ink-1); }
.system-sidebar .nav-item.active {
  background: color-mix(in srgb, var(--system-color) 10%, transparent);
  color: var(--system-color);
}
.system-sidebar .nav-item.active::before { background: var(--system-color); }

/* ── Topbar ─────────────────────────────────────── */
.hub-topbar {
  position: sticky; top: 0; z-index: 800;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.topbar-menu-btn {
  display: none; background: none; border: none;
  color: var(--text-2); font-size: 18px; cursor: pointer;
  padding: 6px; border-radius: var(--r-sm); flex-shrink: 0;
}

.topbar-system-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--system-color,var(--ink)) 25%, var(--border));
  background: color-mix(in srgb, var(--system-color,var(--ink)) 08%, transparent);
  color: var(--system-color, var(--ink-1));
  font-size: 12px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}

/* search */
.topbar-search-wrap {
  position: relative; flex: 1; max-width: 400px; min-width: 0;
  display: flex; align-items: center;
}
.topbar-search-icon { position: absolute; left: 11px; color: var(--text-3); font-size: 12px; pointer-events: none; }
.topbar-search {
  width: 100%; padding: 8px 36px 8px 32px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); color: var(--text); font-size: 13px;
  font-family: inherit; transition: var(--mid);
}
.topbar-search::placeholder { color: var(--text-3); }
.topbar-search:focus { outline: none; border-color: rgba(122,27,242,.35); background: var(--bg-3); box-shadow: 0 0 0 3px var(--ink-glass); }
.search-kbd {
  position: absolute; right: 9px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 5px; padding: 1px 6px; font-size: 10px; color: var(--text-3);
  font-family: 'DM Mono', monospace;
}

.search-results-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  max-height: 380px; overflow-y: auto;
  display: none; z-index: 1000;
}
.search-results-dropdown.show { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: var(--fast); border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-2); }
.sri-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--bg-3); padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.sri-title { flex: 1; font-size: 13px; font-weight: 500; }
.sri-domain { font-size: 11px; color: var(--text-3); }

/* topbar actions */
.topbar-action-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-2); width: 34px; height: 34px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; transition: var(--mid);
  position: relative;
}
.topbar-action-btn:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-2); }
.topbar-quick-create {
  background: var(--aurora); color: #fff; border: none;
  box-shadow: 0 4px 14px var(--ink-glow);
}
.topbar-quick-create:hover { filter: brightness(1.08); color: #fff; }

.notif-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--ink); color: #fff;
  min-width: 16px; height: 16px; border-radius: 999px;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface); padding: 0 3px;
}

/* notif dropdown */
.notif-dropdown {
  width: 340px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
}
.notif-title { font-size: 14px; font-weight: 700; }
.notif-mark-all { font-size: 12px; color: var(--ink-1); cursor: pointer; font-weight: 500; }
.notif-mark-all:hover { text-decoration: underline; }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; transition: var(--fast);
  border-bottom: 1px solid var(--border);
}
.notif-item:hover { background: var(--bg-2); }
.notif-item.unread { background: rgba(122,27,242,.03); }
.notif-item.priority-urgent { border-left: 2.5px solid var(--red); }
.notif-item.priority-high { border-left: 2.5px solid var(--amber); }
.notif-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.notif-color-green   { background: var(--green-bg); color: var(--green); }
.notif-color-blue    { background: var(--blue-bg); color: var(--blue); }
.notif-color-amber   { background: var(--amber-bg); color: var(--amber); }
.notif-color-red     { background: var(--red-bg); color: var(--red); }
.notif-color-purple  { background: var(--ink-glass); color: var(--ink-1); }
.notif-color-secondary { background: var(--bg-3); color: var(--text-3); }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 12.5px; font-weight: 500; margin-bottom: 1px; }
.notif-sub  { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.notif-empty { display: flex; flex-direction: column; align-items: center; padding: 28px; gap: 6px; color: var(--text-3); font-size: 13px; }
.notif-empty i { font-size: 26px; color: var(--green); }
.notif-footer { display: block; text-align: center; padding: 11px; font-size: 12.5px; color: var(--ink-1); font-weight: 500; border-top: 1px solid var(--border); transition: var(--fast); }
.notif-footer:hover { background: var(--ink-glass); }

/* user dropdown */
.topbar-user-btn {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 4px 8px 4px 4px;
  cursor: pointer; transition: var(--mid); color: var(--text);
}
.topbar-user-btn:hover { border-color: var(--border-2); background: var(--bg-2); }
.topbar-avatar {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  background: var(--ink-glass); border: 1.5px solid rgba(122,27,242,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--ink-1);
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-user-name { display: block; font-size: 12px; font-weight: 600; }
.topbar-user-role { display: block; font-size: 10.5px; color: var(--text-3); }

.user-dropdown {
  min-width: 210px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
}
.user-dropdown-header { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.uh-avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: var(--ink-glass); border: 2px solid rgba(122,27,242,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--ink-1);
}
.uh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.uh-name { font-size: 12.5px; font-weight: 600; }
.uh-email { font-size: 11px; color: var(--text-3); }
.user-dropdown .dropdown-item { border-radius: var(--r-sm); padding: 8px 12px; font-size: 13px; color: var(--text-2); transition: var(--fast); }
.user-dropdown .dropdown-item:hover { background: var(--bg-2); color: var(--text); }
.user-dropdown .dropdown-divider { border-color: var(--border); margin: 3px 0; }

/* ── Launcher (Hub Home) ─────────────────────────── */
.launcher-home {
  min-height: 100vh;
  background: var(--bg);
}

/* Ambient hero gradient */
.launcher-home::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(122,27,242,.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 5%, rgba(0,85,255,.10) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.launcher-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px clamp(18px, 4vw, 48px) 64px;
}

/* top bar */
.launcher-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 56px;
}

.launcher-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.launcher-brand-mark {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--aurora);
  display: grid; place-items: center;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--ink-glow);
}
.launcher-brand-text {
  font-size: 18px; font-weight: 800; letter-spacing: -.025em;
}
.launcher-brand-text strong { color: var(--ink-1); }

.launcher-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 13px;
}
.launcher-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer; transition: var(--mid);
  backdrop-filter: blur(8px);
}
.launcher-icon-btn:hover { border-color: var(--border-2); color: var(--text); }

/* hero section */
.launcher-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.launcher-wordmark {
  width: min(240px, 58vw);
  height: auto;
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 24px rgba(122,27,242,.12));
}

.launcher-kicker {
  color: var(--ink-1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.launcher-kicker::before {
  content: '';
  width: 18px; height: 1.5px;
  background: var(--aurora);
  display: inline-block;
  border-radius: 2px;
}

.launcher-title {
  font-size: clamp(34px, 6vw, 68px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -.04em;
  margin-bottom: 12px;
}
.launcher-subtitle { color: var(--text-2); font-size: 15px; }

/* search */
.launcher-search-wrap {
  min-width: min(320px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  backdrop-filter: blur(14px);
}
.launcher-search-wrap i { color: var(--text-3); flex-shrink: 0; }
.launcher-search {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text); font-family: inherit; font-size: 14px;
}
.launcher-search::placeholder { color: var(--text-3); }
.launcher-search-wrap span { color: var(--text-3); font-size: 11px; font-weight: 700; }

/* systems grid — auto-fit, fluid, never overflows */
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 14px;
}

.launcher-system {
  min-height: 176px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 20px;
  overflow: hidden;
  transition: transform var(--mid), border-color var(--mid), background var(--mid), box-shadow var(--mid);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.launcher-system:hover {
  transform: translateY(-3px);
  border-color: var(--sc, var(--ink));
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0,0,0,.10), 0 0 0 1px var(--sc, var(--ink));
}
/* system card glow */
.launcher-system::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 80% 0%, color-mix(in srgb, var(--sc, var(--ink)) 18%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity var(--mid);
  pointer-events: none;
}
.launcher-system:hover::before { opacity: 1; }

.launcher-system-icon {
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  color: var(--sc, var(--ink-1));
  background: color-mix(in srgb, var(--sc, var(--ink)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc, var(--ink)) 28%, transparent);
  font-size: 20px;
}
.launcher-system-name {
  font-size: 16px; font-weight: 800; letter-spacing: -.025em;
  color: var(--text);
}
.launcher-system-desc { color: var(--text-3); font-size: 12.5px; line-height: 1.5; max-width: 200px; }
.launcher-system-enter {
  position: absolute; right: 16px; bottom: 14px;
  color: var(--sc, var(--ink-1));
  opacity: 0; transform: translateX(-4px);
  transition: var(--mid);
  font-size: 14px;
}
.launcher-system:hover .launcher-system-enter { opacity: 1; transform: translateX(0); }

.launcher-empty {
  grid-column: 1/-1; padding: 52px 20px;
  text-align: center; color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.launcher-empty i { display: block; font-size: 32px; margin-bottom: 10px; }

/* message alerts in launcher */
.launcher-messages { margin-bottom: 16px; }

/* section label */
.launcher-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.launcher-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* system welcome */
.system-welcome-header .page-title { display: flex; align-items: center; gap: 10px; }
.system-module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px,100%), 1fr)); gap: 14px; }
.system-module-card {
  min-height: 164px; display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px;
  transition: var(--mid);
}
.system-module-card:hover { transform: translateY(-2px); border-color: var(--border-2); background: var(--bg-2); }
.system-module-card.is-disabled { cursor: default; opacity: .7; }
.system-module-icon {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--ink-glass); color: var(--ink-1);
  border: 1px solid rgba(122,27,242,.18);
}
.system-module-name { font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.system-module-desc { color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
.system-module-action { margin-top: auto; color: var(--ink-1); font-size: 12px; font-weight: 700; }

/* ── Hub Home (internal) ────────────────────────── */
.hub-home { max-width: 1400px; margin: 0 auto; }

/* Welcome hero */
.welcome-hero {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: clamp(20px,3vw,36px) clamp(20px,3.5vw,40px);
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.welcome-glow {
  position: absolute; top: -80px; right: -80px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, var(--ink-glow) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-content { position: relative; z-index: 1; }
.greeting-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--green-bg); border: 1px solid rgba(0,195,122,.20);
  border-radius: 20px; padding: 3px 10px; font-size: 11px; color: var(--green);
  font-weight: 600; margin-bottom: 10px;
}
.greeting-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }
.welcome-title { font-size: clamp(20px,2.5vw,30px); font-weight: 900; letter-spacing:-.03em; margin-bottom: 6px; }
.welcome-name { color: var(--ink-1); }
.welcome-sub { font-size: 13.5px; color: var(--text-2); max-width: 480px; }
.welcome-meta {
  display: flex; flex-direction: column; gap: 7px;
  text-align: right; flex-shrink: 0;
}
.meta-card {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 7px 12px;
  font-size: 12.5px; color: var(--text-2); justify-content: flex-end;
}
.meta-card i { color: var(--ink-1); }

/* KPI strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 12px; margin-bottom: 20px;
}
.kpi-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--mid);
}
.kpi-item:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.kpi-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  background: rgba(var(--kc), .12); border: 1px solid rgba(var(--kc), .22);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--kc);
}
.kpi-value { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; color: var(--text); line-height: 1; }
.kpi-label { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; font-weight: 500; }

/* ── Page Components ────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 14px; flex-wrap: wrap;
}
.page-header-left { flex: 1; min-width: 0; }
.page-breadcrumb {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-3); margin-bottom: 5px;
}
.page-breadcrumb a { color: var(--ink-1); }
.page-breadcrumb-sep { color: var(--text-3); }
.page-title { font-size: clamp(20px, 2.5vw, 26px); font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────── */
.btn-hub {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: var(--mid); border: 1px solid transparent;
  white-space: nowrap; user-select: none;
}
.btn-hub-primary {
  background: var(--aurora); color: #fff; border: none;
  box-shadow: 0 4px 16px var(--ink-glow);
}
.btn-hub-primary:hover { filter: brightness(1.06); box-shadow: 0 6px 20px var(--ink-glow); color: #fff; }
.btn-hub-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-hub-ghost:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-2); }
.btn-hub-danger { background: var(--red-bg); color: var(--red); border-color: rgba(239,68,68,.25); }
.btn-hub-danger:hover { background: rgba(239,68,68,.18); }
.btn-hub-sm { padding: 5px 12px; font-size: 12px; }

/* ── Cards ──────────────────────────────────────── */
.hub-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.hub-card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.hub-card-title { font-size: 14px; font-weight: 700; letter-spacing:-.01em; display: flex; align-items:center; gap: 7px; }
.hub-card-body { padding: 20px; }

.form-card { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 12px; font-weight: 700; }
.form-field-wide { grid-column: 1/-1; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-2); color: var(--text); padding: 9px 11px;
  font: inherit; font-weight: 500; transition: var(--mid);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: rgba(122,27,242,.40); box-shadow: 0 0 0 3px var(--ink-glass);
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px 20px; border-top: 1px solid var(--border);
}

/* layout grids */
.split-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,.7fr); gap: 18px; }
.three-column-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }

/* table */
.hub-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hub-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hub-table th {
  padding: 10px 14px; text-align: left;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.hub-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: middle;
}
.hub-table tr:last-child td { border-bottom: none; }
.hub-table tbody tr:hover td { background: var(--bg-2); color: var(--text); }
.table-empty { text-align: center; color: var(--text-3); padding: 28px; }

/* stack list */
.stack-list { display: flex; flex-direction: column; padding: 8px; }
.stack-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.stack-item:last-child { border-bottom: 0; }
.stack-item strong { display: block; color: var(--text); }
.stack-item span { display: block; color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.mini-progress { width: 80px; height: 5px; overflow: hidden; border-radius: 20px; background: var(--bg-3); }
.mini-progress span { display: block; height: 100%; background: var(--aurora); }

/* empty panel */
.empty-panel {
  min-height: 190px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; padding: 30px; color: var(--text-3); text-align: center;
}
.empty-panel i { font-size: 34px; color: var(--ink-1); }
.empty-panel strong { color: var(--text); font-size: 15px; }

/* diagram */
.diagram-canvas-wrap {
  min-height: 420px; overflow: auto; padding: 16px;
  background: repeating-linear-gradient(0deg,transparent,transparent 27px,var(--border) 28px),
    repeating-linear-gradient(90deg,transparent,transparent 27px,var(--border) 28px),
    var(--bg-2);
  background-size: 28px 28px;
}
.diagram-canvas-wrap svg { display: block; max-width: 100%; height: auto; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }

/* ── Status Badges ──────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.status-badge::before { content:''; width:4px; height:4px; border-radius:50%; background:currentColor; }
.badge-success  { background: var(--green-bg); color: var(--green); border: 1px solid rgba(0,195,122,.20); }
.badge-warning  { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245,158,11,.20); }
.badge-danger   { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,.20); }
.badge-info     { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(59,130,246,.20); }
.badge-primary  { background: var(--ink-glass); color: var(--ink); border: 1px solid rgba(122,27,242,.20); }
.badge-secondary{ background: var(--bg-3); color: var(--text-3); border: 1px solid var(--border); }

/* ── Forms ──────────────────────────────────────── */
.hub-form-group { margin-bottom: 18px; }
.hub-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; }
.hub-input, .hub-select, .hub-textarea {
  width: 100%; padding: 9px 12px;
  background: var(--bg-2); border: 1.5px solid var(--border);
  border-radius: var(--r-md); color: var(--text);
  font-size: 13.5px; font-family: inherit; transition: var(--mid);
}
.hub-input:focus, .hub-select:focus, .hub-textarea:focus {
  outline: none; border-color: rgba(122,27,242,.40); box-shadow: 0 0 0 3px var(--ink-glass);
}
.hub-textarea { resize: vertical; min-height: 90px; }
.hub-select { appearance: none; cursor: pointer; }

/* filter bar */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-search-wrap { position: relative; flex: 1; min-width: 180px; }
.filter-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 12px; pointer-events: none; }
.filter-search {
  width: 100%; padding: 8px 11px 8px 29px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text); font-size: 13px;
  font-family: inherit; transition: var(--mid);
}
.filter-search:focus { outline: none; border-color: rgba(122,27,242,.40); box-shadow: 0 0 0 3px var(--ink-glass); }

/* stats row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px,100%),1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px; transition: var(--mid);
}
.stat-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.stat-card-value { font-size: 28px; font-weight: 800; letter-spacing: -.04em; color: var(--text); line-height: 1; }
.stat-card-label { font-size: 11.5px; color: var(--text-3); margin-top: 4px; font-weight: 500; }
.stat-card-trend { font-size: 11.5px; margin-top: 5px; }
.stat-card-trend.up { color: var(--green); }
.stat-card-trend.down { color: var(--red); }

/* ── Activity ───────────────────────────────────── */
.hub-bottom-row { display: grid; grid-template-columns: 1fr min(360px,40%); gap: 18px; margin-bottom: 18px; }
.activity-panel, .notif-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.panel-title i { color: var(--ink-1); }
.panel-badge { background: var(--green-bg); border: 1px solid rgba(0,195,122,.20); border-radius: 20px; padding: 2px 8px; font-size: 10px; color: var(--green); font-weight: 700; }
.panel-action { font-size: 11.5px; color: var(--ink-1); cursor: pointer; font-weight: 500; }
.panel-action:hover { text-decoration: underline; }

.activity-list { padding: 14px 18px; max-height: 300px; overflow-y: auto; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; position: relative; }
.activity-item:not(:last-child) { border-bottom: 1px solid var(--border); }
.activity-line { position: absolute; left: 10px; top: 22px; bottom: -9px; width: 1px; background: var(--border); }
.activity-item:last-child .activity-line { display: none; }
.activity-dot { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--border-2); background: var(--bg-2); position: relative; z-index: 1; }
.activity-body { flex: 1; min-width: 0; }
.activity-verb { font-size: 12.5px; font-weight: 500; color: var(--text); line-height: 1.4; }
.activity-meta { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.activity-user { font-size: 11px; color: var(--ink-1); font-weight: 500; }
.activity-time { font-size: 10.5px; color: var(--text-3); }
.activity-empty { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 13px; padding: 18px 0; justify-content: center; }

/* notif panel */
.notif-panel-list { max-height: 300px; overflow-y: auto; }
.notif-panel-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; transition: var(--fast); border-bottom: 1px solid var(--border); }
.notif-panel-item:hover { background: var(--bg-2); }
.notif-panel-item.priority-urgent { border-left: 2.5px solid var(--red); }
.notif-panel-item.priority-high   { border-left: 2.5px solid var(--amber); }
.npi-icon { width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.color-green    { background: var(--green-bg); color: var(--green); }
.color-blue     { background: var(--blue-bg); color: var(--blue); }
.color-amber    { background: var(--amber-bg); color: var(--amber); }
.color-red      { background: var(--red-bg); color: var(--red); }
.color-purple   { background: var(--ink-glass); color: var(--ink-1); }
.color-secondary{ background: var(--bg-3); color: var(--text-3); }
.npi-body { flex: 1; min-width: 0; }
.npi-title { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npi-time  { font-size: 10.5px; color: var(--text-3); }
.npi-urgent { width: 18px; height: 18px; background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,.25); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }
.notif-panel-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 36px; color: var(--text-3); font-size: 13px; }
.notif-panel-empty i { font-size: 26px; color: var(--green); }
.panel-footer-link { display: block; text-align: center; padding: 11px; font-size: 12.5px; color: var(--ink-1); font-weight: 500; border-top: 1px solid var(--border); transition: var(--fast); }
.panel-footer-link:hover { background: var(--ink-glass); }

/* ── Alerts ─────────────────────────────────────── */
.hub-messages { margin-bottom: 18px; }
.hub-alert {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); color: var(--text); padding: 11px 14px; font-size: 13px;
}
.hub-alert-success { border-color: rgba(0,195,122,.28); background: var(--green-bg); }
.hub-alert-error, .hub-alert-danger { border-color: rgba(239,68,68,.28); background: var(--red-bg); }
.hub-alert-warning { border-color: rgba(245,158,11,.28); background: var(--amber-bg); }
.hub-alert-info    { border-color: rgba(59,130,246,.28); background: var(--blue-bg); }
.hub-alert .btn-close { filter: none; opacity: .5; }
[data-theme="twilight"] .hub-alert .btn-close { filter: invert(1); }

/* ── Auth ───────────────────────────────────────── */
.auth-body { overflow: hidden; }
.auth-scene { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; }
.auth-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .3; }
.auth-orb-1 { width: 600px; height: 600px; top: -200px; left: -200px; background: var(--ink); }
.auth-orb-2 { width: 400px; height: 400px; bottom: -100px; right: -100px; background: #4f46e5; }
.auth-orb-3 { width: 300px; height: 300px; top: 50%; left: 60%; background: #7c3aed; }
.auth-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px,transparent 1px),linear-gradient(90deg,var(--border) 1px,transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%,black,transparent);
}
.auth-card {
  position: relative; z-index: 10;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 22px; padding: 38px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 60px var(--ink-glow);
  backdrop-filter: blur(20px);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand-icon {
  width: 46px; height: 46px; background: var(--aurora); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; overflow: hidden;
  box-shadow: 0 4px 16px var(--ink-glow);
}
.auth-brand-name { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.03em; }
.auth-brand-name strong { color: var(--ink-1); }
.auth-brand-sub { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; }
.auth-title { font-size: 26px; font-weight: 900; letter-spacing: -.04em; margin-bottom: 5px; }
.auth-subtitle { font-size: 13.5px; color: var(--text-2); margin-bottom: 24px; }
.auth-error {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 18px;
  font-size: 13px; color: #fca5a5; display: flex; align-items: center; gap: 7px;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-icon { position: absolute; left: 12px; font-size: 14px; color: var(--text-3); pointer-events: none; }
.auth-input {
  width: 100%; padding: 11px 40px 11px 38px;
  background: var(--bg-2); border: 1.5px solid var(--border);
  border-radius: var(--r-md); color: var(--text);
  font-size: 14px; font-family: inherit; transition: var(--mid);
}
.auth-input::placeholder { color: var(--text-3); }
.auth-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ink-glass); }
.auth-input.is-invalid { border-color: var(--red); }
.auth-pwd-toggle { position: absolute; right: 11px; background: none; border: none; color: var(--text-3); cursor: pointer; padding: 4px; font-size: 14px; transition: var(--mid); }
.auth-pwd-toggle:hover { color: var(--text); }
.auth-field-error { font-size: 11.5px; color: var(--red); }
.auth-submit {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 20px; width: 100%;
  background: var(--aurora); border: none; border-radius: var(--r-md);
  color: #fff; font-size: 14.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: var(--mid); margin-top: 3px;
  box-shadow: 0 4px 16px var(--ink-glow);
}
.auth-submit:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 24px var(--ink-glow); }
.auth-footer { margin-top: 24px; text-align: center; font-size: 11.5px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 18px; }

/* ── Footer ─────────────────────────────────────── */
.hub-footer { border-top: 1px solid var(--border); padding: 12px 28px; background: var(--surface); }
.footer-inner { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.footer-brand { font-weight: 800; color: var(--text-2); letter-spacing: -.01em; }
.footer-version { background: var(--ink-glass); color: var(--ink-1); border-radius: 4px; padding: 1px 5px; font-size: 9.5px; font-family: 'DM Mono', monospace; }
.footer-sep { color: var(--border-2); }

/* ── Modal ──────────────────────────────────────── */
.hub-modal .modal-content { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-xl); color: var(--text); box-shadow: var(--shadow-lg); }
.hub-modal .modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.hub-modal .modal-title { font-size: 16px; font-weight: 700; }
.hub-modal .modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }

/* ── Toast ──────────────────────────────────────── */
.hub-toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; }
.hub-toast {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg); min-width: 280px;
  animation: toast-slide-in .28s var(--spring);
}
@keyframes toast-slide-in { from { opacity:0; transform:translateX(18px); } }

/* ── Enterprise shell ───────────────────────────── */
.enterprise-shell { max-width: 1480px; margin: 0 auto; }
.enterprise-hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background: linear-gradient(135deg,rgba(122,27,242,.08),rgba(0,85,255,.06)), var(--surface);
  box-shadow: var(--shadow-sm); padding: 24px 26px; margin-bottom: 20px;
}
.enterprise-hero::after { content:''; position:absolute; inset:auto -80px -120px auto; width:300px; height:300px; border-radius:999px; background:var(--aurora); opacity:.08; pointer-events:none; }
.enterprise-hero .page-header { position: relative; z-index: 1; margin-bottom: 0; }
.enterprise-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,380px); gap: 18px; align-items: start; }
.enterprise-grid-wide { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.45fr); gap: 18px; align-items: start; }
.module-action-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(145px,100%),1fr)); gap: 12px; margin-bottom: 22px; }
.module-action {
  display: flex; flex-direction: column; gap: 9px; min-height: 124px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-sm); transition: var(--mid);
}
.module-action:hover { transform: translateY(-2px); border-color: color-mix(in srgb,var(--ink) 25%,var(--border)); box-shadow: var(--shadow-md); }
.module-action i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--aurora); box-shadow: 0 6px 16px var(--ink-glow); }
.module-action strong { font-size: 13.5px; color: var(--text); }
.module-action span { color: var(--text-3); font-size: 12px; line-height: 1.4; }

.metric-card { position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.metric-card::before { content:''; position:absolute; inset:0 auto 0 0; width:2.5px; background:var(--aurora); }
.metric-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.metric-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--ink-glass); color: var(--ink-1); }
.metric-kicker { color: var(--text-3); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.avatar-stack { display: flex; align-items: center; }
.avatar-chip, .avatar-stack span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--ink-glass); border: 1.5px solid color-mix(in srgb,var(--ink) 35%,#fff); color: var(--ink-1); font-weight: 700; font-size: 10.5px; }
.avatar-stack span + span { margin-left: -8px; }

.enterprise-filter { padding: 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.enterprise-empty { background: linear-gradient(135deg,rgba(122,27,242,.04),rgba(0,85,255,.03)),var(--surface); }

.enterprise-timeline .stack-item { position: relative; justify-content: flex-start; }
.timeline-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 999px; background: var(--aurora); box-shadow: 0 0 0 3px var(--ink-glass); }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-actions { display: inline-flex; align-items: center; gap: 5px; }
.list-primary { display: flex; flex-direction: column; gap: 2px; }
.list-primary strong { color: var(--text); }
.list-primary span { color: var(--text-3); font-size: 11.5px; }

.pipeline-strip { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(160px,100%),1fr)); gap: 10px; }
.pipeline-step { position: relative; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.pipeline-step.is-active { border-color: color-mix(in srgb,var(--ink) 30%,var(--border)); background: color-mix(in srgb,var(--ink) 5%,var(--surface)); }
.pipeline-step strong, .pipeline-step span { display: block; }
.pipeline-step strong { color: var(--text); font-size: 12.5px; }
.pipeline-step span { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }

.kanban-board { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(250px,100%),1fr)); gap: 14px; align-items: start; }
.kanban-column { background: color-mix(in srgb,var(--bg-2) 90%,white); border: 1px solid var(--border); border-radius: var(--r-lg); min-height: 200px; padding: 10px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px; box-shadow: var(--shadow-sm); }
.kanban-column-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 3px 10px; }
.kanban-column-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.kanban-count { min-width: 22px; text-align: center; border-radius: 999px; background: var(--bg-3); color: var(--text-3); font-size: 10.5px; font-weight: 700; padding: 1px 6px; }
.kanban-card + .kanban-card { margin-top: 8px; }
.kanban-card-title { color: var(--text); font-size: 12.5px; font-weight: 700; }
.kanban-card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; color: var(--text-3); font-size: 11px; }

.loading-skeleton { min-height: 11px; border-radius: 999px; background: linear-gradient(90deg,var(--bg-2),var(--bg-3),var(--bg-2)); background-size: 220% 100%; animation: skeleton-pulse 1.4s ease infinite; }
@keyframes skeleton-pulse { to { background-position:-220% 0; } }

/* public shell */
.public-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(260px,.75fr) minmax(300px,1fr); gap: 24px; padding: 38px; background: radial-gradient(circle at top left,rgba(233,213,255,.7),transparent 34rem),linear-gradient(135deg,#f8faff 0%,#edf2ff 100%); }
.public-shell-wide { grid-template-columns: minmax(0,1fr) minmax(280px,360px); }
.public-panel, .public-card { border: 1px solid var(--border); border-radius: var(--r-xl); background: rgba(255,255,255,.88); box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); }
.public-panel { padding: 30px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.public-panel::after { content:''; position:absolute; inset:auto -18% -28% 28%; height:260px; background:var(--aurora); opacity:.10; transform:rotate(-8deg); border-radius:40px; }
.public-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.public-brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--aurora); color: #fff; overflow: hidden; }
.public-brand strong, .public-brand span, .public-copy { display: block; }
.public-brand span, .public-copy p { color: var(--text-3); }
.public-copy { position: relative; z-index: 1; max-width: 500px; }
.public-copy h1 { font-size: clamp(2rem,5vw,3.8rem); line-height: 1; }
.public-card { padding: 26px; }
.public-form .form-control, .public-form .form-select { border-color: var(--border); background: var(--bg-2); color: var(--text); }
.public-form em { color: var(--red); font-style: normal; font-size: 11.5px; }
.eyebrow { display: inline-flex; margin-bottom: 7px; color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }

.public-document-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.quote-total-panel { display: grid; justify-content: end; gap: 7px; padding: 20px; border-top: 1px solid var(--border); }
.quote-total-panel span { display: flex; justify-content: space-between; gap: 38px; color: var(--text-2); }
.quote-grand-total { color: var(--text) !important; font-size: 16px; }
.quote-flow-card { border: 1px solid rgba(122,27,242,.20); box-shadow: 0 12px 36px rgba(122,27,242,.10); }
.quote-milestone-row { padding: 14px 18px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1.2fr 2fr 110px 120px auto; gap: 8px; align-items: end; }
.quote-timeline { position: relative; padding: 16px 18px; }
.quote-timeline-item { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 0 0 16px; }
.quote-timeline-item:not(:last-child)::before { content:''; position:absolute; left:7px; top:16px; bottom:0; width:1.5px; background:var(--aurora); opacity:.38; }
.quote-timeline-dot { width: 16px; height: 16px; border-radius: 999px; background: var(--aurora); box-shadow: 0 0 0 4px color-mix(in srgb,var(--ink) 15%,transparent); }
.quote-timeline-item strong { display: block; color: var(--text); margin-bottom: 2px; }
.quote-timeline-item p { color: var(--text-2); font-size: 13px; line-height: 1.5; margin: 0 0 3px; }
.quote-timeline-item span { color: var(--ink); font-size: 11.5px; font-weight: 700; }
.quote-portal { align-items: start; }
.quote-portal-main { overflow: hidden; }
.quote-public-logo { width: 44px; height: 44px; object-fit: cover; display: block; border-radius: 11px; margin-bottom: 10px; box-shadow: 0 8px 22px rgba(122,27,242,.16); }
.quote-portal-hero { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center; padding: 16px; margin-bottom: 18px; border-radius: 7px; background: linear-gradient(135deg,rgba(122,27,242,.12),rgba(0,85,255,.10)),#fff; border: 1px solid rgba(122,27,242,.15); }
.quote-portal-hero span { display: block; color: var(--text-2); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.quote-portal-hero strong { color: var(--ink-2); font-size: 22px; }
.quote-portal-timeline { border-top: 1px solid var(--border); }
.quote-decision-actions { border-top: 1px solid var(--border); padding-top: 16px; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 10px; }
.detail-grid > div { padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-2); }
.detail-grid span, .detail-grid strong { display: block; }
.detail-grid span { color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing:.06em; text-transform:uppercase; margin-bottom: 3px; }
.detail-grid strong { color: var(--text); font-size: 13.5px; }

/* ── Hub KPI search ─────────────────────────────── */
.systems-search-section { margin-bottom: 18px; }
.systems-search-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 10px 16px; transition: var(--mid);
}
.systems-search-wrap:focus-within { border-color: rgba(122,27,242,.35); box-shadow: 0 0 0 3px var(--ink-glass); }
.systems-search-icon { font-size: 16px; color: var(--ink-1); flex-shrink: 0; }
.systems-search-input { flex: 1; background: none; border: none; font-size: 14.5px; color: var(--text); font-family: inherit; }
.systems-search-input::placeholder { color: var(--text-3); }
.systems-search-input:focus { outline: none; }
.systems-count { font-size: 12px; color: var(--text-3); white-space: nowrap; font-weight: 500; }

.systems-section { margin-bottom: 30px; }
.systems-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.systems-title { font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.systems-subtitle { font-size: 13px; color: var(--text-3); }

.systems-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(240px,100%),1fr)); gap: 16px; }

.system-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); transition: transform var(--spring), border-color var(--mid), box-shadow var(--mid);
  cursor: pointer; display: block;
}
.system-card:hover { transform: translateY(-4px) scale(1.008); border-color: var(--sc,var(--ink)); box-shadow: 0 12px 36px rgba(0,0,0,.14), 0 0 0 1px var(--sc,var(--ink)); }
.sc-glow { position: absolute; top: -40px; right: -40px; width: 180px; height: 180px; background: radial-gradient(circle,color-mix(in srgb,var(--sc,var(--ink)) 32%,transparent) 0%,transparent 70%); opacity: 0; transition: opacity var(--mid); pointer-events: none; }
.system-card:hover .sc-glow { opacity: 1; }
.sc-inner { padding: 24px 22px 20px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.sc-icon-wrap { position: relative; width: 50px; height: 50px; }
.sc-icon { width: 50px; height: 50px; background: color-mix(in srgb,var(--sc,var(--ink)) 13%,transparent); border: 1.5px solid color-mix(in srgb,var(--sc,var(--ink)) 30%,transparent); border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--sc,var(--ink-1)); transition: var(--spring); }
.system-card:hover .sc-icon { transform: scale(1.08) rotate(-4deg); }
.sc-icon-ring { position: absolute; inset: -5px; border: 1.5px dashed color-mix(in srgb,var(--sc,var(--ink)) 22%,transparent); border-radius: 20px; opacity: 0; transform: scale(.85); transition: var(--spring); }
.system-card:hover .sc-icon-ring { opacity: 1; transform: scale(1); }
.sc-content { flex: 1; }
.sc-name { font-size: 15.5px; font-weight: 800; letter-spacing: -.025em; margin-bottom: 3px; color: var(--text); }
.sc-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.sc-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }
.sc-enter { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--sc,var(--ink-1)); opacity: 0; transform: translateX(-4px); transition: var(--mid); }
.system-card:hover .sc-enter { opacity: 1; transform: translateX(0); }
.sc-status { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-3); }
.sc-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: blink 2.5s infinite; }
.no-systems { grid-column:1/-1; text-align:center; padding:50px 20px; color:var(--text-3); }
.no-systems i { font-size:36px; display:block; margin-bottom:10px; }

/* pagination */
.hub-pagination { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; color: var(--text-3); font-size: 12px; margin-top: 14px; }

/* quick actions */
.quick-actions-grid { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quick-action-card { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); font-weight: 700; box-shadow: var(--shadow-sm); transition: var(--mid); }
.quick-action-card:hover { border-color: var(--border-2); background: var(--bg-2); color: var(--text); }
.quick-action-card i { color: var(--ink-1); }

.dashboard-widget-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(240px,100%),1fr)); gap: 14px; }

/* dropdown override */
.dropdown-menu { background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); border-radius: var(--r-lg); }
.quick-create-menu .dropdown-item i { color: var(--ink-1); }

/* ── Responsive — modern approach ──────────────── */
/* No horizontal scroll at any viewport. Grid auto-fills, not media queries. */

@media (max-width: 1100px) {
  .hub-bottom-row { grid-template-columns: 1fr; }
  .split-grid, .three-column-grid { grid-template-columns: 1fr; }
  .enterprise-grid, .enterprise-grid-wide { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .quote-milestone-row { grid-template-columns: 1fr 1fr; }
  .quote-portal-hero { grid-template-columns: 1fr 1fr; }
  .public-shell, .public-shell-wide { grid-template-columns: 1fr; padding: 22px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .hub-sidebar { transform: translateX(-256px); width: 256px; }
  .hub-sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .hub-main { margin-left: 0 !important; }
  .topbar-menu-btn { display: flex; }
  .topbar-system-pill span { display: none; }
  .hub-content { padding: 16px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .launcher-hero { flex-direction: column; align-items: stretch; }
  .launcher-top { margin-bottom: 36px; }
  .welcome-hero { flex-direction: column; padding: 20px; }
  .welcome-meta { text-align: left; flex-direction: row; flex-wrap: wrap; }
  .module-action-grid { grid-template-columns: 1fr 1fr; }
  .hub-card-header, .table-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .module-action-grid, .pipeline-strip { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn-hub { flex: 1; justify-content: center; }
  .notif-dropdown { width: min(340px, calc(100vw - 16px)); }
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ── Utility ─────────────────────────────────────── */
.text-primary { color: var(--ink-1); }
.text-muted   { color: var(--text-3); }
.fw-800 { font-weight: 800; }

/* ── Small input variant for inline forms ── */
.hub-input-sm {
  padding: 7px 10px;
  font-size: 12.5px;
  border-radius: var(--r-sm);
}

/* ── Invoice/Quote send form ── */
.send-invoice-card { max-width: 680px; }
.send-preview-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-2);
  font-family: 'DM Mono', monospace;
  word-break: break-all;
}

/* ── PDF download button emphasis ── */
.btn-hub-pdf {
  background: rgba(239,68,68,.08);
  color: var(--red);
  border-color: rgba(239,68,68,.25);
}
.btn-hub-pdf:hover {
  background: rgba(239,68,68,.15);
  color: var(--red);
}