@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

/* =====================================================
   MOBILE / iOS PWA
   ===================================================== */
@media (max-width: 768px) {

  /* ── Safe area (iPhone notch + home bar) ── */
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* ── Убираем сайдбар ── */
  .sidebar, aside.glass-panel { display: none !important; }

  /* ── Layout ── */
  .app-container, #app-container {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    padding-top: 0;
  }
  .main-content {
    margin-left: 0 !important;
    padding-bottom: calc(72px + var(--safe-bottom)) !important;
    overflow-x: hidden;
    width: 100vw;
    max-width: 100vw;
  }
  .page-view { padding: 0 !important; }
  .content-body { padding: 16px !important; }

  /* ── Таббар ── */
  #mobile-tabbar { display: flex !important; }
  #work-tabs { display: none !important; }

  /* ── Логин — красиво на весь экран ── */
  #auth-gate {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .login-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 28px 28px 0 0 !important;
    padding: 36px 24px calc(32px + var(--safe-bottom)) !important;
    box-shadow: 0 -20px 60px rgba(0,0,0,0.6) !important;
    min-height: auto !important;
  }
  .login-logo-wrap { margin-bottom: 28px; }

  /* ── Touch targets ── */
  button, a[role], .chip-btn, .nav-item, .work-tab,
  input[type="submit"], .btn-primary, .btn-secondary {
    min-height: 44px;
  }

  /* ── Модалки — full screen снизу ── */
  body > div[style*="position:fixed"][style*="z-index"] > div,
  body > div[style*="position:fixed"] > div[style*="border-radius"] {
    border-radius: 20px 20px 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    margin: auto 0 0 0 !important;
    align-self: flex-end;
  }
  body > div[style*="position:fixed"][style*="z-index"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  /* ── Мессенджер ── */
  .messenger-layout {
    grid-template-columns: 1fr !important;
    height: calc(100vh - 72px - var(--safe-bottom)) !important;
  }
  .mess-list-col { display: flex; width: 100%; }
  .mess-chat-col { display: none; width: 100%; }
  .mess-list-col.mobile-visible { display: flex !important; }
  .mess-chat-col.mobile-visible { display: flex !important; }
  .mess-chat-col.mobile-hidden, .mess-list-col.mobile-hidden { display: none !important; }

  /* ── Грид-панели ── */
  .glass-panel { border-radius: 16px !important; }
  [class*="grid"] { gap: 10px !important; }

  /* ── KPI / карточки ── */
  .kpi-grid, [style*="grid-template-columns:repeat(auto-fit,minmax(160px"],
  [style*="grid-template-columns:repeat(auto-fit,minmax(180px"] {
    grid-template-columns: 1fr 1fr !important;
  }
  [style*="grid-template-columns:repeat(auto-fit,minmax(260px"],
  [style*="grid-template-columns:repeat(auto-fit,minmax(300px"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns:repeat(auto-fit,minmax(200px"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ── CRM таблица ── */
  .crm-table { font-size: 0.78rem; }
  .crm-table th, .crm-table td { padding: 10px 8px !important; }

  /* ── Типографика ── */
  h1 { font-size: 1.6rem !important; }
  h2 { font-size: 1.3rem !important; }
  h3 { font-size: 1.1rem !important; }

  /* ── Горизонтальный скролл для табов ── */
  .work-tabs-row, #work-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
  }

  /* ── Скрыть лишние колонки в таблицах ── */
  .hide-mobile { display: none !important; }

  /* ── Попапы контекстного меню ── */
  #msg-context-menu, .context-menu, .popover {
    left: 8px !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: none !important;
    border-radius: 16px !important;
  }

  /* ── Ввод в чате ── */
  .mess-input-row {
    padding: 10px 12px !important;
    padding-bottom: calc(10px + var(--safe-bottom)) !important;
  }
  .mess-input { font-size: 16px !important; } /* предотвращает zoom на iOS */

  /* ── Форма ── */
  input, textarea, select {
    font-size: 16px !important; /* предотвращает zoom на iOS */
    border-radius: 12px !important;
  }

  /* ── Скрыть декоративные элементы ── */
  .hero-bg-shapes, .animated-bg, .particles { display: none !important; }
}

/* Нижний таббар — скрыт по умолчанию, виден только на мобильном */
#mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(19, 21, 30, 0.96);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 9999;
  align-items: center;
  justify-content: space-around;
}

#mobile-tabbar .mb-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-size: 0.62rem;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: color 0.18s;
  min-width: 52px;
  min-height: 44px;
  justify-content: center;
}
#mobile-tabbar .mb-tab svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}
#mobile-tabbar .mb-tab.active {
  color: #fbbf24;
}
#mobile-tabbar .mb-tab.active svg {
  filter: drop-shadow(0 0 6px rgba(251,191,36,0.5));
}

/* Автосворачивание сайдбара при заходе в кабинет отдела */
.sidebar.dept-focus-hidden {
  transform: translateX(-105%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
body.dept-cabinet-focus .main-content { margin-left: 0 !important; transition: margin-left 0.35s ease; }

/* Мантра руководителей — hover-эффект */
.lead-mantra:hover {
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.35));
  transform: scale(1.02);
  transition: all 0.25s ease;
}


/* Скрываем auth-gate до инициализации без document.write */
html.preauth-hide #auth-gate { display: none !important; }
html.preauth-hide #app-container { display: grid !important; }

:root {
  --font-primary: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  /* Primary Branding Theme: Reflective Silver & Chrome */
  --bg-app: linear-gradient(135deg, #090b0f 0%, #15181f 100%);
  --bg-sidebar: rgba(18, 22, 28, 0.8);
  --bg-card: rgba(30, 36, 45, 0.5);
  --bg-header: rgba(18, 22, 28, 0.8);
  
  --text-main: #cbd5e1; /* Silver Gray */
  --text-muted: #8a95a5; /* Slate Silver */
  --text-light: #64748b;
  
  --border-color: rgba(148, 163, 184, 0.15);
  --glass-border: rgba(184, 194, 209, 0.12);
  
  /* Enhanced 3D bevel and deeper shadows for protrusion effect */
  --glass-shadow: 0 24px 64px 0 rgba(0, 0, 0, 0.85), inset 2px 2px 0px rgba(255, 255, 255, 0.18), inset -2px -2px 0px rgba(0, 0, 0, 0.5);
  
  /* True Silver Color Palette */
  --primary: #a1abcc;
  --primary-glow: rgba(161, 171, 204, 0.15);
  
  /* UI Accents */
  --success: #34d399;
  --success-glow: rgba(52, 211, 153, 0.25);
  --warning: #fbbf24;
  --warning-glow: rgba(251, 191, 36, 0.25);
  --danger: #f87171;
  --danger-glow: rgba(248, 113, 113, 0.25);
  --purple: #707a8a;
  --purple-glow: rgba(112, 122, 138, 0.15);

  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Company-specific themes — soft yet vibrant pastels (dark) */
body.theme-flow-synergy {
  --primary: #5EEAD4;
  --primary-glow: rgba(94, 234, 212, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #0f1f24 0%, #0a1418 60%, #080f12 100%);
}
body.theme-dtw {
  --primary: #FDA4AF;
  --primary-glow: rgba(253, 164, 175, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #241418 0%, #170a0d 60%, #0f0708 100%);
}
body.theme-prosky {
  --primary: #7DD3FC;
  --primary-glow: rgba(125, 211, 252, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #0f1a24 0%, #0a121a 60%, #070c11 100%);
}
body.theme-skycharter {
  --primary: #C4B5FD;
  --primary-glow: rgba(196, 181, 253, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #1a1728 0%, #100e1a 60%, #0a0912 100%);
}
body.theme-forbiz {
  --primary: #F0ABFC;
  --primary-glow: rgba(240, 171, 252, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #24132a 0%, #170a1c 60%, #0f0713 100%);
}
body.theme-lussovito {
  --primary: #FCD34D;
  --primary-glow: rgba(252, 211, 77, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #241d0c 0%, #171208 60%, #0f0c05 100%);
}
body.theme-finbridge {
  --primary: #86EFAC;
  --primary-glow: rgba(134, 239, 172, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #0f2418 0%, #0a170f 60%, #070f0a 100%);
}
body.theme-raven {
  --primary: #FCA5A5;
  --primary-glow: rgba(252, 165, 165, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #241213 0%, #170a0b 60%, #0f0708 100%);
}
body.theme-freenans {
  --primary: #A5B4FC;
  --primary-glow: rgba(165, 180, 252, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #14162b 0%, #0b0d1c 60%, #070812 100%);
}
body.theme-brokerz {
  --primary: #E5E7EB;
  --primary-glow: rgba(229, 231, 235, 0.18);
  --bg-app: radial-gradient(1000px 700px at 20% 0%, #1a1d24 0%, #101318 60%, #0a0c10 100%);
}

/* Company-specific themes — light variants */
[data-theme="light"] body.theme-flow-synergy { --bg-app: radial-gradient(1200px 800px at 20% 0%, #ecfeff 0%, #e0f7fa 60%, #d6f0f4 100%); }
[data-theme="light"] body.theme-dtw          { --bg-app: radial-gradient(1200px 800px at 20% 0%, #fff5f6 0%, #ffe4e7 60%, #ffd5da 100%); }
[data-theme="light"] body.theme-prosky       { --bg-app: radial-gradient(1200px 800px at 20% 0%, #f0f9ff 0%, #e0f2fe 60%, #d0e9fb 100%); }
[data-theme="light"] body.theme-skycharter   { --bg-app: radial-gradient(1200px 800px at 20% 0%, #f5f3ff 0%, #ede9fe 60%, #ddd6fe 100%); }
[data-theme="light"] body.theme-forbiz       { --bg-app: radial-gradient(1200px 800px at 20% 0%, #fdf4ff 0%, #fae8ff 60%, #f5d0fe 100%); }
[data-theme="light"] body.theme-lussovito    { --bg-app: radial-gradient(1200px 800px at 20% 0%, #fffbeb 0%, #fef3c7 60%, #fde68a 100%); }
[data-theme="light"] body.theme-finbridge    { --bg-app: radial-gradient(1200px 800px at 20% 0%, #f0fdf4 0%, #dcfce7 60%, #bbf7d0 100%); }
[data-theme="light"] body.theme-raven        { --bg-app: radial-gradient(1200px 800px at 20% 0%, #fef2f2 0%, #fee2e2 60%, #fecaca 100%); }
[data-theme="light"] body.theme-freenans     { --bg-app: radial-gradient(1200px 800px at 20% 0%, #eef2ff 0%, #e0e7ff 60%, #c7d2fe 100%); }
[data-theme="light"] body.theme-brokerz      { --bg-app: radial-gradient(1200px 800px at 20% 0%, #f8fafc 0%, #f1f5f9 60%, #e2e8f0 100%); }

/* ============ LIGHT THEME ============ */
[data-theme="light"] {
  --bg-app: linear-gradient(135deg, #f4f6fa 0%, #e6ebf3 100%);
  --bg-sidebar: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-header: rgba(255, 255, 255, 0.85);

  --text-main: #1c2530;
  --text-muted: #556377;
  --text-light: #8592a4;

  --border-color: rgba(30, 41, 59, 0.10);
  --glass-border: rgba(30, 41, 59, 0.08);
  --glass-shadow: 0 12px 40px rgba(30, 41, 59, 0.12), inset 1px 1px 0px rgba(255, 255, 255, 0.9), inset -1px -1px 0px rgba(30, 41, 59, 0.05);

  --primary: #4b5975;
  --primary-glow: rgba(75, 89, 117, 0.15);
  --purple: #64748b;
}

/* Light theme overrides for company-specific tinted backgrounds */
[data-theme="light"] body.theme-flow-synergy { --bg-app: linear-gradient(135deg, #eaf6ff 0%, #dbeafe 100%); }
[data-theme="light"] body.theme-dtw          { --bg-app: linear-gradient(135deg, #fdf6e3 0%, #f6ecd0 100%); }
[data-theme="light"] body.theme-prosky       { --bg-app: linear-gradient(135deg, #e6f4ff 0%, #cfe5f7 100%); }
[data-theme="light"] body.theme-skycharter   { --bg-app: linear-gradient(135deg, #f4f6fa 0%, #e6ebf3 100%); }
[data-theme="light"] body.theme-forbiz       { --bg-app: linear-gradient(135deg, #fdeaf7 0%, #f8d6ea 100%); }
[data-theme="light"] body.theme-lussovito    { --bg-app: linear-gradient(135deg, #fff4e0 0%, #fde3bc 100%); }
[data-theme="light"] body.theme-finbridge    { --bg-app: linear-gradient(135deg, #e6faf1 0%, #cceedb 100%); }
[data-theme="light"] body.theme-raven        { --bg-app: linear-gradient(135deg, #ffe8e8 0%, #fbcaca 100%); }

/* Light theme: brand-365 needs to be dark ink instead of light silver */
[data-theme="light"] .brand-365 {
  color: #1c2530;
  text-shadow: 0 6px 24px rgba(30, 41, 59, 0.18);
}

/* Light theme: sidebar logo — darker silver gradient so it stays visible */
[data-theme="light"] .logo-text {
  background: linear-gradient(135deg, #64748b 0%, #94a3b8 25%, #cbd5e1 50%, #94a3b8 75%, #64748b 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Light theme: BROKERZ keeps convex silver + sunbeam, but shadows use ink instead of black */
[data-theme="light"] .auth-logo {
  background:
    linear-gradient(
      100deg,
      transparent 0%,
      transparent 38%,
      rgba(255, 255, 255, 0.55) 46%,
      #ffffff 50%,
      rgba(255, 255, 255, 0.55) 54%,
      transparent 62%,
      transparent 100%
    ),
    linear-gradient(
      180deg,
      #cbd5e1 0%,
      #94a3b8 40%,
      #64748b 75%,
      #475569 100%
    );
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9))
    drop-shadow(1px 2px 1px rgba(30, 41, 59, 0.30))
    drop-shadow(0 6px 14px rgba(30, 41, 59, 0.20));
}

/* Light theme: soft glass panels */
[data-theme="light"] .glass-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.65) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

[data-theme="light"] .company-card:hover {
  background: rgba(30, 41, 59, 0.04);
}

[data-theme="light"] .company-card h3 { color: var(--text-main); }
[data-theme="light"] .company-card p  { color: var(--text-muted); }
[data-theme="light"] .auth-subtitle    { color: var(--text-muted); }

[data-theme="light"] .login-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.80) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 60px rgba(30, 41, 59, 0.18), inset 1px 1px 0px rgba(255, 255, 255, 0.9);
}

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  border-color: var(--border-color);
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder { color: var(--text-light); }

[data-theme="light"] .auth-theme-toggle {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  border-color: var(--border-color);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--transition);
}

/* Tactile Convex Glassmorphism Panel */
.glass-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

/* App Shell Layout */
#app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* Auth Screens styling */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-app);
}

/* Floating theme toggle on the auth screen */
.auth-theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
  z-index: 2100;
}
.auth-theme-toggle:hover {
  transform: rotate(-15deg) scale(1.08);
  color: var(--primary);
}
.auth-theme-toggle i {
  width: 20px;
  height: 20px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

/* Wrapper so the giant "365" can sit behind BROKERZ */
.brand-title {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
  line-height: 1;
  isolation: isolate;
}

/* Huge bold "365" sitting right behind BROKERZ */
.brand-365 {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 11rem;
  letter-spacing: -0.04em;
  color: #e5e7eb;
  opacity: 0.20;
  z-index: -1;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  animation: brand365Pulse 22s ease-in-out infinite;
}

/* Convex silver letters with a bright specular "sunbeam" gliding across */
.auth-logo {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 3.8rem;
  font-weight: 800;
  text-transform: uppercase;
  /* Base silver body — subtle vertical bevel top-to-bottom */
  background:
    /* the moving sunbeam glare (narrow bright band) */
    linear-gradient(
      100deg,
      transparent 0%,
      transparent 38%,
      rgba(255, 255, 255, 0.35) 46%,
      #ffffff 50%,
      rgba(255, 255, 255, 0.35) 54%,
      transparent 62%,
      transparent 100%
    ),
    /* the underlying silver body */
    linear-gradient(
      180deg,
      #f1f5f9 0%,
      #cbd5e1 30%,
      #94a3b8 55%,
      #64748b 100%
    );
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: -60% 0, 0 0;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  animation: brokerzSunbeam 5.5s linear infinite;
  /* 3D convex effect: bright bevel top-left, deep shadow bottom-right */
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.4))
    drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.55))
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.75));
  margin-bottom: 0;
  letter-spacing: 0.08em;
}

@keyframes brokerzSunbeam {
  0%   { background-position: -60% 0, 0 0; }
  100% { background-position: 160% 0, 0 0; }
}

/* baseline 20% -> smoothly up to ~70% -> hold 5s -> back to 20%
   Total cycle 22s: rise ~3s, hold 5s, fall ~3s, rest ~11s */
@keyframes brand365Pulse {
  0%   { opacity: 0.20; }
  14%  { opacity: 0.70; }
  36%  { opacity: 0.70; }
  50%  { opacity: 0.20; }
  100% { opacity: 0.20; }
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

@keyframes chromeShine {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  width: 100%;
}

@media (max-width: 1024px) {
  .company-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .company-grid {
    grid-template-columns: 1fr;
  }
}

/* Convex Protruding Company Card */
/* Minimalist frameless company card */
.company-card {
  padding: 28px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: var(--radius-lg);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.company-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.03);
}
.company-card:hover .company-icon-box {
  transform: scale(1.06);
  color: var(--company-color);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--company-color) 25%, transparent);
}
/* Красный крестик удаления — виден только при наведении на карточку */
.company-card:hover .company-delete-btn { opacity: 1 !important; }
.company-delete-btn:hover { background: rgba(255,80,80,0.28) !important; }

.company-card:focus,
.company-card:active,
.company-card:focus-visible {
  outline: none;
  border: none;
}

/* Minimalist icon logo */
.company-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--company-color) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--company-color);
  border: none;
  box-shadow: none;
  transition: var(--transition);
}
.company-icon-box i,
.company-icon-box svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.6;
  color: var(--company-color);
  stroke: var(--company-color);
}

.company-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 8px;
  font-weight: 600;
  color: #cfd6e0;
}

.company-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Convex Protruding Login Card Container */
.login-card {
  width: 420px;
  max-width: 100%;
  padding: 40px;
  display: none;
  animation: fadeIn 0.4s ease;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.01) 100%), var(--bg-card);
  border: 1px solid rgba(168, 179, 196, 0.22);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.9), inset 2.5px 2.5px 0px rgba(255, 255, 255, 0.25), inset -2.5px -2.5px 0px rgba(0, 0, 0, 0.5);
}

.login-back-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 24px;
  transition: var(--transition);
}

.login-back-btn:hover {
  color: var(--text-main);
}

/* Sidebar */
aside {
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  border-right: 1px solid var(--border-color);
  z-index: 100;
  box-shadow: inset -1px 0px 0px rgba(0, 0, 0, 0.4), inset 1px 1px 0px rgba(255, 255, 255, 0.05);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 24px;
  border-bottom: 1px solid var(--border-color);
}

/* Convex Silver Logo in Sidebar */
.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #707a8a 0%, #cbd5e1 50%, #707a8a 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #090b0f;
  font-weight: 800;
  font-size: 1.25rem;
  border: 1px solid rgba(168, 179, 196, 0.45);
  box-shadow: inset 1px 1.5px 0px rgba(255, 255, 255, 0.4), inset -1px -1.5px 0px rgba(0,0,0,0.3), 0 3px 6px rgba(0,0,0,0.3);
}

/* 3D Sidebar logo with animated gradient wave */
.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  text-transform: uppercase;
  background: linear-gradient(
    135deg,
    #707a8a 0%,
    #cbd5e1 25%,
    #ffffff 50%,
    #cbd5e1 75%,
    #707a8a 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: chromeShine 6s linear infinite;
  filter: 
    drop-shadow(0.5px 0.5px 0px rgba(255, 255, 255, 0.4))
    drop-shadow(-0.5px -0.5px 0px rgba(0, 0, 0, 0.6))
    drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.6));
  letter-spacing: 0.05em;
}

nav {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item:hover, .nav-item.active {
  color: #cfd6e0;
  background: rgba(112, 122, 138, 0.08);
  border-color: var(--glass-border);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(112, 122, 138, 0.12) 0%, rgba(112, 122, 138, 0) 100%);
  border-left: 4px solid var(--primary);
  color: var(--primary);
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.05), inset 0px -1px 0px rgba(0, 0, 0, 0.3);
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

/* User Profile Widget in Sidebar */
.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-color);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #cfd6e0;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

/* Header */
header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25), inset 0px 1px 0px rgba(255,255,255,0.05);
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(112, 122, 138, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  width: 320px;
  gap: 10px;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  width: 100%;
  font-size: 0.9rem;
}

.search-bar svg {
  color: var(--text-muted);
  width: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(112, 122, 138, 0.1);
  box-shadow: inset 1px 1px 1px rgba(255,255,255,0.1), 0 2px 4px rgba(0,0,0,0.3);
}

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

/* Page Content container */
.content-body {
  padding: 32px;
  flex-grow: 1;
}

.page-view {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.page-view.active {
  display: block;
}

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

/* Stories Style Strip */
.stories-wrapper {
  padding: 16px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), inset 1.5px 1.5px 0px rgba(255, 255, 255, 0.08);
}

.stories-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.stories-container::-webkit-scrollbar {
  display: none;
}

.story-bubble {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 72px;
  transition: var(--transition);
}

.story-bubble:hover {
  transform: scale(1.05);
}

.story-avatar-holder {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(45deg, var(--primary), var(--purple), var(--success));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.story-bubble.viewed .story-avatar-holder {
  background: var(--border-color);
}

.story-avatar-holder img, .story-avatar-holder i {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #15181f;
}

.story-avatar-holder i {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 12px;
}

.story-bubble span {
  font-size: 0.7rem;
  margin-top: 6px;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

/* Fullscreen Story Viewer */
.story-viewer-content {
  width: 440px;
  height: 90vh;
  max-height: 800px;
  position: relative;
  background: black;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(0,0,0,0.9);
}

.story-viewer-progress-strip {
  display: flex;
  gap: 4px;
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 10;
}

.progress-track {
  height: 3px;
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: white;
}

.story-viewer-header {
  position: absolute;
  top: 24px; left: 16px; right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.story-viewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid white;
}

.story-viewer-image-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.story-viewer-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-viewer-caption-label {
  position: absolute;
  bottom: 40px; left: 24px; right: 24px;
  background: rgba(0, 0, 0, 0.7);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
}

.story-prev-trigger, .story-next-trigger {
  position: absolute;
  top: 0; bottom: 0; width: 40%;
  cursor: pointer;
  z-index: 5;
}

.story-prev-trigger { left: 0; }
.story-next-trigger { right: 0; }

/* Personal Account Layout (Личный кабинет) */
.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

.profile-sidebar {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), inset 2px 2px 0px rgba(255, 255, 255, 0.08);
}

.profile-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  cursor: pointer;
}

.profile-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-edit-overlay {
  position: absolute;
  bottom: 0; right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f172a;
  transition: var(--transition);
}

.avatar-edit-overlay:hover {
  transform: scale(1.1);
}

.profile-tabs {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-tabs .tab-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.profile-tabs .tab-item:hover, .profile-tabs .tab-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-border);
}

.profile-tabs .tab-item.active {
  border-left: 4px solid var(--primary);
  background: linear-gradient(90deg, var(--primary-glow) 0%, rgba(255,255,255,0) 100%);
  color: var(--primary);
}

.profile-content-pane {
  padding: 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), inset 2px 2px 0px rgba(255, 255, 255, 0.08);
}

.profile-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.profile-tab-content.active {
  display: block;
}

/* Audio track card design */
.audio-track {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25), inset 1.5px 1.5px 0px rgba(255,255,255,0.05);
}

.track-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.track-play-btn:hover {
  transform: scale(1.1);
}

/* Gallery Photo grid */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.gallery-item {
  border-radius: var(--radius-md);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  cursor: zoom-in;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

/* Friends structure */
.friend-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
}

.friend-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
}

.friend-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.friend-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Gifts structure */
.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
}

.gift-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  text-align: center;
}

.gift-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.gift-sender {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Image option circle pickers in creator modal */
.img-picker-option {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  object-fit: cover;
}

.img-picker-option.selected {
  border-color: var(--primary);
  transform: scale(1.05);
}

/* CRM Pipeline styling */
.crm-pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.pipeline-column {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 500px;
}

.column-header {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding-bottom: 12px;
  border-bottom: 2px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.column-count {
  background: rgba(112, 122, 138, 0.15);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
}

/* Convex Protruding CRM Deals cards */
.crm-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  cursor: grab;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(30, 36, 45, 0.4);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 2px 2px 0px rgba(255, 255, 255, 0.15), inset -2px -2px 0px rgba(0, 0, 0, 0.4);
}

.crm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.6), inset 2px 2px 0px rgba(255, 255, 255, 0.25), inset -2px -2px 0px rgba(0, 0, 0, 0.3);
}

.crm-card .deal-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.crm-card .deal-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

.crm-card .deal-client {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Kanban Board Styling */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.kanban-column {
  padding: 16px;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  padding-bottom: 8px;
}

.add-task-btn {
  background: rgba(112, 122, 138, 0.05);
  border: 1px dashed var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  width: 100%;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
}

.add-task-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
}

/* Convex Protruding Kanban Task Card */
.task-card {
  padding: 16px;
  border-radius: var(--radius-md);
  cursor: grab;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(30, 36, 45, 0.4);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 2px 2px 0px rgba(255, 255, 255, 0.15), inset -2px -2px 0px rgba(0, 0, 0, 0.4);
}

.task-card:active {
  cursor: grabbing;
}

.task-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/* Outstanding 3D Metallic Button */
.btn-primary {
  background: linear-gradient(135deg, #707a8a 0%, #cfd6e0 50%, #707a8a 100%);
  color: #090b0f;
  border: 1px solid rgba(168, 179, 196, 0.5);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55), inset 2px 2px 0px rgba(255, 255, 255, 0.5), inset -2px -2px 1px rgba(0, 0, 0, 0.45);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(168, 179, 196, 0.45), inset 2px 2px 0px rgba(255, 255, 255, 0.65), inset -2px -2px 0px rgba(0, 0, 0, 0.3);
  border-color: rgba(168, 179, 196, 0.8);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), inset -2px -2px 0px rgba(255, 255, 255, 0.2), inset 2px 2px 2px rgba(0, 0, 0, 0.6);
}

/* Dashboard Metrics CSS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-details h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 1.8rem;
  font-family: var(--font-display);
  font-weight: 700;
}

/* Convex Metric Icon box */
.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #090b0f;
  background: linear-gradient(135deg, #cfd6e0, #707a8a) !important;
  border: 1px solid rgba(168, 179, 196, 0.4);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4), inset 1.5px 2px 0px rgba(255, 255, 255, 0.45), inset -1.5px -2px 0px rgba(0, 0, 0, 0.4);
}

/* Dynamic social feed & chat styling */
.feed-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.feed-post-card {
  padding: 20px;
  margin-bottom: 20px;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.post-meta h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.post-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.post-actions {
  display: flex;
  gap: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover {
  color: var(--primary);
}

.chat-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
}

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  max-width: 80%;
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3), inset 1px 1px 0px rgba(255, 255, 255, 0.08);
}

.chat-bubble.sent {
  background: var(--primary);
  color: #090b0f;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  font-weight: 500;
}

.chat-bubble.received {
  background: rgba(112,122,138,0.05);
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-input {
  display: flex;
  gap: 10px;
}

.chat-input input {
  flex-grow: 1;
  background: rgba(112, 122, 138, 0.05);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.4);
}

/* Modal styling for Quick Actions */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  width: 500px;
  max-width: 90vw;
  padding: 32px;
  animation: modalScale 0.3s ease-out;
  border: 1px solid rgba(168,179,196,0.15);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(112, 122, 138, 0.05);
  color: var(--text-main);
  outline: none;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.4);
}

/* ============================================================
   MINIMAL AESTHETIC OVERRIDE — soft, airy, K/J-inspired
   Kills heavy bevels, insets, thick borders and dark drop shadows.
   Loaded last so it wins the cascade.
   ============================================================ */

:root {
  /* Softer, warmer dark surface — less "corporate" */
  --bg-app: radial-gradient(1200px 800px at 20% 0%, #1a1e28 0%, #0f1218 60%, #0b0d12 100%);
  --bg-sidebar: rgba(20, 23, 30, 0.6);
  --bg-card: rgba(28, 32, 40, 0.55);
  --bg-header: rgba(20, 23, 30, 0.55);

  --text-main: #e6e8ee;
  --text-muted: #a1a8b4;
  --text-light: #6f7684;

  --border-color: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);

  --primary: #b8c2ff;
  --primary-glow: rgba(184, 194, 255, 0.14);

  /* K/J pastel accents */
  --accent-peach: #ffd6c8;
  --accent-mint:  #c8f0dc;
  --accent-sky:   #cfe7ff;
  --accent-lav:   #dcd4ff;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

[data-theme="light"] {
  --bg-app: radial-gradient(1200px 800px at 20% 0%, #ffffff 0%, #f6f7fb 60%, #eef1f7 100%);
  --bg-sidebar: rgba(255, 255, 255, 0.75);
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-header: rgba(255, 255, 255, 0.75);
  --border-color: rgba(20, 20, 30, 0.06);
  --glass-border: rgba(20, 20, 30, 0.06);
  --glass-shadow: 0 6px 24px rgba(30, 41, 59, 0.06);
  --text-main: #17181c;
  --text-muted: #6a7280;
  --text-light: #a2a8b3;
  --primary: #6472ff;
  --primary-glow: rgba(100, 114, 255, 0.10);
}

/* Flatten every panel: no heavy shadows, no bevels, no thick borders */
.glass-panel,
.login-card,
.profile-sidebar,
.profile-content-pane,
.stories-wrapper,
.audio-track,
.gallery-item,
.crm-card,
.task-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--glass-shadow) !important;
  border-radius: var(--radius-lg) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Sidebar — softer, no hard right border, no insets */
aside {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  box-shadow: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.logo-container {
  border-bottom: none;
  padding-bottom: 16px;
}

/* Sidebar app icon — flat rounded chip, no bevel */
.logo-icon {
  background: linear-gradient(135deg, var(--accent-lav), var(--accent-sky));
  border: none;
  color: #1a1c22;
  box-shadow: 0 4px 14px rgba(184, 194, 255, 0.28);
  border-radius: 14px;
}

/* Sidebar wordmark — clean, no heavy filters */
.logo-text {
  animation: none;
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--text-main);
  filter: none;
  letter-spacing: 0.02em;
  font-weight: 700;
  text-transform: none;
}

/* Nav — pill items, no left bar, no border */
.nav-item {
  border: none !important;
  border-radius: 14px;
  color: var(--text-muted);
  padding: 11px 14px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: none;
  color: var(--text-main);
}
[data-theme="light"] .nav-item:hover { background: rgba(20, 20, 30, 0.04); }
.nav-item.active {
  background: var(--primary-glow) !important;
  color: var(--primary) !important;
  border-left: none !important;
  box-shadow: none !important;
}

.sidebar-footer { border-top: none; padding-top: 16px; }
.user-avatar { border: none; }
.user-name { color: var(--text-main); font-weight: 600; }

/* Header — flat, floating */
header {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

.search-bar {
  background: rgba(255, 255, 255, 0.04);
  border: none;
  box-shadow: none;
  border-radius: 14px;
  padding: 10px 16px;
}
[data-theme="light"] .search-bar { background: rgba(20, 20, 30, 0.04); }

.icon-btn {
  color: var(--text-muted);
  border-radius: 12px;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  color: var(--text-main);
}
[data-theme="light"] .icon-btn:hover { background: rgba(20, 20, 30, 0.05); }

/* Login card — soft, minimal */
.login-card {
  width: 380px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22) !important;
}
[data-theme="light"] .login-card {
  box-shadow: 0 20px 60px rgba(30, 41, 59, 0.10) !important;
}

/* Buttons — clean pill, no chrome/metallic bevel */
.btn-primary {
  background: var(--primary);
  color: #0b0d12;
  border: none;
  border-radius: 14px;
  padding: 12px 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 22px rgba(184, 194, 255, 0.22);
}
.btn-primary:hover {
  transform: translateY(-1px);
  opacity: 1;
  box-shadow: 0 12px 30px rgba(184, 194, 255, 0.30);
  border-color: transparent;
  background: #cfd6ff;
}
[data-theme="light"] .btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(100, 114, 255, 0.22);
}
[data-theme="light"] .btn-primary:hover {
  background: #7a86ff;
  box-shadow: 0 12px 30px rgba(100, 114, 255, 0.30);
}

/* Inputs — soft rounded fields, no inset shadow */
.form-group input,
.form-group select,
.form-group textarea,
input, textarea, select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: none !important;
  padding: 12px 14px;
  color: var(--text-main);
  transition: border-color .2s, background .2s;
}
.form-group input:focus,
.form-group textarea:focus,
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea,
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: rgba(20, 20, 30, 0.03);
}
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  background: rgba(20, 20, 30, 0.05);
}

/* Auth theme toggle — flat pill */
.auth-theme-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: none;
  backdrop-filter: blur(20px);
}
[data-theme="light"] .auth-theme-toggle {
  background: rgba(255, 255, 255, 0.9);
}

/* Company card typography — softer */
.company-card h3 {
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.company-card p { color: var(--text-muted); }

/* CRM & Kanban cards — flat, gentle */
.crm-card,
.task-card {
  border-left: none !important;
  padding: 18px;
}
.crm-card:hover,
.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28) !important;
}
[data-theme="light"] .crm-card:hover,
[data-theme="light"] .task-card:hover {
  box-shadow: 0 14px 40px rgba(30, 41, 59, 0.10) !important;
}

/* Kanban add-task — soft dashed hint */
.add-task-btn {
  background: transparent;
  border: 1px dashed var(--border-color);
  box-shadow: none;
  color: var(--text-muted);
  border-radius: 14px;
}
.add-task-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}

/* Column headers — no hard bottom bar */
.column-header { border-bottom: none; padding-bottom: 6px; }
.kanban-column-header { padding-bottom: 4px; }

/* Profile bits — soften */
.profile-avatar-wrapper { border-width: 2px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); }
.friend-avatar { border-width: 1px; }

/* Story ring — pastel gradient (K/J-ish) */
.story-avatar-holder {
  background: linear-gradient(45deg, var(--accent-peach), var(--accent-lav), var(--accent-sky));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.story-avatar-holder img,
.story-avatar-holder i {
  border-color: var(--bg-card);
}

/* Subtle scroll for main content area */
main { scroll-behavior: smooth; }

/* Body typography weight — lighter, more airy */
body { font-weight: 400; letter-spacing: 0.005em; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.005em; }

/* Kill any leftover thick inset shadows on generic elements */
.badge { box-shadow: 0 0 0 2px var(--bg-card); }

/* Content padding — breathe more */
.content-body { padding: 40px; }
@media (max-width: 900px) { .content-body { padding: 24px; } }

/* ============ PALETTE PICKER ============ */
.floating-controls {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 2100;
}
.floating-controls .auth-theme-toggle {
  position: static;
}

.header-palette-wrap {
  position: relative;
  display: inline-flex;
}

.palette-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  min-width: 176px;
  z-index: 2200;
}
[data-theme="light"] .palette-popover {
  box-shadow: 0 20px 60px rgba(30, 41, 59, 0.10);
}
.palette-popover.open {
  display: grid;
  animation: paletteIn .18s ease-out;
}
@keyframes paletteIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Popover anchored under the AUTH palette button — position it relative to the floating group */
#auth-palette-popover {
  top: 60px;
  right: 0;
}

.palette-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.palette-swatch:hover {
  transform: scale(1.1);
}
.palette-swatch.active {
  border-color: var(--text-main);
  box-shadow: 0 0 0 3px var(--bg-card), 0 6px 16px rgba(0,0,0,0.20);
}

/* ============ COMBINED SETTINGS POPOVER (theme + palette) ============ */
.header-settings-wrap { position: relative; display: inline-flex; }
.floating-controls    { position: fixed; top: 24px; right: 24px; z-index: 2100; }

.settings-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 220px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  z-index: 2200;
}
[data-theme="light"] .settings-popover {
  box-shadow: 0 20px 60px rgba(30, 41, 59, 0.12);
}
.settings-popover.open {
  display: block;
  animation: paletteIn .18s ease-out;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settings-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.settings-divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0;
}

.settings-theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.settings-theme-toggle:hover {
  transform: rotate(-15deg) scale(1.06);
  color: var(--primary);
}
.settings-theme-toggle i { width: 16px; height: 16px; }
[data-theme="light"] .settings-theme-toggle { background: rgba(20,20,30,0.03); }

.palette-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.palette-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  justify-self: center;
}
.palette-swatch:hover { transform: scale(1.12); }
.palette-swatch.active {
  border-color: var(--text-main);
  box-shadow: 0 0 0 3px var(--bg-card), 0 6px 16px rgba(0,0,0,0.20);
}

/* ============ SETTINGS POPOVER v2 — make it obvious ============ */
.settings-popover {
  min-width: 260px !important;
  padding: 16px !important;
}
.palette-grid {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
}
.palette-swatch {
  width: 42px !important;
  height: 42px !important;
  position: relative;
}
.palette-swatch.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center no-repeat;
  background-size: 22px 22px;
}

/* Show the currently active color on the palette button itself */
#auth-settings-btn, #app-settings-btn {
  position: relative;
}
#auth-settings-btn::after, #app-settings-btn::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-card);
}

/* Guard: nothing should intercept clicks on the swatches */
.palette-swatch, .palette-swatch * { pointer-events: auto; }
.palette-swatch.active::after { pointer-events: none; }
.settings-popover, .palette-grid { pointer-events: auto; }
.settings-popover svg, #auth-settings-btn svg, #app-settings-btn svg { pointer-events: none; }

/* Accent-driven feedback so a color pick is instantly obvious */
.brand-title::before {
  content: '';
  position: absolute;
  inset: -40px;
  border-radius: 40%;
  background: radial-gradient(closest-side, var(--primary-glow), transparent 70%);
  z-index: -2;
  pointer-events: none;
  filter: blur(24px);
  opacity: 0.9;
}
.auth-overlay::before {
  content: '';
  position: fixed;
  top: -160px; right: -160px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--primary-glow), transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  z-index: 0;
}

/* ============ BULLETPROOF PALETTE FEEDBACK ============ */
/* Big visible ring on the picked swatch */
.palette-swatch.active {
  transform: scale(1.14) !important;
  box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 6px var(--primary), 0 8px 20px rgba(0,0,0,0.35) !important;
  border-color: transparent !important;
}
.palette-swatch.active::after {
  content: '✓' !important;
  color: #111 !important;
  font-weight: 900 !important;
  font-size: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  inset: 0 !important;
}

/* Icon of the palette button turns into the accent color */
#auth-settings-btn i, #app-settings-btn i,
#auth-settings-btn svg, #app-settings-btn svg {
  color: var(--primary);
  stroke: var(--primary);
}

/* Make the BROKERZ auth logo look like a clickable entry point for the holding */
.brand-title {
  cursor: pointer;
  transition: transform .25s ease, filter .25s ease;
  padding: 8px 16px;
  border-radius: 20px;
}
.brand-title:hover {
  transform: translateY(-3px) scale(1.02);
}
.brand-title:hover .auth-logo {
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.95))
    drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.55))
    drop-shadow(0 12px 26px rgba(255, 255, 255, 0.20));
}
.brand-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  transition: transform .3s ease;
}
.brand-title:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Light theme: subtle ink underline */
[data-theme="light"] .brand-title::after {
  background: linear-gradient(90deg, transparent, rgba(30, 41, 59, 0.5), transparent);
}

/* Sidebar logo becomes company-tinted icon after login */
.logo-icon.has-company-icon {
  background: color-mix(in srgb, var(--company-color, #cbd5e1) 18%, transparent);
  color: var(--company-color, #cbd5e1);
  border-color: transparent;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--company-color, #cbd5e1) 25%, transparent);
}
.logo-icon.has-company-icon i,
.logo-icon.has-company-icon svg {
  width: 22px;
  height: 22px;
  color: var(--company-color, #cbd5e1);
  stroke: var(--company-color, #cbd5e1);
  stroke-width: 1.7;
}

/* Company badge on profile page also gets a tinted icon */
.profile-company-badge {
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--company-color, var(--primary)) 14%, transparent);
  color: var(--company-color, var(--primary));
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============================================================
   INSIDE-APP MINIMAL AESTHETIC — Japanese/Korean airy vibe
   Removes remaining hard frames, bevels, metallic effects
   ============================================================ */

/* Uniform soft radii everywhere */
.glass-panel,
.metric-card,
.feed-post-card,
.chat-panel,
.crm-card,
.task-card,
.kanban-column,
.pipeline-column,
.stat-card,
.audio-track,
.friend-card,
.gift-card {
  border-radius: 22px !important;
}

/* Flatten metric icons: soft tinted chip, no bevel */
.metric-icon {
  background: var(--primary-glow) !important;
  color: var(--primary) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 14px !important;
  width: 44px !important;
  height: 44px !important;
}
.metric-icon i, .metric-icon svg {
  color: var(--primary) !important;
  stroke: var(--primary) !important;
  stroke-width: 1.7 !important;
}

/* Dashboard metric value: lighter weight, no chrome feel */
.metric-value { font-weight: 600 !important; letter-spacing: -0.01em; }
.metric-details h3 { text-transform: none !important; letter-spacing: 0.01em !important; font-weight: 500 !important; font-size: 0.78rem !important; }

/* Feed & posts: no top border on actions, softer avatar */
.post-actions {
  border-top: none !important;
  padding-top: 8px !important;
}
.post-avatar { width: 40px !important; height: 40px !important; }

/* Chat bubbles: no inset shadows, flatter */
.chat-bubble {
  box-shadow: none !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 18px !important;
}
[data-theme="light"] .chat-bubble {
  background: rgba(20, 20, 30, 0.05) !important;
}
.chat-bubble.self,
.chat-bubble.you {
  background: var(--primary-glow) !important;
  color: var(--text-main) !important;
}

/* Column headers — no borders, softer type */
.column-header,
.kanban-column-header {
  border-bottom: none !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  letter-spacing: 0.005em;
  padding-bottom: 8px !important;
  color: var(--text-main);
}
.column-count {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-muted) !important;
  border-radius: 999px !important;
  padding: 2px 10px !important;
  font-weight: 500 !important;
}
[data-theme="light"] .column-count { background: rgba(20, 20, 30, 0.06) !important; }

/* CRM & Kanban cards: no colored left bars, flat */
.crm-card,
.task-card {
  border-left: none !important;
  background: rgba(255, 255, 255, 0.03) !important;
  box-shadow: none !important;
  border: 1px solid transparent !important;
  padding: 18px !important;
}
[data-theme="light"] .crm-card,
[data-theme="light"] .task-card {
  background: rgba(20, 20, 30, 0.025) !important;
}
.crm-card:hover,
.task-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
}
[data-theme="light"] .crm-card:hover,
[data-theme="light"] .task-card:hover {
  background: rgba(20, 20, 30, 0.04) !important;
  box-shadow: 0 12px 28px rgba(30, 41, 59, 0.10) !important;
}

/* Deal value uses primary accent softly */
.crm-card .deal-value {
  color: var(--primary) !important;
  font-weight: 600 !important;
}

/* Task tags — pill, soft */
.task-tag {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-muted) !important;
  border-radius: 999px !important;
  padding: 3px 10px !important;
  font-weight: 500 !important;
}
[data-theme="light"] .task-tag { background: rgba(20, 20, 30, 0.06) !important; }

/* Stat icons (profile page) — flat tinted chips */
.stat-icon {
  border: none !important;
  box-shadow: none !important;
  border-radius: 14px !important;
  width: 42px !important;
  height: 42px !important;
}

/* Profile tabs — cleaner pills */
.profile-tabs .tab-item {
  border: none !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
}
.profile-tabs .tab-item.active {
  border-left: none !important;
  background: var(--primary-glow) !important;
  color: var(--primary) !important;
}

/* Media/section titles — soft, understated */
.media-section-title {
  border: none !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  color: var(--text-main) !important;
  padding-bottom: 8px !important;
}

/* Avatars — thinner rings */
.user-avatar,
.profile-avatar-wrapper,
.friend-avatar,
.post-avatar,
.story-viewer-avatar {
  border: none !important;
}
.profile-avatar-wrapper {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20) !important;
}

/* Track cards flat */
.audio-track {
  border: none !important;
  background: rgba(255, 255, 255, 0.03) !important;
  box-shadow: none !important;
}
[data-theme="light"] .audio-track { background: rgba(20, 20, 30, 0.03) !important; }
.track-play-btn {
  background: var(--primary) !important;
  color: #0b0d12 !important;
  box-shadow: 0 4px 14px var(--primary-glow) !important;
}

/* Gallery items - remove borders and heavy shadows */
.gallery-item {
  border: none !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
  border-radius: 18px !important;
}
[data-theme="light"] .gallery-item { box-shadow: 0 6px 16px rgba(30, 41, 59, 0.08) !important; }

/* Header search — even softer */
.search-bar {
  background: rgba(255, 255, 255, 0.035) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 16px !important;
}
[data-theme="light"] .search-bar { background: rgba(20, 20, 30, 0.035) !important; }

/* Wider breathing space between sections */
.content-body { padding: 48px !important; gap: 24px; }
@media (max-width: 1100px) { .content-body { padding: 32px !important; } }
@media (max-width: 700px) { .content-body { padding: 20px !important; } }

/* Kill any remaining insets on generic panels */
.metric-card, .feed-post-card, .chat-panel, .stat-card,
.profile-sidebar, .profile-content-pane {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.20) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}
[data-theme="light"] .metric-card,
[data-theme="light"] .feed-post-card,
[data-theme="light"] .chat-panel,
[data-theme="light"] .stat-card,
[data-theme="light"] .profile-sidebar,
[data-theme="light"] .profile-content-pane {
  box-shadow: 0 8px 30px rgba(30, 41, 59, 0.06) !important;
  border-color: rgba(20, 20, 30, 0.04) !important;
}

/* ============================================================
   FINAL MINIMAL PASS — aggressive flattening
   ============================================================ */

/* Every card, panel, section — no border, whisper-soft shadow only */
.glass-panel {
  background: rgba(255, 255, 255, 0.025) !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
[data-theme="light"] .glass-panel {
  background: rgba(255, 255, 255, 0.55) !important;
  box-shadow: 0 1px 0 rgba(20,20,30,0.03) !important;
}

/* Different soft pastel tint per metric card icon — Korean/Japanese chip vibe */
.metrics-grid .metric-card:nth-child(1) .metric-icon { background: rgba(184, 194, 255, 0.14) !important; color: #B8C2FF !important; }
.metrics-grid .metric-card:nth-child(2) .metric-icon { background: rgba(253, 211, 141, 0.14) !important; color: #FDD38D !important; }
.metrics-grid .metric-card:nth-child(3) .metric-icon { background: rgba(134, 239, 172, 0.14) !important; color: #86EFAC !important; }
.metrics-grid .metric-card:nth-child(4) .metric-icon { background: rgba(240, 171, 252, 0.14) !important; color: #F0ABFC !important; }
.metrics-grid .metric-card:nth-child(1) .metric-icon i,
.metrics-grid .metric-card:nth-child(1) .metric-icon svg { color: #B8C2FF !important; stroke: #B8C2FF !important; }
.metrics-grid .metric-card:nth-child(2) .metric-icon i,
.metrics-grid .metric-card:nth-child(2) .metric-icon svg { color: #FDD38D !important; stroke: #FDD38D !important; }
.metrics-grid .metric-card:nth-child(3) .metric-icon i,
.metrics-grid .metric-card:nth-child(3) .metric-icon svg { color: #86EFAC !important; stroke: #86EFAC !important; }
.metrics-grid .metric-card:nth-child(4) .metric-icon i,
.metrics-grid .metric-card:nth-child(4) .metric-icon svg { color: #F0ABFC !important; stroke: #F0ABFC !important; }

/* Metric card content — bigger, airier */
.metric-card {
  padding: 28px !important;
  border-radius: 24px !important;
}
.metric-value { font-size: 2rem !important; }
.metric-details h3 { font-size: 0.72rem !important; opacity: 0.75; }

/* Sales chart / Events cards — no visible frame */
#dashboard-view .glass-panel { padding: 28px !important; border-radius: 24px !important; }

/* Feed textarea — flat */
#feed-input {
  background: rgba(255, 255, 255, 0.03) !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 14px !important;
}
[data-theme="light"] #feed-input { background: rgba(20, 20, 30, 0.03) !important; }

/* Chat input — pill */
.chat-input {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-input input {
  background: rgba(255, 255, 255, 0.03) !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 12px 18px !important;
  flex: 1;
}
[data-theme="light"] .chat-input input { background: rgba(20, 20, 30, 0.03) !important; }
.chat-input .btn-primary {
  border-radius: 50% !important;
  padding: 0 !important;
  width: 42px !important;
  height: 42px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Section titles — cleaner */
#dashboard-view h3, #crm-view h2, #kanban-view h2, #feed-view h3 {
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

/* Remove dark hr line in personal cabinet */
#profile-view hr { display: none !important; }

/* Add top decorative accent line only on hover — remove all decorative always-visible strips */
.company-card::before,
.stories-wrapper::before { display: none !important; }

/* Sidebar even thinner divider (invisible) */
aside { border-right-color: transparent !important; }
.logo-container { border-bottom: none !important; }
.sidebar-footer { border-top: none !important; }

/* ============ WORK CABINET (Bitrix24-style) ============ */
.work-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: 999px;
}
[data-theme="light"] .work-tabs { background: rgba(20,20,30,0.04); }
.work-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
}
.work-tab i, .work-tab svg { width: 14px; height: 14px; }
.work-tab:hover { color: var(--text-main); }
.work-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}
.wtab-content { display: none; animation: fadeIn .35s ease; }
.wtab-content.active { display: block; }

.chip-btn {
  background: rgba(255,255,255,0.04);
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}
.chip-btn.active { background: var(--primary-glow); color: var(--primary); }
[data-theme="light"] .chip-btn { background: rgba(20,20,30,0.04); }

/* Employees */
.work-employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.employee-card {
  padding: 20px !important;
  border-radius: 22px !important;
  text-align: center;
}
.employee-avatar-wrap {
  position: relative;
  width: 72px; height: 72px;
  margin: 0 auto 12px;
}
.employee-avatar-wrap img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.employee-status {
  position: absolute; right: 2px; bottom: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg-app);
}
.employee-status.online  { background: #86EFAC; }
.employee-status.away    { background: #FCD34D; }
.employee-status.offline { background: #64748b; }
.employee-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.employee-role { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 14px; }
.employee-meta {
  display: flex; justify-content: space-around;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 12px;
  gap: 8px;
}
.employee-meta > div { text-align: center; }
.employee-meta b { display: block; font-size: 1rem; }
.employee-meta span { color: var(--text-muted); font-size: 0.7rem; }
[data-theme="light"] .employee-meta { border-top-color: rgba(20,20,30,0.05); }

/* Schedule */
.schedule-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
[data-theme="light"] .schedule-row { border-bottom-color: rgba(20,20,30,0.05); }
.schedule-row:last-child { border-bottom: none; }
.schedule-time { text-align: center; }
.schedule-time b { display: block; font-size: 0.9rem; color: var(--primary); }
.schedule-time span { display: block; font-size: 0.75rem; color: var(--text-muted); }
.schedule-title { font-weight: 500; margin-bottom: 4px; }
.schedule-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

/* Documents */
.work-docs-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.doc-card {
  display: flex !important;
  align-items: center;
  gap: 16px;
  padding: 14px 18px !important;
  border-radius: 18px !important;
}
.doc-ext {
  min-width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}
.doc-body { flex: 1; }
.doc-name { font-weight: 500; font-size: 0.9rem; margin-bottom: 4px; }
.doc-meta { color: var(--text-muted); font-size: 0.72rem; }

/* News */
.news-card {
  padding: 22px !important;
  border-radius: 22px !important;
}
.news-card h4 { margin: 8px 0; font-weight: 600; }
.news-card p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; margin-bottom: 10px; }
.news-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}
.news-time { color: var(--text-light); font-size: 0.72rem; }

/* HR */
.hr-progress {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
.hr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, white));
}
[data-theme="light"] .hr-progress { background: rgba(20,20,30,0.06); }
.hr-request-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
[data-theme="light"] .hr-request-row { border-bottom-color: rgba(20,20,30,0.05); }
.hr-request-row:last-child { border-bottom: none; }
.hr-req-name { font-size: 0.9rem; font-weight: 500; }
.hr-req-period { font-size: 0.75rem; color: var(--text-muted); }
.hr-req-status { font-size: 0.72rem; padding: 3px 10px; border-radius: 999px; font-weight: 500; }

/* Reports */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.report-card {
  padding: 22px !important;
  border-radius: 22px !important;
  display: flex; flex-direction: column;
}
.report-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.report-icon i, .report-icon svg { width: 22px; height: 22px; }
.report-title { color: var(--text-muted); font-size: 0.78rem; }
.report-value { font-size: 1.6rem; font-weight: 600; margin: 4px 0; letter-spacing: -0.01em; }
.report-delta { font-size: 0.82rem; font-weight: 500; }

/* ============ PROFILE ADDITIONS: Work / Resume / KPI ============ */
.work-info-card {
  padding: 24px !important;
  border-radius: 22px !important;
}
.work-info-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
[data-theme="light"] .work-info-row { border-bottom-color: rgba(20,20,30,0.05); }
.work-info-row:last-child { border-bottom: none; }
.work-info-label { color: var(--text-muted); font-size: 0.82rem; }
.work-info-value { font-weight: 500; }

.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.resume-section { margin-bottom: 26px; }
.resume-section-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  font-weight: 600;
}
.timeline {
  position: relative;
  padding-left: 22px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}
[data-theme="light"] .timeline::before { background: rgba(20,20,30,0.08); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-dot {
  position: absolute;
  left: -19px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--bg-app);
}
.timeline-date { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 2px; }
.timeline-role { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.timeline-desc { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }

.skills-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chip {
  background: rgba(255,255,255,0.05);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-main);
}
[data-theme="light"] .skill-chip { background: rgba(20,20,30,0.05); }

.achievement-list { list-style: none; padding: 0; margin: 0; }
.achievement-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9rem;
}
.achievement-list i, .achievement-list svg {
  width: 16px; height: 16px;
  color: var(--primary);
}

/* KPI */
.kpi-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 24px;
}
[data-theme="light"] .kpi-summary { background: rgba(20,20,30,0.03); }
.kpi-ring { position: relative; width: 120px; height: 120px; }
.kpi-ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.kpi-ring-value { font-size: 1.7rem; font-weight: 600; color: var(--primary); }
.kpi-ring-caption { color: var(--text-muted); font-size: 0.72rem; }
.kpi-headline-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.kpi-headline-row:last-child { border-bottom: none; }
[data-theme="light"] .kpi-headline-row { border-bottom-color: rgba(20,20,30,0.05); }
.kpi-headline-row b { color: var(--text-main); font-weight: 600; }

.kpi-bars { display: flex; flex-direction: column; gap: 18px; }
.kpi-bar-head {
  display: flex; justify-content: space-between;
  font-size: 0.88rem; margin-bottom: 8px;
}
.kpi-pct { color: var(--text-muted); font-weight: 500; }
.kpi-bar {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
[data-theme="light"] .kpi-bar { background: rgba(20,20,30,0.06); }
.kpi-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ============ SOCIAL NETWORK PROFILE ============ */
.social-hero {
  position: relative;
  margin-bottom: 20px;
}
.social-cover {
  height: 220px;
  border-radius: 24px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.social-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.35) 100%);
}
.cover-edit-btn {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  background: rgba(0,0,0,0.35);
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
}
.cover-edit-btn i { width: 14px; height: 14px; }

.social-hero-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: end;
  padding: 0 24px;
  margin-top: -60px;
  position: relative;
  z-index: 3;
}
.social-avatar {
  width: 140px !important;
  height: 140px !important;
  border: 5px solid var(--bg-app) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.30) !important;
  border-radius: 50% !important;
}
.social-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.social-avatar .avatar-edit-btn {
  bottom: 6px; right: 6px;
  width: 34px; height: 34px;
}
.online-dot {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 18px; height: 18px;
  background: #86EFAC;
  border-radius: 50%;
  border: 4px solid var(--bg-app);
}

.social-hero-info { padding-bottom: 8px; }
.social-name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.social-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.social-meta i { color: var(--text-muted); }
.social-dot { opacity: 0.5; }
.social-status {
  color: var(--text-main);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 10px;
  opacity: 0.85;
}

.social-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 8px;
}
.social-action-btn {
  padding: 10px 16px !important;
  border-radius: 14px !important;
  font-size: 0.85rem !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  color: var(--text-main);
}
.social-action-btn i { width: 15px; height: 15px; }
.social-action-btn.ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}
[data-theme="light"] .social-action-btn { background: rgba(20,20,30,0.05); }
[data-theme="light"] .social-action-btn.ghost { background: rgba(20,20,30,0.04); }

.social-counters {
  display: flex;
  gap: 8px;
  padding: 20px 24px 0;
  flex-wrap: wrap;
}
.social-counter {
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 10px 18px;
  text-align: center;
  min-width: 88px;
}
[data-theme="light"] .social-counter { background: rgba(20,20,30,0.04); }
.social-counter b { display: block; font-size: 1.1rem; font-weight: 600; }
.social-counter span { color: var(--text-muted); font-size: 0.72rem; }

/* Horizontal tab strip */
.profile-tab-menu.horizontal {
  display: flex !important;
  flex-direction: row !important;
  gap: 4px !important;
  padding: 8px !important;
  border-radius: 20px !important;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-tab-menu.horizontal::-webkit-scrollbar { display: none; }
.profile-tab-menu.horizontal .ptab {
  flex-shrink: 0;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-size: 0.85rem !important;
  gap: 6px;
}
.profile-tab-menu.horizontal .ptab i { width: 14px; height: 14px; }

/* Social layout: sidebar + main */
.social-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .social-layout { grid-template-columns: 1fr; }
}

.social-side { display: flex; flex-direction: column; gap: 20px; }
.social-side-card { padding: 20px !important; border-radius: 20px !important; }
.side-card-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.side-card-count { color: var(--text-light); font-weight: 500; }
.about-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.about-row b { color: var(--text-main); font-weight: 500; text-align: right; }
.contact-row {
  display: flex; gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 0.85rem;
}
.contact-row i { width: 15px; height: 15px; color: var(--text-muted); }

.friends-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.friends-mini-item {
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.friends-mini-item img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
}
.friends-mini-item span {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Wall composer */
.wall-composer {
  padding: 16px !important;
  display: flex;
  gap: 14px;
  border-radius: 20px !important;
  margin-bottom: 18px;
}
.composer-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.wall-composer textarea {
  width: 100%;
  border: none;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text-main);
  font-family: inherit;
  resize: none;
  outline: none;
  font-size: 0.92rem;
}
[data-theme="light"] .wall-composer textarea { background: rgba(20,20,30,0.03); }
.composer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.composer-chip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  cursor: pointer;
}
.composer-chip:hover { background: rgba(255,255,255,0.04); color: var(--text-main); }
[data-theme="light"] .composer-chip:hover { background: rgba(20,20,30,0.04); }
.composer-chip i { width: 14px; height: 14px; }

/* Wall posts */
.wall-posts { display: flex; flex-direction: column; gap: 16px; }
.wall-post { padding: 20px !important; border-radius: 20px !important; }
.wall-post .post-header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.wall-post .post-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.wall-post .post-meta h4 { font-size: 0.92rem; font-weight: 600; margin: 0; }
.wall-post .post-meta span { color: var(--text-muted); font-size: 0.72rem; }
.wall-post .post-content { font-size: 0.94rem; line-height: 1.55; margin-bottom: 12px; }
.wall-post .post-image-strip {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
}
.wall-post .post-image-strip img {
  width: 100%;
  display: block;
  border-radius: 16px;
}
.wall-post .post-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  border-top: none !important;
  padding-top: 0 !important;
}
.wall-post .action-btn {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  gap: 6px;
}
.wall-post .action-btn:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .wall-post .action-btn:hover { background: rgba(20,20,30,0.05); }
.wall-post .action-btn i { width: 14px; height: 14px; }
.post-mention { color: var(--primary); font-weight: 500; font-size: 0.88rem; }

/* Cover fallback for light theme */
[data-theme="light"] .social-cover::after {
  background: linear-gradient(180deg, transparent 40%, rgba(255,255,255,0.30) 100%);
}

/* ============ TOP MODE SWITCH (Работа ⇄ Личный) ============ */
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  margin: 12px 0 18px;
}
[data-theme="light"] .mode-switch { background: rgba(20,20,30,0.04); }
.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 9px 8px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all .2s;
}
.mode-btn i, .mode-btn svg { width: 14px; height: 14px; }
.mode-btn:hover { color: var(--text-main); }
.mode-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

/* ============ DEPARTMENTS ============ */
.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.dept-card {
  padding: 22px !important;
  border-radius: 22px !important;
  display: flex;
  flex-direction: column;
  transition: transform .25s;
}
.dept-card:hover { transform: translateY(-4px); }
.dept-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.dept-icon i, .dept-icon svg { width: 24px; height: 24px; }
.dept-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.dept-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  min-height: 40px;
}
.dept-meta {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
[data-theme="light"] .dept-meta { border-top-color: rgba(20,20,30,0.05); }
.dept-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.dept-meta-row b { color: var(--text-main); font-weight: 500; }
.dept-open {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  margin-top: auto;
  transition: gap .2s;
}
.dept-open:hover { gap: 8px; }
.dept-open i, .dept-open svg { width: 14px; height: 14px; }

/* ============ TOASTS ============ */
#toast-holder {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 0.88rem;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateX(24px);
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  min-width: 200px;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast i, .toast svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }

/* Liked / bookmarked states */
.action-btn.liked { color: #F87171 !important; }
.action-btn.bookmarked { color: var(--primary) !important; }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; animation: fadeIn .25s ease; }
.lightbox img {
  max-width: 90vw;
  max-height: 82vh;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(12px);
}
.lightbox-close i { width: 18px; height: 18px; }
#lightbox-caption {
  position: absolute;
  bottom: 24px;
  color: #fff;
  font-size: 0.95rem;
  padding: 8px 20px;
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
}

/* ============ MESSENGER LINKING ============ */
.messenger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.messenger-card {
  padding: 24px !important;
  border-radius: 22px !important;
  display: flex;
  flex-direction: column;
}
.messenger-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.messenger-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.20);
}
.messenger-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}
.messenger-caption {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 2px;
}
.messenger-status {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}
.messenger-status.disconnected {
  background: rgba(148,163,184,0.15);
  color: var(--text-muted);
}
.messenger-status.connected {
  background: rgba(134,239,172,0.15);
  color: #86EFAC;
}

.messenger-steps {
  padding-left: 20px;
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}
.messenger-steps li { padding: 2px 0; }
.messenger-steps b { color: var(--text-main); font-weight: 600; }

.qr-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border-radius: 20px;
  margin-bottom: 16px;
}
[data-theme="light"] .qr-holder { background: rgba(20,20,30,0.03); }
.qr-holder img {
  border-radius: 14px;
  background: #fff;
  padding: 8px;
}
.qr-timer {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.qr-timer b { color: var(--text-main); font-weight: 600; }
.qr-again { color: var(--primary); text-decoration: underline; cursor: pointer; }

.messenger-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.messenger-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.85rem;
}
.messenger-ghost:hover { color: var(--text-main); }

.messenger-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
[data-theme="light"] .messenger-note { background: rgba(20,20,30,0.03); }
.messenger-note i, .messenger-note svg {
  width: 16px; height: 16px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============ MESSENGER STATE PANELS ============ */
.mess-idle {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 24px 8px;
  text-align: center;
}
.mess-connect-btn {
  background: var(--primary);
  color: #0b0d12;
  border: none;
  padding: 16px 22px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 26px var(--primary-glow);
  transition: transform .2s, box-shadow .2s;
}
.mess-connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px var(--primary-glow);
}
.mess-connect-btn i, .mess-connect-btn svg { width: 18px; height: 18px; }
[data-theme="light"] .mess-connect-btn { color: #fff; }

.mess-alt-links {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.mess-alt-links a {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}
.mess-alt-links a:hover { text-decoration: underline; }

.mess-done {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 20px;
  background: rgba(134, 239, 172, 0.08);
  border-radius: 16px;
}
.mess-done-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: rgba(134, 239, 172, 0.18);
  color: #86EFAC;
  display: flex; align-items: center; justify-content: center;
}
.mess-done-icon i, .mess-done-icon svg { width: 24px; height: 24px; }
.mess-done-text b { display: block; font-weight: 600; }
.mess-done-text span {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2px;
  display: block;
}

/* ============ CLEAN TAB ISOLATION IN PERSONAL CABINET ============
   Hide the persistent left sidebar (Обо мне / Контакты / Друзья mini).
   Each tab now shows only its own content, full-width. */
.social-layout {
  grid-template-columns: 1fr !important;
}
.social-side { display: none !important; }
.social-main { max-width: 1100px; margin: 0 auto; }

/* ============ SIDEBAR GROUP HEADERS ============ */
.nav-group-label {
  padding: 14px 14px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.nav-group-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
  margin: 8px 12px 0;
  border-radius: 1px;
}
[data-theme="light"] .nav-group-divider { background: rgba(20, 20, 30, 0.05); }

/* First group in nav needs no top divider */
.mode-nav > .nav-group-label:first-child { padding-top: 4px; }

/* ============ PROFILE TAB CONTENT — show/hide by active ============ */
.ptab-content { display: none; }
.ptab-content.active { display: block; animation: fadeIn .3s ease; }

/* Sidebar already has all these sections — hide the horizontal top strip */
.profile-tab-menu.horizontal { display: none !important; }

/* User asked to remove the whole hero (cover + avatar + counters) from personal cabinet */
.social-hero { display: none !important; }

/* Revert: keep the profile hero visible (cover + avatar + name + counters)
   — only the horizontal tab strip stays hidden. */
.social-hero { display: block !important; }

/* ============ FOLLOWERS / FOLLOWING LISTS ============ */
.follow-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding: 8px 16px;
  min-width: 260px;
}
[data-theme="light"] .follow-search { background: rgba(20,20,30,0.04); }
.follow-search i { width: 15px; height: 15px; color: var(--text-muted); }
.follow-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 100%;
}

.follow-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.follow-card {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 14px 18px !important;
  border-radius: 20px !important;
}
.follow-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.follow-info { flex: 1; min-width: 0; }
.follow-info h4 { font-size: 0.92rem; font-weight: 600; margin: 0; }
.follow-info span { color: var(--text-muted); font-size: 0.78rem; }

.follow-btn {
  background: var(--primary);
  color: #0b0d12;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.follow-btn:hover { transform: translateY(-1px); }
.follow-btn.following {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.follow-btn.following:hover {
  color: #F87171;
  border-color: #F87171;
}
[data-theme="light"] .follow-btn { color: #fff; }

/* ============ JOB INVITATIONS ============ */
.inv-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.invitations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.invitation-card {
  padding: 22px !important;
  border-radius: 22px !important;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform .25s;
}
.invitation-card:hover { transform: translateY(-4px); }
.invitation-card.is-hot {
  outline: 1px solid rgba(252, 165, 165, 0.25);
  outline-offset: -1px;
}
.inv-hot-tag {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(252, 165, 165, 0.15);
  color: #FCA5A5;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}
.inv-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.inv-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-company { font-weight: 600; font-size: 0.95rem; }
.inv-received { color: var(--text-muted); font-size: 0.72rem; }
.inv-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}
.inv-badge.new      { background: rgba(184,194,255,0.18); color: #B8C2FF; }
.inv-badge.reviewed { background: rgba(148,163,184,0.15); color: var(--text-muted); }

.inv-role {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.005em;
}
.inv-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.inv-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.inv-row i, .inv-row svg { width: 14px; height: 14px; }

.inv-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}
.inv-accept {
  flex: 1;
  padding: 9px 14px !important;
  font-size: 0.82rem !important;
  border-radius: 12px !important;
}
.inv-view {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 9px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 12px;
}
.inv-view:hover { color: var(--text-main); background: rgba(255,255,255,0.04); }
[data-theme="light"] .inv-view:hover { background: rgba(20,20,30,0.04); }
.inv-decline {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.inv-decline:hover { color: #F87171; border-color: #F87171; }
.inv-decline i, .inv-decline svg { width: 14px; height: 14px; }

/* Red dot on the "Приглашения" counter */
.counter-hot { position: relative; }
.counter-dot {
  position: absolute;
  top: 8px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #F87171;
  box-shadow: 0 0 0 3px var(--bg-card);
}

/* Notification dot on Приглашения counter — green instead of red */
.counter-dot { background: #86EFAC !important; }

/* Inline company logo inside the invitation avatar box */
.inv-logo {
  overflow: hidden;
  padding: 4px;
}
.inv-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.inv-logo-fallback {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}

/* Sidebar already has all these — hide the horizontal work-tab strip too */
.work-tabs { display: none !important; }

/* ============ INTERNAL MESSENGER ============ */
.messenger-app {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  height: 620px;
  background: var(--bg-card);
  border-radius: 22px;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

/* Left column */
.mess-app-side {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: transparent;
}
.mess-app-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 12px;
}
.mess-app-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.mess-app-new {
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mess-app-new i { width: 16px; height: 16px; }

.mess-app-search {
  margin: 0 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
}
[data-theme="light"] .mess-app-search { background: rgba(20,20,30,0.04); }
.mess-app-search i { width: 15px; height: 15px; color: var(--text-muted); }
.mess-app-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 100%;
}

.mess-app-tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px 8px;
}
.mess-app-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.mess-app-tab.active { background: var(--primary-glow); color: var(--primary); }

/* Переключатель Внутренние / Внешние */
.mess-app-source {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 12px 8px;
  margin-top: 4px;
}
/* ============ Плотный фон для всех попапов, модалок и всплывашек ============
   ~80% непрозрачности (rgba .8) — не мешает восприятию сайта, но текст снизу не просвечивает */

/* 1) Именованные попап-меню и часы/таймер в шапке */
#platform-accounts-menu,
#msg-ctx-menu,
#chat-ctx-menu,
#chat-folder-submenu,
#accounts-menu,
#companies-menu,
#dash-cur-menu,
.clock-popover,
.palette-popover,
.search-popover,
.notif-popover {
  background: rgba(20, 22, 29, 0.85) !important;
  backdrop-filter: blur(20px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.3) !important;
}
[data-theme="light"] #platform-accounts-menu,
[data-theme="light"] #msg-ctx-menu,
[data-theme="light"] #chat-ctx-menu,
[data-theme="light"] #chat-folder-submenu,
[data-theme="light"] #accounts-menu,
[data-theme="light"] #companies-menu,
[data-theme="light"] #dash-cur-menu,
[data-theme="light"] .clock-popover,
[data-theme="light"] .palette-popover,
[data-theme="light"] .search-popover {
  background: rgba(255, 255, 255, 0.9) !important;
}

/* 2) Все динамические модалки (fixed + inset:0 + z-index в 5-значном диапазоне)
   Одна из внутренних div-обёрток получает солидную подложку. */
div[style*="position:fixed"][style*="z-index:1"][style*="inset:0"] > div:not(.tp-preset):not(.mess-bubble) {
  background-color: rgba(20, 22, 29, 0.85) !important;
  backdrop-filter: blur(18px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
}
[data-theme="light"] div[style*="position:fixed"][style*="z-index:1"][style*="inset:0"] > div:not(.tp-preset):not(.mess-bubble) {
  background-color: rgba(255, 255, 255, 0.92) !important;
}

/* 3) Инлайновые дропдауны, у которых есть stopPropagation
   (шапка сайта — часы, палитра, поиск) */
[onclick*="event.stopPropagation"] {
  background: rgba(20, 22, 29, 0.85) !important;
}
[data-theme="light"] [onclick*="event.stopPropagation"] {
  background: rgba(255, 255, 255, 0.92) !important;
}

/* Табы-папки */
.mess-folder-tabs {
  display: flex;
  gap: 4px;
  padding: 4px 12px 8px;
  overflow-x: auto;
  scrollbar-width: none;      /* Firefox — прокрутка есть, полоса скрыта */
  -ms-overflow-style: none;
}
.mess-folder-tabs::-webkit-scrollbar { display: none; height: 0; width: 0; }
.mess-folder-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.mess-folder-tab:hover { background: var(--surface-2, rgba(255,255,255,0.05)); color: var(--text-main); }
.mess-folder-tab.active {
  background: var(--primary-glow, rgba(139,92,246,0.15));
  border-color: var(--primary);
  color: var(--primary);
}
.mess-folder-tab.mess-folder-add {
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}
.mess-folder-del {
  opacity: 0.5;
  padding: 0 2px;
  cursor: pointer;
  font-weight: 700;
}
.mess-folder-del:hover { opacity: 1; color: #ef4444; }

/* Строка иконок платформ */
.mess-platform-strip {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}
.mess-platform-btn {
  position: relative;
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.mess-platform-btn:hover { background: var(--surface-2, rgba(255,255,255,0.05)); }
.mess-platform-btn.active {
  background: var(--primary-glow, rgba(139,92,246,0.15));
  border-color: var(--primary);
}
.mess-platform-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mess-platform-status {
  position: absolute;
  right: 6px; top: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #6b7280;
  border: 2px solid var(--bg-card);
}
.mess-platform-btn.connected .mess-platform-status { background: #22c55e; }

/* Обёртка аватара шапки чата */
.mess-app-thread-avatar-wrap {
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.mess-app-thread-avatar-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(94,234,212,0.10));
}
.mess-app-thread-avatar-placeholder svg { transition: transform 0.4s ease; }
.mess-app-thread-avatar-wrap:hover .mess-app-thread-avatar-placeholder svg { transform: scale(1.1); }
.mess-src-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-2, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.mess-src-btn i, .mess-src-btn svg { width: 16px; height: 16px; }
.mess-src-btn:hover { color: var(--text-strong, #fff); border-color: rgba(255,255,255,0.16); }
.mess-src-btn.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}
.mess-src-count {
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
/* Иконка источника у чата (внизу справа аватарки) */
.mess-app-item .mess-src-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface, #1a1a1e);
  color: #fff;
  font-size: 10px;
}
.mess-app-item .mess-src-badge.tg { background: #229ED9; }
.mess-app-item .mess-src-badge.wa { background: #25D366; }
.mess-app-avatar-wrap { position: relative; }


.mess-app-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
}
.mess-app-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background .2s;
}
.mess-app-item:hover { background: rgba(255,255,255,0.03); }
.mess-app-item.active { background: var(--primary-glow); }
[data-theme="light"] .mess-app-item:hover { background: rgba(20,20,30,0.03); }

.mess-app-avatar-wrap { position: relative; }
.mess-app-avatar-wrap img {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.mess-app-online {
  position: absolute;
  bottom: 0; right: 0;
  width: 12px; height: 12px;
  background: #86EFAC;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.mess-app-item-body { min-width: 0; }
.mess-app-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.mess-app-item-name { font-weight: 600; font-size: 0.88rem; }
.mess-app-item-time { font-size: 0.7rem; color: var(--text-muted); }
.mess-app-item-preview {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.mess-app-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary);
  color: #0b0d12;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
[data-theme="light"] .mess-app-unread { color: #fff; }

/* Right column: thread */
.mess-app-main { display: flex; flex-direction: column; overflow: hidden; }
.mess-app-thread-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.mess-app-thread-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
}
.mess-app-thread-name { font-weight: 600; }
.mess-app-thread-status { color: var(--text-muted); font-size: 0.75rem; }

.mess-app-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mess-app-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 40px;
}
.mess-app-empty i { width: 42px; height: 42px; opacity: 0.4; }

.mess-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  padding-right: 34px; /* место для кнопки перевода */
}
.mess-bubble.me { padding-right: 14px; } /* у своих не нужно */
.mess-bubble:hover .mess-bubble-translate { opacity: 1 !important; }
.mess-bubble-translate:hover { background: rgba(139,92,246,0.30) !important; }
.mess-bubble-translated {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(139,92,246,0.35);
  font-size: 0.82rem;
  color: var(--primary);
  font-style: italic;
}
.mess-bubble.me {
  align-self: flex-end;
  background: var(--primary);
  color: #0b0d12;
  border-bottom-right-radius: 4px;
}
[data-theme="light"] .mess-bubble.me { color: #fff; }
.mess-bubble.them {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  border-bottom-left-radius: 4px;
}
[data-theme="light"] .mess-bubble.them { background: rgba(20,20,30,0.04); }
.mess-bubble-author {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.mess-bubble-time {
  font-size: 0.68rem;
  opacity: 0.6;
  margin-top: 4px;
}

.mess-app-composer {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
}
.mess-app-composer input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: none;
  outline: none;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--text-main);
  font-size: 0.9rem;
}
[data-theme="light"] .mess-app-composer input { background: rgba(20,20,30,0.04); }
.mess-app-send {
  border-radius: 50% !important;
  padding: 0 !important;
  width: 40px !important;
  height: 40px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Nav badge (unread counter next to Сообщения nav item) */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--primary);
  color: #0b0d12;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
[data-theme="light"] .nav-badge { color: #fff; }

/* Mobile: collapse messenger to single-column */
@media (max-width: 900px) {
  .messenger-app { grid-template-columns: 1fr; height: calc(100vh - 160px); }
  .mess-app-side { border-right: none; border-bottom: 1px solid var(--border-color); max-height: 40vh; }
}

/* ============ ONLINE STORAGE ============ */
.storage-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .storage-layout { grid-template-columns: 1fr; }
}

/* Left rail */
.storage-side {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(20px);
}
.storage-upload-btn {
  background: var(--primary);
  color: #0b0d12;
  border: none;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 22px var(--primary-glow);
}
.storage-upload-btn i { width: 16px; height: 16px; }
[data-theme="light"] .storage-upload-btn { color: #fff; }

.storage-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.storage-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: none;
}
.storage-nav-item i { width: 16px; height: 16px; }
.storage-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-main); }
[data-theme="light"] .storage-nav-item:hover { background: rgba(20,20,30,0.04); }
.storage-nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
}

.storage-usage {
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
}
[data-theme="light"] .storage-usage { background: rgba(20,20,30,0.03); }
.storage-usage-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.storage-usage-head b { color: var(--text-main); font-weight: 600; }
.storage-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
[data-theme="light"] .storage-bar { background: rgba(20,20,30,0.06); }
.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, white));
  border-radius: 999px;
}
.storage-breakdown { display: flex; flex-direction: column; gap: 6px; }
.storage-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.storage-legend .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: auto;
}
.storage-legend b { color: var(--text-main); font-weight: 500; font-size: 0.75rem; }
.storage-upgrade {
  margin-top: 14px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
}
.storage-upgrade:hover { border-color: var(--primary); color: var(--primary); }

/* Main */
.storage-main {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 20px 24px;
  backdrop-filter: blur(20px);
}
.storage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.storage-breadcrumb {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.storage-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.storage-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  min-width: 220px;
}
[data-theme="light"] .storage-search { background: rgba(20,20,30,0.04); }
.storage-search i { width: 15px; height: 15px; color: var(--text-muted); }
.storage-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 100%;
}

.storage-view-toggle {
  display: flex;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 3px;
}
[data-theme="light"] .storage-view-toggle { background: rgba(20,20,30,0.04); }
.storage-view-toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.storage-view-toggle button.active { background: var(--bg-card); color: var(--text-main); }
.storage-view-toggle button i { width: 15px; height: 15px; }

#storage-new-folder {
  padding: 8px 14px !important;
  font-size: 0.82rem !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
#storage-new-folder i { width: 14px; height: 14px; }

.storage-section-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Folders grid */
.storage-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.storage-folder {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
[data-theme="light"] .storage-folder { background: rgba(20,20,30,0.02); }
.storage-folder:hover { background: rgba(255,255,255,0.05); transform: translateY(-1px); }
[data-theme="light"] .storage-folder:hover { background: rgba(20,20,30,0.05); }
.storage-folder-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.storage-folder-icon i { width: 20px; height: 20px; }
.storage-folder-name { font-weight: 500; font-size: 0.9rem; }
.storage-folder-meta { color: var(--text-muted); font-size: 0.72rem; }
.storage-more {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.storage-more:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }

/* Files list */
.storage-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}
.storage-main.list-mode .storage-files {
  grid-template-columns: 1fr;
}
.storage-file {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  transition: background .2s;
}
[data-theme="light"] .storage-file { background: rgba(20,20,30,0.02); }
.storage-file:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .storage-file:hover { background: rgba(20,20,30,0.05); }
.storage-file-ext {
  min-width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
}
.storage-file-ext i { width: 16px; height: 16px; }
.storage-file-body { min-width: 0; }
.storage-file-name {
  font-weight: 500;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.storage-file-name .star-on { width: 12px; height: 12px; color: #FCD34D; fill: #FCD34D; }
.storage-file-meta { color: var(--text-muted); font-size: 0.72rem; margin-top: 2px; }
.storage-file-action {
  width: 32px; height: 32px;
  padding: 0;
  color: var(--text-muted);
}
.storage-file-action:hover { color: var(--primary); }
.storage-file-action i { width: 14px; height: 14px; }

/* ============ WHITEBOARD (Доска) ============ */
.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px !important;
  margin-bottom: 14px;
  border-radius: 18px !important;
}
.board-tool-group, .board-colors, .board-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.board-tool, .board-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.board-tool:hover, .board-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
[data-theme="light"] .board-tool:hover, [data-theme="light"] .board-btn:hover { background: rgba(20,20,30,0.05); }
.board-tool.active { background: var(--primary-glow); color: var(--primary); }
.board-tool i, .board-btn i { width: 16px; height: 16px; }

.board-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

.board-color {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s;
  padding: 0;
}
.board-color:hover { transform: scale(1.15); }
.board-color.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--bg-card); }
#board-color-pick {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
}
#board-color-pick::-webkit-color-swatch-wrapper { padding: 0; }
#board-color-pick::-webkit-color-swatch { border: none; border-radius: 50%; }

.board-sizes {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.board-sizes input[type=range] {
  width: 100px;
  accent-color: var(--primary);
}
.board-sizes span {
  min-width: 24px;
  text-align: center;
  color: var(--text-main);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.board-canvas-wrap {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 12px;
  backdrop-filter: blur(20px);
  overflow: hidden;
}
#board-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 14/7.2;
  display: block;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 40px 40px,
    rgba(15, 18, 24, 0.6);
  border-radius: 16px;
  cursor: crosshair;
  touch-action: none;
}
[data-theme="light"] #board-canvas {
  background:
    linear-gradient(rgba(20,20,30,0.04) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(20,20,30,0.04) 1px, transparent 1px) 0 0 / 40px 40px,
    #fafbfd;
}

/* ============ COLLABS ============ */
.collab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.collab-card {
  padding: 22px !important;
  border-radius: 22px !important;
  display: flex;
  flex-direction: column;
  transition: transform .25s;
}
.collab-card:hover { transform: translateY(-3px); }
.collab-companies {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.collab-comp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
}
.collab-comp i, .collab-comp svg { width: 13px; height: 13px; }
.collab-x { color: var(--text-muted); font-size: 1rem; padding: 0 2px; }

.collab-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; letter-spacing: -0.005em; }
.collab-goal { color: var(--text-muted); font-size: 0.86rem; line-height: 1.5; margin-bottom: 14px; min-height: 40px; }

.collab-progress { margin-bottom: 14px; }
.collab-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
[data-theme="light"] .collab-progress-bar { background: rgba(20,20,30,0.06); }
.collab-progress-fill { height: 100%; border-radius: 999px; transition: width .5s; }
.collab-progress-meta { font-size: 0.76rem; color: var(--text-muted); }
.collab-progress-meta b { color: var(--text-main); }

.collab-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 14px;
}
[data-theme="light"] .collab-meta { border-top-color: rgba(20,20,30,0.05); }
.collab-meta-row { color: var(--text-muted); font-size: 0.8rem; display: flex; gap: 8px; align-items: center; }
.collab-meta-row i, .collab-meta-row svg { width: 14px; height: 14px; }
.collab-meta-row b { color: var(--text-main); font-weight: 500; margin-left: 4px; }

.collab-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  align-items: center;
}
.collab-open {
  flex: 1;
  padding: 10px 14px !important;
  font-size: 0.85rem !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  position: relative;
}
.collab-open i { width: 15px; height: 15px; }
.collab-unread {
  background: #F87171;
  color: #fff;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
}
.collab-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 0.82rem;
}
.collab-ghost:hover { background: rgba(255,255,255,0.04); color: var(--text-main); }
[data-theme="light"] .collab-ghost:hover { background: rgba(20,20,30,0.04); }
.collab-ghost i { width: 14px; height: 14px; }

/* ============ INVENTORY ============ */
.inv-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.inv-kpi {
  padding: 16px !important;
  border-radius: 18px !important;
  display: flex;
  gap: 12px;
  align-items: center;
}
.inv-kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.inv-kpi-icon i { width: 20px; height: 20px; }
.inv-kpi-title { color: var(--text-muted); font-size: 0.75rem; }
.inv-kpi-val { font-size: 1.15rem; font-weight: 600; margin-top: 2px; }

.inv-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.inv-select {
  background: rgba(255,255,255,0.04);
  border: none;
  border-radius: 12px;
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}
[data-theme="light"] .inv-select { background: rgba(20,20,30,0.04); }

.inv-table {
  padding: 8px !important;
  border-radius: 20px !important;
  overflow-x: auto;
}
.inv-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.4fr 0.8fr 1fr 1.1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
}
.inv-row + .inv-row { border-top: 1px dashed rgba(255,255,255,0.04); border-radius: 0; }
[data-theme="light"] .inv-row + .inv-row { border-top-color: rgba(20,20,30,0.05); }
.inv-row:hover { background: rgba(255,255,255,0.03); }
[data-theme="light"] .inv-row:hover { background: rgba(20,20,30,0.03); }
.inv-head-row {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent !important;
  border-top: none !important;
}
.inv-name { font-weight: 500; }
.inv-sku { font-family: 'Menlo', monospace; font-size: 0.78rem; color: var(--text-muted); }
.inv-wh  { color: var(--text-muted); font-size: 0.8rem; }
.inv-qty { font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-price { font-variant-numeric: tabular-nums; }
.inv-status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}
.inv-actions-cell { display: flex; gap: 4px; }
.inv-actions-cell .icon-btn { width: 30px; height: 30px; padding: 0; }
.inv-actions-cell .icon-btn i { width: 13px; height: 13px; }

@media (max-width: 900px) {
  .inv-row { grid-template-columns: 1fr auto; gap: 6px; }
  .inv-row.inv-head-row { display: none; }
  .inv-sku, .inv-wh, .inv-qty, .inv-price { grid-column: 1 / -1; }
}

/* ============ ONLINE BOOKING ============ */
.booking-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.booking-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .booking-layout { grid-template-columns: 1fr; } }

.booking-side {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 20px;
  backdrop-filter: blur(20px);
}
.booking-side-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 14px;
}
.booking-services { display: flex; flex-direction: column; gap: 6px; }
.booking-service {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  transition: opacity .2s;
}
[data-theme="light"] .booking-service { background: rgba(20,20,30,0.03); }
.booking-service.inactive { opacity: 0.5; }
.booking-service-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.booking-service-name { font-weight: 500; font-size: 0.88rem; }
.booking-service-meta { color: var(--text-muted); font-size: 0.72rem; margin-top: 2px; }

/* Toggle switch */
.booking-service-toggle { position: relative; display: inline-block; width: 34px; height: 20px; cursor: pointer; }
.booking-service-toggle input { display: none; }
.booking-service-toggle span {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  transition: background .2s;
}
[data-theme="light"] .booking-service-toggle span { background: rgba(20,20,30,0.1); }
.booking-service-toggle span::before {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.booking-service-toggle input:checked + span { background: var(--primary); }
.booking-service-toggle input:checked + span::before { transform: translateX(14px); }

.booking-add-service {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.82rem;
  margin-top: 12px;
}
.booking-add-service:hover { color: var(--primary); border-color: var(--primary); }

.booking-main {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 20px 24px;
  backdrop-filter: blur(20px);
}

.booking-day-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  margin-bottom: 20px;
  width: fit-content;
}
[data-theme="light"] .booking-day-tabs { background: rgba(20,20,30,0.04); }
.booking-day-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.booking-day-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.booking-day-count {
  background: rgba(255,255,255,0.06);
  color: var(--text-main);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}
.booking-day-tab.active .booking-day-count {
  background: var(--primary-glow);
  color: var(--primary);
}

.booking-list { display: flex; flex-direction: column; gap: 8px; }
.booking-item {
  display: grid;
  grid-template-columns: 70px 44px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}
[data-theme="light"] .booking-item { background: rgba(20,20,30,0.03); }
.booking-item:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .booking-item:hover { background: rgba(20,20,30,0.05); }
.booking-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}
.booking-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.booking-client { font-weight: 600; font-size: 0.92rem; }
.booking-service-line { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }
.booking-staff { color: var(--text-main); }
.booking-status {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}
.booking-actions { display: flex; gap: 4px; }
.booking-actions .icon-btn { width: 32px; height: 32px; padding: 0; }
.booking-actions .icon-btn i { width: 14px; height: 14px; }

@media (max-width: 700px) {
  .booking-item { grid-template-columns: 1fr auto; gap: 8px; }
  .booking-avatar { grid-row: 1; }
  .booking-status, .booking-actions { grid-column: 1 / -1; }
}

/* ============ MARKETPLACE ============ */
.mp-hero {
  padding: 32px !important;
  border-radius: 24px !important;
  margin-bottom: 20px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 15%, transparent),
    color-mix(in srgb, var(--primary) 3%, transparent)) !important;
}
.mp-hero-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.mp-hero-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; max-width: 700px; }
.mp-hero-sub { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin-bottom: 20px; max-width: 700px; }
.mp-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.mp-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.mp-cats { display: flex; gap: 6px; flex-wrap: wrap; }

.mp-section-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 14px;
}
.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.mp-app-card {
  padding: 20px !important;
  border-radius: 20px !important;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .25s;
}
.mp-app-card:hover { transform: translateY(-4px); }
.mp-featured {
  position: absolute;
  top: 12px; right: 12px;
  background: linear-gradient(135deg, #FCD34D, #FDD38D);
  color: #1a1c22;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}
.mp-app-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.mp-app-icon i { width: 24px; height: 24px; }
.mp-app-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.mp-app-dev { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 10px; }
.mp-app-meta {
  display: flex;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.mp-app-meta i { width: 12px; height: 12px; vertical-align: middle; margin-right: 3px; color: #FCD34D; }
.mp-app-cat { color: var(--primary); }
.mp-app-price { font-size: 0.82rem; margin-bottom: 12px; }

.mp-btn-install, .mp-btn-open {
  width: 100%;
  border: none;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
  transition: all .2s;
}
.mp-btn-install { background: var(--primary); color: #0b0d12; }
[data-theme="light"] .mp-btn-install { color: #fff; }
.mp-btn-install:hover { transform: translateY(-1px); }
.mp-btn-open { background: var(--primary-glow); color: var(--primary); }
.mp-btn-open i { width: 14px; height: 14px; }

/* My published apps (developer) */
.mp-my-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.mp-my-card {
  padding: 16px 20px !important;
  border-radius: 18px !important;
  display: flex !important;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.mp-my-card .mp-app-icon { margin: 0; width: 44px; height: 44px; border-radius: 12px; }
.mp-my-body { flex: 1; min-width: 200px; }
.mp-my-meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }
.mp-my-meta b { color: var(--text-main); }
.mp-my-status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}
.mp-my-status.published { background: rgba(134,239,172,0.15); color: #86EFAC; }
.mp-my-status.review    { background: rgba(252,211,77,0.15); color: #FCD34D; }
.mp-my-add-card {
  padding: 20px;
  border: 2px dashed var(--border-color);
  border-radius: 18px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.9rem;
  transition: all .2s;
}
.mp-my-add-card:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-glow); }
.mp-my-add-card i { width: 18px; height: 18px; }

/* ============ APPS & SITES ============ */
.apps-list { display: flex; flex-direction: column; gap: 10px; }
.apps-row {
  padding: 14px 18px !important;
  border-radius: 18px !important;
  display: flex !important;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.apps-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.apps-icon i { width: 22px; height: 22px; }
.apps-body { flex: 1; min-width: 200px; }
.apps-name { font-weight: 600; font-size: 0.92rem; display: flex; gap: 8px; align-items: center; }
.apps-type-badge {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 500;
}
[data-theme="light"] .apps-type-badge { background: rgba(20,20,30,0.06); }
.apps-meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }
.apps-meta a { color: var(--primary); text-decoration: none; }
.apps-meta a:hover { text-decoration: underline; }
.apps-status {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
}
.apps-actions { display: flex; gap: 4px; }
.apps-actions .icon-btn { width: 32px; height: 32px; padding: 0; }
.apps-actions .icon-btn i { width: 14px; height: 14px; }

/* ============ SIGNATURE ============ */
.sig-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .sig-layout { grid-template-columns: 1fr; } }

.sig-preview-card { padding: 20px !important; border-radius: 22px !important; }
.sig-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  margin-bottom: 16px;
}
[data-theme="light"] .sig-tabs { background: rgba(20,20,30,0.04); }
.sig-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
}
.sig-tab.active { background: var(--bg-card); color: var(--text-main); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.sig-canvas-wrap {
  background: #fafbfd;
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px dashed var(--border-color);
}
#sig-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 800/240;
  display: block;
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
  background: #fff;
}
#sig-typed {
  width: 100%;
  padding: 40px 20px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 2.4rem;
  background: #fff;
  border: none;
  outline: none;
  border-radius: 10px;
  color: #1a1c22;
  text-align: center;
}

.sig-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.sig-color-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.sig-color-label input[type=color] {
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  padding: 0;
}
.sig-color-label input[type=color]::-webkit-color-swatch { border: none; border-radius: 50%; }

.sig-info-card { padding: 20px !important; border-radius: 22px !important; }
.sig-cert-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.sig-cert-row:last-child { border-bottom: none; }
[data-theme="light"] .sig-cert-row { border-bottom-color: rgba(20,20,30,0.05); }
.sig-cert-row b { color: var(--text-main); font-weight: 500; }

.sig-section-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 14px;
}
.sig-recent { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; }
.sig-doc {
  padding: 14px 18px !important;
  border-radius: 16px !important;
  display: flex !important;
  gap: 12px;
  align-items: center;
}
.sig-doc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.sig-doc-icon i { width: 18px; height: 18px; }
.sig-doc-body { flex: 1; }
.sig-doc-name { font-weight: 500; font-size: 0.88rem; }
.sig-doc-meta { color: var(--text-muted); font-size: 0.72rem; margin-top: 2px; }

/* ============ КЭДО (Госключ) ============ */
.kedo-connect {
  padding: 24px !important;
  border-radius: 22px !important;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 10%, transparent),
    color-mix(in srgb, var(--primary) 3%, transparent)) !important;
}
.kedo-connect-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .3s, color .3s;
}
.kedo-connect-icon.connected {
  background: rgba(134,239,172,0.18);
  color: #86EFAC;
}
.kedo-connect-icon i { width: 30px; height: 30px; }
.kedo-connect-body { flex: 1; }
.kedo-status {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.kedo-connect-body p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 16px; max-width: 720px; }
.kedo-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.kedo-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  margin-bottom: 18px;
}
[data-theme="light"] .kedo-tabs { background: rgba(20,20,30,0.04); }
.kedo-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kedo-tab.active { background: var(--bg-card); color: var(--text-main); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.kedo-tab .collab-unread { background: #FCD34D; color: #1a1c22; }

.kedo-list { display: flex; flex-direction: column; gap: 8px; }
.kedo-doc {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-card);
  border-radius: 16px;
  backdrop-filter: blur(20px);
}
.kedo-doc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kedo-doc-icon i { width: 20px; height: 20px; }
.kedo-doc-body { flex: 1; min-width: 200px; }
.kedo-doc-name { font-weight: 500; font-size: 0.92rem; }
.kedo-doc-meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }
.kedo-doc-meta b { color: var(--text-main); font-weight: 500; }
.kedo-doc [data-kedo-sign] {
  padding: 8px 14px !important;
  font-size: 0.82rem !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.kedo-doc [data-kedo-sign] i { width: 14px; height: 14px; }
.kedo-doc .collab-ghost { padding: 8px 10px; }

/* ============ BOARD MODE TABS + PRESENTATION ============ */
.board-mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
}
[data-theme="light"] .board-mode-tabs { background: rgba(20,20,30,0.04); }
.board-mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.board-mode-tab i { width: 14px; height: 14px; }
.board-mode-tab.active { background: var(--bg-card); color: var(--text-main); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.pres-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px !important;
  margin-bottom: 14px;
  border-radius: 18px !important;
  flex-wrap: wrap;
}
.pres-counter { font-family: var(--font-display); color: var(--text-muted); font-size: 0.9rem; padding: 0 6px; }
.pres-counter b { color: var(--text-main); font-weight: 700; }

.pres-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  background: var(--bg-card);
  border-radius: 22px;
  padding: 14px;
  backdrop-filter: blur(20px);
  min-height: 480px;
}
@media (max-width: 900px) { .pres-layout { grid-template-columns: 1fr; } }

.pres-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}
.pres-thumb {
  position: relative;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(255,255,255,0.04);
  aspect-ratio: 16/9;
}
[data-theme="light"] .pres-thumb { background: rgba(20,20,30,0.04); }
.pres-thumb img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}
.pres-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.pres-thumb-num {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.pres-stage {
  background: #fff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  overflow: hidden;
  position: relative;
}
.pres-slide-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.pres-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.pres-empty i { width: 42px; height: 42px; opacity: 0.4; }
.pres-empty .btn-primary { padding: 10px 18px !important; }

/* ============ БД AI MODAL ============ */
.bd-btn { display: inline-flex; align-items: center; }
.bd-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
}
.bd-modal.open { display: flex; animation: fadeIn .2s ease; }

.bd-modal-card {
  width: 640px;
  max-width: 92vw;
  background: var(--bg-card);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bd-modal-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.bd-modal-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, white));
  color: #0b0d12;
  display: flex; align-items: center; justify-content: center;
}
.bd-modal-icon i { width: 22px; height: 22px; }
.bd-modal-head h3 { font-family: var(--font-display); font-size: 1.1rem; margin: 0; }
.bd-modal-head p { color: var(--text-muted); font-size: 0.82rem; margin: 2px 0 0; }
.bd-modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
}
.bd-modal-close i { width: 16px; height: 16px; }

.bd-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.bd-suggestion {
  background: rgba(255,255,255,0.04);
  border: none;
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: left;
  display: flex;
  gap: 8px;
  align-items: center;
  line-height: 1.35;
}
[data-theme="light"] .bd-suggestion { background: rgba(20,20,30,0.04); }
.bd-suggestion:hover { background: var(--primary-glow); color: var(--primary); }
.bd-suggestion i { width: 14px; height: 14px; flex-shrink: 0; color: var(--primary); }

.bd-chat {
  min-height: 60px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bd-msg {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 85%;
}
.bd-msg.user { align-self: flex-end; background: var(--primary); color: #0b0d12; border-bottom-right-radius: 4px; }
[data-theme="light"] .bd-msg.user { color: #fff; }
.bd-msg.ai {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
[data-theme="light"] .bd-msg.ai { background: rgba(20,20,30,0.04); }
.bd-msg.ai i { width: 16px; height: 16px; color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.bd-msg.typing { display: flex; gap: 4px; padding: 14px 18px; }
.bd-msg.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bd-typing 1.2s infinite;
}
.bd-msg.typing span:nth-child(2) { animation-delay: .2s; }
.bd-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bd-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.bd-input-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
}
[data-theme="light"] .bd-input-wrap { background: rgba(20,20,30,0.04); }
.bd-mic {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bd-mic i { width: 18px; height: 18px; }
.bd-mic.recording { background: #F87171; color: #fff; animation: bd-pulse 1s infinite; }
@keyframes bd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); }
}
.bd-input-wrap textarea {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  resize: none;
  padding: 12px 6px;
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 24px;
  max-height: 120px;
}
.bd-send {
  width: 40px; height: 40px;
  padding: 0 !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
.bd-hint { color: var(--text-muted); font-size: 0.75rem; display: flex; gap: 6px; align-items: center; }
.bd-hint i { width: 12px; height: 12px; }

/* ============ CLOCK / TIMER / STOPWATCH ============ */
.clock-wrap { position: relative; display: inline-flex; }
.clock-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px !important;
  width: auto !important;
  height: auto !important;
  border-radius: 12px !important;
}
.clock-inline { font-variant-numeric: tabular-nums; font-size: 0.85rem; font-weight: 600; }

.clock-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--bg-card);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  backdrop-filter: blur(24px);
  display: none;
  z-index: 3000;
}
.clock-popover.open { display: block; animation: paletteIn .18s ease-out; }

.clock-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  margin-bottom: 16px;
}
[data-theme="light"] .clock-tabs { background: rgba(20,20,30,0.04); }
.clock-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
}
.clock-tab.active { background: var(--bg-card); color: var(--text-main); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }

.clock-view { display: none; }
.clock-view.active { display: block; }

.clock-ring {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 16px;
}
.clock-ring-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.clock-ring-big { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--primary); }
.clock-ring-cap { color: var(--text-muted); font-size: 0.72rem; }
.workday-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.workday-row b { color: var(--text-main); font-variant-numeric: tabular-nums; }
.clock-edit-times {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}
.clock-edit-times input[type=time] {
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--text-main);
  font-size: 0.85rem;
}
[data-theme="light"] .clock-edit-times input[type=time] { background: rgba(20,20,30,0.05); }

.clock-big {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3rem;
  text-align: center;
  padding: 12px 0 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.clock-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.clock-input-row label { display: block; color: var(--text-muted); font-size: 0.72rem; margin-bottom: 4px; text-align: center; }
.clock-input-row input {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: none;
  color: var(--text-main);
  text-align: center;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  outline: none;
}
[data-theme="light"] .clock-input-row input { background: rgba(20,20,30,0.04); }
.clock-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.clock-presets .chip-btn { font-size: 0.72rem; padding: 6px 10px; }

.clock-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.clock-actions .btn-primary,
.clock-actions .collab-ghost {
  padding: 10px 16px !important;
  border-radius: 12px !important;
  font-size: 0.85rem !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.clock-actions i { width: 14px; height: 14px; }

.sw-laps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  max-height: 160px;
  overflow-y: auto;
}
.sw-lap {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
[data-theme="light"] .sw-lap { background: rgba(20,20,30,0.03); }
.sw-lap b { color: var(--text-main); font-variant-numeric: tabular-nums; }

/* ============ Hide profile cover, keep just the profile card ============ */
.social-cover { display: none !important; }
.social-hero-body { margin-top: 0 !important; padding: 20px 0 0 !important; }
.social-avatar { border-width: 0 !important; }
.social-hero { margin-bottom: 24px; }

/* Role link — clickable, styled as a link */
.role-link {
  color: var(--primary) !important;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-glow);
  transition: all .2s;
}
.role-link:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--primary) 22%, transparent);
}

/* ============ Company modal ============ */
.company-modal-cover {
  height: 120px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 40%, #B8C2FF));
  border-radius: 22px 22px 0 0;
  margin: -24px -24px 0;
}
.company-modal-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin: -40px 0 20px;
  position: relative;
}
.company-modal-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--primary);
  color: #0b0d12;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 5px solid var(--bg-card);
  box-shadow: 0 12px 30px rgba(0,0,0,0.30);
}
.company-modal-icon i { width: 32px; height: 32px; }
.company-modal-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 2px; }
.company-modal-tag { color: var(--text-muted); font-size: 0.85rem; }

.company-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  margin-bottom: 18px;
  text-align: center;
}
[data-theme="light"] .company-modal-stats { background: rgba(20,20,30,0.03); }
.company-modal-stats > div { display: flex; flex-direction: column; }
.company-modal-stats b { font-size: 1.05rem; font-weight: 700; font-family: var(--font-display); }
.company-modal-stats span { color: var(--text-muted); font-size: 0.72rem; }

.company-modal-section-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 8px;
}
.company-modal-about p { color: var(--text-main); font-size: 0.88rem; line-height: 1.6; margin: 0 0 18px; }

.company-modal-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}
.company-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.company-modal-row:last-child { border-bottom: none; }
[data-theme="light"] .company-modal-row { border-bottom-color: rgba(20,20,30,0.05); }
.company-modal-row b { color: var(--text-main); font-weight: 500; }
.company-modal-row a { color: var(--primary); text-decoration: none; }

.company-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.company-modal-actions .btn-primary {
  flex: 1;
  padding: 12px 18px !important;
  border-radius: 14px !important;
  font-size: 0.9rem !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 180px;
}
.company-modal-actions .collab-ghost {
  padding: 12px 16px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.company-modal-actions i { width: 15px; height: 15px; }

/* Personal cabinet main area should fill the full available width */
.social-main {
  max-width: none !important;
  margin: 0 !important;
  width: 100% !important;
}
.social-layout { max-width: none !important; }

/* Hide middle counters (Публикации / Фото / Видео / Подарки), keep only Подписчики, Подписки, Приглашения */
.social-counters .social-counter:nth-child(3),
.social-counters .social-counter:nth-child(4),
.social-counters .social-counter:nth-child(5),
.social-counters .social-counter:nth-child(6) { display: none !important; }

/* Avatar edit camera — pinned to bottom-right of avatar, lavender to match violet tone */
.profile-avatar-wrapper { position: relative; }
.social-avatar .avatar-edit-btn,
.avatar-edit-btn {
  position: absolute !important;
  bottom: 4px !important;
  right: 4px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #C4B5FD, #A78BFA) !important;
  color: #1a1c22 !important;
  border: 3px solid var(--bg-app) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 6px 16px rgba(167, 139, 250, 0.45) !important;
  z-index: 3;
  transition: transform .2s;
}
.social-avatar .avatar-edit-btn:hover,
.avatar-edit-btn:hover { transform: scale(1.08); }
.social-avatar .avatar-edit-btn i,
.avatar-edit-btn i,
.social-avatar .avatar-edit-btn svg,
.avatar-edit-btn svg {
  width: 15px !important;
  height: 15px !important;
  color: #1a1c22 !important;
  stroke: #1a1c22 !important;
}

/* Move online dot up-left so it doesn't overlap the camera */
.online-dot {
  right: auto !important;
  left: 4px !important;
  bottom: 4px !important;
  border: 3px solid var(--bg-app) !important;
}

/* Hide old green dot on the avatar */
.online-dot { display: none !important; }

/* Silver "shine" effect for names — same as BROKERZ365 logo */
.shine,
.social-name,
.post-meta h4,
.mess-app-item-name,
.mess-app-thread-name,
.employee-name,
.follow-info h4,
.wall-post .post-meta h4 {
  background:
    linear-gradient(
      100deg,
      transparent 0%,
      transparent 38%,
      rgba(255, 255, 255, 0.32) 46%,
      #ffffff 50%,
      rgba(255, 255, 255, 0.32) 54%,
      transparent 62%,
      transparent 100%
    ),
    linear-gradient(
      180deg,
      #f1f5f9 0%,
      #cbd5e1 30%,
      #94a3b8 55%,
      #64748b 100%
    );
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: -60% 0, 0 0;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  animation: nameSunbeam 6s linear infinite;
}
[data-theme="light"] .shine,
[data-theme="light"] .social-name,
[data-theme="light"] .post-meta h4,
[data-theme="light"] .mess-app-item-name,
[data-theme="light"] .mess-app-thread-name,
[data-theme="light"] .employee-name,
[data-theme="light"] .follow-info h4,
[data-theme="light"] .wall-post .post-meta h4 {
  background:
    linear-gradient(
      100deg,
      transparent 0%,
      transparent 38%,
      rgba(255, 255, 255, 0.55) 46%,
      #ffffff 50%,
      rgba(255, 255, 255, 0.55) 54%,
      transparent 62%,
      transparent 100%
    ),
    linear-gradient(
      180deg,
      #64748b 0%,
      #475569 40%,
      #334155 80%,
      #1e293b 100%
    );
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes nameSunbeam {
  0%   { background-position: -60% 0, 0 0; }
  100% { background-position: 160% 0, 0 0; }
}

/* Онлайн-статус: тонкое зелёное кольцо вокруг аватара. Спокойно, без пульса. */
.social-name.online,
.online.shine { filter: none; }

.employee-card .employee-name { filter: none; }
.wall-post .post-meta h4,
.mess-app-thread-name { filter: none; }

.profile-avatar-wrapper.social-avatar.is-online {
  box-shadow: 0 0 0 2px #22c55e, 0 12px 32px rgba(0,0,0,0.30) !important;
}
.mess-app-avatar-wrap.is-online img,
.mess-app-avatar-wrap.is-online > div:first-child {
  box-shadow: 0 0 0 2px #22c55e;
}
.employee-card.is-online .employee-avatar {
  box-shadow: 0 0 0 2px #22c55e;
}
.mess-app-avatar-wrap, .employee-avatar { position: relative; }

/* Chat thread head: glow if header has .online class */
.mess-app-thread-head.online .mess-app-thread-name {
  filter: drop-shadow(0 0 4px rgba(134, 239, 172, 0.5))
          drop-shadow(0 0 10px rgba(134, 239, 172, 0.28));
}

/* Post author: glow if header has .online class */
.wall-post.online .post-meta h4 {
  filter: drop-shadow(0 0 4px rgba(134, 239, 172, 0.5))
          drop-shadow(0 0 10px rgba(134, 239, 172, 0.28));
}

/* Name shine — pass every 35s over 3s window, with subtle emphasis during the sweep */
.shine,
.social-name,
.post-meta h4,
.mess-app-item-name,
.mess-app-thread-name,
.employee-name,
.follow-info h4,
.wall-post .post-meta h4 {
  animation: nameSunbeam35 35s ease-out infinite, nameEmphasis 35s ease-in-out infinite !important;
}

@keyframes nameSunbeam35 {
  0%   { background-position: -60% 0, 0 0; }
  /* 3-second sweep window (~8.5% of 35s) */
  8.5% { background-position: 160% 0, 0 0; }
  100% { background-position: 160% 0, 0 0; }
}

@keyframes nameEmphasis {
  0%, 100% {
    transform: scale(1);
    letter-spacing: normal;
  }
  4% {
    transform: scale(1.03);
    letter-spacing: 0.005em;
  }
  8.5% {
    transform: scale(1);
    letter-spacing: normal;
  }
}

/* Hover a name → immediately trigger the shine + emphasis */
.mess-app-item:hover .mess-app-item-name,
.employee-card:hover .employee-name,
.follow-card:hover .follow-info h4,
.wall-post:hover .post-meta h4,
.social-name:hover {
  animation: nameSunbeamHover 1.4s ease-out, nameEmphasisHover 1.4s ease-out !important;
  cursor: default;
}

@keyframes nameSunbeamHover {
  0%   { background-position: -60% 0, 0 0; }
  100% { background-position: 160% 0, 0 0; }
}
@keyframes nameEmphasisHover {
  0%   { transform: scale(1); letter-spacing: normal; }
  40%  { transform: scale(1.04); letter-spacing: 0.008em; }
  100% { transform: scale(1); letter-spacing: normal; }
}

/* Header search — icon only, expands to input on click */
.header-search-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.header-search-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--text-muted);
}
.header-search-btn i { width: 18px; height: 18px; }
#header-search-input {
  width: 0;
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.88rem;
  transition: width .25s ease, padding .25s ease, margin .25s ease;
  border-radius: 12px;
}
.header-search-wrap.open #header-search-input {
  width: 240px;
  padding: 9px 14px;
  margin-left: 6px;
  background: rgba(255,255,255,0.05);
}
[data-theme="light"] .header-search-wrap.open #header-search-input {
  background: rgba(20,20,30,0.05);
}

/* Lightning ⚡ spark animation on БД button hover */
.bd-btn { position: relative; overflow: visible; }
.bd-btn i {
  transition: filter .2s, transform .2s;
}
.bd-btn:hover i {
  animation: bdSpark 0.9s ease-in-out;
  filter: drop-shadow(0 0 6px #FCD34D) drop-shadow(0 0 12px #FCD34D);
  color: #FCD34D !important;
}
@keyframes bdSpark {
  0%   { transform: rotate(0deg) scale(1);   filter: drop-shadow(0 0 0 transparent); }
  15%  { transform: rotate(-8deg) scale(1.25); filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 16px #FCD34D); }
  25%  { transform: rotate(6deg) scale(1.1);  filter: drop-shadow(0 0 4px #fff); }
  40%  { transform: rotate(-4deg) scale(1.3); filter: drop-shadow(0 0 10px #FCD34D) drop-shadow(0 0 18px #FCD34D); }
  55%  { transform: rotate(4deg) scale(1);   filter: drop-shadow(0 0 2px #FCD34D); }
  70%  { transform: rotate(-2deg) scale(1.15); filter: drop-shadow(0 0 8px #FCD34D); }
  100% { transform: rotate(0deg) scale(1);   filter: drop-shadow(0 0 6px #FCD34D) drop-shadow(0 0 12px #FCD34D); }
}

/* Sporadic idle flicker so it feels alive even without hover — every ~9s */
.bd-btn i {
  animation: bdIdleFlicker 9s ease-in-out infinite;
}
@keyframes bdIdleFlicker {
  0%, 92%, 100% { filter: drop-shadow(0 0 0 transparent); transform: scale(1); }
  94% { filter: drop-shadow(0 0 8px #FCD34D) drop-shadow(0 0 4px #fff); transform: scale(1.15) rotate(-4deg); }
  96% { filter: drop-shadow(0 0 2px #FCD34D); transform: scale(1) rotate(2deg); }
  98% { filter: drop-shadow(0 0 6px #FCD34D); transform: scale(1.08) rotate(-2deg); }
}
.bd-btn:hover i { animation: bdSpark 0.9s ease-in-out !important; }

/* Real lightning-strike sparks on hover */
.bd-btn { position: relative; overflow: visible; z-index: 1; }

/* Electric aura around the button on hover */
.bd-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(252, 211, 77, 0.6), transparent 70%);
  filter: blur(8px);
  transition: opacity .2s;
}
.bd-btn:hover::before {
  animation: bdAura 0.9s ease-out;
}
@keyframes bdAura {
  0%   { opacity: 0; transform: scale(0.6); }
  10%  { opacity: 1; transform: scale(1.4); }
  20%  { opacity: 0.2; transform: scale(1); }
  35%  { opacity: 1; transform: scale(1.5); }
  50%  { opacity: 0.1; transform: scale(1); }
  70%  { opacity: 0.9; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1); }
}

/* Lightning bolt icon flashing white/yellow on hover */
.bd-btn:hover i {
  animation: bdLightning 0.9s steps(20, end) !important;
  filter: none !important;
  color: #fff !important;
}
@keyframes bdLightning {
  0%   { color: #FCD34D; filter: drop-shadow(0 0 0 transparent) brightness(1); transform: translateX(0) rotate(0); }
  5%   { color: #FFF;    filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 20px #FCD34D) brightness(3); transform: translateX(-1px) rotate(-3deg); }
  8%   { color: #FCD34D; filter: brightness(0.8); transform: translateX(1px); }
  12%  { color: #FFF;    filter: drop-shadow(0 0 14px #fff) drop-shadow(0 0 24px #FCD34D) brightness(4); transform: translateX(-2px) rotate(4deg) scale(1.15); }
  15%  { color: #FCD34D; filter: brightness(1); transform: translateX(0); }
  22%  { color: #FFF;    filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 18px #FCD34D) brightness(2.5); transform: translateX(2px) rotate(-2deg); }
  30%  { color: #FCD34D; filter: brightness(0.9); transform: translateX(0); }
  40%  { color: #FFF;    filter: drop-shadow(0 0 16px #fff) drop-shadow(0 0 22px #FCD34D) brightness(4.5); transform: translateX(-1px) rotate(5deg) scale(1.2); }
  45%  { color: #FCD34D; filter: brightness(1); transform: translateX(0); }
  55%  { color: #FFF;    filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 20px #FCD34D) brightness(3); transform: translateX(1px) rotate(-3deg); }
  60%  { color: #FCD34D; filter: brightness(0.85); }
  75%  { color: #FFF;    filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 16px #FCD34D) brightness(2.5); transform: rotate(2deg) scale(1.1); }
  85%  { color: #FCD34D; filter: brightness(1); transform: scale(1); }
  100% { color: #FCD34D; filter: drop-shadow(0 0 6px #FCD34D); transform: scale(1); }
}

/* Kill any leftover animation and idle flicker on hover — keep only the strike */
.bd-btn:hover i { animation: bdLightning 0.9s steps(20, end) !important; }

/* Idle: keep subtle occasional spark but MUCH tamer */
.bd-btn i {
  animation: bdIdleFlicker 12s ease-in-out infinite;
}
@keyframes bdIdleFlicker {
  0%, 94%, 100% { filter: drop-shadow(0 0 0 transparent); }
  96% { filter: drop-shadow(0 0 6px #FCD34D) brightness(1.6); }
  97% { filter: brightness(1); }
  98% { filter: drop-shadow(0 0 4px #FCD34D) brightness(1.4); }
}

/* Collapsible sidebar group labels */
.nav-group-label {
  cursor: pointer;
  user-select: none;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: opacity .2s;
}
.nav-group-label:hover { opacity: 1; }
.nav-group-label::after {
  content: '';
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a95a5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform .25s;
  flex-shrink: 0;
}
.nav-group-label.collapsed::after {
  transform: rotate(-90deg);
}
.nav-item.hidden-by-group { display: none !important; }
.nav-group-divider.hidden-by-group { display: none !important; }

/* ============ Photo-first wall composer v2 ============ */
.wall-composer2 {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 22px !important;
  margin-bottom: 20px;
}

/* Idle drop zone */
.wc2-drop { padding: 32px; cursor: pointer; transition: background .2s; }
.wc2-drop:hover, .wc2-drop.dragover { background: rgba(255,255,255,0.03); }
[data-theme="light"] .wc2-drop:hover, [data-theme="light"] .wc2-drop.dragover { background: rgba(20,20,30,0.03); }
.wc2-drop-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}
.wc2-drop-icon {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.wc2-drop-icon i { width: 28px; height: 28px; }
.wc2-drop-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.wc2-drop-sub { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }
.wc2-upload-btn {
  padding: 12px 20px !important;
  border-radius: 14px !important;
  font-size: 0.9rem !important;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}
.wc2-upload-btn i { width: 15px; height: 15px; }

/* Loaded state */
.wc2-loaded { padding: 0; }
.wc2-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px;
  background: #0b0d12;
  max-height: 420px;
  overflow: hidden;
}
[data-theme="light"] .wc2-preview { background: #f5f5f5; }
.wc2-preview-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.wc2-preview-item img, .wc2-preview-item video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.wc2-preview-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wc2-preview-remove i { width: 14px; height: 14px; }

.wc2-caption {
  display: flex;
  gap: 12px;
  padding: 16px 20px 12px;
  align-items: flex-start;
}
#wc2-caption {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  padding: 8px 0;
  min-height: 44px;
}

.wc2-attach-title {
  padding: 4px 20px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.wc2-attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  padding: 0 20px 16px;
}
.wc2-attach {
  background: rgba(255,255,255,0.03);
  border: none;
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  text-align: left;
  transition: background .2s;
}
[data-theme="light"] .wc2-attach { background: rgba(20,20,30,0.03); }
.wc2-attach:hover { background: var(--primary-glow); color: var(--primary); }
.wc2-attach i { width: 15px; height: 15px; color: var(--primary); }
.wc2-attach.added {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.wc2-attached {
  padding: 0 20px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wc2-tag {
  background: var(--primary-glow);
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wc2-tag i { width: 12px; height: 12px; }
.wc2-tag-x {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
}
.wc2-tag-x i { width: 12px; height: 12px; }

.wc2-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border-color);
}

/* ============ Composer v3 — 4 post-type choices ============ */
.wc2-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
}
.wc2-choice {
  background: rgba(255,255,255,0.03);
  border: none;
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  text-align: left;
  transition: transform .2s, background .2s;
  color: var(--text-main);
}
[data-theme="light"] .wc2-choice { background: rgba(20,20,30,0.03); }
.wc2-choice:hover { transform: translateY(-2px); background: rgba(255,255,255,0.05); }
[data-theme="light"] .wc2-choice:hover { background: rgba(20,20,30,0.05); }

.wc2-choice-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.wc2-choice-icon i { width: 22px; height: 22px; }
.wc2-choice-icon .live-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #F87171;
  animation: livePulse 1.4s infinite ease-in-out;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6); }
  50%      { opacity: 0.85; transform: scale(1.15); box-shadow: 0 0 0 5px rgba(248, 113, 113, 0); }
}

.wc2-choice-body { display: flex; flex-direction: column; gap: 3px; }
.wc2-choice-body b { font-weight: 600; font-size: 0.96rem; }
.wc2-choice-body span { color: var(--text-muted); font-size: 0.78rem; }

/* Text-only composer variant */
.wc2-text-mode { padding: 16px 20px; }
.wc2-text-mode textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 14px 16px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  min-height: 100px;
  resize: vertical;
}
[data-theme="light"] .wc2-text-mode textarea { background: rgba(20,20,30,0.03); }

/* Live broadcast overlay */
.live-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  z-index: 9600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.live-overlay.open { display: flex; animation: fadeIn .25s; }
.live-card {
  width: 640px;
  max-width: 92vw;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(24px);
}
.live-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 6px; }
.live-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.live-icon-big {
  width: 96px; height: 96px;
  border-radius: 32px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.live-icon-big i { width: 46px; height: 46px; }
.live-icon-big .live-dot {
  top: 12px; right: 12px;
  width: 12px; height: 12px;
}
.live-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 18px;
  margin-bottom: 18px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}
.live-preview video { width: 100%; height: 100%; object-fit: cover; }
.live-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.live-actions .btn-primary { padding: 12px 22px !important; font-size: 0.9rem !important; }
.live-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #FCA5A5;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.live-timer .live-dot { position: static; }
.live-fields { display: grid; gap: 10px; margin-bottom: 18px; text-align: left; }
.live-fields input, .live-fields textarea {
  background: rgba(255,255,255,0.04);
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
}
[data-theme="light"] .live-fields input, [data-theme="light"] .live-fields textarea {
  background: rgba(20,20,30,0.04);
}

/* ============ Themed hover animations per composer choice ============ */
.wc2-choice { position: relative; overflow: visible; }
.wc2-choice-icon { transition: transform .3s; overflow: visible; }

/* --- 1. Camera → shutter flash + subtle zoom --- */
.wc2-choice[data-wc2-type="media"]:hover .wc2-choice-icon {
  animation: cameraSnap 0.8s ease-out;
}
.wc2-choice[data-wc2-type="media"]:hover .wc2-choice-icon i {
  animation: cameraZoom 0.8s ease-out;
}
@keyframes cameraSnap {
  0%   { box-shadow: 0 0 0 0 rgba(184,194,255,0); }
  35%  { box-shadow: 0 0 0 8px rgba(255,255,255,0.6), 0 0 40px rgba(184,194,255,0.7); }
  60%  { box-shadow: 0 0 0 4px rgba(184,194,255,0.3); }
  100% { box-shadow: 0 0 0 0 rgba(184,194,255,0); }
}
@keyframes cameraZoom {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.85); }
  55%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* --- 2. Radio-tower → concentric signal waves + tower shake --- */
.wc2-choice[data-wc2-type="live"] .wc2-choice-icon::before,
.wc2-choice[data-wc2-type="live"] .wc2-choice-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid #FCA5A5;
  opacity: 0;
  pointer-events: none;
}
.wc2-choice[data-wc2-type="live"]:hover .wc2-choice-icon::before {
  animation: signalWave 1.2s ease-out infinite;
}
.wc2-choice[data-wc2-type="live"]:hover .wc2-choice-icon::after {
  animation: signalWave 1.2s ease-out 0.4s infinite;
}
@keyframes signalWave {
  0%   { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}
.wc2-choice[data-wc2-type="live"]:hover .wc2-choice-icon i {
  animation: towerShake 0.4s ease-in-out infinite alternate;
}
@keyframes towerShake {
  0%   { transform: rotate(-2deg) translateY(0); }
  100% { transform: rotate(2deg) translateY(-1px); }
}

/* --- 3. Type → cursor blink + subtle "typing" jump --- */
.wc2-choice[data-wc2-type="text"] .wc2-choice-icon::after {
  content: '';
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: 2px;
  height: 16px;
  background: #86EFAC;
  opacity: 0;
  border-radius: 1px;
}
.wc2-choice[data-wc2-type="text"]:hover .wc2-choice-icon::after {
  animation: textCursor 0.8s steps(2, jump-none) infinite;
}
.wc2-choice[data-wc2-type="text"]:hover .wc2-choice-icon i {
  animation: textPeck 0.35s ease-in-out infinite alternate;
}
@keyframes textCursor {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}
@keyframes textPeck {
  0%   { transform: translateY(0) scale(1); }
  100% { transform: translateY(-2px) scale(1.02); }
}

/* --- 4. Podcast → radiating sound waves + mic pulse --- */
.wc2-choice[data-wc2-type="audio"] .wc2-choice-icon::before,
.wc2-choice[data-wc2-type="audio"] .wc2-choice-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(240,171,252,0.4), transparent 60%);
  opacity: 0;
  pointer-events: none;
  filter: blur(4px);
}
.wc2-choice[data-wc2-type="audio"]:hover .wc2-choice-icon::before {
  animation: audioPulse 1.1s ease-out infinite;
}
.wc2-choice[data-wc2-type="audio"]:hover .wc2-choice-icon::after {
  animation: audioPulse 1.1s ease-out 0.55s infinite;
}
@keyframes audioPulse {
  0%   { opacity: 0.9; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(1.8); }
}
.wc2-choice[data-wc2-type="audio"]:hover .wc2-choice-icon i {
  animation: micThrob 0.7s ease-in-out infinite;
}
@keyframes micThrob {
  0%, 100% { transform: scale(1);   filter: brightness(1); }
  50%      { transform: scale(1.12); filter: brightness(1.3); }
}

/* Slight lift + brighter background for all on hover already handled — keep icons visible */
.wc2-choice-icon i { position: relative; z-index: 2; }

/* Composer choices — icons only, hide text labels */
.wc2-choice-body { display: none !important; }
.wc2-choice {
  grid-template-columns: 1fr !important;
  justify-items: center;
  padding: 20px !important;
}
.wc2-choice-icon {
  width: 56px !important;
  height: 56px !important;
  border-radius: 18px !important;
}
.wc2-choice-icon i { width: 26px !important; height: 26px !important; }

.wc2-choices {
  grid-template-columns: repeat(4, 1fr) !important;
}
@media (max-width: 700px) {
  .wc2-choices { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Composer choices — strip all frames, backgrounds, padding — just icons */
.wc2-choice {
  background: transparent !important;
  padding: 16px !important;
  border-radius: 12px !important;
}
.wc2-choice:hover {
  background: transparent !important;
  transform: translateY(-2px);
}
.wc2-choice-icon {
  background: transparent !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
}
.wc2-choice-icon i {
  width: 30px !important;
  height: 30px !important;
  stroke-width: 1.7;
}
.wc2-choices { padding: 20px 16px !important; gap: 8px !important; }

/* ============ Приглашения counter — "come to us" attraction interactivity ============ */
.counter-hot { cursor: pointer; overflow: visible; transition: transform .3s; }

/* Number pulsing gently — draws attention */
.counter-hot b {
  display: inline-block;
  animation: invitesIdle 5s ease-in-out infinite;
  transform-origin: center;
}
@keyframes invitesIdle {
  0%, 88%, 100% { transform: scale(1); }
  92% { transform: scale(1.08) translateY(-2px); }
  95% { transform: scale(1)    translateY(0); }
  97% { transform: scale(1.05) translateY(-1px); }
}

/* Green dot pulse with ring — like a beacon */
.counter-hot .counter-dot {
  animation: invitesBeacon 2.4s ease-in-out infinite;
  box-shadow: 0 0 0 3px var(--bg-card);
}
@keyframes invitesBeacon {
  0%, 100% { box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 0 rgba(134, 239, 172, 0.7); }
  50%      { box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 6px rgba(134, 239, 172, 0);   }
}

/* Hover — mini "wave" (companies waving to attract the employee) */
.counter-hot:hover { transform: translateY(-3px); }
.counter-hot:hover b {
  animation: invitesWave 0.9s ease-in-out;
  color: #86EFAC;
}
@keyframes invitesWave {
  0%   { transform: rotate(0) scale(1); }
  20%  { transform: rotate(-12deg) scale(1.15); }
  40%  { transform: rotate(10deg) scale(1.2); }
  60%  { transform: rotate(-8deg) scale(1.15); }
  80%  { transform: rotate(4deg) scale(1.08); }
  100% { transform: rotate(0) scale(1.05); }
}

/* Sparks flying out on hover — "attention flare" */
.counter-hot::before,
.counter-hot::after {
  content: '✦';
  position: absolute;
  color: #86EFAC;
  font-size: 0.7rem;
  opacity: 0;
  pointer-events: none;
}
.counter-hot::before { top: 4px; left: 6px; }
.counter-hot::after  { top: 4px; right: 6px; }
.counter-hot:hover::before {
  animation: sparkLeft 0.9s ease-out;
}
.counter-hot:hover::after {
  animation: sparkRight 0.9s ease-out;
}
@keyframes sparkLeft {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0);   }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-14px, -12px) rotate(-180deg); }
}
@keyframes sparkRight {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0);   }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translate(14px, -12px) rotate(180deg); }
}

/* Soft green glow behind the counter on hover */
.counter-hot::before,
.counter-hot::after { z-index: 2; }
.counter-hot { position: relative; }
.counter-hot:hover {
  background: rgba(134, 239, 172, 0.08);
}

/* Revert — bring back the framed background boxes on composer choice icons */
.wc2-choice {
  background: rgba(255,255,255,0.03) !important;
  padding: 20px !important;
  border-radius: 18px !important;
}
[data-theme="light"] .wc2-choice { background: rgba(20,20,30,0.03) !important; }
.wc2-choice:hover {
  background: rgba(255,255,255,0.05) !important;
  transform: translateY(-2px);
}
[data-theme="light"] .wc2-choice:hover { background: rgba(20,20,30,0.05) !important; }

.wc2-choice-icon {
  width: 56px !important;
  height: 56px !important;
  border-radius: 18px !important;
  /* keep the tinted per-icon background set inline via style="background:..." */
}
.wc2-choice-icon i {
  width: 26px !important;
  height: 26px !important;
  stroke-width: 1.7;
}

/* ============ WALL — Instagram-style grid ============ */
.wall-posts {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 4px !important;
}
@media (max-width: 900px) { .wall-posts { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 500px) { .wall-posts { grid-template-columns: repeat(1, 1fr) !important; } }

.wall-post {
  padding: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  backdrop-filter: none;
}
.wall-post:hover { transform: none; }

/* Hide the standard post chrome inside the tile */
.wall-post .post-header,
.wall-post .post-content,
.wall-post .post-actions { display: none; }

/* Full-bleed photo/video fills the square */
.wall-post .post-image-strip {
  position: absolute;
  inset: 0;
  margin: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
}
.wall-post .post-image-strip img,
.wall-post .post-image-strip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 !important;
}

/* Text-only post fallback tile — gradient background with text */
.wall-post:not(:has(.post-image-strip))::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 45%, transparent), color-mix(in srgb, var(--primary) 15%, transparent)),
    var(--bg-card);
}
.wall-post:not(:has(.post-image-strip)) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grid tile hover — dim + show quick stats */
.wall-post::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.wall-post:hover::after { opacity: 1; }

/* Hover overlay with likes / comments — synthesised from data-* on hover */
.wall-post .hover-stats {
  position: absolute;
  bottom: 12px; left: 12px; right: 12px;
  display: flex;
  gap: 16px;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 2;
}
.wall-post:hover .hover-stats { opacity: 1; transform: translateY(0); }
.wall-post .hover-stats span { display: inline-flex; align-items: center; gap: 5px; }
.wall-post .hover-stats i { width: 15px; height: 15px; fill: #fff; stroke: #fff; }

/* Multi-media indicator (top-right corner) */
.wall-post .media-indicator {
  position: absolute;
  top: 10px; right: 10px;
  color: #fff;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
  z-index: 2;
}
.wall-post .media-indicator i { width: 18px; height: 18px; }

/* Text-only tile: show the actual text content, cropped */
.wall-post-text-preview {
  position: relative;
  z-index: 1;
  color: #fff;
  padding: 22px;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 500;
  text-align: center;
  max-height: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Small header row above the grid (optional counts) */
.wall-posts { margin-top: 4px; }

/* ============ Fill viewport — no more abrupt page cut-off ============ */
/* Every top-level tab/page fills at least the viewport minus header */
.page-view {
  min-height: calc(100vh - var(--header-height, 70px) - 48px);
}
.ptab-content.active,
.wtab-content.active {
  min-height: calc(100vh - var(--header-height, 70px) - 200px);
}

/* Bottom breathing space + gradient fade so grid never ends abruptly */
.wall-posts,
.work-employee-grid,
.reports-grid,
.mp-grid,
.invitations-grid,
.follow-list,
.collab-grid,
.departments-grid {
  padding-bottom: 80px;
}

/* Optional end-of-feed indicator at the wall bottom */
.wall-posts::after {
  content: '';
  display: block;
  grid-column: 1 / -1;
  height: 1px;
}
.wall-end-mark {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 12px 40px;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.wall-end-mark::before {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--border-color);
  border-radius: 2px;
  margin: 0 auto 14px;
}

/* Content body — give it a floor so it always spans full height */
.content-body {
  min-height: calc(100vh - var(--header-height, 70px));
  padding-bottom: 80px !important;
}

/* Main scrolls smoothly, sidebar continues aligned */
main { padding-bottom: 40px; }

/* Sidebar — footer sits directly under nav (no big gap) */
aside nav, aside .mode-nav { flex-grow: 0 !important; margin-bottom: 0; }
aside .sidebar-footer {
  margin-top: 16px !important;
  padding-top: 16px !important;
  border-top: 1px solid var(--border-color) !important;
}
aside {
  height: auto !important;
  min-height: 100vh;
  padding-bottom: 24px;
}

/* ============ Feed user search ============ */
.feed-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  margin-bottom: 12px;
}
[data-theme="light"] .feed-search-bar { background: rgba(20,20,30,0.04); }
.feed-search-bar i { width: 16px; height: 16px; color: var(--text-muted); }
.feed-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.9rem;
  width: 100%;
}
.feed-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.feed-search-results:empty { display: none; }
.feed-search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background .2s;
}
[data-theme="light"] .feed-search-result { background: rgba(20,20,30,0.03); }
.feed-search-result:hover { background: rgba(255,255,255,0.06); }
[data-theme="light"] .feed-search-result:hover { background: rgba(20,20,30,0.06); }
.feed-search-result img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.feed-search-result .fsr-name { font-weight: 600; font-size: 0.9rem; }
.feed-search-result .fsr-meta { color: var(--text-muted); font-size: 0.75rem; }
.feed-search-result button {
  margin-left: auto;
  background: var(--primary);
  color: #0b0d12;
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
}
[data-theme="light"] .feed-search-result button { color: #fff; }

/* ============ Profile tab (new) ============ */
.profile-tab-hero {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: center;
  padding: 24px !important;
  border-radius: 22px !important;
  margin-bottom: 24px;
}
.profile-tab-hero img {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
}
.profile-tab-info h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 4px; }
.profile-tab-info p { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 14px; }
.profile-tab-metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-tab-metrics > div {
  background: rgba(255,255,255,0.04);
  padding: 8px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-width: 90px;
  position: relative;
}
[data-theme="light"] .profile-tab-metrics > div { background: rgba(20,20,30,0.04); }
.profile-tab-metrics b { font-size: 1.1rem; font-weight: 700; font-family: var(--font-display); }
.profile-tab-metrics span { color: var(--text-muted); font-size: 0.72rem; margin-top: 2px; }

.profile-tab-section-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin: 26px 0 12px;
}

/* ============ Media albums ============ */
.media-albums {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}
.media-albums:empty { display: none; }
.album-tile {
  min-width: 160px;
  height: 100px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-glow), color-mix(in srgb, var(--primary) 3%, transparent));
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform .2s;
  border: 1px solid transparent;
}
.album-tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.album-tile.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 25%, transparent); }
.album-tile.all { background: rgba(255,255,255,0.04); }
[data-theme="light"] .album-tile.all { background: rgba(20,20,30,0.04); }
.album-tile-name { font-weight: 600; font-size: 0.88rem; }
.album-tile-count { color: var(--text-muted); font-size: 0.72rem; }
.album-current-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.album-current-title:empty { display: none; }

/* ============ Messenger sub-tabs (Внутренний / Внешние) ============ */
.mess-subtabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  margin-bottom: 18px;
}
[data-theme="light"] .mess-subtabs { background: rgba(20,20,30,0.04); }
.mess-subtab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mess-subtab i { width: 14px; height: 14px; }
.mess-subtab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}
.mess-sub-view { display: none; }
.mess-sub-view.active { display: block; }

/* Hide subtabs, always show external cards */
.mess-subtabs { display: none !important; }
#mess-internal-slot { display: none !important; }
#mess-external-slot { display: block !important; }

/* Show external chats section right inside the Мессендж tab */
.ext-chats-section {
  margin-top: 24px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
}
[data-theme="light"] .ext-chats-section { background: rgba(20,20,30,0.03); }
.ext-chats-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ext-chats-title .badge {
  background: var(--primary-glow);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
}
.ext-chats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
}
.ext-chat-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.ext-chat-item:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .ext-chat-item:hover { background: rgba(20,20,30,0.05); }
.ext-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #229ED9;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.ext-chat-avatar.wa { background: #25D366; }
.ext-chat-name { font-weight: 500; font-size: 0.9rem; }
.ext-chat-preview { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-chat-unread {
  background: var(--primary);
  color: #0b0d12;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}
[data-theme="light"] .ext-chat-unread { color: #fff; }

/* Chat modal */
.ext-chat-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.ext-chat-modal.open { display: flex; }
.ext-chat-modal-card {
  background: var(--bg-card);
  border-radius: 22px;
  width: 700px;
  max-width: 96vw;
  height: 80vh;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ext-chat-modal-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.ext-chat-modal-head h3 { font-size: 1rem; margin: 0; }
.ext-chat-modal-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
}
.ext-chat-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ext-chat-modal-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
}
.ext-chat-modal-input input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: none;
  outline: none;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--text-main);
}
[data-theme="light"] .ext-chat-modal-input input { background: rgba(20,20,30,0.04); }

/* Bring back internal chat visibility, hide separate external sections */
.mess-subtabs { display: none !important; }
#mess-internal-slot { display: block !important; }
#mess-external-slot { display: block !important; margin-top: 24px; }
.ext-chats-section { display: none !important; }

/* Big card buttons to open TG / WA in a Telegram-style window */
.ext-open-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.ext-open-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 20px;
  cursor: pointer;
  color: #fff;
  transition: transform .25s;
  border: none;
  text-align: left;
  font-family: inherit;
}
.ext-open-card:hover { transform: translateY(-3px); }
.ext-open-card.tg { background: linear-gradient(135deg, #229ED9, #1A73B8); }
.ext-open-card.wa { background: linear-gradient(135deg, #25D366, #128C7E); }
.ext-open-card-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ext-open-card-icon i { width: 24px; height: 24px; }
.ext-open-card-body h4 { margin: 0; font-size: 1rem; }
.ext-open-card-body span { font-size: 0.82rem; opacity: 0.85; }
.ext-open-card-count {
  margin-left: auto;
  background: rgba(255,255,255,0.22);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
}

/* ============ Telegram-style full window overlay ============ */
.tg-window {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tg-window.open { display: flex; }
.tg-window-card {
  width: 1100px;
  max-width: 96vw;
  height: 88vh;
  max-height: 800px;
  background: #17212B;
  color: #E4E9EC;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 340px 1fr;
  box-shadow: 0 30px 90px rgba(0,0,0,0.5);
}
.tg-window-card.wa { background: #0B141A; }

/* Sidebar */
.tg-side {
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
}
.tg-side-head {
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #17212B;
}
.tg-window-card.wa .tg-side-head { background: #202C33; }
.tg-side-head .tg-brand-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #229ED9;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.tg-window-card.wa .tg-side-head .tg-brand-icon { background: #25D366; }
.tg-side-head h3 { margin: 0; font-size: 0.95rem; color: #fff; font-family: var(--font-display); }
.tg-side-head .tg-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 6px;
}
.tg-side-search {
  padding: 8px 12px;
  background: #17212B;
}
.tg-window-card.wa .tg-side-search { background: #202C33; }
.tg-side-search input {
  width: 100%;
  background: #242F3D;
  border: none;
  outline: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}
.tg-window-card.wa .tg-side-search input { background: #2A3942; }
.tg-side-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.tg-chat-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .1s;
}
.tg-chat-row:hover { background: rgba(255,255,255,0.04); }
.tg-chat-row.active { background: #2B5278; }
.tg-window-card.wa .tg-chat-row.active { background: #2A3942; }
.tg-chat-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6C93B7, #3D6684);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.tg-chat-avatar.g0 { background: linear-gradient(135deg, #FF7E5F, #FEB47B); }
.tg-chat-avatar.g1 { background: linear-gradient(135deg, #6A82FB, #FC5C7D); }
.tg-chat-avatar.g2 { background: linear-gradient(135deg, #43CEA2, #185A9D); }
.tg-chat-avatar.g3 { background: linear-gradient(135deg, #DA22FF, #9733EE); }
.tg-chat-avatar.g4 { background: linear-gradient(135deg, #F7971E, #FFD200); }
.tg-chat-info { min-width: 0; }
.tg-chat-name {
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg-chat-preview {
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.tg-chat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.tg-chat-time { color: rgba(255,255,255,0.4); font-size: 0.7rem; }
.tg-chat-unread {
  background: #4EA4F6;
  color: #fff;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}
.tg-window-card.wa .tg-chat-unread { background: #25D366; color: #17212B; }

/* Thread panel */
.tg-thread {
  display: flex;
  flex-direction: column;
  background: #0E1621;
}
.tg-window-card.wa .tg-thread { background: #0B141A; }
.tg-thread-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 0.9rem;
}
.tg-thread-head {
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #17212B;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tg-window-card.wa .tg-thread-head { background: #202C33; }
.tg-thread-head h4 { color: #fff; margin: 0; font-size: 0.95rem; }
.tg-thread-head .tg-status { color: rgba(255,255,255,0.5); font-size: 0.75rem; }
.tg-thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background:
    radial-gradient(circle at 20% 20%, rgba(56,120,180,0.08), transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(56,120,180,0.05), transparent 50%);
}
.tg-msg {
  max-width: 65%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.35;
  word-wrap: break-word;
}
.tg-msg.me {
  align-self: flex-end;
  background: #2B5278;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.tg-window-card.wa .tg-msg.me { background: #005C4B; }
.tg-msg.them {
  align-self: flex-start;
  background: #182533;
  color: #E4E9EC;
  border-bottom-left-radius: 4px;
}
.tg-window-card.wa .tg-msg.them { background: #202C33; }
.tg-msg-time { display:block; font-size: 0.68rem; opacity: 0.55; margin-top: 4px; text-align: right; }
.tg-thread-composer {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  background: #17212B;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.tg-window-card.wa .tg-thread-composer { background: #202C33; }
.tg-thread-composer input {
  background: #242F3D;
  border: none;
  outline: none;
  color: #fff;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
}
.tg-window-card.wa .tg-thread-composer input { background: #2A3942; }
.tg-thread-composer button {
  background: #4EA4F6;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
}
.tg-window-card.wa .tg-thread-composer button { background: #25D366; }

/* Login/signup two-tab switcher */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  margin-bottom: 20px;
}
[data-theme="light"] .auth-tabs { background: rgba(20,20,30,0.05); }
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* Скрываем поломанную кнопку "Подключить WhatsApp" — оставляем только "Открыть WhatsApp Web" */
.messenger-card[data-mess="whatsapp"] [data-mess-start="whatsapp"] { display: none !important; }
.messenger-card[data-mess="whatsapp"] [data-mess-code="whatsapp"] { display: none !important; }
.messenger-card[data-mess="whatsapp"] [data-mess-send="whatsapp"] { display: none !important; }

/* Заменяем текст-инструкцию, чтобы пользователь понимал что делать */
.messenger-card[data-mess="whatsapp"] .mess-idle::before {
  content: 'Нажмите ниже — откроется WhatsApp Web в отдельном окне. Отсканируйте QR своим телефоном (WhatsApp → Настройки → Связанные устройства).';
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: center;
  padding: 0 12px;
}

/* И кнопку "Открыть WhatsApp Web" делаем большой и заметной */
.messenger-card[data-mess="whatsapp"] .mess-open-web {
  background: linear-gradient(135deg, #25D366, #128C7E) !important;
  color: #fff !important;
  padding: 14px 20px !important;
  border-radius: 14px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.28);
  transition: transform .2s;
}
.messenger-card[data-mess="whatsapp"] .mess-open-web:hover { transform: translateY(-1px); }

/* Скрываем «Ещё чаты Telegram/WhatsApp» кнопку-карточку для WhatsApp — но оставляем открытие Telegram Web */
.ext-open-cards .ext-open-card.wa { display: none !important; }

/* Отменяем скрытие кнопки WhatsApp — Baileys выдаёт нормальный QR внутри сайта */
.messenger-card[data-mess="whatsapp"] [data-mess-start="whatsapp"] { display: inline-flex !important; }
.messenger-card[data-mess="whatsapp"] [data-mess-code="whatsapp"] { display: inline !important; }
.messenger-card[data-mess="whatsapp"] [data-mess-send="whatsapp"] { display: inline !important; }
.messenger-card[data-mess="whatsapp"] .mess-idle::before { content: none !important; }
.messenger-card[data-mess="whatsapp"] .mess-open-web { display: none !important; }
.ext-open-cards .ext-open-card.wa { display: flex !important; }
