/* ============================================
   PYNGYN WORKSPACE — Design System
   ============================================ */
:root {
  --primary: #F97316;
  --primary-50: #FFF7ED;
  --primary-100: #FFEDD5;
  --primary-500: #F97316;
  --primary-600: #EA580C;
  --primary-700: #C2410C;

  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;
  --slate-950: #020617;

  --success: #22C55E;
  --success-50: #F0FDF4;
  --warning: #F59E0B;
  --warning-50: #FFFBEB;
  --danger: #EF4444;
  --danger-50: #FEF2F2;
  --info: #3B82F6;
  --info-50: #EFF6FF;
  --purple: #8B5CF6;
  --purple-50: #F5F3FF;
  --pink: #EC4899;
  --pink-50: #FDF2F8;
  --teal: #14B8A6;
  --teal-50: #F0FDFA;

  --bg: #F8FAFC;
  --bg-elevated: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-soft: #94A3B8;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-w: 256px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== APP LAYOUT ===== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  height: 100vh;
  transition: grid-template-columns 0.3s ease;
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(2px); z-index: 55; }

/* ===== SIDEBAR ===== */
.sidebar {
  grid-area: sidebar;
  background: var(--slate-900);
  color: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #FB923C 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
  flex-shrink: 0;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-tag { font-size: 10px; color: var(--primary); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.app.collapsed .brand-text { display: none; }

.ws-switcher {
  margin: 14px; padding: 10px 12px;
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all 0.15s;
}
.ws-switcher:hover { background: var(--slate-200); }
[data-theme="dark"] .ws-switcher:hover { background: var(--slate-200); }
.ws-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #F97316, #FB923C);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; color: white;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.25);
}
.ws-info { flex: 1; min-width: 0; min-width: 0; }
.ws-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); letter-spacing: -0.01em; }
.ws-plan { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 1px; }
.app.collapsed .ws-info, .app.collapsed .ws-chev { display: none; }
.ws-chev { color: #64748B; flex-shrink: 0; transition: transform 0.2s ease, color 0.15s; }
.ws-switcher:hover .ws-chev { color: #0F172A; }
.ws-switcher.open .ws-chev { transform: rotate(180deg); color: #F97316; }
[data-theme="dark"] .ws-chev { color: #94A3B8; }
[data-theme="dark"] .ws-switcher:hover .ws-chev { color: #E2E8F0; }

.nav { flex: 1; overflow-y: auto; padding: 0 10px 20px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; color: var(--slate-500);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 18px 12px 8px;
}
.app.collapsed .nav-section-label { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--slate-300); cursor: pointer;
  position: relative;
  font-size: 13.5px; font-weight: 500;
  transition: all 0.15s; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: white; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(249,115,22,0.15) 0%, rgba(249,115,22,0.04) 100%);
  color: white;
}
.nav-item.highlight { background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(236, 72, 153, 0.08)); border: 1px solid rgba(249, 115, 22, 0.25); }
.nav-item.highlight:hover { background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(236, 72, 153, 0.12)); border-color: var(--primary); }
.nav-item.active::before {
  content: ''; position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px; background: var(--primary); border-radius: 0 3px 3px 0;
}
.nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 1.8; }
.nav-item .badge {
  margin-left: auto;
  background: var(--primary); color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
}
.nav-item .badge.muted { background: rgba(255,255,255,0.08); color: var(--slate-300); }
.app.collapsed .nav-item .label, .app.collapsed .nav-item .badge { display: none; }
.app.collapsed .nav-item { justify-content: center; }

/* ----- Spaces nav item with chevron + sub-dropdown ----- */
.nav-item-has-children { padding: 0; gap: 0; }
.nav-item-has-children .nav-item-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px 10px 12px;
  background: transparent; border: none;
  color: inherit; font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left;
  border-radius: 10px;
  transition: background 0.12s;
}
.nav-item-has-children .nav-item-main:hover { background: rgba(255,255,255,0.04); }
.nav-item-has-children .nav-item-chevron {
  width: 28px; height: 36px;
  display: grid; place-items: center;
  background: transparent; border: none;
  color: var(--slate-300, #94A3B8);
  cursor: pointer; border-radius: 0 10px 10px 0;
  transition: color 0.12s, background 0.12s, transform 0.18s;
  margin-right: 4px;
}
.nav-item-has-children .nav-item-chevron:hover { color: white; background: rgba(255,255,255,0.04); }
.nav-item-has-children.open .nav-item-chevron { transform: rotate(180deg); color: var(--primary, #F97316); }
.app.collapsed .nav-item-has-children .nav-item-chevron { display: none; }

.nav-item-has-children.open {
  background: linear-gradient(90deg, rgba(249,115,22,0.15) 0%, rgba(249,115,22,0.04) 100%);
}
.nav-item-has-children.open .nav-item-main { color: white; }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 12px;
  right: 12px;
  background: var(--slate-900, #0F172A);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  z-index: 50;
  animation: navDropdownIn 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes navDropdownIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.nav-dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 4px;
  font-size: 10px; font-weight: 700; color: var(--text-soft, #94A3B8);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.nav-dropdown-link {
  font-size: 10.5px; font-weight: 700;
  background: transparent; border: none; cursor: pointer;
  color: var(--primary, #F97316);
  padding: 2px 6px; border-radius: 5px;
  text-transform: none; letter-spacing: 0;
}
.nav-dropdown-link:hover { background: rgba(249, 115, 22, 0.12); }
.nav-dropdown-list { display: flex; flex-direction: column; gap: 1px; max-height: 280px; overflow-y: auto; }
.nav-dropdown-list::-webkit-scrollbar { width: 4px; }
.nav-dropdown-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.nav-dd-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 6px 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--slate-300, #CBD5E1); font: inherit; font-size: 12.5px;
  border-radius: 6px; text-align: left;
  transition: background 0.1s, color 0.1s;
}
.nav-dd-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-dd-item-icon {
  width: 18px; height: 18px; border-radius: 5px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 10px;
}
.nav-dd-item-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-dd-item-tag {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 4px;
  flex-shrink: 0;
}
.nav-dd-item-tag.team   { background: rgba(59, 130, 246, 0.18); color: #93C5FD; }
.nav-dd-item-tag.project{ background: rgba(139, 92, 246, 0.18); color: #C4B5FD; }
.nav-dd-item-tag.shared { background: rgba(236, 72, 153, 0.18); color: #F9A8D4; }
.nav-dd-item.active { background: rgba(249, 115, 22, 0.15); color: white; }
.nav-dd-create {
  margin-top: 4px; padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.1);
}

/* ----- Nested space tree (space -> folders) ----- */
.nav-dd-space { display: flex; flex-direction: column; }
.nav-dd-space-row { display: flex; align-items: stretch; gap: 2px; }
.nav-dd-space-chev {
  width: 18px; flex-shrink: 0;
  display: grid; place-items: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-soft, #94A3B8);
  border-radius: 5px;
  transition: color 0.12s, background 0.12s, transform 0.18s;
}
.nav-dd-space-chev:hover { color: white; background: rgba(255,255,255,0.06); }
.nav-dd-space.open .nav-dd-space-chev { transform: rotate(90deg); color: var(--primary, #F97316); }
.nav-dd-space-btn { flex: 1; min-width: 0; }
.nav-dd-folders {
  display: flex; flex-direction: column;
  padding: 2px 0 2px 20px;
  margin: 1px 0 2px 6px;
  border-left: 1px dashed rgba(255,255,255,0.1);
}
.nav-dd-space:not(.open) .nav-dd-folders[hidden] { display: none; }
.nav-dd-folder {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 4px 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--slate-300, #CBD5E1); font: inherit; font-size: 12px;
  border-radius: 5px; text-align: left;
  transition: background 0.1s, color 0.1s;
}
.nav-dd-folder:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-dd-folder-bullet {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0; display: grid; place-items: center;
  color: white;
}
.nav-dd-folder-text {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-dd-folder-count {
  font-size: 10px; font-weight: 600;
  color: var(--text-soft, #94A3B8);
  background: rgba(255,255,255,0.05);
  padding: 1px 5px; border-radius: 4px;
  flex-shrink: 0;
}
.nav-dd-folder-new {
  color: var(--primary, #F97316) !important;
  font-weight: 600;
  margin-top: 2px;
}
.nav-dd-folder-new:hover { background: rgba(249, 115, 22, 0.1) !important; color: var(--primary, #F97316) !important; }
.nav-dd-empty {
  font-size: 11px; color: var(--text-soft, #94A3B8);
  padding: 4px 8px; font-style: italic;
}
.app.collapsed .nav-dropdown { display: none; }
.nav-item.ai-nav {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: white; margin-top: 8px;
}
.nav-item.ai-nav:hover { background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.12)); }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; transition: all 0.15s;
}
.user-card:hover { background: rgba(255,255,255,0.04); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #FB923C);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
  position: relative; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--slate-400); }
.app.collapsed .user-info { display: none; }
.app.collapsed .user-card { justify-content: center; }

.collapse-btn {
  position: absolute; top: 22px; right: -12px;
  width: 24px; height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  z-index: 50; box-shadow: var(--shadow-sm);
}
.collapse-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.app.collapsed .collapse-btn svg { transform: rotate(180deg); }

/* ===== TOP BAR ===== */
.topbar {
  grid-area: topbar;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: relative; z-index: 30;
}
.mobile-menu-btn {
  display: none;
  width: 40px; height: 40px; border-radius: 10px;
  align-items: center; justify-content: center;
  color: var(--text-muted);
}
.mobile-menu-btn:hover { background: var(--slate-100); color: var(--text); }
.mobile-menu-btn svg { width: 20px; height: 20px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.breadcrumb .crumb { color: var(--text); font-weight: 600; }
.breadcrumb svg { width: 14px; height: 14px; }
.topbar-spacer { flex: 1; }

.search { flex: 0 1 380px; position: relative; }
.search input {
  width: 100%; height: 40px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px 0 40px;
  font-size: 13.5px;
  transition: all 0.15s;
}
.search input:focus { outline: none; background: white; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-soft); width: 16px; height: 16px; }
.search-kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 3px; }
.search-kbd kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: monospace;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--slate-100); color: var(--text); }
.icon-btn.ai-btn { background: linear-gradient(135deg, #EEF2FF, #E0E7FF); color: #6366F1; border: 1px solid #C7D2FE; }
.icon-btn.ai-btn:hover { box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.icon-btn.chat-top-btn { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); color: #047857; border: 1px solid #6EE7B7; }
.icon-btn.chat-top-btn:hover { box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.icon-btn.chat-top-btn.active { background: linear-gradient(135deg, #10B981, #059669); color: white; border-color: #047857; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); }
.icon-btn.ai-btn.active { background: linear-gradient(135deg, #6366F1, #4F46E5); color: white; border-color: #4338CA; }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 2; }
.icon-btn .dot-badge {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--danger);
  border: 2px solid var(--bg-elevated);
  border-radius: 50%;
  display: none;
}
.icon-btn .dot-badge.show { display: block; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  transition: all 0.15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-600); }
.btn-secondary { background: var(--slate-100); color: var(--text); }
.btn-secondary:hover { background: var(--slate-200); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--slate-100); color: var(--text); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.divider-v { width: 1px; height: 28px; background: var(--border); margin: 0 4px; }

/* ===== MAIN ===== */
.main { grid-area: main; overflow-y: auto; background: var(--bg); }
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 4px; }
.page { max-width: 1600px; margin: 0 auto; padding: 28px 32px 80px; }

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

.welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.welcome h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.welcome h1 .wave { display: inline-block; animation: wave 2.5s infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
}
.welcome p { color: var(--text-muted); font-size: 14px; }
.welcome-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.featured {
  background: linear-gradient(135deg, var(--slate-900) 0%, #1E293B 100%);
  border-color: transparent; color: white;
}
.stat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.orange { background: var(--primary-50); color: var(--primary); }
.stat-icon.blue { background: var(--info-50); color: var(--info); }
.stat-icon.green { background: var(--success-50); color: var(--success); }
.stat-icon.purple { background: var(--purple-50); color: var(--purple); }
.stat-icon.pink { background: var(--pink-50); color: var(--pink); }
.stat-icon.dark { background: rgba(255,255,255,0.08); color: var(--primary); }
.stat-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  background: var(--success-50); color: var(--success);
}
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-card.featured .stat-label { color: var(--slate-400); }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }

/* ===== SECTIONS ===== */
.section { margin-bottom: 32px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 16px;
}
.section-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.section-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.project-cover {
  height: 84px; border-radius: 10px;
  margin-bottom: 14px; position: relative; overflow: hidden;
}
.project-cover.cover-1 { background: linear-gradient(135deg, #F97316 0%, #FB923C 50%, #FDBA74 100%); }
.project-cover.cover-2 { background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 50%, #C4B5FD 100%); }
.project-cover.cover-3 { background: linear-gradient(135deg, #14B8A6 0%, #2DD4BF 50%, #5EEAD4 100%); }
.project-cover.cover-4 { background: linear-gradient(135deg, #EC4899 0%, #F472B6 50%, #FBCFE8 100%); }
.project-cover.cover-5 { background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 50%, #93C5FD 100%); }
.project-cover.cover-6 { background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 50%, #FCD34D 100%); }
.project-cover-icon {
  position: absolute; bottom: -10px; right: 14px;
  width: 44px; height: 44px;
  background: white; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); color: var(--primary);
}
.project-cover-icon svg { width: 22px; height: 22px; }
.project-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.project-cat { font-size: 11.5px; color: var(--text-muted); margin-bottom: 14px; }
.progress { height: 6px; background: var(--slate-100); border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary), #FB923C); }
.progress-bar.green { background: linear-gradient(90deg, var(--success), #4ADE80); }
.progress-bar.purple { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }
.progress-bar.pink { background: linear-gradient(90deg, #EC4899, #F472B6); }
.progress-bar.blue { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.progress-text { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; }
.progress-text .pct { font-weight: 700; color: var(--text); }
.project-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }

.avatar-stack { display: flex; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--slate-200); color: white;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
  margin-left: -8px; flex-shrink: 0;
}
.avatar:first-child { margin-left: 0; }
.avatar.cyan { background: linear-gradient(135deg, #06B6D4, #0EA5E9); }
.avatar.purple { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.avatar.orange { background: linear-gradient(135deg, #F97316, #FB923C); }
.avatar.green { background: linear-gradient(135deg, #22C55E, #4ADE80); }
.avatar.pink { background: linear-gradient(135deg, #EC4899, #F472B6); }
.avatar.indigo { background: linear-gradient(135deg, #6366F1, #818CF8); }
.avatar.teal { background: linear-gradient(135deg, #14B8A6, #2DD4BF); }
.avatar.amber { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.avatar.rose { background: linear-gradient(135deg, #F43F5E, #FB7185); }
.avatar.more { background: var(--slate-200); color: var(--text-muted); }
.avatar.lg { width: 36px; height: 36px; font-size: 12px; border-width: 0; margin: 0; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.xs { width: 18px; height: 18px; font-size: 8px; border-width: 1.5px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.tag.priority-high { background: var(--danger-50); color: var(--danger); }
.tag.priority-medium { background: var(--warning-50); color: var(--warning); }
.tag.priority-low { background: var(--info-50); color: var(--info); }
.tag.status-active { background: var(--success-50); color: var(--success); }
.tag.status-progress { background: var(--primary-50); color: var(--primary); }
.tag.category { background: var(--slate-100); color: var(--slate-700); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ===== KANBAN ===== */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.kanban-col { background: var(--slate-50); border-radius: var(--radius-lg); padding: 12px; min-height: 400px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 12px; }
.kanban-col-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.kanban-col-title .dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-col-title .dot.gray { background: var(--slate-400); }
.kanban-col-title .dot.blue { background: var(--info); }
.kanban-col-title .dot.amber { background: var(--warning); }
.kanban-col-title .dot.purple { background: var(--purple); }
.kanban-col-title .dot.green { background: var(--success); }
.kanban-count {
  background: white; color: var(--text-muted);
  font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px;
  border: 1px solid var(--border);
}
.task-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.15s;
  position: relative;
}
.task-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.task-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 3px; height: 100%;
  border-radius: 3px 0 0 3px;
}
.task-card.prio-high::before { background: var(--danger); }
.task-card.prio-medium::before { background: var(--warning); }
.task-card.prio-low::before { background: var(--info); }
.task-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.task-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-muted); }
.task-meta-item { display: inline-flex; align-items: center; gap: 3px; }
.task-meta-item svg { width: 11px; height: 11px; }
.task-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.task-progress { flex: 1; height: 4px; background: var(--slate-100); border-radius: 4px; overflow: hidden; margin-right: 8px; }
.task-progress-bar { height: 100%; background: var(--primary); border-radius: 4px; }

/* ===== CARDS / TABLES ===== */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap.lg { height: 300px; }
.chart-wrap.sm { height: 140px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 12px 16px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--slate-50); }

/* ===== CALENDAR ===== */
.calendar { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--slate-50); border-bottom: 1px solid var(--border); }
.cal-head div { padding: 10px 12px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 80px; }
.cal-day {
  border-right: 1px solid var(--slate-100);
  border-bottom: 1px solid var(--slate-100);
  padding: 6px 8px;
  position: relative;
}
.cal-day.muted { background: var(--slate-50); color: var(--text-soft); }
.cal-day.today .cal-num { background: var(--primary); color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cal-num { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.cal-event {
  font-size: 10.5px; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600;
}
.cal-event.orange { background: var(--primary-50); color: var(--primary-700); }
.cal-event.blue { background: var(--info-50); color: var(--info); }
.cal-event.green { background: var(--success-50); color: var(--success); }
.cal-event.purple { background: var(--purple-50); color: var(--purple); }
.cal-event.pink { background: var(--pink-50); color: var(--pink); }

/* ===== TOAST ===== */
.toast-stack {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
  z-index: 250; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--slate-900); color: white;
  padding: 10px 16px 10px 12px; border-radius: 12px;
  box-shadow: var(--shadow-xl);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 360px;
}
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-20px); opacity: 0; } }
.toast-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-icon svg { width: 14px; height: 14px; }
.toast-icon.message { background: var(--primary); }
.toast-icon.warning { background: var(--warning); }
.toast-icon.success { background: var(--success); }
.toast-icon.danger { background: var(--danger); }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 12.5px; }
.toast-sub { font-size: 11px; color: var(--slate-300); margin-top: 1px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  width: 480px; max-width: 90vw;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--slate-50);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}
.form-input {
  width: 100%; height: 38px;
  padding: 0 12px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px; outline: none;
  transition: all 0.15s;
}
.form-input:focus { background: white; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1); }
textarea.form-input { height: auto; padding: 10px 12px; line-height: 1.4; }
.create-option {
  padding: 14px; border: 1px solid var(--border);
  border-radius: 10px; text-align: left;
  background: white; transition: all 0.15s; cursor: pointer;
}
.create-option:hover { border-color: var(--primary); background: var(--primary-50); }
.co-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ============================================
   CHAT BUBBLES — Messenger-style, one per conversation
   ============================================ */
.chat-bubbles-bar {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 8px;
  z-index: 90;
  max-width: calc(100vw - 32px);
  flex-wrap: wrap-reverse;
}
.chat-bubble-item {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  background: var(--slate-700);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
  padding: 0;
  user-select: none;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.chat-bubble-item:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}
.chat-bubble-item.active {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.32);
}
.chat-bubble-item.compose {
  background: linear-gradient(135deg, #10B981, #059669);
}
.chat-bubble-item.compose svg { width: 24px; height: 24px; }
.chat-bubble-item .bubble-presence {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2.5px solid white;
}
.bubble-presence.online { background: var(--success); }
.bubble-presence.away { background: var(--warning); }
.bubble-presence.busy { background: var(--danger); }
.bubble-presence.offline { background: var(--slate-300); }
.chat-bubble-item .bubble-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--danger);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid white;
  box-sizing: content-box;
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chat-bubble-item .bubble-badge.show { transform: scale(1); }
.chat-bubble-item .bubble-close {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--slate-700);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid white;
  font-size: 11px;
  line-height: 1;
}
.chat-bubble-item:hover .bubble-close { display: flex; }
.chat-bubble-item .bubble-close:hover { background: var(--danger); }
.chat-bubble-item .bubble-name-tag {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--slate-900);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.chat-bubble-item:hover .bubble-name-tag { opacity: 1; }
.chat-bubble-item.has-typing .bubble-presence {
  animation: typingPulse 1.4s infinite;
}
@keyframes typingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

/* Chat window (one per open conversation) */
.chat-window {
  position: fixed;
  bottom: 84px;
  width: 340px;
  height: 520px;
  max-height: calc(100vh - 110px);
  background: var(--bg-elevated);
  border-radius: 14px;
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.06);
  z-index: 89;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatWindowIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
@keyframes chatWindowIn {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.chat-window.open { display: flex; }
.chat-window-closed {
  position: fixed;
  bottom: 84px;
  width: 340px;
  padding: 12px 16px;
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 89;
  box-shadow: var(--shadow-md);
}

.cw-header {
  padding: 12px 14px;
  background: var(--slate-900);
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.cw-header:hover { background: #1E293B; }
.cw-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -20px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.2), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.cw-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  position: relative;
  color: white;
}
.cw-avatar .presence {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2.5px solid var(--slate-900);
}
.cw-info { flex: 1; min-width: 0; }
.cw-name {
  font-size: 13.5px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cw-name .ch-hash { color: var(--slate-400); font-weight: 600; }
.cw-status {
  font-size: 11px;
  color: var(--slate-300);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.cw-status .dot { width: 6px; height: 6px; border-radius: 50%; }
.cw-status .dot.online { background: var(--success); }
.cw-status .dot.away { background: var(--warning); }
.cw-status .dot.busy { background: var(--danger); }
.cw-status .dot.offline { background: var(--slate-400); }
.cw-actions { display: flex; gap: 2px; position: relative; z-index: 2; }
.cw-actions button {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  color: var(--slate-300);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  transition: all 0.15s;
}
.cw-actions button:hover { background: rgba(255,255,255,0.1); color: white; }
.cw-actions button svg { width: 14px; height: 14px; }

/* Banner */
.cw-banner {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cw-banner.pending { background: var(--warning-50); color: #92400E; border-bottom: 1px solid #FCD34D; }
.cw-banner.request { background: var(--info-50); color: #1E40AF; border-bottom: 1px solid #93C5FD; }
.cw-banner.declined { background: var(--danger-50); color: #991B1B; border-bottom: 1px solid #FCA5A5; }
.cw-banner .pulse-dot { width: 7px; height: 7px; background: var(--warning); border-radius: 50%; animation: pulse-dot 1.5s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.3); } }
.cw-banner .banner-text { flex: 1; }
.cw-banner button.bb {
  height: 22px; padding: 0 8px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 3px;
  border: none; cursor: pointer;
}
.cw-banner button.bb svg { width: 10px; height: 10px; }
.cw-banner button.bb.accept { background: var(--success); color: white; }
.cw-banner button.bb.accept:hover { background: #16A34A; }
.cw-banner button.bb.decline { background: white; color: var(--danger); border: 1px solid #FCA5A5; }

/* Messages */
.cw-dropzone {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.cw-dropzone.drag-over .dz-overlay { display: flex; }
.dz-overlay {
  display: none;
  position: absolute;
  inset: 8px;
  background: rgba(16, 185, 129, 0.95);
  color: white;
  border: 3px dashed white;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
  font-weight: 600;
  font-size: 12px;
}
.dz-overlay svg { width: 28px; height: 28px; }
.cw-messages {
  height: 100%;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.04), transparent 40%), var(--bg);
}
.cw-messages::-webkit-scrollbar { width: 5px; }
.cw-messages::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }

.cw-day-divider { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 10.5px; color: var(--text-soft); font-weight: 600; }
.cw-day-divider::before, .cw-day-divider::after { content: ''; flex: 1; height: 1px; background: var(--slate-200); }

.cw-msg { display: flex; gap: 8px; padding: 1px 0; max-width: 85%; }
.cw-msg.them { align-self: flex-start; }
.cw-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.cw-msg-avatar { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: white; font-size: 10px; font-weight: 700; flex-shrink: 0; align-self: flex-start; margin-top: 2px; }
.cw-msg.me .cw-msg-avatar { background: transparent; color: transparent; width: 0; margin: 0; }
.cw-msg-col { display: flex; flex-direction: column; min-width: 0; }
.cw-msg.me .cw-msg-col { align-items: flex-end; }
.cw-msg-author { font-size: 11.5px; font-weight: 700; margin-bottom: 1px; padding: 0 4px; }
.cw-msg.me .cw-msg-author { display: none; }
.cw-msg-bubble {
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
  color: var(--text);
}
.cw-msg.them .cw-msg-bubble { background: var(--bg-elevated); border: 1px solid var(--border); border-top-left-radius: 4px; }
.cw-msg.me .cw-msg-bubble { background: linear-gradient(135deg, #10B981, #059669); color: white; border-top-right-radius: 4px; }
.cw-msg .cw-msg-meta { font-size: 10px; color: var(--text-soft); margin-top: 1px; display: flex; align-items: center; gap: 3px; padding: 0 4px; }
.cw-msg.me .cw-msg-meta { justify-content: flex-end; }
.cw-msg .cw-msg-meta .read { color: #10B981; font-weight: 700; }
.cw-msg .cw-msg-meta .read.pending { color: var(--text-soft); font-weight: 400; }
.cw-msg-bubble .mention { background: rgba(16, 185, 129, 0.12); color: #047857; padding: 1px 4px; border-radius: 4px; font-weight: 600; }
.cw-msg.me .cw-msg-bubble .mention { background: rgba(255,255,255,0.22); color: white; }

.cw-msg-files { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.cw-msg-file { display: flex; align-items: center; gap: 6px; padding: 5px 6px; background: rgba(255,255,255,0.6); border: 1px solid var(--border); border-radius: 6px; font-size: 11.5px; }
.cw-msg.me .cw-msg-file { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.2); }
.cw-msg-file-icon { width: 24px; height: 24px; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.cw-msg-file-icon svg { width: 12px; height: 12px; }
.cw-msg-file-icon.pdf { background: #EF4444; }
.cw-msg-file-icon.doc { background: #3B82F6; }
.cw-msg-file-icon.sheet { background: #10B981; }
.cw-msg-file-icon.image { background: #8B5CF6; }
.cw-msg-file-icon.file { background: #64748B; }
.cw-msg-file-info { flex: 1; min-width: 0; }
.cw-msg-file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-msg-file-meta { font-size: 9.5px; opacity: 0.75; }

.cw-msg-system { align-self: center; max-width: 90%; padding: 4px 10px; background: var(--slate-100); border-radius: 8px; font-size: 10.5px; color: var(--text-muted); text-align: center; display: flex; align-items: center; gap: 4px; margin: 3px 0; }
.cw-msg-system svg { width: 10px; height: 10px; }
.cw-msg-system.success { background: var(--success-50); color: var(--success); }
.cw-msg-system.danger { background: var(--danger-50); color: var(--danger); }

.cw-typing { display: flex; gap: 8px; align-items: center; padding: 3px 0; align-self: flex-start; max-width: 85%; }
.cw-typing .cw-msg-avatar { background: linear-gradient(135deg, #8B5CF6, #EC4899); }
.cw-typing-bubble { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; border-top-left-radius: 4px; padding: 6px 10px; display: flex; gap: 3px; }
.cw-typing-bubble .dot { width: 5px; height: 5px; background: var(--text-soft); border-radius: 50%; animation: typingDot 1.4s infinite; }
.cw-typing-bubble .dot:nth-child(2) { animation-delay: 0.2s; }
.cw-typing-bubble .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-3px); opacity: 1; } }

/* Input */
.cw-input-wrap {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
  padding: 8px 10px 6px;
}
.cw-attach-preview-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.cw-attach-preview { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 4px; background: var(--slate-50); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; }
.cw-attach-preview .ic { width: 20px; height: 20px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: white; }
.cw-attach-preview .ic svg { width: 10px; height: 10px; }
.cw-attach-preview .ic.pdf { background: #EF4444; }
.cw-attach-preview .ic.doc { background: #3B82F6; }
.cw-attach-preview .ic.sheet { background: #10B981; }
.cw-attach-preview .ic.image { background: #8B5CF6; }
.cw-attach-preview .ic.file { background: #64748B; }
.cw-attach-preview .name { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cw-attach-preview .x { background: transparent; color: var(--text-muted); border: none; cursor: pointer; padding: 0; width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; }
.cw-attach-preview .x:hover { color: var(--danger); }

.cw-input { display: flex; align-items: flex-end; gap: 4px; background: var(--slate-50); border: 1px solid var(--border); border-radius: 10px; padding: 4px; transition: all 0.15s; }
.cw-input:focus-within { background: white; border-color: #10B981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.cw-attach-btn, .cw-voice-btn, .cw-send-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted);
  border: none; cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.cw-attach-btn:hover { background: var(--slate-200); color: var(--text); }
.cw-attach-btn svg { width: 14px; height: 14px; }
.cw-voice-btn.recording { background: var(--danger); color: white; border-color: var(--danger); animation: voicePulse 1.4s ease-in-out infinite; }
.cw-input textarea { flex: 1; border: none; outline: none; background: transparent; resize: none; font-size: 13px; line-height: 1.4; min-height: 24px; max-height: 100px; padding: 5px 4px; font-family: inherit; }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.cw-send-btn { background: linear-gradient(135deg, #10B981, #059669); color: white; }
.cw-send-btn:hover:not(:disabled) { transform: scale(1.05); }
.cw-send-btn:disabled { background: var(--slate-200); color: var(--text-soft); cursor: not-allowed; }
.cw-send-btn svg { width: 12px; height: 12px; }

/* Closed state */
.cw-closed-banner {
  background: var(--slate-100);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cw-closed-banner svg { width: 14px; height: 14px; flex-shrink: 0; }
.cw-closed-banner strong { color: var(--text); display: block; font-size: 12.5px; }
.cw-closed-banner button { margin-left: auto; }

/* Chat list popup (from compose bubble) */
.chat-list-popup {
  position: fixed;
  bottom: 84px;
  right: 16px;
  width: 340px;
  max-height: 480px;
  background: var(--bg-elevated);
  border-radius: 14px;
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.06);
  z-index: 91;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatWindowIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
.chat-list-popup-head { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.chat-list-popup-title { font-size: 14px; font-weight: 700; }
.chat-list-popup-hide { display: flex; align-items: center; gap: 5px; background: transparent; border: 1px solid var(--border); padding: 4px 9px; border-radius: 6px; font: inherit; font-size: 11px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.12s; }
.chat-list-popup-hide:hover { background: var(--bg-soft); color: var(--text); }
.chat-list-popup-hide.active { background: rgba(239, 68, 68, 0.1); color: #DC2626; border-color: rgba(239, 68, 68, 0.4); }
.chat-list-popup-hide.active svg { color: #DC2626; }

body.chat-bubbles-hidden .chat-window { display: none !important; }
body.chat-bubbles-hidden #chatWindowsContainer { display: none !important; }
.chat-list-popup-search { padding: 10px 12px; border-bottom: 1px solid var(--slate-100); position: relative; }
.chat-list-popup-search svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--text-soft); width: 13px; height: 13px; pointer-events: none; }
.chat-list-popup-search input { width: 100%; height: 34px; background: var(--slate-50); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px 0 32px; font-size: 12.5px; outline: none; }
.chat-list-popup-search input:focus { background: white; border-color: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,0.1); }
.chat-list-popup-body { flex: 1; overflow-y: auto; padding: 6px 8px 10px; }
.chat-list-popup-body::-webkit-scrollbar { width: 4px; }
.chat-list-popup-body::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 2px; }
.chat-list-popup-section { font-size: 10.5px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 8px 4px; display: flex; align-items: center; justify-content: space-between; }
.chat-list-popup-section .new-btn { color: #10B981; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.chat-list-popup-section .new-btn:hover { background: #D1FAE5; }
.chat-list-popup-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.chat-list-popup-item:hover { background: var(--slate-50); }
.chat-list-popup-item .ci-avatar { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 11.5px; flex-shrink: 0; position: relative; }
.chat-list-popup-item .ci-avatar.channel { background: linear-gradient(135deg, var(--slate-700), var(--slate-800)); }
.chat-list-popup-item .presence { position: absolute; bottom: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid white; }
.chat-list-popup-item .info { flex: 1; min-width: 0; }
.chat-list-popup-item .name { font-size: 13px; font-weight: 600; }
.chat-list-popup-item .sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-popup-empty { padding: 30px 16px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* Mobile */
@media (max-width: 768px) {
  .chat-bubbles-bar { right: 12px; bottom: 12px; gap: 6px; }
  .chat-bubble-item { width: 50px; height: 50px; font-size: 12px; }
  .chat-bubble-item.compose svg { width: 20px; height: 20px; }
  .chat-window, .chat-list-popup { right: 8px; left: 8px; width: auto; bottom: 72px; }
  .chat-window { height: calc(100vh - 90px); }
}
@media (max-width: 480px) {
  .chat-bubble-item { width: 46px; height: 46px; }
  .chat-bubbles-bar { right: 8px; bottom: 8px; }
}

/* ============================================
   BUSINESS BRAIN PANEL
   ============================================ */
.brain-panel {
  position: fixed; top: 0; right: 0;
  height: 100vh; width: 420px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.brain-panel.open { transform: translateX(0); }

.brain-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, #EEF2FF 0%, #F0F9FF 50%, #FAF5FF 100%); flex-shrink: 0; }
.brain-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.brain-head-left { display: flex; align-items: center; gap: 12px; }
.brain-orb {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #14B8A6 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; position: relative;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}
.brain-orb::after { content: ''; position: absolute; inset: -3px; border-radius: 14px; background: linear-gradient(135deg, #6366F1, #14B8A6); opacity: 0.3; z-index: -1; animation: brainPulse 2s infinite; }
@keyframes brainPulse { 0%, 100% { transform: scale(1); opacity: 0.3; } 50% { transform: scale(1.15); opacity: 0; } }
.brain-orb svg { width: 18px; height: 18px; }
.brain-head-title { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.brain-head-title .pro-badge { font-size: 9px; font-weight: 700; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: white; padding: 1px 5px; border-radius: 4px; }
.brain-head-sub { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.brain-head-sub .live { width: 6px; height: 6px; background: var(--success); border-radius: 50%; animation: blink 1.5s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.brain-tabs { display: flex; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(4px); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.brain-tab { flex: 1; height: 30px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--text-muted); border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: all 0.15s; cursor: pointer; border: none; background: transparent; }
.brain-tab:hover { color: var(--text); }
.brain-tab.active { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: white; box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3); }
.brain-tab svg { width: 12px; height: 12px; }
.brain-tab .count { font-size: 10px; padding: 1px 5px; border-radius: 8px; background: rgba(255,255,255,0.25); color: white; }
.brain-tab:not(.active) .count { background: var(--slate-100); color: var(--text-muted); }

.brain-context { padding: 8px 16px 0; display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.context-chip { font-size: 10px; font-weight: 600; color: var(--text-muted); background: white; border: 1px solid var(--border); padding: 2px 7px 2px 5px; border-radius: 10px; display: inline-flex; align-items: center; gap: 4px; }
.context-chip .dot { width: 5px; height: 5px; background: var(--success); border-radius: 50%; }
.context-chip.kb { color: #6366F1; border-color: #C7D2FE; background: #EEF2FF; }
.context-chip.kb .dot { background: #6366F1; }

.brain-view { display: none; flex: 1; flex-direction: column; min-height: 0; }
.brain-view.active { display: flex; }

.brain-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.brain-body::-webkit-scrollbar { width: 4px; }
.brain-body::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 2px; }

.brain-msg { display: flex; gap: 10px; max-width: 95%; }
.brain-msg.user { margin-left: auto; flex-direction: row-reverse; }
.brain-msg-avatar { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: white; font-size: 11px; font-weight: 700; }
.brain-msg.bot .brain-msg-avatar { background: linear-gradient(135deg, #6366F1, #8B5CF6, #14B8A6); }
.brain-msg.user .brain-msg-avatar { background: var(--slate-200); color: var(--text); }
.brain-msg-content { background: var(--slate-50); padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.brain-msg.user .brain-msg-content { background: var(--primary); color: white; }
.brain-msg-content strong { font-weight: 700; }
.brain-msg-content em { font-style: italic; }
.brain-msg-content .hi { background: linear-gradient(135deg, #FEF3C7, #FED7AA); padding: 1px 5px; border-radius: 4px; font-weight: 700; }
.brain-msg-content .risk { color: #B45309; font-weight: 600; }
.brain-msg-content .good { color: var(--success); font-weight: 600; }

.msg-sources { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.msg-source { font-size: 10px; font-weight: 600; color: var(--text-muted); background: var(--slate-50); border: 1px solid var(--border); padding: 2px 7px; border-radius: 8px; display: inline-flex; align-items: center; gap: 3px; }
.msg-source svg { width: 9px; height: 9px; }
.msg-source.kb { color: #6366F1; border-color: #C7D2FE; background: #EEF2FF; }

.brain-suggestions { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.brain-suggestion { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: white; border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; cursor: pointer; text-align: left; transition: all 0.15s; }
.brain-suggestion:hover { border-color: #6366F1; background: #EEF2FF; }
.brain-suggestion .ic { width: 22px; height: 22px; border-radius: 6px; background: #EEF2FF; color: #6366F1; display: flex; align-items: center; justify-content: center; }
.brain-suggestion .ic svg { width: 11px; height: 11px; }

.brain-input-wrap { padding: 12px 16px 16px; border-top: 1px solid var(--border); background: var(--bg-elevated); flex-shrink: 0; }
.brain-input { display: flex; align-items: flex-end; gap: 6px; background: var(--slate-50); border: 1px solid var(--border); border-radius: 12px; padding: 6px 6px 6px 12px; transition: all 0.15s; }
.brain-input:focus-within { background: white; border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }
.brain-input textarea { flex: 1; border: none; outline: none; background: transparent; resize: none; font-size: 13px; line-height: 1.4; min-height: 22px; max-height: 100px; padding: 6px 0; font-family: inherit; }
.brain-send-btn { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: white; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; flex-shrink: 0; }
.brain-send-btn svg { width: 14px; height: 14px; }

/* Knowledge tab */
.kb-header { padding: 10px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--slate-100); flex-shrink: 0; }
.kb-search { flex: 1; position: relative; }
.kb-search input { width: 100%; height: 32px; background: var(--slate-50); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px 0 32px; font-size: 12.5px; outline: none; }
.kb-search input:focus { background: white; border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.kb-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-soft); width: 13px; height: 13px; }
.kb-add { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: white; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; flex-shrink: 0; }
.kb-add svg { width: 14px; height: 14px; }

.kb-categories { padding: 8px 14px; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--slate-100); flex-shrink: 0; }
.kb-categories::-webkit-scrollbar { height: 0; }
.kb-cat { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px 10px; border-radius: 12px; background: transparent; border: 1px solid transparent; white-space: nowrap; cursor: pointer; }
.kb-cat:hover { background: var(--slate-100); }
.kb-cat.active { background: #EEF2FF; color: #6366F1; border-color: #C7D2FE; }

.kb-list { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.kb-item { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 12px; transition: all 0.15s; }
.kb-item:hover { border-color: #C7D2FE; box-shadow: var(--shadow-sm); }
.kb-item-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.kb-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kb-icon svg { width: 14px; height: 14px; }
.kb-icon.doc { background: #EEF2FF; color: #6366F1; }
.kb-icon.note { background: #FEF3C7; color: #B45309; }
.kb-icon.faq { background: #DBEAFE; color: #1E40AF; }
.kb-icon.decision { background: #FCE7F3; color: #BE185D; }
.kb-icon.persona { background: #D1FAE5; color: #047857; }
.kb-icon.url { background: #E0E7FF; color: #4338CA; }
.kb-item-title { font-size: 13px; font-weight: 600; flex: 1; line-height: 1.3; }
.kb-item-meta { font-size: 10.5px; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.kb-item-content { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-item-tags { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 8px; }
.kb-tag { font-size: 10px; font-weight: 600; color: var(--text-muted); background: var(--slate-50); padding: 1px 6px; border-radius: 6px; }

.kb-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kb-type-btn { padding: 12px; border: 1.5px solid var(--border); border-radius: 10px; text-align: left; transition: all 0.15s; cursor: pointer; background: white; }
.kb-type-btn:hover, .kb-type-btn.selected { border-color: #6366F1; background: #EEF2FF; }
.kb-type-btn .kb-icon { margin-bottom: 6px; }
.kb-type-btn .name { font-size: 12.5px; font-weight: 600; }
.kb-type-btn .desc { font-size: 10.5px; color: var(--text-soft); }

/* Brain quick grid (in dashboard) */
.brain-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brain-quick-card { padding: 12px; background: white; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.15s; text-align: left; }
.brain-quick-card:hover { border-color: #C7D2FE; transform: translateY(-1px); }
.brain-quick-card .ic { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.brain-quick-card .ic svg { width: 14px; height: 14px; }
.brain-quick-card .btitle { font-size: 12.5px; font-weight: 600; }
.brain-quick-card .bdesc { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

.brain-insight { padding: 14px 18px; border-bottom: 1px solid var(--slate-100); }
.brain-insight:last-child { border-bottom: none; }
.brain-insight-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.brain-insight-icon { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: white; }
.brain-insight-icon svg { width: 13px; height: 13px; }
.brain-insight-icon.purple { background: linear-gradient(135deg, #6366F1, #8B5CF6); }
.brain-insight-icon.amber { background: linear-gradient(135deg, #F59E0B, #FB923C); }
.brain-insight-icon.green { background: linear-gradient(135deg, #22C55E, #4ADE80); }
.brain-insight-title { font-size: 12.5px; font-weight: 600; }
.brain-insight-time { font-size: 10.5px; color: var(--text-soft); margin-left: auto; }
.brain-insight-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.docs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.doc-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all 0.15s; }
.doc-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.doc-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.doc-icon svg { width: 20px; height: 20px; }
.doc-icon.orange { background: var(--primary-50); color: var(--primary); }
.doc-icon.blue { background: var(--info-50); color: var(--info); }
.doc-icon.green { background: var(--success-50); color: var(--success); }
.doc-icon.purple { background: var(--purple-50); color: var(--purple); }
.doc-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.doc-meta { font-size: 11.5px; color: var(--text-muted); }

.goals-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.okr-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.okr-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.okr-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.okr-progress .progress { flex: 1; }
.okr-progress .pct { font-size: 13px; font-weight: 700; }
.okr-kr { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--slate-100); font-size: 13px; }
.okr-kr .progress { width: 100px; height: 4px; }

/* ============================================
   DARK MODE (proper, not just inverted)
   ============================================ */
[data-theme="dark"] {
  --bg: #0B1220;
  --bg-elevated: #111827;
  --bg-soft: #0F172A;
  --slate-50: #0F172A;
  --slate-100: #1E293B;
  --slate-200: #334155;
  --slate-300: #475569;
  --slate-400: #64748B;
  --slate-500: #94A3B8;
  --slate-600: #CBD5E1;
  --slate-700: #E2E8F0;
  --slate-800: #F1F5F9;
  --slate-900: #F8FAFC;
  --border: #1E293B;
  --border-strong: #334155;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-soft: #64748B;
  --primary-50: rgba(249, 115, 22, 0.12);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .app { background: var(--bg); }
[data-theme="dark"] .topbar { background: var(--bg-elevated); border-bottom-color: var(--border); }
[data-theme="dark"] .sidebar { background: #020617; }
[data-theme="dark"] .stat-card,
[data-theme="dark"] .card { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .card-head { border-bottom-color: var(--border); }
[data-theme="dark"] .table th { background: var(--bg-soft); color: var(--text-muted); }
[data-theme="dark"] .table td { border-bottom-color: var(--border); }
[data-theme="dark"] .table tr:hover td { background: var(--bg-soft); }
[data-theme="dark"] .cal-day { border-right-color: var(--border); border-bottom-color: var(--border); }
[data-theme="dark"] .cal-day.muted { background: var(--bg-soft); }
[data-theme="dark"] .cal-day.today { background: rgba(249, 115, 22, 0.1); }
[data-theme="dark"] .cal-head { background: var(--bg-soft); border-bottom-color: var(--border); }
[data-theme="dark"] .cal-event.orange { background: rgba(249, 115, 22, 0.2); color: #FDBA74; }
[data-theme="dark"] .cal-event.blue { background: rgba(59, 130, 246, 0.2); color: #93C5FD; }
[data-theme="dark"] .cal-event.green { background: rgba(34, 197, 94, 0.2); color: #86EFAC; }
[data-theme="dark"] .cal-event.purple { background: rgba(139, 92, 246, 0.2); color: #C4B5FD; }
[data-theme="dark"] .cal-event.pink { background: rgba(236, 72, 153, 0.2); color: #F9A8D4; }
[data-theme="dark"] .calendar { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .kanban-col { background: var(--bg-soft); }
[data-theme="dark"] .task-card { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .progress { background: var(--slate-100); }
[data-theme="dark"] .form-input { background: var(--slate-50); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .form-input:focus { background: var(--bg-elevated); border-color: var(--primary); }
[data-theme="dark"] .btn-secondary { background: var(--slate-100); color: var(--text); }
[data-theme="dark"] .btn-secondary:hover { background: var(--slate-200); }
[data-theme="dark"] .btn-ghost:hover { background: var(--slate-100); }
[data-theme="dark"] .tag.category { background: var(--slate-100); color: var(--text-muted); }
[data-theme="dark"] .tag.status-active { background: rgba(34, 197, 94, 0.15); color: #86EFAC; }
[data-theme="dark"] .tag.priority-high { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; }
[data-theme="dark"] .tag.priority-medium { background: rgba(245, 158, 11, 0.15); color: #FCD34D; }
[data-theme="dark"] .tag.priority-low { background: rgba(59, 130, 246, 0.15); color: #93C5FD; }
[data-theme="dark"] .doc-card { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .okr-card { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .search input { background: var(--slate-50); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .search input:focus { background: var(--bg-elevated); }
[data-theme="dark"] .modal { background: var(--bg-elevated); }
[data-theme="dark"] .modal-head { border-bottom-color: var(--border); }
[data-theme="dark"] .modal-foot { background: var(--bg-soft); border-top-color: var(--border); }
[data-theme="dark"] .toast { background: #0F172A; }
[data-theme="dark"] .kanban-count { background: var(--bg-soft); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .ai-msg-content { background: var(--slate-100); color: var(--text); }
[data-theme="dark"] .msg-bubble { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .msg-row.them .msg-bubble { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .msg-row.me .msg-bubble { background: linear-gradient(135deg, #10B981, #059669); color: white; }
[data-theme="dark"] .msg-file { background: rgba(255,255,255,0.04); border-color: var(--border); }
[data-theme="dark"] .msg-row.me .msg-file { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
[data-theme="dark"] .msg-msg-system { background: var(--slate-100); }
[data-theme="dark"] .msg-system { background: var(--slate-100); color: var(--text-muted); }
[data-theme="dark"] .chat-day-divider { color: var(--text-muted); }
[data-theme="dark"] .chat-day-divider::before, [data-theme="dark"] .chat-day-divider::after { background: var(--border); }
[data-theme="dark"] .chat-list { background: var(--bg-soft); border-right-color: var(--border); }
[data-theme="dark"] .chat-item { color: var(--text); }
[data-theme="dark"] .chat-item:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .chat-item.active { background: var(--bg-elevated); }
[data-theme="dark"] .chat-item .ci-avatar .presence { border-color: var(--bg-soft); }
[data-theme="dark"] .chat-item.active .ci-avatar .presence { border-color: var(--bg-elevated); }
[data-theme="dark"] .chat-main { background: var(--bg-elevated); }
[data-theme="dark"] .chat-input { background: var(--slate-50); border-color: var(--border); }
[data-theme="dark"] .chat-input:focus-within { background: var(--bg-elevated); border-color: #10B981; }
[data-theme="dark"] .chat-input textarea { color: var(--text); }
[data-theme="dark"] .chat-send { background: var(--slate-200); }
[data-theme="dark"] .brain-head { background: linear-gradient(135deg, #1E1B4B 0%, #1E293B 50%, #1F2937 100%); border-bottom-color: var(--border); }
[data-theme="dark"] .brain-msg-content { background: var(--slate-100); color: var(--text); }
[data-theme="dark"] .brain-suggestion { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .brain-suggestion:hover { background: var(--slate-100); }
[data-theme="dark"] .brain-input { background: var(--slate-50); border-color: var(--border); }
[data-theme="dark"] .brain-input:focus-within { background: var(--bg-elevated); }
[data-theme="dark"] .brain-input textarea { color: var(--text); }
[data-theme="dark"] .context-chip { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .kb-item { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .kb-cat:hover { background: var(--slate-100); }
[data-theme="dark"] .kb-tag { background: var(--slate-100); }
[data-theme="dark"] .settings-nav { background: var(--bg-soft); border-right-color: var(--border); }
[data-theme="dark"] .settings-nav-item:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .status-banner { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .api-key-row { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .webhook-row { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .audit-row { border-bottom-color: var(--border); }
[data-theme="dark"] .audit-row:hover { background: var(--bg-soft); }
[data-theme="dark"] textarea.form-input { color: var(--text); }

/* Theme transition */
body { transition: background 0.3s, color 0.3s; }
.topbar, .sidebar, .main, .card, .stat-card, .kanban-col, .task-card, .form-input, .btn, .modal, .toast, .tab, .project-card, .ai-msg-content, .chat-list, .chat-main, .msg-bubble, .msg-file, .chat-input, .brain-head, .brain-input, .brain-suggestion, .kb-item, .ai-btn, .chat-top-btn, .icon-btn { transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s; }

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: flex-start; }
.settings-nav { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; position: sticky; top: 0; }
.settings-nav-section { font-size: 10.5px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 8px 4px; }
.settings-nav-section:first-child { padding-top: 4px; }
.settings-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-muted); text-align: left; transition: all 0.15s; }
.settings-nav-item:hover { background: var(--slate-100); color: var(--text); }
.settings-nav-item.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.settings-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.settings-content { min-height: 600px; }
.settings-panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.settings-panel-head { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.settings-panel-head h2 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.settings-panel-head p { font-size: 13px; color: var(--text-muted); }
.settings-panel-body { padding: 24px; }
.settings-section { padding: 18px 0; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: none; }
.settings-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.settings-section-title { font-size: 14px; font-weight: 600; }
.settings-section-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; max-width: 480px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.settings-row-label { font-size: 13px; font-weight: 500; }
.settings-row-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* Theme toggle */
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-option { padding: 12px; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; text-align: center; transition: all 0.15s; background: var(--bg-elevated); }
.theme-option:hover { border-color: var(--text-soft); }
.theme-option.active { border-color: var(--primary); background: var(--primary-50); }
.theme-option .preview { width: 100%; height: 50px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--border); }
.theme-option .preview.light { background: #F8FAFC; }
.theme-option .preview.light .pbar { background: #E2E8F0; }
.theme-option .preview.light .pdot { background: #F97316; }
.theme-option .preview.dark { background: #0B1220; }
.theme-option .preview.dark .pbar { background: #1E293B; }
.theme-option .preview.dark .pdot { background: #F97316; }
.theme-option .preview.system { background: linear-gradient(90deg, #F8FAFC 50%, #0B1220 50%); }
.theme-option .preview .pbar { height: 6px; border-radius: 3px; margin: 12px 8px 4px; }
.theme-option .preview .pdot { width: 12px; height: 12px; border-radius: 50%; margin: 4px 8px; }
.theme-option .name { font-size: 12.5px; font-weight: 600; }

/* Toggle switch */
.toggle { width: 40px; height: 22px; background: var(--slate-300); border-radius: 11px; position: relative; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.toggle.on { background: var(--primary); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.toggle.on::after { left: 20px; }

/* Branding preview */
.branding-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.branding-controls .form-input { margin-bottom: 10px; }
.color-picker { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.color-swatch { width: 38px; height: 38px; border-radius: 8px; cursor: pointer; border: 2px solid var(--border); }
.branding-preview { padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-soft); }
.branding-preview-header { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.branding-preview-mark { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 17px; }
.branding-preview-name { font-size: 16px; font-weight: 700; }
.branding-preview-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.branding-preview-btn { background: var(--primary); color: white; padding: 8px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; display: inline-block; margin-top: 10px; }
.logo-upload { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px dashed var(--border); border-radius: 10px; cursor: pointer; transition: all 0.15s; }
.logo-upload:hover { border-color: var(--primary); background: var(--primary-50); }
.logo-upload-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.logo-upload-icon svg { width: 20px; height: 20px; }

/* SSO / Security */
.sso-provider { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; transition: all 0.15s; }
.sso-provider:hover { border-color: var(--text-soft); }
.sso-provider-logo { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; }
.sso-provider-info { flex: 1; }
.sso-provider-name { font-size: 13.5px; font-weight: 600; }
.sso-provider-desc { font-size: 11.5px; color: var(--text-muted); }
.sso-status { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; }
.sso-status.connected { background: var(--success-50); color: var(--success); }
.sso-status.disconnected { background: var(--slate-100); color: var(--text-muted); }

/* API Keys */
.api-key-row { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.api-key-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-elevated); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.api-key-info { flex: 1; min-width: 0; }
.api-key-name { font-size: 13px; font-weight: 600; }
.api-key-value { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.api-key-value code { background: transparent; padding: 0; }
.api-key-actions { display: flex; gap: 4px; }
.api-key-actions button { width: 30px; height: 30px; border-radius: 7px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.api-key-actions button:hover { color: var(--text); }
.api-key-actions svg { width: 14px; height: 14px; }

/* Webhooks */
.webhook-row { display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.webhook-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.webhook-icon svg { width: 16px; height: 16px; }
.webhook-info { flex: 1; min-width: 0; }
.webhook-name { font-size: 13px; font-weight: 600; }
.webhook-url { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }
.webhook-events { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.webhook-event { font-size: 10px; padding: 2px 6px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; font-weight: 500; color: var(--text-muted); }

/* Audit log */
.audit-toolbar { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-soft); flex-wrap: wrap; }
.audit-toolbar select, .audit-toolbar input { height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; font-size: 12.5px; background: var(--bg-elevated); color: var(--text); outline: none; }
.audit-list { max-height: 600px; overflow-y: auto; }
.audit-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--slate-100); transition: background 0.12s; }
.audit-row:hover { background: var(--bg-soft); }
.audit-row:last-child { border-bottom: none; }
.audit-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.audit-icon svg { width: 14px; height: 14px; }
.audit-icon.create { background: var(--success-50); color: var(--success); }
.audit-icon.update { background: var(--info-50); color: var(--info); }
.audit-icon.delete { background: var(--danger-50); color: var(--danger); }
.audit-icon.auth { background: var(--purple-50); color: var(--purple); }
.audit-icon.security { background: var(--warning-50); color: var(--warning); }
.audit-info { flex: 1; min-width: 0; }
.audit-text { font-size: 13px; }
.audit-meta { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; display: flex; gap: 8px; }
.audit-time { font-size: 11.5px; color: var(--text-soft); flex-shrink: 0; }

/* API Docs */
.docs-content { padding: 0; }
.docs-section { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.docs-section:last-child { border-bottom: none; }
.docs-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.docs-section p { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.code-block { background: #0F172A; color: #E2E8F0; padding: 14px 16px; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.6; overflow-x: auto; margin: 10px 0; }
.code-block .method { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-right: 8px; }
.code-block .method.get { background: var(--info); }
.code-block .method.post { background: var(--success); }
.code-block .method.delete { background: var(--danger); }
.code-block .method.put { background: var(--warning); color: #0F172A; }
.code-block .path { color: #93C5FD; }
.code-block .comment { color: #64748B; }
.code-block .str { color: #86EFAC; }
.endpoint { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; transition: all 0.15s; }
.endpoint:hover { border-color: var(--text-soft); }
.endpoint .method { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; color: white; }
.endpoint .method.get { background: var(--info); }
.endpoint .method.post { background: var(--success); }
.endpoint .method.delete { background: var(--danger); }
.endpoint .path { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.endpoint .desc { color: var(--text-muted); font-size: 12px; margin-left: auto; }

/* Status Page */
.status-hero { padding: 28px 32px; background: linear-gradient(135deg, var(--success-50), #ECFDF5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 20px; }
.status-hero.issues { background: linear-gradient(135deg, var(--warning-50), #FEF3C7); }
.status-hero.outage { background: linear-gradient(135deg, var(--danger-50), #FEE2E2); }
.status-hero-icon { width: 56px; height: 56px; border-radius: 16px; background: white; display: flex; align-items: center; justify-content: center; color: var(--success); box-shadow: var(--shadow); flex-shrink: 0; }
.status-hero.issues .status-hero-icon { color: var(--warning); }
.status-hero.outage .status-hero-icon { color: var(--danger); }
.status-hero-icon svg { width: 28px; height: 28px; }
.status-hero-title { font-size: 20px; font-weight: 700; }
.status-hero-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.status-uptime { margin-left: auto; text-align: right; }
.status-uptime-pct { font-size: 32px; font-weight: 800; color: var(--success); }
.status-uptime-label { font-size: 12px; color: var(--text-muted); }
.status-services { padding: 0; }
.status-service { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.status-service:last-child { border-bottom: none; }
.status-service-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); }
.status-service-icon svg { width: 18px; height: 18px; }
.status-service-name { font-size: 13.5px; font-weight: 600; flex: 1; }
.status-service-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.operational { background: var(--success); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.status-dot.degraded { background: var(--warning); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.status-dot.outage { background: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.status-uptime-bars { display: flex; gap: 2px; align-items: flex-end; height: 30px; }
.status-uptime-bar { width: 4px; background: var(--success); border-radius: 1px; }
.status-uptime-bar.warn { background: var(--warning); }
.status-uptime-bar.down { background: var(--danger); }
.status-incidents { padding: 20px 24px; }
.status-incidents h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.status-incident { display: flex; gap: 12px; padding: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.status-incident-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); margin-top: 5px; flex-shrink: 0; }
.status-incident-dot.resolved { background: var(--text-soft); }
.status-incident-title { font-size: 13.5px; font-weight: 600; }
.status-incident-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.status-incident-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* Theme toggle button in topbar */
.theme-toggle-btn {
  background: linear-gradient(135deg, #1E293B, #334155);
  color: #FBBF24;
}
[data-theme="dark"] .theme-toggle-btn { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #92400E; }

/* Live audit pill */
.audit-live-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; padding: 3px 8px; background: rgba(34, 197, 94, 0.12); color: var(--success); border-radius: 10px; text-transform: uppercase; letter-spacing: 0.05em; margin-left: 8px; vertical-align: middle; }
.audit-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: audit-pulse 1.6s ease-in-out infinite; }
@keyframes audit-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); } 50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } }

/* Audit empty state */
.audit-empty { padding: 60px 24px; text-align: center; color: var(--text-muted); }
.audit-empty svg { color: var(--text-soft); opacity: 0.5; margin-bottom: 8px; }
.ae-title { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 4px; }
.ae-sub { font-size: 12.5px; margin-top: 4px; }

/* Service status banner */
.service-status-banner { position: fixed; bottom: 24px; right: 24px; z-index: 1000; background: #0F172A; color: white; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); max-width: 380px; animation: bannerSlideUp 0.3s ease; }
.ssb-inner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.ssb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25); animation: audit-pulse 1.6s ease-in-out infinite; }
.service-status-banner a { color: #FCD34D; font-weight: 600; cursor: pointer; }
.service-status-banner a:hover { text-decoration: underline; }
.ssb-close { background: rgba(255,255,255,0.1); border: none; color: white; width: 24px; height: 24px; border-radius: 6px; font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.ssb-close:hover { background: rgba(255,255,255,0.2); }
@keyframes bannerSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* SSO enforcement banner */
.sso-enforce-banner { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 999; background: linear-gradient(135deg, #1E1B4B, #312E81); color: white; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); font-size: 12.5px; max-width: 90vw; }
.seb-inner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.seb-inner svg { color: #C4B5FD; flex-shrink: 0; }

/* ============================================
   AI PILL
   ============================================ */
.ai-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 10px; background: linear-gradient(135deg, #8B5CF6, #EC4899); color: white; text-transform: uppercase; letter-spacing: 0.06em; margin-left: 8px; vertical-align: middle; }

/* ============================================
   SMART INBOX TRIAGE
   ============================================ */
.inbox-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.inbox-stat { padding: 16px 18px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; gap: 12px; }
.inbox-stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inbox-stat-icon svg { width: 20px; height: 20px; }
.inbox-stat-icon.needs { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.inbox-stat-icon.fyi { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.inbox-stat-icon.low { background: rgba(100, 116, 139, 0.1); color: var(--text-soft); }
.inbox-stat-icon.ai { background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15)); color: #8B5CF6; }
.inbox-stat-num { font-size: 22px; font-weight: 800; line-height: 1; }
.inbox-stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.inbox-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
.inbox-col { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-height: 400px; }
.inbox-col-head { padding: 12px 16px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.inbox-dot { width: 8px; height: 8px; border-radius: 50%; }
.inbox-col-head.needs-response .inbox-dot { background: var(--danger); }
.inbox-col-head.needs-response { color: var(--danger); }
.inbox-col-head.fyi .inbox-dot { background: var(--info); }
.inbox-col-head.fyi { color: var(--info); }
.inbox-col-head.low-priority .inbox-dot { background: var(--text-soft); }
.inbox-list { padding: 8px; }
.inbox-item { padding: 12px; border-radius: 8px; margin-bottom: 4px; transition: background 0.12s; cursor: pointer; }
.inbox-item:hover { background: var(--bg-soft); }
.inbox-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.inbox-item-title { font-size: 13px; font-weight: 600; flex: 1; }
.inbox-item-ai { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15)); color: #8B5CF6; flex-shrink: 0; }
.inbox-item-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; margin-bottom: 6px; }
.inbox-item-from { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-soft); }
.inbox-item-from .avatar { width: 18px; height: 18px; font-size: 9px; }
.inbox-item-actions { display: flex; gap: 4px; margin-top: 8px; }
.inbox-action { padding: 4px 8px; font-size: 11px; font-weight: 600; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-muted); cursor: pointer; }
.inbox-action:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
.inbox-action.primary { background: var(--primary); color: white; border-color: var(--primary); }
.inbox-action.primary:hover { opacity: 0.9; }

/* ============================================
   MEETINGS GENERATOR
   ============================================ */
.meetings-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
.meetings-list { display: flex; flex-direction: column; gap: 12px; }
.meeting-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; transition: all 0.15s; }
.meeting-card:hover { border-color: var(--text-soft); box-shadow: var(--shadow); }
.meeting-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.meeting-time { width: 70px; text-align: center; padding: 8px; background: var(--bg-soft); border-radius: 8px; flex-shrink: 0; }
.meeting-time-day { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.meeting-time-num { font-size: 22px; font-weight: 800; line-height: 1; margin: 2px 0; }
.meeting-time-month { font-size: 10px; color: var(--text-muted); }
.meeting-info { flex: 1; min-width: 0; }
.meeting-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.meeting-meta { font-size: 11.5px; color: var(--text-muted); display: flex; gap: 10px; align-items: center; }
.meeting-meta-item { display: flex; align-items: center; gap: 4px; }
.meeting-meta-item svg { width: 12px; height: 12px; }
.meeting-status { padding: 3px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.meeting-status.upcoming { background: var(--primary-50); color: var(--primary); }
.meeting-status.scheduled { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.meeting-status.draft { background: var(--slate-100); color: var(--text-muted); }
.meeting-agenda { font-size: 12.5px; color: var(--text-muted); padding: 10px 12px; background: var(--bg-soft); border-radius: 8px; border-left: 3px solid var(--primary); margin-top: 8px; }
.meeting-agenda strong { color: var(--text); }
.meeting-attendees { display: flex; align-items: center; gap: -6px; margin-top: 8px; }
.meeting-attendees .avatar { width: 24px; height: 24px; font-size: 9px; border: 2px solid var(--bg-elevated); margin-left: -6px; }
.meeting-attendees-more { font-size: 11px; color: var(--text-muted); margin-left: 8px; font-weight: 600; }
.meeting-actions { display: flex; gap: 6px; margin-top: 10px; }
.meeting-generator { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; position: sticky; top: 0; }
.mg-body { padding: 18px; }
.mg-field { margin-bottom: 12px; }
.mg-field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.mg-hint { float: right; text-transform: none; font-weight: 500; color: var(--text-soft); letter-spacing: 0; }
.mg-attendees { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; min-height: 42px; background: var(--bg-soft); }
.mg-attendee { display: flex; align-items: center; gap: 4px; padding: 3px 8px 3px 3px; background: var(--primary-50); color: var(--primary); border-radius: 14px; font-size: 11.5px; font-weight: 600; }
.mg-attendee .avatar { width: 18px; height: 18px; font-size: 9px; }
.mg-generate { width: 100%; padding: 10px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.mg-spark { animation: spark 2s ease-in-out infinite; }
@keyframes spark { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.2); } }
.mg-output { padding: 18px; border-top: 1px solid var(--border); background: linear-gradient(135deg, var(--primary-50), transparent); }
.mg-output-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.mg-output-items { font-size: 12.5px; }
.mg-output-item { padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; gap: 8px; }
.mg-output-item:last-child { border-bottom: none; }
.mg-output-item-num { font-weight: 700; color: var(--primary); flex-shrink: 0; }
.mg-output-item-time { color: var(--text-soft); font-size: 11px; margin-left: auto; }
.mg-output-actions { display: flex; gap: 6px; margin-top: 12px; }
.mg-output-actions .btn { flex: 1; }

/* ============================================
   ACTIVITY TIMELINE
   ============================================ */
.activity-toolbar { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.activity-search { flex: 1; min-width: 200px; }
.activity-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.activity-chip { padding: 6px 12px; font-size: 12px; font-weight: 600; border-radius: 16px; background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); cursor: pointer; transition: all 0.12s; }
.activity-chip:hover { color: var(--text); }
.activity-chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 8px; bottom: 0; width: 2px; background: var(--border); }
.timeline-day { position: relative; margin-bottom: 24px; }
.timeline-day-head { position: sticky; top: 0; background: var(--bg); padding: 6px 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.timeline-day-head::before { content: ''; position: absolute; left: -25px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--primary); z-index: 1; }
.timeline-day-name { font-size: 12px; font-weight: 700; color: var(--text); }
.timeline-day-count { font-size: 11px; color: var(--text-muted); padding: 2px 8px; background: var(--bg-elevated); border-radius: 10px; }
.timeline-item { position: relative; padding: 10px 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; margin-left: 12px; transition: all 0.12s; }
.timeline-item:hover { border-color: var(--text-soft); }
.timeline-item::before { content: ''; position: absolute; left: -25px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--primary); }
.timeline-item-icon { position: absolute; left: -29px; top: 12px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; }
.timeline-item-icon svg { width: 10px; height: 10px; color: var(--primary); }
.timeline-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.timeline-item-text { font-size: 13px; }
.timeline-item-text strong { font-weight: 600; }
.timeline-item-time { font-size: 11px; color: var(--text-soft); flex-shrink: 0; }
.timeline-item-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.timeline-item-meta .avatar { width: 18px; height: 18px; font-size: 9px; }

/* ============================================
   TEMPLATES MARKETPLACE
   ============================================ */
.templates-hero { padding: 24px; background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(236, 72, 153, 0.08)); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 20px; }
.templates-search { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; }
.templates-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.templates-search input { flex: 1; border: none; background: transparent; font-size: 14px; outline: none; color: var(--text); }
.templates-search input::placeholder { color: var(--text-soft); }
.templates-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.templates-cat { padding: 6px 12px; font-size: 12px; font-weight: 600; border-radius: 16px; background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); cursor: pointer; transition: all 0.12s; }
.templates-cat:hover { color: var(--text); }
.templates-cat.active { background: var(--primary); color: white; border-color: var(--primary); }
.templates-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.template-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: all 0.15s; cursor: pointer; }
.template-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.template-preview { height: 140px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.template-preview-bg { position: absolute; }
.tp-header { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(255,255,255,0.85); border-radius: 6px; }
.tp-title { font-size: 10px; font-weight: 700; color: #0F172A; }
.tp-row { display: flex; gap: 4px; }
.tp-card { flex: 1; padding: 8px 6px; background: rgba(255,255,255,0.85); border-radius: 5px; font-size: 8px; color: #475569; }
.tp-card-line { height: 4px; background: rgba(0,0,0,0.1); border-radius: 2px; margin-top: 3px; }
.tp-card-line.short { width: 60%; }
.template-body { padding: 14px 16px; }
.template-cat-badge { font-size: 10px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; }
.template-name { font-size: 14px; font-weight: 700; margin: 4px 0 2px; }
.template-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-bottom: 10px; }
.template-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }
.template-author { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.template-author .avatar { width: 20px; height: 20px; font-size: 10px; }
.template-stats { display: flex; gap: 10px; font-size: 11px; color: var(--text-soft); }
.template-stats span { display: flex; align-items: center; gap: 3px; }
.template-premium { position: absolute; top: 8px; right: 8px; padding: 3px 8px; background: linear-gradient(135deg, #F59E0B, #F97316); color: white; font-size: 9.5px; font-weight: 700; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.template-card { position: relative; }
.templates-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 32px; background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(236, 72, 153, 0.06)); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 20px; align-items: center; }
.tf-text h2 { font-size: 24px; font-weight: 800; margin: 12px 0 10px; }
.tf-text p { color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }
.tf-bullets { list-style: none; padding: 0; margin: 0 0 20px; }
.tf-bullets li { padding: 4px 0; font-size: 13px; color: var(--text); }
.tf-visual { position: relative; height: 240px; }
.tf-card-mini { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 14px; box-shadow: var(--shadow-md); position: absolute; }
.tf-card-mini:nth-child(1) { top: 0; left: 0; transform: rotate(-4deg); width: 200px; }
.tf-card-mini:nth-child(2) { top: 30px; right: 0; transform: rotate(3deg); width: 220px; z-index: 2; }
.tf-card-mini:nth-child(3) { bottom: 0; left: 40px; transform: rotate(-2deg); width: 180px; }
.tfcm-bar { height: 8px; background: var(--slate-100); border-radius: 4px; margin-bottom: 8px; }
.tfcm-bar.short { width: 60%; }

/* ============================================
   VOICE NOTES (in chat)
   ============================================ */
.chat-voice-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-soft); color: var(--text-muted); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.chat-voice-btn:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
.chat-voice-btn.recording { background: var(--danger); color: white; border-color: var(--danger); animation: voicePulse 1.4s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } }
.chat-voice-btn svg { width: 18px; height: 18px; }
.msg-voice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-width: 220px; }
.msg-voice-play { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; border: none; }
.msg-voice-play svg { width: 14px; height: 14px; }
.msg-voice-wave { flex: 1; display: flex; gap: 2px; align-items: center; height: 24px; }
.msg-voice-wave-bar { width: 3px; background: var(--primary); border-radius: 2px; opacity: 0.7; }
.msg-voice-wave-bar.played { opacity: 1; }
.msg-voice-time { font-size: 11px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.msg-row.me .msg-voice { color: white; }
.msg-row.me .msg-voice-wave-bar { background: white; }
.msg-row.me .msg-voice-time { color: rgba(255,255,255,0.8); }
.msg-row.me .msg-voice-play { background: white; color: var(--primary); }
.chat-recording-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.chat-recording-card { background: var(--bg-elevated); padding: 24px 28px; border-radius: 16px; display: flex; align-items: center; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.chat-recording-dot { width: 12px; height: 12px; background: var(--danger); border-radius: 50%; animation: voicePulse 1.2s ease-in-out infinite; }
.chat-recording-time { font-size: 22px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.chat-recording-stop { width: 44px; height: 44px; background: var(--primary); color: white; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-recording-stop:hover { background: var(--primary-600, var(--primary)); opacity: 0.9; }

/* ============================================
   WORKSPACE / CLIENT SPACE SWITCHER
   ============================================ */
.ws-switcher { display: flex; align-items: center; margin-right: 6px; }

/* ============================================
   ASANA-STYLE TASK GROUPING
   ============================================ */
.task-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.task-toolbar-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.task-toolbar-right { display: flex; align-items: center; gap: 6px; }
.task-group-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.task-group-pill:hover { background: var(--bg-elevated); border-color: var(--primary); }
.task-group-pill .pill-icon { width: 14px; height: 14px; color: var(--text-muted); }
.task-group-pill .pill-caret { color: var(--text-muted); }
.task-toolbar-divider { width: 1px; height: 22px; background: var(--border); }
.task-search-input { padding: 6px 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--text); width: 180px; font-family: inherit; }
.task-search-input:focus { outline: none; border-color: var(--primary); }
.task-view-toggle { display: flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.task-view-btn { padding: 4px 10px; background: transparent; border: none; border-radius: 5px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.task-view-btn.active { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
[data-theme="dark"] .task-view-btn.active { background: var(--slate-700); }

.task-group-menu { position: absolute; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; min-width: 200px; z-index: 100; }
.task-group-menu-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text); transition: background 0.1s; }
.task-group-menu-item:hover { background: var(--bg-soft); }
.task-group-menu-item.active { background: rgba(249, 115, 22, 0.1); color: var(--primary); font-weight: 600; }
.task-group-menu-item .check { width: 14px; height: 14px; color: var(--primary); margin-left: auto; }
.task-group-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.task-group-menu-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; }

.task-grouped { display: flex; flex-direction: column; gap: 18px; }
.task-group { background: transparent; }
.task-group-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 8px; cursor: pointer; user-select: none; border-radius: 8px; transition: background 0.15s; }
.task-group-head:hover { background: var(--bg-soft); }
.task-group-caret { width: 14px; height: 14px; color: var(--text-muted); transition: transform 0.2s; }
.task-group.collapsed .task-group-caret { transform: rotate(-90deg); }
.task-group-title { font-size: 12.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.task-group-color { width: 8px; height: 8px; border-radius: 50%; }
.task-group-count { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-soft); padding: 2px 8px; border-radius: 10px; font-family: 'JetBrains Mono', monospace; }
.task-group-sum { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.task-group-add { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 2px 6px; border-radius: 5px; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.task-group-head:hover .task-group-add { opacity: 1; }
.task-group-add:hover { color: var(--primary); background: rgba(249, 115, 22, 0.08); }
.task-group.collapsed .task-group-body { display: none; }
.task-group-body { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; }

.task-group-row { display: grid; grid-template-columns: 24px 28px 1.4fr 140px 120px 100px 80px 60px; gap: 12px; align-items: center; padding: 10px 14px 10px 18px; background: var(--bg-elevated); transition: background 0.1s; cursor: pointer; }
.task-group-row:hover { background: var(--bg-soft); }
.task-group-row.checked { background: rgba(34, 197, 94, 0.04); }
.task-group-row.checked .task-row-title { text-decoration: line-through; color: var(--text-muted); }
.task-group-row-head { background: var(--bg-soft); font-weight: 700; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 14px; cursor: default; }
.task-group-row-head:hover { background: var(--bg-soft); }
.task-row-check { width: 16px; height: 16px; border: 1.5px solid var(--border-strong); border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: white; flex-shrink: 0; transition: all 0.15s; }
.task-group-row-head .task-row-check { visibility: hidden; }
.task-row-check:hover { border-color: var(--primary); }
.task-row-check.checked { background: var(--success); border-color: var(--success); color: white; }
.task-row-check svg { width: 11px; height: 11px; opacity: 0; transition: opacity 0.1s; }
.task-row-check.checked svg { opacity: 1; }
.task-row-prio-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-row-title { font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 6px; min-width: 0; }
.task-row-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-tags { display: flex; gap: 3px; flex-shrink: 0; }
.task-row-tag { font-size: 9.5px; font-weight: 700; padding: 1.5px 6px; border-radius: 4px; }
.task-row-assignee { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); min-width: 0; }
.task-row-assignee .avatar { width: 22px; height: 22px; font-size: 9px; border: none; flex-shrink: 0; }
.task-row-assignee-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-due { font-size: 11.5px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.task-row-due.overdue { color: var(--danger); }
.task-row-due.today { color: var(--warning); }
.task-row-due-soon { color: var(--text-muted); }
.task-row-project { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; min-width: 0; }
.task-row-project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.task-row-loc {
  font-size: 11.5px; color: var(--text-muted, #64748B);
  display: flex; align-items: center; gap: 5px; min-width: 0;
  flex-wrap: nowrap; overflow: hidden;
}
.task-row-loc-space, .task-row-loc-folder {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 999px;
  font-weight: 600; font-size: 10.5px;
  white-space: nowrap; max-width: 100px;
  overflow: hidden; text-overflow: ellipsis;
  border: 1px solid transparent;
  cursor: pointer; transition: transform 0.12s, border-color 0.12s, background 0.12s;
  font-family: inherit;
}
.task-row-loc-space:hover { transform: translateY(-1px); border-color: #F97316; }
.task-row-loc-folder:hover { transform: translateY(-1px); border-color: #94A3B8; }
.task-row-loc-space.active { background: #F97316; color: white; box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4); }
.task-row-loc-folder.active { background: #475569; color: white; box-shadow: 0 2px 6px rgba(71, 85, 105, 0.4); }
.task-row-loc-space-loc, .task-row-loc-folder-loc {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  font-weight: 600; font-size: 10.5px;
  white-space: nowrap;
  border: 1px solid;
}
.task-row-loc-space {
  background: rgba(249, 115, 22, 0.1); color: #C2410C;
}
.task-row-loc-folder {
  background: var(--bg-soft, #F1F5F9); color: var(--text-muted, #475569);
}
.task-row-loc-sep { color: var(--text-soft, #94A3B8); font-weight: 400; }
.task-row-loc-empty { color: var(--text-soft, #94A3B8); font-style: italic; font-size: 11px; }

/* Inline location chips under the task title (more prominent) */
.task-row-loc-inline {
  display: flex; align-items: center; gap: 6px;
  margin-top: 5px; flex-wrap: wrap;
}
.task-row-loc-space-inline, .task-row-loc-folder-inline {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-weight: 700; font-size: 11px;
  white-space: nowrap; max-width: 100%;
  border: 1.5px solid;
  cursor: pointer; font-family: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.task-row-loc-space-inline:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25); }
.task-row-loc-folder-inline:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(71, 85, 105, 0.2); }
.task-row-loc-emoji { font-size: 12px; }

.task-filter-bar { margin-bottom: 10px; }
.task-filter-bar-inner {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), rgba(139, 92, 246, 0.04));
  border: 1px dashed rgba(249, 115, 22, 0.3);
  border-radius: 10px;
}
.task-filter-label { font-size: 11px; font-weight: 700; color: var(--text-muted, #64748B); text-transform: uppercase; letter-spacing: 0.04em; }
.task-filter-sep { color: var(--text-soft, #94A3B8); font-weight: 600; }
.task-filter-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
  transition: transform 0.12s, border-color 0.12s;
}
.task-filter-chip:hover { transform: translateY(-1px); border-color: currentColor; }
.task-filter-clear {
  margin-left: auto;
  background: transparent; border: 1px solid var(--border, #E2E8F0);
  padding: 4px 10px; border-radius: 6px;
  font: inherit; font-size: 11px; font-weight: 600;
  color: var(--text-muted, #64748B); cursor: pointer;
}
.task-filter-clear:hover { background: var(--bg-soft, #F1F5F9); color: var(--text); }
.task-row-progress { display: flex; align-items: center; gap: 6px; }
.task-row-progress-bar { flex: 1; height: 5px; background: var(--slate-100); border-radius: 3px; overflow: hidden; }
[data-theme="dark"] .task-row-progress-bar { background: var(--slate-700); }
.task-row-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.task-row-progress-num { font-size: 10.5px; font-weight: 700; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; min-width: 28px; text-align: right; }
.task-row-timer { width: 26px; height: 26px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.task-row-timer:hover { color: var(--primary); border-color: var(--primary); }
.task-row-timer.running { background: var(--primary); color: white; border-color: var(--primary); }
.task-row-timer svg { width: 13px; height: 13px; }
.task-row-subtasks { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.task-row-subtasks svg { width: 11px; height: 11px; }
.task-row-subtasks.done { color: var(--success); }
/* ============================================
   SETTINGS → INTEGRATIONS
   ============================================ */
.int-settings-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; padding: 16px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; }
.int-settings-stat { text-align: center; }
.int-settings-stat-num { font-size: 28px; font-weight: 800; color: var(--text); font-family: 'JetBrains Mono', monospace; letter-spacing: -0.02em; }
.int-settings-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.int-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.int-cat-btn { padding: 7px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.int-cat-btn:hover { color: var(--text); border-color: var(--primary); }
.int-cat-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.int-cat-btn span { font-size: 10.5px; opacity: 0.8; margin-left: 2px; }
.int-settings-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.int-settings-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; transition: all 0.18s; }
.int-settings-row:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.int-settings-row.connected { background: linear-gradient(135deg, rgba(34, 197, 94, 0.02), rgba(59, 130, 246, 0.02)); }
.int-settings-info { flex: 1; min-width: 0; }
.int-settings-name { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.int-settings-cat { font-size: 9.5px; font-weight: 700; color: var(--text-muted); background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.int-settings-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.int-settings-meta.connected { color: var(--success); font-weight: 600; }
.int-settings-actions { display: flex; gap: 6px; flex-shrink: 0; }
.settings-page-head h2 { font-size: 22px; font-weight: 800; color: var(--text); margin: 0; letter-spacing: -0.02em; }
.settings-page-head p { font-size: 13.5px; color: var(--text-muted); margin: 4px 0 0; }

/* ============================================
   TIMESHEET
   ============================================ */
.ts-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.ts-stat { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; }
.ts-stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.ts-stat-icon svg { width: 20px; height: 20px; }
.ts-stat-icon.green { background: linear-gradient(135deg, #10B981, #34D399); }
.ts-stat-icon.blue { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
.ts-stat-icon.purple { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.ts-stat-icon.orange { background: linear-gradient(135deg, #F97316, #FB923C); }
.ts-stat-num { font-size: 22px; font-weight: 800; color: var(--text); font-family: 'JetBrains Mono', monospace; letter-spacing: -0.02em; line-height: 1; }
.ts-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ts-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ts-toolbar-left, .ts-toolbar-right { display: flex; align-items: center; gap: 6px; }
.ts-toolbar-right { margin-left: auto; }
.ts-select { padding: 6px 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text); font-family: inherit; cursor: pointer; }
.ts-select:focus { outline: none; border-color: var(--primary); }
.ts-grid-wrap { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: auto; }
.ts-grid { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
.ts-grid th, .ts-grid td { padding: 10px 12px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 12.5px; color: var(--text); text-align: center; }
.ts-grid th { background: var(--bg-soft); font-weight: 700; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; position: sticky; top: 0; z-index: 2; }
.ts-grid th:first-child, .ts-grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-elevated); z-index: 1; min-width: 240px; }
.ts-grid th:first-child { background: var(--bg-soft); z-index: 3; }
.ts-grid td.row-group { background: var(--bg-soft); font-weight: 700; text-align: left; }
.ts-grid td.row-total { background: var(--bg-soft); font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.ts-grid th.col-total { background: var(--bg-soft); font-weight: 800; color: var(--text); }
.ts-grid td.cell { cursor: pointer; transition: all 0.15s; padding: 0; height: 44px; }
.ts-grid td.cell:hover { background: rgba(249, 115, 22, 0.05); }
.ts-grid td.cell .cell-content { display: flex; align-items: center; justify-content: center; gap: 3px; height: 100%; padding: 4px; }
.ts-cell-bar { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.ts-cell-bar-billable { height: 14px; background: linear-gradient(90deg, #10B981, #34D399); border-radius: 3px; display: flex; align-items: center; justify-content: center; color: white; font-size: 10px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.ts-cell-bar-nonbillable { height: 14px; background: linear-gradient(90deg, #94A3B8, #CBD5E1); border-radius: 3px; display: flex; align-items: center; justify-content: center; color: white; font-size: 10px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.ts-cell-bar-empty { height: 28px; color: var(--text-muted); font-size: 11px; }
.ts-cell-bar-empty:hover { color: var(--primary); }
.ts-grid tr.weekend th, .ts-grid tr.weekend td { background: var(--bg-soft); }
[data-theme="dark"] .ts-grid tr.weekend th, [data-theme="dark"] .ts-grid tr.weekend td { background: rgba(255,255,255,0.02); }
.ts-day-header { display: flex; flex-direction: column; gap: 2px; }
.ts-day-header-day { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.ts-day-header-date { font-size: 13px; font-weight: 800; color: var(--text); }
.ts-day-header.today .ts-day-header-date { color: var(--primary); }
.ts-day-header.today .ts-day-header-day { color: var(--primary); }
.cf-field-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; transition: all 0.15s; }
.cf-field-card:hover { border-color: var(--primary); }
.cf-field-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: white; font-size: 16px; font-weight: 800; }
.cf-field-icon.text { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
.cf-field-icon.number { background: linear-gradient(135deg, #10B981, #34D399); }
.cf-field-icon.date { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.cf-field-icon.dropdown { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.cf-field-icon.multiselect { background: linear-gradient(135deg, #EC4899, #F472B6); }
.cf-field-icon.person { background: linear-gradient(135deg, #06B6D4, #22D3EE); }
.cf-field-icon.checkbox { background: linear-gradient(135deg, #14B8A6, #2DD4BF); }
.cf-field-icon.url { background: linear-gradient(135deg, #F97316, #FB923C); }
.cf-field-icon.currency { background: linear-gradient(135deg, #6366F1, #818CF8); }
.cf-field-info { flex: 1; min-width: 0; }
.cf-field-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cf-field-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.cf-field-actions { display: flex; gap: 4px; }
.cf-modal-field-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.cf-modal-field-row label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cf-modal-field-row input, .cf-modal-field-row select, .cf-modal-field-row textarea { padding: 9px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text); font-family: inherit; }
.cf-modal-field-row input:focus, .cf-modal-field-row select:focus { outline: none; border-color: var(--primary); }
.cf-type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cf-type-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; background: var(--bg-soft); border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.15s; text-align: center; }
.cf-type-pick:hover { border-color: var(--primary); background: var(--bg-elevated); }
.cf-type-pick.active { border-color: var(--primary); background: rgba(249, 115, 22, 0.06); }
.cf-type-pick-icon { font-size: 20px; }
.cf-type-pick-label { font-size: 11px; font-weight: 600; color: var(--text); }
.cf-options-editor { display: flex; flex-direction: column; gap: 6px; }
.cf-option-row { display: flex; align-items: center; gap: 8px; }
.cf-option-row input { flex: 1; }
.cf-value-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 600; }
.cf-value-chip.text { background: rgba(59, 130, 246, 0.12); color: #2563EB; }
.cf-value-chip.number { background: rgba(16, 185, 129, 0.12); color: #059669; }
.cf-value-chip.date { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.cf-value-chip.dropdown { background: rgba(139, 92, 246, 0.12); color: #7C3AED; }
.cf-value-chip.multiselect { background: rgba(236, 72, 153, 0.12); color: #DB2777; }
.cf-value-chip.person { background: rgba(6, 182, 212, 0.12); color: #0891B2; }
.cf-value-chip.checkbox { background: rgba(20, 184, 166, 0.12); color: #0D9488; }
.cf-value-chip.url { background: rgba(249, 115, 22, 0.12); color: #EA580C; }
.cf-value-chip.currency { background: rgba(99, 102, 241, 0.12); color: #4F46E5; }
.cf-applies-tab { display: flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 8px; }
.cf-applies-tab button { padding: 6px 12px; background: transparent; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; font-family: inherit; }
.cf-applies-tab button.active { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
[data-theme="dark"] .cf-applies-tab button.active { background: var(--slate-700); }

.dict-tabs { display: flex; gap: 4px; padding: 4px 16px; background: transparent; overflow-x: auto; border-bottom: 1px solid var(--border); }
.dict-cat-tab { padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: transparent; border: none; border-radius: 6px 6px 0 0; cursor: pointer; transition: all 0.2s; font-family: inherit; border-bottom: 2px solid transparent; white-space: nowrap; }
.dict-cat-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.dict-cat-tab:hover:not(.active) { color: var(--text); background: var(--bg-soft); }
.dict-row { display: grid; grid-template-columns: 1.5fr 1.5fr 1fr 90px 100px 80px; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.dict-row:hover { background: var(--bg-soft); }
.dict-row:last-child { border-bottom: none; }
.dict-row-head { background: var(--bg-soft); font-weight: 700; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dict-row-head:hover { background: var(--bg-soft); }
.dict-word { font-size: 13.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.dict-hint { font-size: 11.5px; color: var(--text-muted); font-style: italic; }
.dict-cat { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; display: inline-block; }
.dict-cat.product { background: rgba(249, 115, 22, 0.12); color: var(--primary); }
.dict-cat.client { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }
.dict-cat.acronym { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.dict-cat.technical { background: rgba(20, 184, 166, 0.12); color: #14B8A6; }
.dict-cat.jargon { background: rgba(236, 72, 153, 0.12); color: #EC4899; }
.dict-cat.name { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.dict-uses { font-size: 11.5px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', monospace; text-align: right; }
.dict-owner { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); }
.dict-owner .avatar { width: 20px; height: 20px; font-size: 8.5px; border: none; }
.dict-share { display: flex; align-items: center; gap: 4px; }
.dict-share-toggle { width: 30px; height: 16px; background: var(--slate-200); border-radius: 9px; position: relative; cursor: pointer; transition: background 0.2s; }
.dict-share-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: white; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.dict-share-toggle.shared { background: var(--success); }
.dict-share-toggle.shared::after { transform: translateX(14px); }
.dict-actions { display: flex; gap: 4px; justify-content: flex-end; }
.dict-icon-btn { width: 24px; height: 24px; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.dict-icon-btn:hover { background: var(--bg-elevated); color: var(--text); }
.dict-icon-btn.danger:hover { color: var(--danger); }
.dict-icon-btn svg { width: 13px; height: 13px; }

.dict-add-modal { display: flex; flex-direction: column; gap: 14px; padding: 8px 4px; }
.dict-add-modal label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; display: block; }
.dict-add-modal input, .dict-add-modal select, .dict-add-modal textarea { width: 100%; padding: 9px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text); font-family: inherit; transition: border-color 0.15s; }
.dict-add-modal input:focus, .dict-add-modal select:focus, .dict-add-modal textarea:focus { outline: none; border-color: var(--primary); }
.dict-add-modal .dict-preview { padding: 10px 12px; background: var(--bg-soft); border-radius: 8px; font-size: 12px; color: var(--text-muted); }
.dict-add-modal .dict-preview strong { color: var(--text); font-family: 'JetBrains Mono', monospace; }

.voice-train-grid { display: flex; flex-direction: column; gap: 14px; }
.voice-train-step { display: flex; gap: 14px; padding: 16px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; }
.voice-train-num { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #FB923C); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.voice-train-content { flex: 1; min-width: 0; }
.voice-train-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.voice-train-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.voice-train-progress { height: 6px; background: var(--slate-200); border-radius: 3px; overflow: hidden; margin-top: 10px; }
[data-theme="dark"] .voice-train-progress { background: var(--slate-700); }
.voice-train-bar { height: 100%; background: linear-gradient(90deg, var(--primary), #FB923C); border-radius: 3px; transition: width 0.5s; }
.voice-train-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-weight: 600; }

.voice-acc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.voice-acc-row:last-child { border-bottom: none; }
.voice-acc-name { font-size: 12.5px; font-weight: 600; color: var(--text); min-width: 130px; }
.voice-acc-bar { flex: 1; height: 8px; background: var(--slate-100); border-radius: 4px; overflow: hidden; }
[data-theme="dark"] .voice-acc-bar { background: var(--slate-700); }
.voice-acc-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.voice-acc-num { font-size: 13px; font-weight: 800; color: var(--text); font-family: 'JetBrains Mono', monospace; min-width: 42px; text-align: right; }
@keyframes spin { to { transform: rotate(360deg); } }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.int-card { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; transition: all 0.18s; cursor: pointer; position: relative; }
.int-card:hover { transform: translateY(-1px); border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.int-card.connected { background: var(--bg-elevated); }
.int-card.connected::after { content: ''; position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 2px var(--bg-elevated); }
.int-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.int-icon svg { width: 20px; height: 20px; }
.int-icon.gcal { background: linear-gradient(135deg, #4285F4, #1A73E8); color: white; }
.int-icon.zoom { background: #2D8CFF; color: white; }
.int-icon.gmeet { background: linear-gradient(135deg, #00897B, #34A853); color: white; }
.int-icon.slack { background: linear-gradient(135deg, #4A154B, #611f69); color: white; }
.int-icon.gh { background: #181717; color: white; }
.int-icon.figma { background: linear-gradient(135deg, #F24E1E, #A259FF); color: white; padding: 2px; }
.int-icon.figma svg { width: 16px; height: 16px; }
.int-icon.notion { background: #FFFFFF; color: #000000; border: 1px solid var(--border); }
.int-icon.jira { background: #0052CC; color: white; }
.int-icon.linear { background: linear-gradient(135deg, #5E6AD2, #4654C0); color: white; }
.int-icon.teams { background: linear-gradient(135deg, #4B53BC, #7B83EB); color: white; }
.int-icon.drive { background: linear-gradient(135deg, #F4B400 0%, #F9AB00 50%, #FBBC04 100%); color: white; }
.int-icon.computax { background: linear-gradient(135deg, #0066B3, #003F7F); color: white; }
.int-icon.zohobooks { background: linear-gradient(135deg, #E42528, #FF6B6B); color: white; }
[data-theme="dark"] .int-icon.notion { background: #2F3437; color: #FFFFFF; }
.int-body { flex: 1; min-width: 0; }
.int-name { font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.int-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.int-meta.connected { color: var(--success); font-weight: 600; }
.int-action { font-size: 10.5px; font-weight: 700; color: var(--primary); padding: 3px 8px; background: rgba(249, 115, 22, 0.08); border-radius: 6px; flex-shrink: 0; }
.int-action.connected { background: var(--slate-100); color: var(--text-muted); }
[data-theme="dark"] .int-action.connected { background: var(--slate-700); }
.int-card.connected:hover .int-action.connected { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

.int-browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.int-browse { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; text-align: center; cursor: pointer; transition: all 0.15s; }
.int-browse:hover { transform: translateY(-2px); border-color: var(--primary); }
.int-browse .int-icon { width: 32px; height: 32px; }
.int-browse-name { font-size: 11px; font-weight: 600; color: var(--text); }
.skills-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 10px; margin-bottom: 16px; width: fit-content; border: 1px solid var(--border); }
.skills-tab { padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: transparent; border: none; border-radius: 7px; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.skills-tab.active { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.skills-tab:hover:not(.active) { color: var(--text); }
[data-theme="dark"] .skills-tab.active { background: var(--slate-700); }

.skill-bench-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.skill-bench-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 16px; transition: all 0.2s; }
.skill-bench-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.skill-bench-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.skill-bench-avatar { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.skill-bench-name { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.skill-bench-role { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.skill-bench-row { margin-bottom: 10px; }
.skill-bench-row:last-child { margin-bottom: 0; }
.skill-bench-row-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.skill-bench-row-label { font-size: 11.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; }
.skill-bench-row-val { font-size: 11.5px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.skill-bench-bar { position: relative; height: 7px; background: var(--slate-100); border-radius: 4px; overflow: hidden; }
[data-theme="dark"] .skill-bench-bar { background: var(--slate-700); }
.skill-bench-fill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 4px; transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.skill-bench-marker { position: absolute; top: -2px; height: 11px; width: 2px; background: var(--text); border-radius: 1px; }
.skill-bench-marker-label { position: absolute; top: -18px; transform: translateX(-50%); font-size: 9px; font-weight: 700; color: var(--text-muted); white-space: nowrap; letter-spacing: 0.02em; }
.skill-bench-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.skill-bench-delta.up { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.skill-bench-delta.down { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.skill-bench-delta.flat { background: var(--slate-100); color: var(--text-muted); }
.skill-bench-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; padding: 12px 16px; background: var(--bg-soft); border-radius: 12px; border: 1px solid var(--border); }
.skill-bench-stat { text-align: center; }
.skill-bench-stat-num { font-size: 20px; font-weight: 800; color: var(--text); font-family: 'JetBrains Mono', monospace; letter-spacing: -0.02em; }
.skill-bench-stat-label { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; font-weight: 600; }
.skill-bench-leaderboard { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 16px; }
.skill-bench-leaderboard h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.skill-bench-leader { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-soft); border-radius: 8px; margin-bottom: 6px; transition: all 0.15s; }
.skill-bench-leader:hover { background: var(--bg-elevated); }
.skill-bench-leader-rank { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.skill-bench-leader-rank.gold { background: linear-gradient(135deg, #FCD34D, #F59E0B); color: white; }
.skill-bench-leader-rank.silver { background: linear-gradient(135deg, #E5E7EB, #9CA3AF); color: white; }
.skill-bench-leader-rank.bronze { background: linear-gradient(135deg, #D97706, #92400E); color: white; }
.skill-bench-leader-rank.norm { background: var(--slate-100); color: var(--text-muted); }
[data-theme="dark"] .skill-bench-leader-rank.norm { background: var(--slate-700); }
.skill-bench-leader-body { flex: 1; min-width: 0; }
.skill-bench-leader-name { font-size: 12.5px; font-weight: 700; color: var(--text); }
.skill-bench-leader-skill { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.skill-bench-leader-score { font-size: 14px; font-weight: 800; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.skill-radar-wrap { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 16px; }
.skill-radar-wrap h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }
.skill-radar-select { padding: 5px 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--text); cursor: pointer; font-family: inherit; }

.skill-gap-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-soft); border-radius: 8px; margin-bottom: 6px; }
.skill-gap-bar-wrap { flex: 1; height: 8px; background: var(--slate-100); border-radius: 4px; position: relative; overflow: visible; }
[data-theme="dark"] .skill-gap-bar-wrap { background: var(--slate-700); }
.skill-gap-bar { position: absolute; top: 0; left: 0; height: 100%; border-radius: 4px; }
.skill-gap-benchmark { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); border-radius: 1px; }
.skill-gap-name { font-size: 12.5px; font-weight: 700; color: var(--text); min-width: 130px; }
.skill-gap-nums { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; min-width: 100px; text-align: right; }
.skill-gap-pill { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 8px; min-width: 60px; text-align: center; }
.gcal-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.gcal-banner.connected { background: linear-gradient(135deg, rgba(66, 133, 244, 0.05), rgba(52, 168, 83, 0.05)); border-color: rgba(66, 133, 244, 0.2); }
.gcal-icon { width: 36px; height: 36px; border-radius: 8px; background: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.gcal-icon svg { width: 22px; height: 22px; }
.gcal-content { flex: 1; min-width: 0; }
.gcal-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.gcal-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.gcal-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; }
.gcal-status.connected { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.gcal-status.disconnected { background: var(--slate-100); color: var(--text-muted); }
.gcal-events-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.gcal-event { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; }
.gcal-event-time { font-size: 11.5px; font-weight: 700; color: var(--text); min-width: 90px; font-family: 'JetBrains Mono', monospace; }
.gcal-event-bar { width: 3px; height: 32px; border-radius: 2px; background: var(--info); flex-shrink: 0; }
.gcal-event-bar.meeting { background: var(--info); }
.gcal-event-bar.focus { background: var(--purple); }
.gcal-event-bar.personal { background: var(--success); }
.gcal-event-bar.deadline { background: var(--danger); }
.gcal-event-body { flex: 1; min-width: 0; }
.gcal-event-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcal-event-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.gcal-event-badge { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--info-50); color: var(--info); flex-shrink: 0; }
.gcal-connect-modal { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.gcal-perm-list { display: flex; flex-direction: column; gap: 8px; }
.gcal-perm { display: flex; align-items: flex-start; gap: 10px; padding: 10px; background: var(--bg-soft); border-radius: 8px; }
.gcal-perm-icon { width: 24px; height: 24px; border-radius: 6px; background: var(--bg-elevated); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gcal-perm-icon svg { width: 14px; height: 14px; }
.gcal-perm-text { font-size: 12.5px; }
.gcal-perm-text strong { display: block; font-weight: 700; color: var(--text); }
.gcal-perm-text span { color: var(--text-muted); font-size: 11.5px; }
.gcal-google-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px; background: white; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600; color: #1F1F1F; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.gcal-google-btn:hover { background: #F8F9FA; border-color: #DADCE0; }
.gcal-google-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .gcal-google-btn { background: #1F1F1F; color: #E8EAED; border-color: #3C4043; }
[data-theme="dark"] .gcal-google-btn:hover { background: #2D2E30; }

/* Workspace Switcher Dropdown */
.ws-switcher-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer; transition: all 0.15s; text-align: left; font-family: inherit; color: inherit; }
.ws-switcher-btn:hover { background: var(--slate-100); border-color: var(--border); }
.ws-dropdown { position: absolute; top: calc(100% + 6px); left: 12px; right: 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.04); z-index: 100; overflow: hidden; animation: wsDropdownIn 0.18s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes wsDropdownIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.ws-dropdown-head { padding: 10px 14px 6px; font-size: 10.5px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.ws-dropdown-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: transparent; border: none; cursor: pointer; transition: background 0.12s; text-align: left; font-family: inherit; color: var(--text); }
.ws-dropdown-opt:hover { background: var(--bg-soft); }
.ws-dropdown-opt.active { background: var(--primary-50); }
.wsdo-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.wsdo-info { flex: 1; min-width: 0; }
.wsdo-name { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.wsdo-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.wsdo-check { color: var(--primary); flex-shrink: 0; opacity: 0; transition: opacity 0.15s; }
.ws-dropdown-opt.active .wsdo-check { opacity: 1; }
.ws-dropdown-foot { padding: 8px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.ws-dropdown-link { width: 100%; padding: 6px 8px; background: transparent; border: none; font-size: 11.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; text-align: left; border-radius: 6px; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.ws-dropdown-link:hover { color: var(--text); background: var(--bg-elevated); }

.ws-dropdown-create { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: transparent; border: none; cursor: pointer; transition: background 0.12s; text-align: left; font-family: inherit; color: var(--primary); margin-top: 2px; border-top: 1px dashed var(--border); border-radius: 0; }
.ws-dropdown-create:hover, .ws-dropdown-create:focus-visible { background: var(--primary-50); outline: none; }
.ws-dropdown-create .wsdo-create-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(249, 115, 22, 0.12); color: var(--primary); }
.ws-dropdown-create .wsdo-create-text { font-size: 12.5px; font-weight: 700; }
.ws-dropdown-create .wsdo-create-kbd { margin-left: auto; font-size: 10px; color: var(--text-soft); background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }

.ws-new-form { display: flex; flex-direction: column; gap: 12px; }
.ws-new-form label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }
.ws-new-form input, .ws-new-form select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; background: var(--bg-elevated); color: var(--text); }
.ws-new-form input:focus, .ws-new-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); }
.ws-new-row { display: flex; gap: 8px; align-items: center; }
.ws-new-row label { flex: 1; }
.ws-color-dot { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; flex-shrink: 0; transition: transform 0.12s, border-color 0.12s; }
.ws-color-dot:hover { transform: scale(1.08); }
.ws-color-dot.selected { border-color: var(--text); transform: scale(1.05); }
.ws-new-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; font-size: 12.5px; flex-wrap: wrap; }
.breadcrumb-item { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; color: var(--text-muted); cursor: pointer; transition: all 0.12s; font-weight: 500; }
.breadcrumb-item:hover { background: var(--bg-soft); color: var(--text); }
.breadcrumb-item.current { color: var(--text); font-weight: 700; background: var(--primary-50); }
.breadcrumb-item .bi-emoji { font-size: 14px; }
.breadcrumb-sep { color: var(--text-soft); font-size: 10px; opacity: 0.5; }

/* ============================================
   FOLDERS VIEW
   ============================================ */
.folders-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: flex-start; }
.folders-tree { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; position: sticky; top: 0; }
.folders-tree-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.folders-tree-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.folders-tree-count { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 2px 8px; background: var(--bg-elevated); border-radius: 10px; }
.folders-tree-list { padding: 6px; max-height: calc(100vh - 200px); overflow-y: auto; }
.folder-tree-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: all 0.12s; margin-bottom: 2px; }
.folder-tree-item:hover { background: var(--bg-soft); }
.folder-tree-item.active { background: var(--primary-50); }
.folder-tree-item .fti-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.folder-tree-item .fti-info { flex: 1; min-width: 0; }
.folder-tree-item .fti-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-tree-item.active .fti-name { color: var(--primary); }
.folder-tree-item .fti-meta { font-size: 10.5px; color: var(--text-soft); }
.folder-tree-item .fti-chevron { width: 16px; height: 16px; color: var(--text-soft); transition: transform 0.2s; flex-shrink: 0; }
.folder-tree-item.expanded .fti-chevron { transform: rotate(90deg); }
.folder-tree-children { padding-left: 18px; margin: 4px 0 4px 10px; border-left: 2px solid var(--border); }
.folder-tree-children .folder-tree-item { padding: 6px 10px; }
.folder-tree-children .folder-tree-item .fti-icon { width: 24px; height: 24px; font-size: 12px; }

.folders-detail { min-height: 400px; }
.folder-header { background: linear-gradient(135deg, var(--folder-color, #F97316) 0%, color-mix(in srgb, var(--folder-color, #F97316) 70%, white) 100%); color: white; border-radius: 14px; padding: 24px; margin-bottom: 16px; }
.folder-header-top { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.folder-header-icon { width: 56px; height: 56px; background: rgba(255,255,255,0.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; backdrop-filter: blur(8px); }
.folder-header-info { flex: 1; }
.folder-header-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.folder-header-desc { font-size: 13px; opacity: 0.9; }
.folder-header-stats { display: flex; gap: 18px; }
.folder-header-stat { background: rgba(255,255,255,0.15); padding: 8px 12px; border-radius: 8px; backdrop-filter: blur(8px); }
.folder-header-stat-num { font-size: 18px; font-weight: 800; }
.folder-header-stat-label { font-size: 10.5px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.04em; }

.folder-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fp-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: all 0.15s; cursor: pointer; }
.fp-card:hover { border-color: var(--text-soft); transform: translateY(-2px); box-shadow: var(--shadow); }
.fp-cover { height: 90px; padding: 14px; position: relative; }
.fp-cover-icon { width: 36px; height: 36px; background: rgba(255,255,255,0.25); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; backdrop-filter: blur(8px); }
.fp-cover-icon svg { width: 18px; height: 18px; }
.fp-body { padding: 12px 14px; }
.fp-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); }
.fp-name { font-size: 14px; font-weight: 700; margin: 4px 0 8px; }
.fp-progress { height: 5px; background: var(--slate-100); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.fp-progress-bar { height: 100%; background: linear-gradient(90deg, #F97316, #FB923C); border-radius: 3px; }
.fp-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.fp-pct { font-weight: 700; color: var(--text); }
.fp-due { font-size: 10.5px; }
.fp-team { display: flex; align-items: center; gap: 2px; }
.fp-team .avatar { width: 18px; height: 18px; font-size: 8px; border: 1.5px solid var(--bg-elevated); margin-left: -4px; }
.fp-team .avatar:first-child { margin-left: 0; }

.fp-tasks { padding: 10px 14px; background: var(--bg-soft); border-top: 1px solid var(--border); }
.fp-tasks-head { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 6px; }
.fp-task-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 12px; }
.fp-task-row .tag { font-size: 9px; padding: 1px 5px; }
.fp-task-row .ft-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.fp-task-row.done { text-decoration: line-through; color: var(--text-soft); }

.fp-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }

.folder-detail-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); background: var(--bg-elevated); border: 1px dashed var(--border); border-radius: 12px; }
.folder-detail-empty h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.folder-detail-empty p { font-size: 13px; margin-bottom: 16px; }

.folder-action-btn { padding: 6px 12px; background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; backdrop-filter: blur(8px); }
.folder-action-btn:hover { background: rgba(255,255,255,0.3); }
.ws-switch-track { position: relative; display: flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 0; box-shadow: inset 0 1px 2px rgba(0,0,0,0.04); width: 100%; min-width: 220px; }
[data-theme="dark"] .ws-switch-track { background: #0F172A; }
[data-theme="dark"] .ws-name { color: #F1F5F9; }
[data-theme="dark"] .ws-plan { color: #94A3B8; }
[data-theme="dark"] .ws-switcher { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .ws-switcher:hover { background: rgba(255,255,255,0.08); }
.ws-switch-opt { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 8px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: transparent; border: none; border-radius: 6px; cursor: pointer; transition: color 0.2s, transform 0.15s; white-space: nowrap; font-family: inherit; letter-spacing: -0.01em; flex: 1 1 0%; min-width: 0; }
.ws-switch-opt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-switch-opt svg { flex-shrink: 0; opacity: 0.7; transition: opacity 0.2s; }
.ws-switch-opt:hover { color: var(--text); }
.ws-switch-opt:hover svg { opacity: 1; }
.ws-switch-opt.active { color: white; }
.ws-switch-opt.active svg { opacity: 1; }
.ws-switch-opt.active .ws-upgrade-badge { background: rgba(255,255,255,0.25); color: white; }
.ws-upgrade-badge { display: inline-flex; align-items: center; font-size: 8.5px; font-weight: 800; padding: 2px 4px; background: linear-gradient(135deg, #F59E0B, #F97316); color: white; border-radius: 4px; letter-spacing: 0.04em; line-height: 1; flex-shrink: 0; }
.ws-switch-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: linear-gradient(135deg, #F97316, #FB923C); border-radius: 6px; transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.28s; z-index: 1; box-shadow: 0 2px 8px rgba(249, 115, 22, 0.35), 0 0 0 1px rgba(255,255,255,0.1) inset; pointer-events: none; }
.ws-switch-track.in-client .ws-switch-thumb { transform: translateX(100%); background: linear-gradient(135deg, #8B5CF6, #A78BFA); box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35), 0 0 0 1px rgba(255,255,255,0.1) inset; }
.ws-switch-track.in-client .ws-switch-opt[data-space="client"] { color: white; }
.ws-switch-track.in-client .ws-switch-opt[data-space="workspace"] { color: var(--text-muted); }

/* Client Space Banner */
.client-space-banner { background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 50%, #C084FC 100%); color: white; padding: 10px 24px; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2); }
.csb-inner { display: flex; align-items: center; gap: 14px; max-width: 1400px; margin: 0 auto; }
.csb-icon { width: 32px; height: 32px; background: rgba(255,255,255,0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.csb-content { flex: 1; min-width: 0; }
.csb-title { font-size: 13.5px; font-weight: 700; }
.csb-sub { font-size: 11.5px; opacity: 0.85; }
.csb-action { padding: 6px 12px; background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.csb-action:hover { background: rgba(255,255,255,0.3); }
.csb-back { padding: 6px 12px; background: white; color: #8B5CF6; border: none; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; transition: transform 0.12s; }
.csb-back:hover { transform: translateX(-2px); }

/* Client Space Mode Styles */
body.client-space-mode { background: #FAFBFC; }
body.client-space-mode .sidebar { display: none; }
body.client-space-mode .app { grid-template-columns: 1fr; }
body.client-space-mode .main { padding: 20px 32px; max-width: 1200px; margin: 0 auto; width: 100%; }
body.client-space-mode .topbar { background: rgba(255,255,255,0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
body.client-space-mode .topbar .search { max-width: 400px; }
body.client-space-mode .sidebar-footer { display: none; }
body.client-space-mode .topbar-actions .divider-v,
body.client-space-mode .topbar-actions .ai-btn,
body.client-space-mode .topbar-actions .chat-top-btn { display: none; }
body.client-space-mode .topbar-actions .icon-btn:not(.theme-toggle-btn) { display: none; }
body.client-space-mode .welcome { display: none; }
body.client-space-mode .nav-section-label { display: none; }
body.client-space-mode .stats-grid { grid-template-columns: repeat(4, 1fr); }
body.client-space-mode .stat-card { background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
body.client-space-mode .section .card,
body.client-space-mode .section { background: transparent; box-shadow: none; border: none; }
body.client-space-mode .section .card { background: white; border: 1px solid var(--border); }
body.client-space-mode .section-head .section-title { font-size: 18px; }

/* Hide internal-only views in client space */
body.client-space-mode .nav-item[data-view="brain"],
body.client-space-mode .nav-item[data-view="activity"],
body.client-space-mode .nav-item[data-view="templates"],
body.client-space-mode .nav-item[data-view="finance"],
body.client-space-mode .nav-item[data-view="inbox"],
body.client-space-mode .nav-item[data-view="meetings"],
body.client-space-mode .nav-item[data-view="focus"],
body.client-space-mode .nav-item[data-view="settings"] { display: none; }

/* But show the sidebar in client space with a simpler nav */
body.client-space-mode .sidebar { display: flex; width: 240px; border-right: 1px solid var(--border); padding: 16px 12px; }
body.client-space-mode .sidebar .nav-item { padding: 10px 12px; }

/* Override topbar layout in client space */
body.client-space-mode .app { grid-template-columns: 240px 1fr; }
body.client-space-mode .main { padding: 24px 32px; }

/* Client Space Upgrade Modal */
.client-upgrade-features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 0; }
.client-upgrade-feature { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.client-upgrade-feature .cufic { width: 24px; height: 24px; border-radius: 6px; background: linear-gradient(135deg, #8B5CF6, #A78BFA); color: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.client-upgrade-feature .cufic svg { width: 14px; height: 14px; }
.client-upgrade-feature strong { display: block; font-weight: 700; }
.client-upgrade-feature span { color: var(--text-muted); font-size: 11.5px; }

/* ============================================
   COMMAND PALETTE (⌘K)
   ============================================ */
.cmdk-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(8px); z-index: 3000; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; animation: cmdkFadeIn 0.15s ease; }
@keyframes cmdkFadeIn { from { opacity: 0; } to { opacity: 1; } }
.cmdk-modal { width: 640px; max-width: 92vw; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; overflow: hidden; max-height: 70vh; display: flex; flex-direction: column; animation: cmdkSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes cmdkSlideIn { from { transform: translateY(-10px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.cmdk-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cmdk-icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.cmdk-input { flex: 1; border: none; background: transparent; font-size: 16px; outline: none; color: var(--text); font-family: inherit; }
.cmdk-input::placeholder { color: var(--text-soft); }
.cmdk-kbd { font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 3px 7px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-soft); }
.cmdk-results { overflow-y: auto; flex: 1; padding: 8px 0; }
.cmdk-group { padding: 8px 0; }
.cmdk-group-label { padding: 6px 18px 4px; font-size: 10.5px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.07em; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 18px; cursor: pointer; user-select: none; transition: background 0.1s; position: relative; }
.cmdk-item:hover, .cmdk-item.active { background: var(--primary-50); }
.cmdk-item.active { box-shadow: inset 2px 0 0 var(--primary); }
.cmdk-item-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: white; font-weight: 700; font-size: 12px; }
.cmdk-item-icon svg { width: 16px; height: 16px; }
.cmdk-item-icon.gray { background: var(--slate-100); color: var(--text-muted); }
.cmdk-item-icon.orange { background: linear-gradient(135deg, #F97316, #FB923C); }
.cmdk-item-icon.blue { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
.cmdk-item-icon.green { background: linear-gradient(135deg, #10B981, #34D399); }
.cmdk-item-icon.purple { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.cmdk-item-icon.pink { background: linear-gradient(135deg, #EC4899, #F472B6); }
.cmdk-item-icon.cyan { background: linear-gradient(135deg, #06B6D4, #22D3EE); }
.cmdk-item-icon.amber { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.cmdk-item-body { flex: 1; min-width: 0; }
.cmdk-item-title { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item-title .hl { background: rgba(249, 115, 22, 0.25); color: var(--primary); border-radius: 2px; padding: 0 1px; }
.cmdk-item-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cmdk-item-kbd { font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-soft); flex-shrink: 0; font-family: 'JetBrains Mono', monospace; }
.cmdk-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.cmdk-empty-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cmdk-empty-sub { font-size: 12px; }
.cmdk-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--bg-soft); font-size: 11px; color: var(--text-muted); }
.cmdk-foot-keys { display: flex; gap: 14px; }
.cmdk-foot-keys kbd { display: inline-block; font-size: 9.5px; font-weight: 700; padding: 2px 5px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg-elevated); margin: 0 1px; font-family: 'JetBrains Mono', monospace; }
.cmdk-foot-tip { color: var(--text-soft); font-style: italic; }
[data-theme="dark"] .cmdk-overlay { background: rgba(0, 0, 0, 0.7); }
[data-theme="dark"] .cmdk-item:hover, [data-theme="dark"] .cmdk-item.active { background: rgba(249, 115, 22, 0.1); }

/* ============================================
   CUSTOMIZABLE DASHBOARD
   ============================================ */
.dashboard-edit-bar { display: none; align-items: center; justify-content: space-between; padding: 10px 16px; background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1)); border: 1px dashed #8B5CF6; border-radius: 10px; margin-bottom: 16px; }
body.dashboard-edit .dashboard-edit-bar { display: flex; }
.dashboard-edit-bar-text { font-size: 13px; font-weight: 600; color: #8B5CF6; display: flex; align-items: center; gap: 8px; }
.dashboard-edit-bar-actions { display: flex; gap: 6px; }

.dash-widget { position: relative; }
body.dashboard-edit .dash-widget { outline: 2px dashed #8B5CF6; outline-offset: -2px; border-radius: 12px; transition: outline-color 0.15s; }
body.dashboard-edit .dash-widget:hover { outline-color: #EC4899; }
body.dashboard-edit .dash-widget .dash-widget-controls { display: flex; }
.dash-widget-controls { position: absolute; top: 8px; right: 8px; z-index: 10; display: none; gap: 4px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 3px; box-shadow: var(--shadow); }
.dash-widget-ctrl { width: 24px; height: 24px; border-radius: 5px; background: transparent; border: none; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dash-widget-ctrl:hover { background: var(--slate-100); color: var(--text); }
.dash-widget-ctrl.danger:hover { background: var(--danger-50); color: var(--danger); }
.dash-widget-ctrl svg { width: 12px; height: 12px; }
.dash-widget.dragging { opacity: 0.4; }
.dash-widget.drag-over { outline: 2px solid #F97316 !important; }
.dash-widget-handle { cursor: grab; }
.dash-widget-handle:active { cursor: grabbing; }

.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dash-grid-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }

/* Note widget */
.dash-note { min-height: 120px; }
.dash-note textarea { width: 100%; min-height: 100px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical; background: var(--bg-soft); color: var(--text); }
.dash-note textarea:focus { outline: none; border-color: var(--primary); background: var(--bg-elevated); }

/* Quote widget */
.dash-quote { padding: 30px 20px; text-align: center; }
.dash-quote-text { font-size: 16px; font-style: italic; line-height: 1.5; color: var(--text); margin-bottom: 12px; }
.dash-quote-author { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Focus time widget */
.dash-focus-widget { padding: 18px 20px; }
.dash-focus-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--slate-100); }
.dash-focus-row:last-child { border-bottom: none; }
.dash-focus-task { flex: 1; font-size: 13px; }

/* Custom stats widget */
.dash-stats-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px 16px; }
.dash-stats-mini-item { text-align: center; padding: 10px; background: var(--bg-soft); border-radius: 8px; }
.dash-stats-mini-num { font-size: 20px; font-weight: 800; }
.dash-stats-mini-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Weather widget */
.dash-weather { padding: 20px; text-align: center; }
.dash-weather-temp { font-size: 48px; font-weight: 800; line-height: 1; }
.dash-weather-loc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.dash-weather-desc { font-size: 13px; margin-top: 6px; }
.dash-weather-detail { display: flex; justify-content: space-around; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--slate-100); }
.dash-weather-detail div { text-align: center; }
.dash-weather-detail div strong { display: block; font-size: 13px; }
.dash-weather-detail div span { font-size: 10.5px; color: var(--text-muted); }

/* Quick actions */
.dash-quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px 16px; }
.dash-quick-action { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.12s; text-decoration: none; color: var(--text); }
.dash-quick-action:hover { background: var(--primary-50); border-color: var(--primary); transform: translateY(-1px); }
.dash-quick-action-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-elevated); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-quick-action-icon svg { width: 16px; height: 16px; }
.dash-quick-action-text { font-size: 12.5px; font-weight: 600; }

/* Onboarding checklist */
.dash-checklist-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--slate-100); }
.dash-checklist-item:last-child { border-bottom: none; }
.dash-checklist-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all 0.12s; }
.dash-checklist-check.checked { background: var(--success); border-color: var(--success); color: white; }
.dash-checklist-check svg { width: 12px; height: 12px; }
.dash-checklist-text { flex: 1; font-size: 13px; }
.dash-checklist-text.done { text-decoration: line-through; color: var(--text-soft); }

/* Add widget gallery */
.dash-gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px 0; }
.dash-gallery-item { padding: 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.12s; }
.dash-gallery-item:hover { border-color: var(--primary); background: var(--primary-50); }
.dash-gallery-item.added { opacity: 0.5; cursor: not-allowed; }
.dash-gallery-item-icon { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--primary-50), transparent); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.dash-gallery-item-icon svg { width: 18px; height: 18px; }
.dash-gallery-item-name { font-size: 13px; font-weight: 600; }
.dash-gallery-item-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

/* Add widget placeholder */
.dash-add-slot { border: 2px dashed var(--border); border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all 0.12s; color: var(--text-muted); }
.dash-add-slot:hover { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
body:not(.dashboard-edit) .dash-add-slot { display: none; }

/* ============================================
   FOCUS / TIME TRACKING
   ============================================ */
.focus-grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; margin-bottom: 20px; }
.focus-timer-card { background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%); color: white; border-radius: 16px; padding: 22px; position: relative; overflow: hidden; }
.focus-timer-card::before { content: ''; position: absolute; top: -50px; right: -50px; width: 200px; height: 200px; background: radial-gradient(circle, rgba(249, 115, 22, 0.15), transparent 70%); border-radius: 50%; }
.ftc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; position: relative; z-index: 1; }
.ftc-mode { font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.06em; }
.focus-timer-card .toggle { background: rgba(255,255,255,0.2); }
.focus-timer-card .toggle.on { background: linear-gradient(135deg, #F97316, #EC4899); }
.ftc-ring-wrap { position: relative; width: 240px; height: 240px; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.ftc-ring-wrap > svg.ftc-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ftc-ring { width: 100%; height: 100%; }
.ftc-time { font-size: 38px; font-weight: 800; font-family: 'JetBrains Mono', monospace; letter-spacing: -0.02em; position: relative; z-index: 1; line-height: 1; }
.ftc-task { font-size: 12px; color: rgba(255,255,255,0.7); text-align: center; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 1; margin-top: 8px; }
[data-theme="light"] .ftc-task { color: rgba(15, 23, 42, 0.7); }
[data-theme="light"] .ftc-tasks-head { color: rgba(15, 23, 42, 0.6); }
[data-theme="light"] .ftc-task-item:hover { background: rgba(15, 23, 42, 0.05); }
[data-theme="light"] .ftc-task-item-time { color: rgba(15, 23, 42, 0.5); }
.ftc-controls { display: flex; gap: 8px; margin-bottom: 16px; position: relative; z-index: 1; }
.ftc-main { flex: 1; padding: 12px; font-size: 14px; font-weight: 700; }
.ftc-secondary { padding: 12px 16px; background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.15); }
.ftc-secondary:hover { background: rgba(255,255,255,0.15); }
.ftc-secondary:disabled { opacity: 0.4; cursor: not-allowed; }
.ftc-secondary.break-mode { background: linear-gradient(135deg, #10B981, #34D399); border-color: transparent; color: white; }
.ftc-tasks { position: relative; z-index: 1; }
.ftc-tasks-head { font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.ftc-tasks-list { max-height: 200px; overflow-y: auto; }
.ftc-task-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.ftc-task-item:hover { background: rgba(255,255,255,0.08); }
.ftc-task-item-time { font-size: 11px; color: rgba(255,255,255,0.5); margin-left: auto; flex-shrink: 0; }
.ftc-task-item-title { font-size: 12.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftc-task-item-proj { font-size: 10px; color: rgba(255,255,255,0.4); }

.focus-side { display: flex; flex-direction: column; gap: 16px; }
.focus-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.focus-stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.focus-stat-num { font-size: 20px; font-weight: 800; line-height: 1.1; }
.focus-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.focus-stat-bar { height: 4px; background: var(--slate-100); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.fsb-fill { height: 100%; background: linear-gradient(90deg, #F97316, #EC4899); border-radius: 2px; }

.focus-digest { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; flex: 1; }
.fd-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.fd-title { font-size: 15px; font-weight: 700; }
.fd-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.fd-body { font-size: 13px; line-height: 1.6; color: var(--text); }
.fd-line { padding: 4px 0; display: flex; align-items: flex-start; gap: 6px; }
.fd-line-num { font-weight: 700; color: var(--primary); flex-shrink: 0; }
.fd-project-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--slate-100); }
.fd-project-row:last-child { border-bottom: none; }
.fd-project-name { font-size: 13px; font-weight: 600; flex: 1; }
.fd-project-time { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.fd-project-bar { height: 4px; background: var(--slate-100); border-radius: 2px; flex: 1; max-width: 120px; overflow: hidden; }
.fd-project-bar-fill { height: 100%; background: var(--primary); border-radius: 2px; }

/* Timesheet */
.timesheet { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ts-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ts-title { font-size: 16px; font-weight: 700; }
.ts-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ts-nav { display: flex; gap: 6px; align-items: center; }
.ts-table { width: 100%; border-collapse: collapse; }
.ts-th, .ts-td { padding: 10px 14px; text-align: left; font-size: 12.5px; border-bottom: 1px solid var(--slate-100); }
.ts-th { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; background: var(--bg-soft); }
.ts-th.center, .ts-td.center { text-align: center; }
.ts-project-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ts-project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ts-total { font-weight: 700; background: var(--primary-50); color: var(--primary); }
.ts-td { vertical-align: middle; }
.ts-td.hours { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.ts-td.hours.zero { color: var(--text-soft); }
.ts-td.hours.high { font-weight: 700; color: var(--text); }

/* Inline timer on tasks */
.task-card { position: relative; }
.task-timer-btn { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: all 0.12s; z-index: 2; }
.task-card:hover .task-timer-btn { opacity: 1; }
.task-timer-btn:hover { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.1); }
.task-timer-btn.running { opacity: 1; background: var(--danger); color: white; border-color: var(--danger); animation: voicePulse 1.4s ease-in-out infinite; }
.task-timer-btn svg { width: 12px; height: 12px; }
.task-timer-tracked { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 6px; background: var(--primary-50); color: var(--primary); border-radius: 5px; margin-top: 4px; }

/* Floating timer widget */
.focus-float { position: fixed; bottom: 24px; right: 24px; z-index: 1000; background: linear-gradient(135deg, #0F172A, #1E293B); color: white; border-radius: 14px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 12px; min-width: 280px; animation: bannerSlideUp 0.3s ease; }
.focus-float-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25); animation: voicePulse 1.4s ease-in-out infinite; flex-shrink: 0; }
.focus-float-info { flex: 1; min-width: 0; }
.focus-float-task { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-float-time { font-size: 16px; font-weight: 800; font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.focus-float-pause, .focus-float-stop { width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(255,255,255,0.1); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.focus-float-pause:hover, .focus-float-stop:hover { background: rgba(255,255,255,0.2); }
.focus-float-pause svg, .focus-float-stop svg { width: 12px; height: 12px; }

/* Break mode banner */
.focus-break-banner { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 999; background: linear-gradient(135deg, #10B981, #34D399); color: white; padding: 10px 20px; border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3); display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.focus-break-banner svg { width: 18px; height: 18px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1280px) {
  :root { --sidebar-w: 232px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
  .three-col { grid-template-columns: 1fr 1fr; }
  .three-col > .card:last-child { grid-column: 1 / -1; }
  .two-col { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: repeat(5, 260px); }
  .search { flex: 0 1 280px; }
  .docs-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; --topbar-h: 64px; }
  .page { padding: 24px 20px 60px; }
  .welcome h1 { font-size: 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-value { font-size: 22px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .three-col { grid-template-columns: 1fr; }
  .three-col > .card:last-child { grid-column: auto; }
  .two-col { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(4, 280px); padding-bottom: 8px; }
  .search { display: none; }
  .breadcrumb { display: none; }
  .topbar { padding: 0 16px; gap: 8px; }
  .docs-grid { grid-template-columns: repeat(2, 1fr); }
  .goals-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
  .app.mobile-open { grid-template-columns: var(--sidebar-w) 1fr; }
  .app.mobile-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .app.mobile-open .sidebar-overlay { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 60; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
  .app.collapsed .sidebar { transform: translateX(-100%); }
  .app.mobile-open.collapsed .sidebar { transform: translateX(0); }
  .collapse-btn { display: none; }
  .mobile-menu-btn { display: flex; }
  .page { padding: 20px 16px 60px; }
  .welcome { flex-direction: column; align-items: flex-start; gap: 14px; }
  .welcome h1 { font-size: 22px; }
  .welcome-actions { width: 100%; }
  .welcome-actions .btn { flex: 1; justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }
  .projects-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .kanban-col { min-height: auto; }
  .docs-grid { grid-template-columns: 1fr; }
  .chat-panel { width: 100vw; max-width: 100vw; }
  .chat-list { width: 100%; }
  .chat-panel.show-conv .chat-list { display: none; }
  .chat-back-btn { display: flex; }
  .chat-rail { width: 56px; }
  .chat-rail-btn .crb-label { display: none; }
  .brain-panel { width: 100vw; max-width: 100vw; }
}

@media (max-width: 480px) {
  :root { --topbar-h: 60px; }
  .brand { padding: 0 14px; }
  .ws-switcher { margin: 12px 10px 8px; padding: 8px 10px; }
  .topbar { padding: 0 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-value { font-size: 18px; }
  .welcome h1 { font-size: 20px; }
  .toast-stack { top: 70px; left: 12px; right: 12px; transform: none; }
  .modal { width: 95vw; }
  .cal-grid { grid-auto-rows: 60px; }
  .cal-num { font-size: 10px; }
}

/* ============================================================
   SPACES VIEW
   ============================================================ */

/* ============================================================
   AUTOMATION BUILDER
   ============================================================ */
.autobot-badge {
  display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: 0.08em;
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
  color: white; padding: 2px 7px; border-radius: 5px; vertical-align: middle;
  margin-left: 6px;
}
.aut-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 1100px) { .aut-layout { grid-template-columns: 1fr; } }

/* ---- Chat (left) ---- */
.aut-chat {
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  display: flex; flex-direction: column;
  min-height: 600px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.aut-chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #E2E8F0);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(59, 130, 246, 0.04));
}
.aut-bot-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
  animation: autPulse 2.5s ease-in-out infinite;
}
@keyframes autPulse {
  0%, 100% { box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3); }
  50% { box-shadow: 0 4px 18px rgba(6, 182, 212, 0.55); }
}
.aut-bot-name { font-size: 14px; font-weight: 700; }
.aut-bot-status { font-size: 11px; color: var(--text-muted, #64748B); display: flex; align-items: center; gap: 5px; }
.aut-bot-dot { width: 6px; height: 6px; border-radius: 50%; background: #10B981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }
.aut-chat-clear { margin-left: auto; background: transparent; border: 1px solid var(--border, #E2E8F0); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--text-muted, #64748B); font-size: 16px; }
.aut-chat-clear:hover { background: var(--bg-soft, #F1F5F9); color: var(--text); }

.aut-chat-msgs {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-soft, #F8FAFC);
}
.aut-msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; word-wrap: break-word; }
.aut-msg.user { align-self: flex-end; background: linear-gradient(135deg, #F97316, #FB923C); color: white; border-bottom-right-radius: 4px; }
.aut-msg.bot  { align-self: flex-start; background: var(--card, #fff); color: var(--text, #0F172A); border: 1px solid var(--border, #E2E8F0); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.aut-msg.bot .aut-msg-meta { font-size: 10px; font-weight: 700; color: #06B6D4; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.aut-msg.typing { color: var(--text-muted, #94A3B8); font-style: italic; }
.aut-msg-typing-dots span { animation: autBlink 1.2s infinite; display: inline-block; }
.aut-msg-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.aut-msg-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes autBlink { 0%, 60%, 100% { opacity: 0.2; } 30% { opacity: 1; } }
.aut-msg-suggest { display: inline-block; margin-top: 6px; padding: 4px 10px; background: rgba(6, 182, 212, 0.1); color: #0891B2; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid rgba(6, 182, 212, 0.2); }
.aut-msg-suggest:hover { background: rgba(6, 182, 212, 0.18); }

.aut-chat-input {
  border-top: 1px solid var(--border, #E2E8F0);
  padding: 12px;
  background: var(--card, #fff);
}
.aut-chat-input textarea {
  width: 100%; border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px; padding: 10px 12px;
  font: inherit; font-size: 13px; resize: vertical; min-height: 56px; max-height: 140px;
  background: var(--bg-soft, #F8FAFC); color: var(--text);
}
.aut-chat-input textarea:focus { outline: none; border-color: #06B6D4; box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15); background: white; }
.aut-chat-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.aut-chat-suggestions { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.aut-chat-suggestions button { background: transparent; border: 1px solid var(--border, #E2E8F0); padding: 4px 9px; border-radius: 6px; font: inherit; font-size: 10.5px; color: var(--text-muted, #64748B); cursor: pointer; }
.aut-chat-suggestions button:hover { background: var(--bg-soft); color: var(--text); border-color: #06B6D4; }
.aut-chat-send { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #06B6D4, #3B82F6); color: white; border: none; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3); }
.aut-chat-send:hover { transform: translateY(-1px); }
.aut-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Main (right) ---- */
.aut-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.aut-tabs { display: flex; align-items: center; gap: 4px; background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 12px; padding: 6px; }
.aut-tab { background: transparent; border: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted, #64748B); padding: 6px 12px; border-radius: 7px; display: flex; align-items: center; gap: 5px; }
.aut-tab:hover { color: var(--text); }
.aut-tab.active { background: var(--bg-soft, #F1F5F9); color: var(--text); }
.aut-tab-count { font-size: 10px; background: rgba(6, 182, 212, 0.15); color: #0891B2; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.aut-tabs-search { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--bg-soft, #F8FAFC); border-radius: 7px; color: var(--text-soft, #94A3B8); }
.aut-tabs-search input { border: none; outline: none; background: transparent; font: inherit; font-size: 12px; color: var(--text); width: 180px; }

.aut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.aut-card {
  position: relative;
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.aut-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); border-color: #06B6D4; }
.aut-card-head { display: flex; align-items: flex-start; gap: 10px; }
.aut-card-icon { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #06B6D4, #3B82F6); display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3); }
.aut-card-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.aut-card-desc { font-size: 11.5px; color: var(--text-muted, #64748B); margin-top: 2px; line-height: 1.4; }
.aut-card-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 999px;
}
.aut-card-status.active  { background: rgba(16, 185, 129, 0.12); color: #059669; }
.aut-card-status.paused { background: rgba(245, 158, 11, 0.12); color: #B45309; }
.aut-card-status.draft  { background: rgba(100, 116, 139, 0.12); color: #475569; }
.aut-card-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.aut-card-stats { display: flex; gap: 14px; padding-top: 10px; border-top: 1px solid var(--border, #E2E8F0); }
.aut-stat { display: flex; flex-direction: column; gap: 1px; }
.aut-stat-num { font-size: 13px; font-weight: 700; line-height: 1.1; }
.aut-stat-label { font-size: 9.5px; color: var(--text-soft, #94A3B8); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.aut-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; background: var(--bg-soft, #F8FAFC); border: 2px dashed var(--border, #E2E8F0); border-radius: 14px; color: var(--text-muted, #64748B); }
.aut-empty-icon { font-size: 40px; margin-bottom: 10px; }
.aut-empty-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* ---- Editor ---- */
.aut-editor { background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 16px; overflow: hidden; }
.aut-editor[hidden] { display: none; }
.aut-editor-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border, #E2E8F0); background: var(--bg-soft, #F8FAFC); flex-wrap: wrap; }
.aut-editor-back { background: transparent; border: 1px solid var(--border, #E2E8F0); padding: 5px 10px; border-radius: 7px; font: inherit; font-size: 12px; color: var(--text-muted, #64748B); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.aut-editor-back:hover { background: white; color: var(--text); }
.aut-editor-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 200px; }
.aut-editor-status { display: flex; align-items: center; gap: 8px; }
.aut-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; color: var(--text-muted, #64748B); }
.aut-switch input { display: none; }
.aut-switch-slider { width: 30px; height: 16px; background: #CBD5E1; border-radius: 8px; position: relative; transition: background 0.15s; }
.aut-switch-slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: white; border-radius: 50%; transition: transform 0.15s; }
.aut-switch input:checked + .aut-switch-slider { background: #10B981; }
.aut-switch input:checked + .aut-switch-slider::after { transform: translateX(14px); }
.aut-switch-label { font-size: 11px; font-weight: 700; color: var(--text); }

.aut-editor-body { padding: 20px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 1200px) { .aut-editor-body { grid-template-columns: 1fr; } }

.aut-editor-name { grid-column: 1 / -1; }
.aut-editor-name label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted, #64748B); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.aut-editor-name input { width: 100%; padding: 10px 12px; border: 1px solid var(--border, #E2E8F0); border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; background: var(--bg-soft, #F8FAFC); }
.aut-editor-name input:focus { outline: none; border-color: #06B6D4; background: white; box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15); }

/* Flow */
.aut-flow { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.aut-step {
  background: var(--card, #fff);
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.aut-step:hover { border-color: #06B6D4; box-shadow: 0 4px 12px rgba(6, 182, 212, 0.1); }
.aut-step-trigger  { border-left: 4px solid #F97316; }
.aut-step-condition { border-left: 4px solid #F59E0B; }
.aut-step-action   { border-left: 4px solid #10B981; }
.aut-step-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-soft, #F8FAFC); border-bottom: 1px solid var(--border, #E2E8F0); }
.aut-step-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; }
.aut-step-trigger  .aut-step-icon { background: rgba(249, 115, 22, 0.15); color: #F97316; }
.aut-step-condition .aut-step-icon { background: rgba(245, 158, 11, 0.15); color: #B45309; }
.aut-step-action   .aut-step-icon { background: rgba(16, 185, 129, 0.15); color: #059669; }
.aut-step-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, #64748B); flex: 1; }
.aut-step-menu { width: 22px; height: 22px; background: transparent; border: none; cursor: pointer; border-radius: 5px; color: var(--text-soft, #94A3B8); font-size: 16px; }
.aut-step-menu:hover { background: white; color: var(--text); }
.aut-step-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-muted, #64748B); cursor: pointer; }
.aut-step-toggle input { accent-color: #F59E0B; }
.aut-step-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.aut-step-body select { padding: 8px 10px; border: 1px solid var(--border, #E2E8F0); border-radius: 8px; font: inherit; font-size: 12.5px; background: white; }
.aut-step-body select:focus { outline: none; border-color: #06B6D4; }
.aut-step-config { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--bg-soft, #F8FAFC); border-radius: 8px; }
.aut-step-config-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.aut-step-config-row label { font-weight: 600; color: var(--text-muted, #64748B); min-width: 80px; }
.aut-step-config-row input, .aut-step-config-row select { flex: 1; padding: 6px 10px; border: 1px solid var(--border, #E2E8F0); border-radius: 6px; font: inherit; font-size: 12px; background: white; }
.aut-step-config-row input:focus, .aut-step-config-row select:focus { outline: none; border-color: #06B6D4; }

.aut-arrow { align-self: center; color: var(--text-soft, #94A3B8); }
.aut-cond-rows { display: flex; flex-direction: column; gap: 6px; }
.aut-cond-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; align-items: center; }
.aut-cond-row select, .aut-cond-row input { padding: 6px 10px; border: 1px solid var(--border, #E2E8F0); border-radius: 6px; font: inherit; font-size: 12px; background: white; }
.aut-cond-row .aut-cond-del { background: transparent; border: none; color: #DC2626; cursor: pointer; font-size: 14px; width: 24px; height: 24px; border-radius: 4px; }
.aut-cond-row .aut-cond-del:hover { background: #FEF2F2; }
.aut-add-cond { align-self: flex-start; background: transparent; border: 1px dashed var(--border, #CBD5E1); padding: 6px 10px; border-radius: 6px; font: inherit; font-size: 11px; color: var(--text-muted, #64748B); cursor: pointer; }
.aut-add-cond:hover { background: var(--bg-soft); border-color: #F59E0B; color: #B45309; }
.aut-add-step { align-self: center; background: var(--card, #fff); border: 1.5px dashed #10B981; padding: 10px 16px; border-radius: 10px; font: inherit; font-size: 12px; font-weight: 600; color: #059669; cursor: pointer; margin-top: 6px; }
.aut-add-step:hover { background: rgba(16, 185, 129, 0.06); }

/* Run history */
.aut-run-history { background: var(--bg-soft, #F8FAFC); border: 1px solid var(--border, #E2E8F0); border-radius: 12px; padding: 12px; }
.aut-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.aut-history-title { font-size: 12px; font-weight: 700; }
.aut-history-stats { font-size: 10.5px; color: var(--text-muted, #64748B); }
.aut-history-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.aut-history-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: white; border-radius: 6px; font-size: 11.5px; }
.aut-history-row .status { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.aut-history-row .status.success { background: rgba(16, 185, 129, 0.12); color: #059669; }
.aut-history-row .status.failed  { background: rgba(239, 68, 68, 0.12); color: #B91C1C; }
.aut-history-row .status.skipped { background: rgba(100, 116, 139, 0.12); color: #475569; }
.aut-history-row .time { color: var(--text-soft, #94A3B8); font-size: 10.5px; }
.aut-history-empty { font-size: 11.5px; color: var(--text-muted, #94A3B8); text-align: center; padding: 12px; font-style: italic; }

/* Templates modal */
.aut-templates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .aut-templates-grid { grid-template-columns: 1fr; } }
.aut-template-card {
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  display: flex; flex-direction: column; gap: 6px;
}
.aut-template-card:hover { border-color: #06B6D4; background: rgba(6, 182, 212, 0.04); }
.aut-template-card .icon { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #06B6D4, #3B82F6); color: white; display: grid; place-items: center; }
.aut-template-card .name { font-size: 13px; font-weight: 700; }
.aut-template-card .desc { font-size: 11.5px; color: var(--text-muted, #64748B); line-height: 1.4; }

/* ============================================================
   END AUTOMATION BUILDER
   ============================================================ */

/* ----- Goals / OKRs ----- */

/* ============================================================
   REQUEST FORMS (Service Catalog)
   ============================================================ */
.forms-toolbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.forms-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; color: var(--text-soft, #94A3B8); padding: 6px 10px; background: var(--bg-soft, #F8FAFC); border-radius: 8px; border: 1px solid var(--border, #E2E8F0); }
.forms-search input { flex: 1; border: none; outline: none; background: transparent; font: inherit; font-size: 13px; color: var(--text); }
.forms-search kbd { font-family: inherit; font-size: 10px; font-weight: 700; color: var(--text-muted, #94A3B8); background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); padding: 2px 6px; border-radius: 4px; }

.forms-cats { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.forms-cat-chip { background: transparent; border: 1px solid var(--border, #E2E8F0); padding: 4px 10px; border-radius: 999px; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-muted, #64748B); cursor: pointer; display: flex; align-items: center; gap: 5px; transition: all 0.12s; }
.forms-cat-chip:hover { border-color: #F97316; color: var(--text); }
.forms-cat-chip.active { background: var(--primary, #F97316); color: white; border-color: var(--primary, #F97316); }
.forms-cat-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.forms-sort { position: relative; }
.forms-sort-btn { display: flex; align-items: center; gap: 5px; background: transparent; border: 1px solid var(--border, #E2E8F0); padding: 6px 10px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted, #64748B); cursor: pointer; }
.forms-sort-btn:hover { color: var(--text); }
.forms-sort-menu { position: absolute; top: calc(100% + 4px); right: 0; background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 10px; padding: 4px; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16); min-width: 180px; z-index: 20; }
.forms-sort-menu[hidden] { display: none; }
.forms-sort-menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 7px 10px; border-radius: 6px; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.forms-sort-menu button:hover { background: var(--bg-soft, #F1F5F9); }

.forms-view-toggle { display: flex; gap: 2px; background: var(--bg-soft, #F1F5F9); padding: 3px; border-radius: 8px; }
.forms-view-toggle button { background: transparent; border: none; padding: 5px 8px; border-radius: 5px; cursor: pointer; color: var(--text-muted, #94A3B8); display: grid; place-items: center; }
.forms-view-toggle button.active { background: var(--card, #fff); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

.forms-section-head { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 10px; }
.forms-section-title { font-size: 14px; font-weight: 700; }
.forms-section-sub { font-size: 11.5px; color: var(--text-muted, #64748B); }

.forms-favs { margin-bottom: 6px; }
.forms-favs[hidden] { display: none; }

.forms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.forms-grid-favs { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

.form-card {
  position: relative;
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.form-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); border-color: var(--primary, #F97316); }
.form-card-head { display: flex; align-items: flex-start; gap: 10px; }
.form-card-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 20px; color: white; font-weight: 700;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}
.form-card-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.form-card-desc { font-size: 11.5px; color: var(--text-muted, #64748B); margin-top: 3px; line-height: 1.45; }
.form-card-cat {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 999px;
}
.form-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border, #E2E8F0); font-size: 11px; color: var(--text-muted, #64748B); }
.form-card-submissions { display: flex; align-items: center; gap: 4px; }
.form-card-fav { background: transparent; border: 1px solid var(--border, #E2E8F0); width: 28px; height: 28px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; color: var(--text-soft, #94A3B8); transition: all 0.12s; }
.form-card-fav:hover { color: #F59E0B; border-color: #F59E0B; }
.form-card-fav.active { background: rgba(245, 158, 11, 0.1); color: #F59E0B; border-color: rgba(245, 158, 11, 0.3); }
.form-card-fav.active svg { fill: currentColor; }

.forms-list { display: flex; flex-direction: column; gap: 6px; }
.form-list-row {
  display: grid; grid-template-columns: 36px 1fr 120px 100px 80px 36px;
  gap: 14px; align-items: center;
  padding: 10px 14px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.form-list-row:hover { border-color: var(--primary, #F97316); background: var(--bg-soft, #F8FAFC); }
.form-list-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: white; font-size: 16px; }
.form-list-title { font-size: 13px; font-weight: 700; }
.form-list-desc { font-size: 11px; color: var(--text-muted, #64748B); margin-top: 2px; }
.form-list-owner { font-size: 11.5px; color: var(--text-muted, #64748B); }

.forms-empty { text-align: center; padding: 60px 20px; background: var(--bg-soft, #F8FAFC); border: 2px dashed var(--border, #E2E8F0); border-radius: 14px; color: var(--text-muted, #64748B); }
.forms-empty-icon { font-size: 40px; margin-bottom: 10px; }
.forms-empty-title { font-size: 15px; font-weight: 700; color: var(--text); }
.forms-empty-sub { font-size: 12.5px; margin-top: 4px; }

.form-submit-modal .modal { max-width: 560px; }
.form-submit-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--border, #E2E8F0); background: var(--bg-soft, #F8FAFC); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.form-submit-head .form-card-icon { width: 44px; height: 44px; font-size: 22px; }
.form-submit-head-title { font-size: 16px; font-weight: 700; }
.form-submit-head-sub { font-size: 12px; color: var(--text-muted, #64748B); margin-top: 2px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-field label { font-size: 11px; font-weight: 700; color: var(--text-muted, #64748B); text-transform: uppercase; letter-spacing: 0.04em; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border, #E2E8F0); border-radius: 8px;
  font: inherit; font-size: 13px; background: var(--bg-soft, #F8FAFC); color: var(--text);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--primary, #F97316); background: white; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12); }
.form-field textarea { min-height: 80px; resize: vertical; font-family: inherit; }
.form-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .form-field-row { grid-template-columns: 1fr; } }
.form-required { color: #DC2626; margin-left: 2px; }

/* ============================================================
   END REQUEST FORMS
   ============================================================ */

/* ============================================================
   NOTES
   ============================================================ */
.notes-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 16px;
  height: calc(100vh - var(--topbar-h) - 80px);
  min-height: 600px;
}
@media (max-width: 1200px) { .notes-layout { grid-template-columns: 240px 1fr; } .notes-ai { display: none; } }
@media (max-width: 800px)  { .notes-layout { grid-template-columns: 1fr; } }

/* Left sidebar */
.notes-side {
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.notes-side-head { padding: 12px; border-bottom: 1px solid var(--border, #E2E8F0); }
.notes-search { display: flex; align-items: center; gap: 6px; margin: 10px 12px 0; padding: 6px 10px; background: var(--bg-soft, #F8FAFC); border-radius: 8px; color: var(--text-soft, #94A3B8); }
.notes-search input { flex: 1; border: none; outline: none; background: transparent; font: inherit; font-size: 12px; color: var(--text); }
.notes-tabs { display: flex; gap: 2px; padding: 8px 10px 4px; border-bottom: 1px solid var(--border, #E2E8F0); }
.notes-tab { background: transparent; border: none; cursor: pointer; padding: 5px 8px; border-radius: 6px; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-muted, #64748B); display: flex; align-items: center; gap: 4px; }
.notes-tab:hover { color: var(--text); }
.notes-tab.active { background: var(--bg-soft, #F1F5F9); color: var(--text); }
.notes-tab-count { font-size: 9.5px; font-weight: 700; background: var(--bg-soft, #F1F5F9); color: var(--text-muted); padding: 1px 5px; border-radius: 4px; }
.notes-tab.active .notes-tab-count { background: var(--card, #fff); }
.notes-list { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.notes-list-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s; border: 1px solid transparent;
}
.notes-list-item:hover { background: var(--bg-soft, #F8FAFC); }
.notes-list-item.active { background: var(--bg-soft, #F1F5F9); border-color: var(--border, #E2E8F0); }
.notes-list-pin { color: #F59E0B; font-size: 11px; flex-shrink: 0; padding-top: 2px; }
.notes-list-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notes-list-preview { font-size: 11px; color: var(--text-muted, #64748B); margin-top: 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notes-list-foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.notes-list-time { font-size: 10px; color: var(--text-soft, #94A3B8); }
.notes-list-cat { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; border-radius: 4px; background: var(--bg-soft, #F1F5F9); color: var(--text-muted, #64748B); }

/* Center editor */
.notes-main {
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.notes-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: var(--text-muted, #64748B); text-align: center; padding: 40px; }
.notes-empty-icon { font-size: 56px; margin-bottom: 12px; }
.notes-empty-title { font-size: 18px; font-weight: 700; color: var(--text); }
.notes-empty-sub { font-size: 12.5px; margin-top: 4px; max-width: 320px; }
.notes-editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.notes-editor[hidden] { display: none; }
.notes-editor-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px 8px; border-bottom: 1px solid var(--border, #E2E8F0); }
.notes-editor-title { flex: 1; border: none; outline: none; background: transparent; font: inherit; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); padding: 4px 0; min-width: 0; }
.notes-editor-title::placeholder { color: var(--text-soft, #94A3B8); }
.notes-editor-actions { display: flex; gap: 4px; flex-shrink: 0; }
.notes-icon-btn { width: 32px; height: 32px; background: transparent; border: 1px solid var(--border, #E2E8F0); border-radius: 8px; cursor: pointer; color: var(--text-muted, #64748B); display: grid; place-items: center; transition: all 0.12s; }
.notes-icon-btn:hover { color: var(--text); border-color: var(--text-muted, #94A3B8); }
.notes-icon-btn.active { background: rgba(245, 158, 11, 0.12); color: #B45309; border-color: rgba(245, 158, 11, 0.4); }
.notes-icon-danger:hover { color: #DC2626; border-color: #DC2626; }
.notes-editor-meta { display: flex; align-items: center; gap: 6px; padding: 0 20px 12px; font-size: 11px; color: var(--text-muted, #64748B); }
.notes-editor-content {
  flex: 1; border: none; outline: none; resize: none; padding: 4px 24px 24px;
  font: inherit; font-size: 14px; line-height: 1.7; color: var(--text);
  background: transparent; min-height: 0;
}
.notes-editor-content::placeholder { color: var(--text-soft, #94A3B8); }

/* Right AI panel */
.notes-ai { background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.notes-ai-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 4px; }
.notes-ai-title { font-size: 13px; font-weight: 700; }
.notes-ai-sub { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; background: linear-gradient(135deg, #14B8A6, #2DD4BF); color: white; }
.notes-ai-card { padding: 12px; background: var(--bg-soft, #F8FAFC); border: 1px solid var(--border, #E2E8F0); border-radius: 10px; }
.notes-ai-card-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 8px; }
.notes-ai-card-title { font-size: 13px; font-weight: 700; }
.notes-ai-card-desc { font-size: 11.5px; color: var(--text-muted, #64748B); margin-top: 4px; line-height: 1.5; }
.notes-ai-btn { width: 100%; margin-top: 10px; padding: 7px 10px; background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 7px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted, #64748B); cursor: not-allowed; opacity: 0.7; }
.notes-ai-btn:not(:disabled) { cursor: pointer; opacity: 1; color: var(--text); }
.notes-ai-btn:not(:disabled):hover { background: var(--bg-soft, #F1F5F9); border-color: var(--text-muted); }
.notes-ai-status { display: flex; align-items: center; gap: 6px; margin-top: auto; padding: 8px 10px; background: var(--bg-soft, #F8FAFC); border-radius: 8px; font-size: 11px; color: var(--text-muted, #64748B); }
.notes-ai-dot { width: 6px; height: 6px; border-radius: 50%; background: #F59E0B; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }

@media (max-width: 800px) { .notes-ai { display: none; } }


/* ----- Feature Flags settings panel ----- */
.ff-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.ff-bulk { background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted, #64748B); cursor: pointer; }
.ff-bulk:hover { color: var(--text); border-color: var(--primary, #F97316); }
.ff-bulk-hint { font-size: 11.5px; color: var(--text-soft, #94A3B8); margin-left: auto; }
.ff-cat { margin-bottom: 18px; }
.ff-cat-head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, #94A3B8); margin-bottom: 8px; padding-left: 4px; }
.ff-list { display: flex; flex-direction: column; gap: 6px; }
.ff-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 10px; transition: border-color 0.12s, background 0.12s; }
.ff-row:hover { border-color: var(--primary, #F97316); }
.ff-row.ff-beta { background: linear-gradient(90deg, rgba(139, 92, 246, 0.04), transparent 30%); border-color: rgba(139, 92, 246, 0.25); }
.ff-icon { font-size: 24px; width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; transition: opacity 0.2s, filter 0.2s; }
.ff-body { flex: 1; min-width: 0; }
.ff-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ff-name { font-size: 13px; font-weight: 700; }
.ff-badge { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 4px; color: white; letter-spacing: 0.04em; }
.ff-beta-tag { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 4px; background: rgba(139, 92, 246, 0.15); color: #7C3AED; letter-spacing: 0.04em; }
.ff-desc { font-size: 11.5px; color: var(--text-muted, #64748B); margin-top: 2px; line-height: 1.4; }
.ff-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-muted, #64748B); flex-shrink: 0; }
.ff-switch input { display: none; }
.ff-switch-slider { width: 32px; height: 18px; background: #CBD5E1; border-radius: 9px; position: relative; transition: background 0.15s; }
.ff-switch-slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: white; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ff-switch input:checked + .ff-switch-slider { background: #10B981; }
.ff-switch input:checked + .ff-switch-slider::after { transform: translateX(14px); }
.ff-switch-state { min-width: 22px; }

.settings-panel-stats { display: flex; gap: 6px; flex-shrink: 0; }
.stat-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }


.goal-tabs { display: flex; gap: 4px; background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 10px; padding: 4px; margin-bottom: 16px; width: fit-content; }
.goal-tab { background: transparent; border: none; cursor: pointer; padding: 6px 14px; border-radius: 7px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-muted, #64748B); transition: background 0.12s, color 0.12s; }
.goal-tab:hover { color: var(--text); }
.goal-tab.active { background: var(--bg-soft, #F1F5F9); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

.okrs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.okr-card { background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 14px; padding: 16px; }
.okr-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.okr-card-num { font-size: 11px; font-weight: 800; color: #8B5CF6; background: rgba(139, 92, 246, 0.1); padding: 2px 8px; border-radius: 4px; letter-spacing: 0.04em; flex-shrink: 0; }
.okr-card-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.okr-card-owner { font-size: 11px; color: var(--text-muted, #64748B); margin-top: 2px; }
.okr-card-pct { margin-top: 8px; height: 8px; background: var(--bg-soft, #F8FAFC); border-radius: 4px; overflow: hidden; }
.okr-card-pct-fill { height: 100%; background: linear-gradient(90deg, #8B5CF6, #A78BFA); border-radius: 4px; transition: width 0.3s; }
.okr-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 11px; }
.okr-card-pct-label { font-weight: 700; color: #7C3AED; }
.okr-card-quarter { color: var(--text-soft, #94A3B8); }

.checkins-grid { display: flex; flex-direction: column; gap: 10px; }
.checkin-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: 10px; }
.checkin-date { width: 56px; text-align: center; flex-shrink: 0; }
.checkin-date .day { font-size: 20px; font-weight: 800; line-height: 1; color: var(--text); }
.checkin-date .month { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted, #64748B); margin-top: 2px; }
.checkin-body { flex: 1; min-width: 0; }
.checkin-title { font-size: 13px; font-weight: 700; }
.checkin-sub { font-size: 11.5px; color: var(--text-muted, #64748B); margin-top: 2px; }
.checkin-status { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.checkin-status.on_track { background: rgba(16, 185, 129, 0.12); color: #059669; }
.checkin-status.at_risk  { background: rgba(245, 158, 11, 0.12); color: #B45309; }
.checkin-status.off_track { background: rgba(239, 68, 68, 0.12); color: #B91C1C; }
.checkin-status.upcoming { background: rgba(100, 116, 139, 0.12); color: #475569; }
.space-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.space-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 14px 16px;
}
.space-summary-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.space-summary-num { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.space-summary-label { font-size: 12px; color: var(--text-soft, #94A3B8); margin-top: 2px; font-weight: 500; }

.space-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.space-search {
  flex: 1; min-width: 220px; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0); border-radius: 10px;
  color: var(--text-soft, #94A3B8);
}
.space-search input { border: none; outline: none; background: transparent; flex: 1; font: inherit; font-size: 13px; color: var(--text); }
.space-tabs { display: flex; gap: 4px; background: var(--bg-soft, #F1F5F9); padding: 4px; border-radius: 10px; }
.space-tab {
  padding: 6px 12px; border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted, #64748B);
  border-radius: 7px; transition: background 0.12s, color 0.12s;
}
.space-tab:hover { color: var(--text); }
.space-tab.active { background: var(--card, #fff); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

.space-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.space-card {
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.space-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); border-color: #CBD5E1; }
.space-card-head { display: flex; align-items: flex-start; gap: 12px; }
.space-card-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 18px; color: white; font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}
.space-card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.space-card-desc { font-size: 12.5px; color: var(--text-muted, #64748B); margin-top: 2px; line-height: 1.4; }
.space-card-type {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 999px; margin-top: 6px;
}
.space-card-type.team   { background: rgba(59, 130, 246, 0.12); color: #2563EB; }
.space-card-type.project{ background: rgba(139, 92, 246, 0.12); color: #7C3AED; }
.space-card-type.shared { background: rgba(236, 72, 153, 0.12); color: #DB2777; }

.space-card-stats { display: flex; gap: 14px; padding-top: 12px; border-top: 1px solid var(--border, #E2E8F0); }
.space-stat { flex: 1; }
.space-stat-num { font-size: 14px; font-weight: 700; line-height: 1.1; }
.space-stat-label { font-size: 10.5px; color: var(--text-soft, #94A3B8); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; font-weight: 600; }

.space-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.space-avatars { display: flex; }
.space-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #94A3B8, #64748B);
  color: white; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--card, #fff);
  margin-left: -8px;
}
.space-avatar:first-child { margin-left: 0; }
.space-avatar.more { background: var(--bg-soft, #F1F5F9); color: var(--text-muted, #64748B); }
.space-card-cta { font-size: 11px; font-weight: 600; color: var(--text-soft, #94A3B8); display: flex; align-items: center; gap: 4px; }

.space-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; text-align: center;
  background: var(--bg-soft, #F8FAFC);
  border: 2px dashed var(--border, #E2E8F0);
  border-radius: 14px;
  color: var(--text-muted, #64748B);
}
.space-empty-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--card, #fff); display: grid; place-items: center; margin-bottom: 12px; color: var(--text-soft, #94A3B8); }
.space-empty-title { font-size: 15px; font-weight: 700; color: var(--text); }
.space-empty-sub { font-size: 12.5px; margin-top: 4px; max-width: 340px; }

.space-card-menu {
  position: absolute; top: 12px; right: 12px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  z-index: 10; min-width: 160px;
  display: none;
}
.space-card-menu.open { display: block; }
.space-card-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  background: transparent; border: none; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--text);
  border-radius: 6px; text-align: left;
}
.space-card-menu button:hover { background: var(--bg-soft, #F1F5F9); }
.space-card-menu button.danger { color: #DC2626; }
.space-card-menu button.danger:hover { background: #FEF2F2; }
.space-card-menu svg { color: currentColor; }

@media (max-width: 600px) {
  .space-summary { grid-template-columns: 1fr; }
  .space-grid { grid-template-columns: 1fr; }
  .space-toolbar { flex-direction: column; align-items: stretch; }
  .space-search { max-width: none; }
}

/* ----- Space detail modal ----- */
.space-detail-modal { max-height: 88vh; display: flex; flex-direction: column; }
.space-detail-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border, #E2E8F0);
  background: var(--bg-soft, #F8FAFC);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.space-detail-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 24px; color: white; font-weight: 700;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
}
.space-detail-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.space-detail-sub { font-size: 13px; color: var(--text-muted, #64748B); margin-top: 4px; line-height: 1.45; }
.space-detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.space-detail-pill {
  font-size: 11px; font-weight: 600; color: var(--text-muted, #64748B);
  background: var(--card, #fff); border: 1px solid var(--border, #E2E8F0);
  padding: 3px 9px; border-radius: 999px;
}
.space-detail-toolbar {
  padding: 12px 22px;
  border-bottom: 1px solid var(--border, #E2E8F0);
  background: var(--bg-elevated, #fff);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.folder-card {
  position: relative;
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex; flex-direction: column; gap: 8px;
}
.folder-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08); border-color: #CBD5E1; }
.folder-card-head { display: flex; align-items: center; justify-content: space-between; position: relative; }
.folder-card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 18px;
}
.folder-card-menu-btn {
  width: 26px; height: 26px; border-radius: 6px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-soft, #94A3B8);
  display: grid; place-items: center;
  transition: background 0.12s, color 0.12s;
}
.folder-card-menu-btn:hover { background: var(--bg-soft, #F1F5F9); color: var(--text); }
.folder-card-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.folder-card-desc { font-size: 12px; color: var(--text-muted, #64748B); line-height: 1.4; min-height: 32px; }
.folder-card-foot { display: flex; gap: 14px; padding-top: 10px; border-top: 1px solid var(--border, #E2E8F0); }
.folder-stat { display: flex; flex-direction: column; gap: 1px; }
.folder-stat-num { font-size: 13px; font-weight: 700; line-height: 1.1; }
.folder-stat-label { font-size: 10.5px; color: var(--text-soft, #94A3B8); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.folder-card-menu {
  position: absolute; top: 30px; right: 0;
  background: var(--card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  z-index: 5; min-width: 160px;
  display: none;
}
.folder-card-menu.open { display: block; }
.folder-card-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  background: transparent; border: none; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--text);
  border-radius: 6px; text-align: left;
}
.folder-card-menu button:hover { background: var(--bg-soft, #F1F5F9); }
.folder-card-menu button.danger { color: #DC2626; }
.folder-card-menu button.danger:hover { background: #FEF2F2; }

.folder-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; text-align: center;
  background: var(--bg-soft, #F8FAFC);
  border: 2px dashed var(--border, #E2E8F0);
  border-radius: 12px;
  color: var(--text-muted, #64748B);
}
.folder-empty-icon { font-size: 32px; margin-bottom: 10px; }
.folder-empty-title { font-size: 14px; font-weight: 700; color: var(--text); }
.folder-empty-sub { font-size: 12px; margin-top: 4px; max-width: 320px; }

.folder-icon-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
}
.folder-icon-btn {
  padding: 8px 0; font-size: 18px;
  background: var(--bg-soft, #F1F5F9); border: 1px solid transparent;
  border-radius: 8px; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.folder-icon-btn:hover { background: #E2E8F0; }
.folder-icon-btn.selected { background: var(--primary-50, #FFF7ED); border-color: var(--primary, #F97316); transform: scale(1.05); }

@media (max-width: 600px) {
  .folder-grid { grid-template-columns: 1fr; }
  .folder-icon-grid { grid-template-columns: repeat(6, 1fr); }
  .space-detail-head { flex-direction: column; }
}

/* ============================================================
   TEAM SELECTOR DROPDOWN
   ============================================================ */
/* ============================================================
   TEAM SELECTOR DROPDOWN
   ============================================================ */
.team-selector {
  position: relative;
  margin-bottom: 24px;
  max-width: 360px;
}

.team-selector-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.team-selector-trigger:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.team-selector-trigger:focus-visible {
  outline: none;
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.team-selector.open .team-selector-trigger {
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.ts-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10B981, #34D399);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.28);
  transition: background 0.2s;
}

.ts-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ts-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #0F172A);
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ts-sub {
  font-size: 13px;
  color: var(--text-soft, #94A3B8);
  font-weight: 500;
  line-height: 1.2;
}

.ts-chev {
  flex: 0 0 auto;
  color: var(--text-soft, #94A3B8);
  transition: transform 0.2s ease, color 0.15s;
}
.team-selector.open .ts-chev {
  transform: rotate(180deg);
  color: #10B981;
}

.ts-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.22), 0 8px 16px -4px rgba(15, 23, 42, 0.08);
  padding: 8px;
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.team-selector.open .ts-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ts-menu[hidden] {
  display: block; /* keep layout so transition can run on first open */
}

.ts-menu-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft, #94A3B8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 12px 6px;
}

.ts-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.12s;
}
.ts-opt:hover,
.ts-opt:focus-visible {
  background: #F1F5F9;
  outline: none;
}
.ts-opt.active {
  background: rgba(16, 185, 129, 0.08);
}

.ts-opt-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.ts-opt-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ts-opt-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #0F172A);
  line-height: 1.25;
}
.ts-opt-sub {
  font-size: 12px;
  color: var(--text-soft, #94A3B8);
  line-height: 1.25;
}
.ts-opt-check {
  flex: 0 0 auto;
  color: #10B981;
  opacity: 0;
  transition: opacity 0.15s;
}
.ts-opt.active .ts-opt-check {
  opacity: 1;
}

.ts-menu-foot {
  border-top: 1px solid var(--border, #E2E8F0);
  margin-top: 6px;
  padding-top: 4px;
}
.ts-menu-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #F97316);
  transition: background 0.12s;
}
.ts-menu-link:hover,
.ts-menu-link:focus-visible {
  background: var(--primary-50, #FFF7ED);
  outline: none;
}

@media (max-width: 600px) {
  .team-selector { max-width: 100%; }
}
