/* ==========================================================================
   ALAATEC AI HQ v2.0 — Official Brand Identity Design System
   Strictly aligned with D:\Alaa\Alaatec\brand\BRAND_IDENTITY.md
   4px spacing rhythm, nested radii, quiet chrome, signature Blue Dot motif.
   ========================================================================== */

@font-face {
  font-family: 'Alexandria';
  src: url('../assets/fonts/Alexandria-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alexandria';
  src: url('../assets/fonts/Alexandria-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alexandria';
  src: url('../assets/fonts/Alexandria-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Syne';
  src: url('../assets/fonts/Syne-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Syne';
  src: url('../assets/fonts/Syne-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Official Alaatec Color Tokens — Dark (Primary) & Light
   ========================================================================== */
:root,
:root[data-theme="dark"] {
  --bg-base: #0b1f3f;
  --bg-center: #12305f;
  --bg-edge: #071530;
  --bg-deep: #07142b;

  --accent: #2f6bff;
  --accent-light: #5b8cff;
  --accent-soft: rgba(47, 107, 255, 0.14);
  --accent-border: rgba(91, 140, 255, 0.45);

  --text-primary: #ffffff;
  --text-logo: #f5f7fb;
  --text-secondary: #9fb2d6;
  --text-muted: rgba(159, 178, 214, 0.72);

  --card-bg: rgba(255, 255, 255, 0.055);
  --card-bg-hover: rgba(255, 255, 255, 0.082);
  --card-border: rgba(255, 255, 255, 0.12);

  --surface-panel: rgba(7, 21, 48, 0.88);
  --surface-strong: rgba(7, 20, 43, 0.96);
  --surface-input: rgba(7, 20, 43, 0.8);
  --surface-subtle: rgba(255, 255, 255, 0.04);

  --grid-line: rgba(91, 140, 255, 0.06);
  --shadow-card: 0 18px 44px rgba(4, 12, 28, 0.42);
  --shadow-accent: 0 10px 26px rgba(47, 107, 255, 0.25);

  --radius-hero: 34px;
  --radius-card: 24px;
  --radius-inner: 16px;
  --radius-control: 12px;

  --sidebar-width: 272px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-base: #dce3ed;
  --bg-center: #eef0f2;
  --bg-edge: #c2cedf;
  --bg-deep: #07142b;

  --accent: #2f6bff;
  --accent-light: #5b8cff;
  --accent-soft: rgba(47, 107, 255, 0.11);
  --accent-border: rgba(47, 107, 255, 0.36);

  --text-primary: #0b1f3f;
  --text-logo: #0b1f3f;
  --text-secondary: #4e5e7a;
  --text-muted: rgba(78, 94, 122, 0.84);

  --card-bg: rgba(255, 255, 255, 0.58);
  --card-bg-hover: rgba(255, 255, 255, 0.76);
  --card-border: rgba(255, 255, 255, 0.72);

  --surface-panel: rgba(255, 255, 255, 0.56);
  --surface-strong: rgba(248, 250, 253, 0.94);
  --surface-input: rgba(255, 255, 255, 0.68);
  --surface-subtle: rgba(255, 255, 255, 0.44);

  --grid-line: transparent;
  --shadow-card: 0 14px 36px rgba(11, 31, 63, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --shadow-accent: 0 10px 24px rgba(47, 107, 255, 0.22);

  color-scheme: light;
}

/* Disable color lag during atomic Dark <-> Light switch */
html.theme-switching,
html.theme-switching * {
  transition: none !important;
}

/* ==========================================================================
   Base & Atmospheric Alaatec Canvas
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Alexandria', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  letter-spacing: 0;
}

body {
  background-color: #dce3ed;
  position: relative;
}

/* Exact 4-Layer Pearl Light Studio Background from glass-side-menu.framer.website */
.pearl-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #dce3ed;
}

.pearl-layer-base,
.pearl-layer-daylight,
.pearl-layer-cobalt,
.pearl-layer-ribbon {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Light Mode — 100% Pixel-Exact Match to Framer "Preview · Pearl light" */
:root[data-theme="light"] .pearl-layer-base {
  background: linear-gradient(140deg, #eef0f2 0%, #dce3ed 48%, #c2cedf 100%);
}
:root[data-theme="light"] .pearl-layer-daylight {
  background: radial-gradient(50% 50% at 77% 22%, #fffffff5 0%, #fff0 69%);
}
:root[data-theme="light"] .pearl-layer-cobalt {
  background: linear-gradient(112deg, #5d78ab00 8%, #5d78ab38 29%, #5d78ab00 52%);
}
:root[data-theme="light"] .pearl-layer-ribbon {
  background: linear-gradient(112deg, #fff0 20%, #ffffffa3 37%, #ffffff14 57%, #fff0 77%);
}

/* Dark Mode — Same 4-Layer Architectural Lighting Geometry in Alaatec Midnight Navy */
:root[data-theme="dark"] .pearl-backdrop {
  background-color: #071530;
}
:root[data-theme="dark"] .pearl-layer-base {
  background: linear-gradient(140deg, #12305f 0%, #0b1f3f 48%, #071530 100%);
}
:root[data-theme="dark"] .pearl-layer-daylight {
  background: radial-gradient(50% 50% at 77% 22%, rgba(91, 140, 255, 0.28) 0%, rgba(47, 107, 255, 0) 69%);
}
:root[data-theme="dark"] .pearl-layer-cobalt {
  background: linear-gradient(112deg, rgba(47, 107, 255, 0) 8%, rgba(47, 107, 255, 0.22) 29%, rgba(47, 107, 255, 0) 52%);
}
:root[data-theme="dark"] .pearl-layer-ribbon {
  background: linear-gradient(112deg, rgba(255, 255, 255, 0) 20%, rgba(159, 178, 214, 0.16) 37%, rgba(91, 140, 255, 0.05) 57%, rgba(255, 255, 255, 0) 77%);
}

.brand-top-strip {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 2.5px;
  z-index: 70;
  background: linear-gradient(90deg, transparent 5%, var(--accent) 42%, var(--accent-light) 58%, transparent 95%);
  opacity: 0.85;
  pointer-events: none;
}

/* Typography Helpers */
.font-syne {
  font-family: 'Syne', 'Alexandria', sans-serif;
}

.ltr-num {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: 'Syne', 'Alexandria', sans-serif;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
  display: inline-block;
}

.ltr-inline {
  direction: ltr;
  unicode-bidi: isolate;
}

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(91, 140, 255, 0.28);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Logo Theme Swap */
.logo-for-dark { display: block; }
.logo-for-light { display: none; }
:root[data-theme="light"] .logo-for-dark { display: none; }
:root[data-theme="light"] .logo-for-light { display: block; }

/* ==========================================================================
   Unified Liquid Glass Surfaces & Cards (Tiered GPU Blur Budget)
   - Floating shells (Sidebar, Topbar, Drawers, Modals): blur(22px)
   - Content cards & Kanban columns: lightweight blur(12px)
   - Nested inner items (.alaa-inner): 0 blur (crisp specular tint only)
   ========================================================================== */
.alaa-card {
  background: linear-gradient(150deg, rgba(18, 48, 95, 0.46) 0%, rgba(11, 31, 63, 0.56) 55%, rgba(7, 21, 48, 0.64) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 16px 38px rgba(4, 12, 28, 0.36);
  contain: layout style;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, background-color 0.2s ease;
}

:root[data-theme="light"] .alaa-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.64) 0%, rgba(244, 248, 253, 0.54) 55%, rgba(235, 241, 250, 0.64) 100%);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 14px 34px rgba(11, 31, 63, 0.08);
}

.alaa-card[onclick]:hover,
.alaa-card.cursor-pointer:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
}

.alaa-card-hero {
  border-radius: 34px;
}

.alaa-card-highlight {
  background: linear-gradient(150deg, rgba(47, 107, 255, 0.24) 0%, rgba(91, 140, 255, 0.12) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(91, 140, 255, 0.52);
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 16px 38px rgba(47, 107, 255, 0.18);
  contain: layout style;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}

:root[data-theme="light"] .alaa-card-highlight {
  background: linear-gradient(150deg, rgba(47, 107, 255, 0.14) 0%, rgba(255, 255, 255, 0.66) 100%);
  border-color: rgba(47, 107, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 14px 34px rgba(47, 107, 255, 0.11);
}

.alaa-card-highlight[onclick]:hover,
.alaa-card-highlight.cursor-pointer:hover {
  transform: translateY(-2px);
}

.alaa-surface-strong {
  background: linear-gradient(155deg, rgba(16, 40, 82, 0.88) 0%, rgba(7, 20, 43, 0.94) 100%);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 24px 60px rgba(4, 12, 28, 0.56);
}

:root[data-theme="light"] .alaa-surface-strong {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.88) 0%, rgba(242, 246, 252, 0.86) 100%);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 #ffffff, 0 24px 56px rgba(11, 31, 63, 0.16);
}

/* Nested Inner Glass Row (Zero backdrop-filter for maximum 60fps smoothness!) */
.alaa-inner {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.16s ease, background-color 0.16s ease;
}

:root[data-theme="light"] .alaa-inner {
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 4px 12px rgba(11, 31, 63, 0.04);
}

/* Signature Blue Signal Dot */
.blue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-light), var(--accent));
  box-shadow: 0 0 10px rgba(47, 107, 255, 0.8);
  display: inline-block;
  flex-shrink: 0;
}

.blue-dot-pulse {
  position: relative;
}
.blue-dot-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-light);
  opacity: 0.7;
  animation: dotRipple 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes dotRipple {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(2.1); opacity: 0; }
}

.alaa-underline {
  position: relative;
  display: inline-block;
}
.alaa-underline::after {
  content: '';
  position: absolute;
  bottom: -6px;
  inset-inline-start: 0;
  width: 40px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

/* ==========================================================================
   Executive Shell + Floating Alaatec Liquid Glass Sidebar
   ========================================================================== */
.app-shell {
  position: relative;
  display: flex;
  min-height: 100vh;
}

/* Wrapper gives floating breathing room on desktop */
.sidebar-rail-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 16px 16px 0;
  flex-shrink: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
}

.app-sidebar {
  position: relative;
  width: 276px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  border-radius: 34px;
  background: linear-gradient(160deg, rgba(18, 48, 95, 0.56) 0%, rgba(11, 31, 63, 0.68) 55%, rgba(7, 21, 48, 0.78) 100%);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(91, 140, 255, 0.14),
    0 24px 60px rgba(4, 12, 28, 0.56);
  transition: width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              border-radius 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              padding 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] .app-sidebar {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.62) 0%, rgba(242, 246, 252, 0.54) 52%, rgba(232, 239, 249, 0.66) 100%);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 22px 54px rgba(11, 31, 63, 0.12);
}

/* Floating Circular Edge Collapse Toggle (< / >) */
.sidebar-edge-toggle {
  position: absolute;
  top: 26px;
  inset-inline-end: -14px;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: #ffffff;
  color: #0b1f3f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  box-shadow: 0 6px 18px rgba(4, 12, 28, 0.38);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, color 0.16s ease;
}

.sidebar-edge-toggle:hover {
  background: #2f6bff;
  border-color: #5b8cff;
  color: #ffffff;
}

.app-sidebar.collapsed .sidebar-edge-toggle svg {
  transform: rotate(180deg);
}

/* Collapsed Liquid Glass Capsule State (Desktop) */
@media (min-width: 1181px) {
  .app-sidebar.collapsed {
    width: 74px;
    border-radius: 999px;
    padding: 16px 12px;
  }

  .app-sidebar.collapsed #sidebar-nav {
    overflow: visible !important;
  }

  .app-sidebar.collapsed .sb-hide-collapsed {
    display: none !important;
  }

  .app-sidebar.collapsed .sb-brand-row {
    justify-content: center;
    padding-bottom: 10px;
    margin-bottom: 8px;
  }

  .app-sidebar.collapsed .glass-search-pill {
    width: 44px;
    height: 44px;
    padding: 0;
    margin-inline: auto;
    justify-content: center;
  }

  .app-sidebar.collapsed .glass-nav-item {
    width: 44px;
    height: 44px;
    padding: 0;
    margin-inline: auto;
    justify-content: center;
  }

  .app-sidebar.collapsed .glass-nav-item .sb-dot-collapsed {
    display: block;
  }

  .app-sidebar.collapsed .sb-divider {
    display: block;
    width: 24px;
    height: 1px;
    margin: 8px auto;
    background: rgba(255, 255, 255, 0.16);
  }

  :root[data-theme="light"] .app-sidebar.collapsed .sb-divider {
    background: rgba(11, 31, 63, 0.14);
  }

  .app-sidebar.collapsed .glass-tree {
    display: none !important;
  }

  .app-sidebar.collapsed .sb-theme-row {
    justify-content: center;
    padding: 0;
    width: 44px;
    height: 44px;
    margin-inline: auto;
    border-radius: 9999px;
  }

  .app-sidebar.collapsed .sb-profile-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    margin-inline: auto;
    justify-content: center;
  }
}

.sb-divider {
  display: none;
}

/* Glass Search Pill inside Sidebar */
.glass-search-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.glass-search-pill:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(91, 140, 255, 0.45);
  color: var(--text-primary);
}

:root[data-theme="light"] .glass-search-pill {
  background: rgba(11, 31, 63, 0.045);
  border-color: rgba(11, 31, 63, 0.11);
}

.glass-kbd {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
}

:root[data-theme="light"] .glass-kbd {
  background: rgba(11, 31, 63, 0.06);
  border-color: rgba(11, 31, 63, 0.1);
}

/* Glass Nav Item (Full Pill + Specular Active Ring) */
.glass-nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8.5px 14px;
  border-radius: 9999px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.glass-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

:root[data-theme="light"] .glass-nav-item:hover {
  background: rgba(11, 31, 63, 0.055);
}

.glass-nav-item.active {
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.26) 0%, rgba(91, 140, 255, 0.14) 100%);
  border-color: rgba(255, 255, 255, 0.42);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 8px 22px rgba(47, 107, 255, 0.24);
}

:root[data-theme="light"] .glass-nav-item.active {
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.16) 0%, rgba(91, 140, 255, 0.09) 100%);
  border-color: rgba(47, 107, 255, 0.55);
  color: #0b1f3f !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 6px 16px rgba(47, 107, 255, 0.12);
}

:root[data-theme="light"] .glass-tree-item.active {
  color: #0b1f3f !important;
  font-weight: 700;
  background: rgba(47, 107, 255, 0.14);
}

.glass-nav-item.active .nav-icon {
  color: #ffffff;
}

:root[data-theme="light"] .glass-nav-item.active .nav-icon {
  color: #2f6bff;
}

/* Tiny Indicator Dot Shown in Collapsed Capsule Mode */
.sb-dot-collapsed {
  display: none;
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f6bff;
  box-shadow: 0 0 8px rgba(47, 107, 255, 0.95);
  border: 1px solid #ffffff;
}

/* Floating Frosted Tooltip Pill in Collapsed Mode (Just like video!) */
.glass-nav-item .sb-tooltip,
.glass-search-pill .sb-tooltip,
.sb-theme-row .sb-tooltip {
  position: absolute;
  inset-inline-start: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(245, 247, 251, 0.94);
  backdrop-filter: blur(16px);
  color: #0b1f3f;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 26px rgba(4, 12, 28, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.9);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.app-sidebar.collapsed .glass-nav-item:hover .sb-tooltip,
.app-sidebar.collapsed .glass-search-pill:hover .sb-tooltip,
.app-sidebar.collapsed .sb-theme-row:hover .sb-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.app-sidebar:not(.collapsed) .sb-tooltip {
  display: none;
}

/* Expandable Projects Sub-Tree with Curved RTL Connectors */
.glass-tree {
  margin-top: 2px;
  margin-bottom: 4px;
  padding-inline-start: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.glass-tree.hidden {
  display: none;
}

.glass-tree::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 14px;
  inset-inline-start: 21px;
  width: 1.5px;
  background: rgba(159, 178, 214, 0.25);
}

.glass-tree-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 10px;
  margin-inline-start: 10px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.glass-tree-item::before {
  content: '';
  position: absolute;
  inset-inline-start: -11px;
  top: 50%;
  width: 11px;
  height: 10px;
  transform: translateY(-100%);
  border-inline-start: 1.5px solid rgba(159, 178, 214, 0.25);
  border-bottom: 1.5px solid rgba(159, 178, 214, 0.25);
  border-end-start-radius: 8px;
}

.glass-tree-item:hover,
.glass-tree-item.active {
  color: var(--text-primary);
  background: rgba(47, 107, 255, 0.14);
}

/* Glass Toggle Switch (Night / Light Mode inside Sidebar) */
.glass-switch {
  width: 42px;
  height: 24px;
  border-radius: 9999px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.glass-switch.is-dark {
  background: var(--accent);
  border-color: var(--accent-light);
}

.glass-switch-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(4, 12, 28, 0.3);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-switch.is-dark .glass-switch-thumb {
  transform: translateX(-18px);
}

/* In-Sidebar Drill-Down Panel (Agent Messages / Feed) */
.sb-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: fadeSlideIn 0.2s ease-out;
}

.sb-panel.hidden {
  display: none;
}

.sb-msg-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.sb-msg-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(91, 140, 255, 0.3);
}

:root[data-theme="light"] .sb-msg-row:hover {
  background: rgba(47, 107, 255, 0.07);
}

.sb-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  shrink: 0;
  flex-shrink: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #2f6bff, #12305f);
  border: 1.5px solid rgba(91, 140, 255, 0.55);
}

.app-main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Floating Liquid Glass Topbar (Matches Glass Sidebar Shell) */
.app-topbar {
  position: sticky;
  top: 16px;
  z-index: 30;
  margin: 16px 24px 0;
  padding: 10px 18px;
  border-radius: 9999px;
  background: linear-gradient(150deg, rgba(18, 48, 95, 0.56) 0%, rgba(11, 31, 63, 0.68) 55%, rgba(7, 21, 48, 0.78) 100%);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 18px 42px rgba(4, 12, 28, 0.42);
}

:root[data-theme="light"] .app-topbar {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.66) 0%, rgba(242, 246, 252, 0.58) 55%, rgba(232, 239, 249, 0.68) 100%);
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 16px 38px rgba(11, 31, 63, 0.1);
}

.app-content {
  flex: 1;
  padding: 20px 24px 36px;
  max-width: 1580px;
  width: 100%;
  margin-inline: auto;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 20, 43, 0.48);
  backdrop-filter: blur(4px);
  z-index: 45;
}

@media (max-width: 1180px) {
  .sidebar-rail-wrap {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    padding: 12px;
    pointer-events: none;
  }
  .app-sidebar {
    pointer-events: auto;
    transform: translateX(120%);
    width: 280px !important;
    border-radius: 30px !important;
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-edge-toggle {
    display: none;
  }
  .sidebar-backdrop.open {
    display: block;
  }
  .app-topbar {
    top: 10px;
    margin: 10px 14px 0;
    padding: 8.5px 14px;
    border-radius: 24px;
  }
  .app-content {
    padding: 16px 14px 28px;
  }
}

/* ==========================================================================
   Liquid Glass Pill Buttons & Inputs
   ========================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(135deg, var(--accent) 0%, #2358e0 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), var(--shadow-accent);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), filter 0.16s ease;
}
.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.975);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 9999px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, border-color 0.16s ease;
}
.btn-secondary:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent-border);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: scale(0.975);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--surface-subtle);
  border-color: var(--card-border);
}
.btn-ghost:active {
  transform: scale(0.975);
}

.alaa-input,
.alaa-select,
.alaa-textarea {
  width: 100%;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--card-border);
  background: var(--surface-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.alaa-input::placeholder,
.alaa-textarea::placeholder {
  color: var(--text-muted);
}
.alaa-input:focus,
.alaa-select:focus,
.alaa-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.2);
}

/* Badges */
.badge-accent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-light);
  border: 1px solid var(--accent-border);
}
:root[data-theme="light"] .badge-accent {
  color: var(--accent);
}

.badge-solid {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent);
  color: #ffffff;
}

.badge-neutral {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(91, 140, 255, 0.55);
}
:root[data-theme="light"] .badge-pending {
  background: rgba(11, 31, 63, 0.08);
  color: #0b1f3f;
  border-color: rgba(47, 107, 255, 0.45);
}

/* Segmented Top Tab Bar (Full Liquid Glass Pill) */
.alaa-tabs-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 9999px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--card-border);
  box-shadow: var(--shadow-card);
}

.alaa-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9999px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.alaa-tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-subtle);
}

.alaa-tab-btn:active {
  transform: scale(0.975);
}

.alaa-tab-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, #2358e0 100%);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), var(--shadow-accent);
}

.alaa-tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 640px) {
  .alaa-tabs-bar {
    display: flex;
    width: 100%;
    border-radius: 22px;
  }
  .alaa-tab-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 9px 12px;
    font-size: 12px;
  }
}

.filter-tab {
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--card-border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.filter-tab:hover {
  color: var(--text-primary);
  border-color: var(--accent-border);
}
.filter-tab:active {
  transform: scale(0.975);
}
.filter-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

/* ==========================================================================
   3D Stage, Floating Wing Labels & Hover Tooltip
   ========================================================================== */
.hq-stage {
  position: relative;
  height: 600px;
  border-radius: var(--radius-hero);
  overflow: hidden;
  border: 1.5px solid var(--accent-border);
  background: radial-gradient(circle at 50% 30%, #12305f 0%, #0b1f3f 55%, #071530 100%);
  box-shadow: var(--shadow-card);
}

:root[data-theme="light"] .hq-stage {
  border-color: rgba(255, 255, 255, 0.85);
  background: #dbe3ef;
  box-shadow: inset 0 1px 0 #ffffff, 0 18px 44px rgba(11, 31, 63, 0.11);
}

@media (max-width: 768px) {
  .hq-stage {
    height: 440px;
    border-radius: 24px;
  }
}

#hq-canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

.wing-label {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  z-index: 12;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(7, 21, 48, 0.9);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(91, 140, 255, 0.45);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(4, 12, 28, 0.55);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.wing-label:hover {
  border-color: #ffffff;
  background: rgba(47, 107, 255, 0.94);
}
.wing-code-tag {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 10px;
  color: #5b8cff;
  background: rgba(47, 107, 255, 0.18);
  padding: 1px 6px;
  border-radius: 999px;
}
.wing-label:hover .wing-code-tag {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
}

:root[data-theme="light"] .wing-label {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.95);
  color: #0b1f3f;
  box-shadow: 0 8px 22px rgba(11, 31, 63, 0.14);
}
:root[data-theme="light"] .wing-label:hover {
  background: #2f6bff;
  border-color: #2f6bff;
  color: #ffffff;
}
:root[data-theme="light"] .wing-code-tag {
  color: #2f6bff;
  background: rgba(47, 107, 255, 0.12);
}

.hq-hover-tooltip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  display: none;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(7, 20, 43, 0.94);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(91, 140, 255, 0.55);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(4, 12, 28, 0.6);
  transform: translate(-50%, -125%);
  white-space: nowrap;
}

.hud-pill {
  background: rgba(7, 21, 48, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  color: #f5f7fb;
  border-radius: 9999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.hud-pill:hover,
.hud-pill.active-preset {
  background: rgba(47, 107, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

:root[data-theme="light"] .hud-pill {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.95);
  color: #0b1f3f;
  box-shadow: inset 0 1px 0 #ffffff, 0 8px 20px rgba(11, 31, 63, 0.1);
}
:root[data-theme="light"] .hud-pill:hover,
:root[data-theme="light"] .hud-pill.active-preset {
  background: #2f6bff;
  border-color: #5b8cff;
  color: #ffffff;
}
:root[data-theme="light"] .hud-pill.active-preset .ltr-num,
:root[data-theme="light"] .hud-pill:hover .ltr-num {
  color: #ffffff !important;
}

/* Progress Bar */
.alaa-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: rgba(159, 178, 214, 0.22);
  overflow: hidden;
}
.alaa-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  transition: width 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Floating Liquid Glass Slide-Over Drawers (Matches Floating Glass Sidebar) */
.alaa-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  padding: 14px;
  background: rgba(7, 20, 43, 0.45);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: flex-end;
}
.alaa-drawer-backdrop.open {
  display: flex;
}
.alaa-drawer-panel {
  width: min(500px, 94vw);
  height: 100%;
  border-radius: 32px;
  background: linear-gradient(155deg, rgba(16, 40, 82, 0.88) 0%, rgba(7, 20, 43, 0.94) 100%);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 24px 60px rgba(4, 12, 28, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerSlideIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="light"] .alaa-drawer-panel {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.86) 0%, rgba(242, 246, 252, 0.84) 100%);
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 #ffffff, 0 24px 56px rgba(11, 31, 63, 0.16);
}
@keyframes drawerSlideIn {
  from { opacity: 0; transform: translateX(-22px) scale(0.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* Popover (Notification Center) */
.alaa-popover {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  width: min(360px, 90vw);
  z-index: 55;
  display: none;
  border-radius: 26px;
  padding: 16px;
}
.alaa-popover.open {
  display: block;
  animation: modalPopIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Modals */
.alaa-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(7, 20, 43, 0.48);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.alaa-modal-backdrop.open {
  display: flex;
}
.alaa-modal-backdrop.open > div {
  animation: modalPopIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalPopIn {
  from { opacity: 0; transform: translateY(8px) scale(0.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Toast Stack */
.alaa-toast {
  background: linear-gradient(155deg, rgba(16, 40, 82, 0.9) 0%, rgba(7, 20, 43, 0.94) 100%);
  backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 16px 38px rgba(4, 12, 28, 0.48);
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 360px;
  animation: modalPopIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="light"] .alaa-toast {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9) 0%, rgba(242, 246, 252, 0.88) 100%);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #ffffff, 0 16px 36px rgba(11, 31, 63, 0.14);
}

.view-section,
.tab-panel {
  animation: fadeSlideIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.view-section.hidden,
.tab-panel.hidden {
  display: none;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Kanban Columns (Liquid Glass) */
.kanban-col {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--card-border);
  border-radius: 26px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 360px;
  box-shadow: var(--shadow-card);
  contain: layout style;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Official Branded Proposal Sheet Preview & Print-Ready PDF */
.proposal-sheet {
  background: #ffffff;
  color: #0b1f3f;
  border-radius: 24px;
  border: 1.5px solid #e1e7f1;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(11, 31, 63, 0.14);
}

.proposal-table {
  width: 100%;
  border-collapse: collapse;
}
.proposal-table th,
.proposal-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e1e7f1;
  text-align: start;
  font-size: 12.5px;
}
.proposal-table th {
  background: #f5f7fb;
  color: #0b1f3f;
  font-weight: 800;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  #proposal-print-area,
  #proposal-print-area * {
    visibility: visible !important;
  }
  #proposal-print-area {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 24px !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #0b1f3f !important;
    z-index: 99999 !important;
  }
  .no-print {
    display: none !important;
  }
}

.text-primary-alaa { color: var(--text-primary); }
.text-secondary-alaa { color: var(--text-secondary); }
.text-accent-alaa { color: var(--accent-light); }
:root[data-theme="light"] .text-accent-alaa { color: var(--accent); }
