/* Cosmos Controller Workspace Styles */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Theme: Cyber Dark (Default) */
  --bg-main: #0B0F19;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-sidebar: rgba(13, 17, 28, 0.88);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.4);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent-primary: #6366F1;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-secondary: #06B6D4;
  --accent-success: #10B981;
  --accent-warning: #F59E0B;
  --accent-danger: #EF4444;
  --glass-blur: blur(16px);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 68px;
  --header-height: 56px;
}

/* Midnight Navy Theme */
[data-theme="navy"] {
  --bg-main: #0a1128;
  --bg-card: rgba(17, 30, 66, 0.75);
  --bg-card-hover: rgba(27, 46, 99, 0.85);
  --bg-sidebar: rgba(10, 18, 43, 0.92);
  --border-color: rgba(96, 165, 250, 0.15);
  --border-highlight: rgba(59, 130, 246, 0.5);
  --accent-primary: #3B82F6;
  --accent-glow: rgba(59, 130, 246, 0.3);
}

/* AMOLED Black Theme */
[data-theme="amoled"] {
  --bg-main: #000000;
  --bg-card: #0e0e0e;
  --bg-card-hover: #181818;
  --bg-sidebar: #060606;
  --border-color: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(255, 255, 255, 0.3);
  --accent-primary: #10B981;
  --accent-glow: rgba(16, 185, 129, 0.3);
}

/* Clean Light Theme */
[data-theme="light"] {
  --bg-main: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-sidebar: rgba(248, 250, 252, 0.95);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.35);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --accent-primary: #4F46E5;
  --accent-glow: rgba(79, 70, 229, 0.15);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   AUTHENTICATION SCREEN (Google Sign-In Modal)
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1E1B4B 0%, #0B0F19 80%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 90%;
  max-width: 440px;
  background: rgba(18, 24, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  backdrop-filter: blur(20px);
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #6366F1, #06B6D4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 28px;
}

.google-auth-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  margin-bottom: 14px;
}

.google-auth-btn:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.guest-auth-btn {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.guest-auth-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-highlight);
}

.auth-footer-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 24px;
  line-height: 1.4;
}

/* App Container Layout */
#app-root {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

/* Sidebar Dock */
.sidebar-dock {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  z-index: 40;
  flex-shrink: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 14px var(--accent-glow);
  cursor: pointer;
  margin-bottom: 12px;
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.06);
}

.dock-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
}

.dock-divider {
  width: 32px;
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

.dock-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-color);
}

.dock-btn.active {
  color: #fff;
  background: var(--accent-primary);
  box-shadow: 0 0 16px var(--accent-glow);
}

.dock-btn .dock-indicator {
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 4px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 0 4px 4px 0;
  transition: transform 0.2s ease;
}

.dock-btn.active .dock-indicator {
  transform: translateY(-50%) scaleY(1);
}

.dock-btn .badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}

/* User Profile Avatar in Dock */
.dock-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.dock-profile-avatar:hover {
  transform: scale(1.1);
}

/* Tooltips */
.tooltip-wrap {
  position: relative;
}
.tooltip-wrap .tooltip-text {
  visibility: hidden;
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1E293B;
  color: #F8FAFC;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.tooltip-wrap:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

/* Main Workspace Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Top App Header */
.top-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 30;
  gap: 12px;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  width: 260px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-search:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.header-search kbd {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  margin-left: auto;
  border: 1px solid var(--border-color);
}

/* Category Filter Pills */
.category-pills {
  display: flex;
  gap: 6px;
  align-items: center;
}

.category-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.category-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.category-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.category-btn .badge-num {
  background: rgba(255,255,255,0.15);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
}

/* Header Notification Bell Button */
.header-notif-btn {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-notif-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.header-notif-btn .notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

/* User Profile Switcher Button in Header */
.profile-badge-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.profile-badge-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.profile-badge-avatar {
  font-size: 16px;
}

/* Viewport / Dynamic Content */
.content-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

/* Dashboard View */
.dashboard-view {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 24px 30px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(6, 182, 212, 0.1));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  background: linear-gradient(to right, #ffffff, #94A3B8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 13.5px;
  max-width: 580px;
  line-height: 1.5;
}

.quick-stats-bar {
  display: flex;
  gap: 12px;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill i {
  color: var(--accent-primary);
  font-size: 16px;
}

.stat-pill .stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-pill .stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* App Grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* App Card */
.app-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--app-color, var(--accent-primary));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--app-color, #fff);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.app-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.app-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.app-info p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.app-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-open {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-open:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.card-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.card-action-btn:hover {
  color: var(--text-primary);
}
.card-action-btn.delete-btn:hover {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   HOMEPAGE IN-WEBSITE AI ASSISTANT VIEWER
   ========================================================================== */
.homepage-ai-viewer {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.2s ease;
}

.homepage-ai-viewer.active {
  display: flex;
  flex-direction: column;
}

.ai-viewer-header {
  padding: 12px 18px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-tab-switcher {
  display: flex;
  gap: 6px;
}

.ai-tab-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.ai-tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.ai-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
}

.ai-viewer-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
}

.ai-active-prompt-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-prompt-quote {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.5;
  font-style: italic;
}

/* ==========================================================================
   IN-TAB BROWSER WORKSPACE VIEW (Tabs at Top + Full In-Tab Viewer)
   ========================================================================== */
.intab-workspace {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  background: var(--bg-main);
  position: absolute;
  inset: 0;
  z-index: 25;
}

.intab-workspace.active {
  display: flex;
}

/* Tab Bar */
.workspace-tab-bar {
  height: 42px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 4px;
  overflow-x: auto;
}

.app-tab {
  height: 32px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  max-width: 180px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.app-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.app-tab.active {
  background: var(--bg-main);
  color: var(--text-primary);
  border-color: var(--border-highlight);
  font-weight: 600;
}

.tab-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}
.tab-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
}

.tab-new-btn {
  height: 28px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}
.tab-new-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

/* In-Tab Navigation Toolbar */
.intab-toolbar {
  height: 40px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 12px;
}

.intab-nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.intab-url-pill {
  flex: 1;
  max-width: 480px;
  height: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 13px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* In-Tab Frame Container */
.intab-frame-container {
  flex: 1;
  width: 100%;
  height: calc(100% - 82px);
  position: relative;
  background: #000;
}

/* Friendly In-Tab Embed Fallback */
.embed-fallback {
  position: absolute;
  inset: 0;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  z-index: 10;
}

.fallback-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--accent-primary);
  margin-bottom: 16px;
}

.fallback-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.fallback-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.fallback-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   NOTIFICATIONS DRAWER & CARDS
   ========================================================================== */
.notif-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.notif-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.notif-card.unread {
  border-left: 3px solid var(--accent-primary);
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  margin-top: 4px;
  flex-shrink: 0;
}

.notif-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-msg {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.notif-time {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Live Toast Notification Popup */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-sidebar);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  backdrop-filter: var(--glass-blur);
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.show .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-primary);
}

/* Buttons */
.btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.btn-primary:hover {
  background: #4F46E5;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--accent-danger);
  color: #fff;
}

/* Side Drawers */
.side-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: 400px;
  height: 100%;
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Inbox Card */
.inbox-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
}

.inbox-card:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.inbox-card.completed {
  opacity: 0.5;
}

.inbox-card.completed .inbox-title {
  text-decoration: line-through;
}

.inbox-check {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
}

.inbox-body {
  flex: 1;
}

.inbox-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.inbox-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.inbox-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
}
.inbox-tag.high { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; }
.inbox-tag.medium { background: rgba(245, 158, 11, 0.2); color: #FCD34D; }
.inbox-tag.low { background: rgba(16, 185, 129, 0.2); color: #6EE7B7; }

/* AI Prompt Bar */
.ai-prompt-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

/* User Profiles List in Modal */
.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-card:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.profile-card.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
}

/* App Manager Row in Settings */
.app-setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}

.app-setting-item:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

/* Command Palette Modal (Ctrl+K) */
.palette-modal {
  width: 90%;
  max-width: 600px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.palette-input-wrap {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.palette-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
}

.palette-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.palette-item:hover, .palette-item.selected {
  background: var(--bg-card-hover);
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .sidebar-dock {
    width: 56px;
  }
  .header-search {
    width: 140px;
  }
  .category-pills {
    display: none;
  }
  .app-grid {
    grid-template-columns: 1fr;
  }
  .side-drawer {
    width: 100%;
    right: -100%;
  }
}
