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

/* Design Tokens & Variables */
:root {
  --font-title: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Premium HSL Color Palette */
  --bg-primary: #030712;
  --bg-secondary: #0b0f19;
  --bg-tertiary: #111827;

  --card-bg: rgba(17, 25, 40, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-glow: rgba(99, 102, 241, 0.15);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Header and structural theme elements */
  --header-bg: rgba(3, 7, 18, 0.8);
  --logo-text-gradient: linear-gradient(to right, #ffffff, #d1d5db);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --card-hover-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.05);
  --input-bg: rgba(3, 7, 18, 0.4);
  --chat-input-bg: rgba(15, 23, 42, 0.7);
  --chat-input-focus-bg: rgba(15, 23, 42, 0.9);
  --chat-input-border: rgba(255, 255, 255, 0.12);
  --msg-hover-bg: #1e293b;
  --auth-wrapper-bg: rgba(3, 7, 18, 0.8);

  /* Chat Variables */
  --chat-container-bg: rgba(11, 15, 25, 0.4);
  --chat-container-border: rgba(255, 255, 255, 0.05);
  --chat-sidebar-bg: rgba(3, 7, 18, 0.4);
  --chat-sidebar-border: rgba(255, 255, 255, 0.05);
  --chat-main-bg: rgba(11, 15, 25, 0.15);
  --chat-header-bg: rgba(11, 15, 25, 0.3);
  --chat-header-border: rgba(255, 255, 255, 0.05);
  --chat-messages-bg: rgba(3, 7, 18, 0.1);
  --chat-self-card-bg: rgba(3, 7, 18, 0.6);
  --chat-self-card-border: rgba(255, 255, 255, 0.05);
  --chat-members-bg: rgba(3, 7, 18, 0.25);
  --chat-members-border: rgba(255, 255, 255, 0.05);
  --chat-active-bg: rgba(99, 102, 241, 0.15);
  --chat-active-border: rgba(99, 102, 241, 0.25);
  --chat-active-color: white;

  --thread-drawer-bg: rgba(11, 15, 25, 0.95);
  --thread-drawer-border: rgba(255, 255, 255, 0.08);
  --thread-header-bg: rgba(3, 7, 18, 0.4);
  --thread-header-border: rgba(255, 255, 255, 0.08);
  --thread-input-bg: rgba(3, 7, 18, 0.5);
  --thread-input-border: rgba(255, 255, 255, 0.08);

  /* Warehouse variables */
  --warehouse-item-bg: rgba(30, 41, 59, 0.45);
  --warehouse-item-border: rgba(255, 255, 255, 0.12);
  --warehouse-item-hover-bg: rgba(30, 41, 59, 0.75);

  /* Kanban Variables */
  --kanban-column-bg: rgba(15, 23, 42, 0.4);
  --kanban-column-border: rgba(255, 255, 255, 0.05);
  --kanban-card-bg: rgba(30, 41, 59, 0.7);
  --kanban-card-border: rgba(255, 255, 255, 0.06);

  /* Accents */
  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.4);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.4);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.4);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.3);
  --accent-rose: #f43f5e;
  --accent-rose-glow: rgba(244, 63, 94, 0.3);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.3);

  --gradient-indigo: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  --gradient-emerald: linear-gradient(135deg, var(--accent-emerald), #059669);
  --gradient-cyan: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  --gradient-purple: linear-gradient(135deg, var(--accent-purple), var(--accent-rose));

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;

  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(15, 23, 42, 0.08);
  --card-glow: rgba(99, 102, 241, 0.05);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --header-bg: rgba(255, 255, 255, 0.85);
  --logo-text-gradient: linear-gradient(to right, #0f172a, #334155);
  --card-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.06);
  --card-hover-shadow: 0 10px 40px 0 rgba(15, 23, 42, 0.08), 0 0 20px rgba(99, 102, 241, 0.04);
  --input-bg: rgba(255, 255, 255, 0.85);
  --chat-input-bg: rgba(255, 255, 255, 0.9);
  --chat-input-focus-bg: #ffffff;
  --chat-input-border: rgba(15, 23, 42, 0.12);
  --msg-hover-bg: #f1f5f9;
  --auth-wrapper-bg: rgba(241, 245, 249, 0.8);

  /* Modal Variables */
  --modal-bg: #ffffff;
  --modal-header-bg: #f8fafc;
  --modal-card-bg: #ffffff;

  /* Chat Variables */
  --chat-container-bg: rgba(255, 255, 255, 0.45);
  --chat-container-border: rgba(15, 23, 42, 0.08);
  --chat-sidebar-bg: rgba(241, 245, 249, 0.6);
  --chat-sidebar-border: rgba(15, 23, 42, 0.08);
  --chat-main-bg: rgba(255, 255, 255, 0.2);
  --chat-header-bg: rgba(255, 255, 255, 0.5);
  --chat-header-border: rgba(15, 23, 42, 0.08);
  --chat-messages-bg: rgba(255, 255, 255, 0.3);
  --chat-self-card-bg: rgba(241, 245, 249, 0.95);
  --chat-self-card-border: rgba(15, 23, 42, 0.08);
  --chat-members-bg: rgba(241, 245, 249, 0.45);
  --chat-members-border: rgba(15, 23, 42, 0.08);
  --chat-active-bg: rgba(99, 102, 241, 0.12);
  --chat-active-border: rgba(99, 102, 241, 0.2);
  --chat-active-color: var(--accent-indigo);

  --thread-drawer-bg: rgba(255, 255, 255, 0.98);
  --thread-drawer-border: rgba(15, 23, 42, 0.1);
  --thread-header-bg: rgba(241, 245, 249, 0.95);
  --thread-header-border: rgba(15, 23, 42, 0.1);
  --thread-input-bg: rgba(241, 245, 249, 0.85);
  --thread-input-border: rgba(15, 23, 42, 0.1);

  /* Warehouse Variables */
  --warehouse-item-bg: rgba(255, 255, 255, 0.65);
  --warehouse-item-border: rgba(15, 23, 42, 0.08);
  --warehouse-item-hover-bg: rgba(255, 255, 255, 0.85);

  /* Kanban Variables */
  --kanban-column-bg: rgba(255, 255, 255, 0.45);
  --kanban-column-border: rgba(15, 23, 42, 0.08);
  --kanban-card-bg: rgba(255, 255, 255, 0.85);
  --kanban-card-border: rgba(15, 23, 42, 0.08);
}

/* Global Reset & Base Styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-indigo) var(--bg-secondary);
}

body {
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.05) 0px, transparent 70%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body), "Noto Color Emoji", "Segoe UI Emoji", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-indigo);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* Structural Layout */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 1.25rem 2rem;
}

.header-container {
  width: 100%;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 0 15px var(--accent-indigo-glow);
}

.logo-text h1 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: var(--logo-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-stats {
  display: flex;
  gap: 1.5rem;
}

.header-stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.header-stat-val {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.header-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Main Container */
main {
  width: 100%;
  margin: 1rem 0 0 0;
  padding: 0 2rem;
  box-sizing: border-box;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  margin-bottom: 2.5rem;
  width: fit-content;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Glassmorphism Card Style */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem 2rem 2rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: var(--card-hover-shadow);
}

.card-title-container {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 1rem !important;
  margin-bottom: 1.5rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding-bottom: 1rem !important;
}

.card-title {
  font-family: var(--font-title) !important;
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.85rem !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Icons */
.icon-container {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  border-radius: 12px !important;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
  flex-shrink: 0 !important;
}

.icon-container svg,
.icon-container i {
  width: 20px !important;
  height: 20px !important;
}

@media (max-width: 768px) {
  .card-title-container {
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
  }

  .card-title {
    font-size: 1.2rem !important;
  }
}

/* Dashboard Summary Cards Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition-normal);
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(6, 182, 212, 0.3);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

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

.stat-number {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 0.15rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Custom Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-indigo {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-rose,
.badge-red {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Page Section Tabs Switching Logic */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Profiles Layout */
.profiles-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Premium Project Cards Overview */
.project-overview-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-top: 4px solid var(--project-accent);
  border-radius: 20px;
  padding: 1.75rem;
  margin-bottom: 0;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow: hidden;
}

.project-overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--project-bg-gradient);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.project-overview-card:hover {
  transform: translateY(-6px);
  border-color: var(--project-accent);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25), 0 0 20px var(--project-accent-glow);
}

[data-theme="light"] .project-overview-card:hover {
  box-shadow: 0 12px 32px 0 rgba(15, 23, 42, 0.1), 0 0 20px var(--project-accent-glow);
}

/* Accent Themes */
.theme-indigo {
  --project-accent: var(--accent-indigo);
  --project-accent-glow: rgba(99, 102, 241, 0.15);
  --project-bg-gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.01));
}

.theme-purple {
  --project-accent: var(--accent-purple);
  --project-accent-glow: rgba(139, 92, 246, 0.15);
  --project-bg-gradient: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(139, 92, 246, 0.01));
}

.theme-cyan {
  --project-accent: var(--accent-cyan);
  --project-accent-glow: rgba(6, 182, 212, 0.15);
  --project-bg-gradient: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(6, 182, 212, 0.01));
}

.project-card-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-title-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.project-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--project-accent-glow);
  color: var(--project-accent);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.project-overview-card:hover .project-icon-wrapper {
  transform: scale(1.1) rotate(5deg);
}

.project-name-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.project-name {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.project-description {
  position: relative;
  z-index: 1;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  flex-grow: 1;
}

.project-tech-tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tech-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.project-overview-card:hover .project-tech-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

[data-theme="light"] .project-tech-tag {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .project-overview-card:hover .project-tech-tag {
  background: rgba(15, 23, 42, 0.06);
}

.project-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--card-border);
  padding-top: 1rem;
  margin-top: 0.25rem;
}

.project-collab-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.collab-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.collab-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.collab-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.collab-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-card {
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.profile-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.profile-card.supervisor-card {
  border-top: 4px solid var(--accent-amber) !important;
  border-color: rgba(245, 158, 11, 0.2);
}

.profile-card.supervisor-card:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.12), 0 12px 24px rgba(0, 0, 0, 0.3);
}

.profile-card.collab-card {
  border-top: 4px solid var(--accent-indigo) !important;
  border-color: rgba(99, 102, 241, 0.2);
}

.profile-card.collab-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.12), 0 12px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .profile-card {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .profile-card:hover {
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08) !important;
}

/* Cover banner inside the card */
.profile-card-cover {
  height: 80px;
  width: 100%;
  position: relative;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.profile-card.supervisor-card .profile-card-cover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}

.profile-card.collab-card .profile-card-cover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .profile-card.supervisor-card .profile-card-cover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.02) 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.08);
}

[data-theme="light"] .profile-card.collab-card .profile-card-cover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.02) 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.5rem;
  margin-top: -35px;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: white;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border: 3px solid #090d16;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-card:hover .profile-avatar {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .profile-avatar {
  border-color: #ffffff !important;
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.12) !important;
}

.profile-title-group h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-role {
  font-size: 0.725rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
  display: block;
}

.profile-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Detail container utilizing cards with Lucide icons */
.profile-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 1.5rem;
  margin-bottom: 1.25rem;
}

.profile-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-detail-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

[data-theme="light"] .profile-detail-item {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .profile-detail-item:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
}

.profile-detail-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.profile-card.supervisor-card .profile-detail-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.profile-detail-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-grow: 1;
}

.profile-detail-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.profile-detail-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

/* Technology section */
.profile-tech-section {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .profile-tech-section {
  border-top-color: rgba(15, 23, 42, 0.06);
  background: rgba(15, 23, 42, 0.02);
}

.profile-tech-title {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.05em;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-tag:hover {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.profile-card.supervisor-card .profile-tag:hover {
  background: linear-gradient(135deg, var(--accent-amber), #ea580c);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .profile-tag {
  background: rgba(15, 23, 42, 0.03) !important;
  color: var(--text-secondary) !important;
  border-color: rgba(15, 23, 42, 0.06) !important;
}

[data-theme="light"] .profile-tag:hover {
  background: var(--accent-indigo) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2) !important;
}

[data-theme="light"] .profile-card.supervisor-card .profile-tag:hover {
  background: var(--accent-amber) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2) !important;
}

/* Delete Button */
.btn-delete-card-member {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease !important;
  z-index: 10;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-delete-card-member:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  transform: scale(1.1) rotate(5deg) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
}

.sub-team-container {
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  border-left: 1.5px dashed rgba(255, 255, 255, 0.08);
  margin-left: 1rem;
}

[data-theme="light"] .sub-team-container {
  border-left-color: rgba(15, 23, 42, 0.08) !important;
}

.sub-team-container .weekly-intern-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* Timeline/Gantt Chart */
.gantt-chart {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.gantt-header {
  display: grid;
  grid-template-columns: 240px repeat(8, 1fr);
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  min-width: 900px;
}

.gantt-header-label {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gantt-header-col {
  text-align: center;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.gantt-row {
  display: grid;
  grid-template-columns: 240px repeat(8, 1fr);
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  min-width: 900px;
}

.gantt-row-label {
  display: flex;
  flex-direction: column;
}

.gantt-row-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.gantt-row-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gantt-bar-container {
  grid-column: span 8;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  position: relative;
  height: 28px;
}

.gantt-bar {
  height: 100%;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.gantt-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255, 255, 255, 0.15), transparent);
  pointer-events: none;
}

.gantt-bar:hover {
  transform: scale(1.01);
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

/* Milestone Indicators */
.gantt-milestones-row {
  display: grid;
  grid-template-columns: 240px repeat(8, 1fr);
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 900px;
  margin-top: 1rem;
}

.milestone-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.milestone-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
  transition: var(--transition-normal);
  cursor: pointer;
}

.milestone-dot::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  top: -5px;
  left: -5px;
  opacity: 0.5;
  animation: pulse-milestone 2s infinite;
}

@keyframes pulse-milestone {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.1;
  }

  100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
}

.milestone-title {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.milestone-date {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* Start Guides layout */
.guides-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.guide-selector-btn {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: var(--transition-normal);
}

.guide-selector-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.01);
}

.guide-selector-btn.active[data-guide="arabikid"] {
  border-color: var(--accent-indigo);
  color: white;
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.guide-selector-btn.active[data-guide="medoc33"] {
  border-color: var(--accent-purple);
  color: white;
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}

.guide-selector-btn.active[data-guide="rhassistant"] {
  border-color: var(--accent-cyan);
  color: white;
  background: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.guide-body {
  display: none;
}

.guide-body.active {
  display: block;
  animation: fadeIn var(--transition-normal);
}

/* Markdown-like layout for Guides */
.tech-guide {
  font-size: 0.95rem;
  color: #e5e7eb;
}

.tech-guide h3 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: white;
  border-left: 4px solid var(--accent-indigo);
  padding-left: 0.75rem;
}

.tech-guide h4 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem 0;
  color: white;
}

.tech-guide p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.tech-guide ul,
.tech-guide ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.tech-guide li {
  margin-bottom: 0.35rem;
}

/* Beautiful Code block styling */
.tech-code-block {
  background: #020617;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  font-family: 'Consolas', 'Fira Code', Monaco, monospace;
  font-size: 0.85rem;
  color: #a7f3d0;
  overflow-x: auto;
  margin: 0.75rem 0 1.5rem 0;
  position: relative;
}

.tech-code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border-bottom-left-radius: 8px;
  border-left: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.alert-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--accent-indigo);
  padding: 1rem;
  border-radius: 0 12px 12px 0;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.75rem;
}

.alert-box.warning {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: var(--accent-amber);
}

.alert-box-icon {
  font-size: 1.25rem;
}

.alert-box-text p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.alert-box-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Weekly Planning Section */
.week-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.week-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.week-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.week-btn.active {
  background: var(--accent-indigo);
  color: white;
  border-color: var(--accent-indigo);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

/* Weekly Layout Columns */
.weekly-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

@media (min-width: 1025px) {
  .weekly-layout {
    display: flex !important;
    gap: 0 !important;
  }

  .weekly-sidebar {
    width: 280px;
    min-width: 250px;
    flex-shrink: 0;
  }

  .weekly-checklist-area {
    flex: 1;
    min-width: 0;
    margin-left: 1.5rem;
  }
}

.weekly-sidebar-resizer {
  display: none;
}

@media (min-width: 1025px) {
  .weekly-sidebar-resizer {
    display: block;
    width: 2px;
    cursor: col-resize;
    background: var(--chat-sidebar-border);
    position: sticky;
    top: 92px;
    z-index: 50;
    height: calc(100vh - 110px) !important;
    flex-shrink: 0;
    transition: background 0.15s ease;
  }

  .weekly-sidebar-resizer::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -4px;
    right: -4px;
    cursor: col-resize;
    z-index: 51;
  }

  .weekly-sidebar-resizer:hover,
  .weekly-sidebar-resizer.resizing {
    background: var(--accent-indigo, #6366f1) !important;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
  }
}

@media (max-width: 1024px) {
  .weekly-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .btn-toggle-weekly-sidebar {
    display: flex !important;
  }

  .weekly-sidebar {
    display: none !important;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem !important;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--card-shadow);
  }

  .weekly-sidebar.show-mobile {
    display: flex !important;
    animation: fadeIn var(--transition-normal);
  }
}

.weekly-sidebar-backdrop {
  display: none;
}

.weekly-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 1025px) {
  .weekly-sidebar {
    height: calc(100vh - 110px) !important;
    max-height: none !important;
    overflow-y: auto;
    position: sticky;
    top: 92px;
    padding-right: 0.5rem;
  }

  .weekly-checklist-area {
    height: calc(100vh - 110px) !important;
    max-height: none !important;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
  }

  .weekly-checklist-area .active-checklist-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0 !important;
  }
}

.tasks-checklist {
  width: 100%;
  display: block;
  overflow-x: hidden;
}

.weekly-sidebar-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.project-sidebar-title {
  font-family: var(--font-title);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.project-sidebar-header-block {
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.project-sidebar-header-block:hover {
  background: var(--bg-tertiary);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
  box-shadow: var(--card-hover-shadow);
}

.project-sidebar-header-block.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
  border-color: var(--accent-indigo);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}


.weekly-intern-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-normal);
}

.weekly-intern-btn:hover {
  border-color: var(--card-border);
  background: var(--bg-tertiary);
}

.weekly-intern-btn.active {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.weekly-intern-btn .project-label {
  color: var(--accent-indigo);
  font-weight: 600;
}

.weekly-intern-btn.active .project-label {
  color: rgba(255, 255, 255, 0.9);
}

.weekly-intern-btn .progress-pill {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

[data-theme="light"] .weekly-intern-btn .progress-pill {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-secondary);
}

.weekly-intern-btn.active .progress-pill {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

/* Tasks Checklist */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
}

.checklist-header h3 {
  font-family: var(--font-title);
  font-size: 1.25rem;
}

.task-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.2);
}

.task-checkbox-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 0.15rem;
}

.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-checkbox:checked {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  border-color: transparent;
}

.task-checkbox:checked::after {
  content: '✓';
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.task-item.completed {
  opacity: 0.5;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
}

.task-text {
  font-weight: 500;
  font-size: 0.95rem;
}

.task-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.task-tag {
  align-self: flex-start;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-top: 0.35rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Custom Progress Bar inside glass-card */
.overall-progress-bar-container {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.5rem;
  position: relative;
}

[data-theme="light"] .overall-progress-bar-container {
  background: rgba(15, 23, 42, 0.08);
}

.overall-progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent-indigo), var(--accent-cyan));
  border-radius: 9999px;
  width: 0%;
  transition: width 0.5s ease-out;
}

/* Footer Section */
footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--card-border);
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--accent-indigo);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Tutor Zone & Administration Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.btn-amber {
  background: linear-gradient(135deg, var(--accent-amber), #d97706);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-amber:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  filter: brightness(1.05);
}

/* Task Comments & Evidences Area */
.task-comment-area {
  width: 100%;
  margin-top: 0.75rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.task-comment-label {
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-comment-input {
  background: rgba(3, 7, 18, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  width: 100%;
  font-size: 0.75rem;
  color: #e5e7eb;
  outline: none;
  transition: var(--transition-fast);
}

.task-comment-input:focus {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}

/* Tutor Administration Grid */
.tutor-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
}

.admin-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}



/* Delete Task Button Premium styling */
.task-delete-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(244, 63, 94, 0.6);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all var(--transition-fast) !important;
}

.task-delete-btn:hover {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
  color: #f43f5e !important;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}



/* Responsive adjustment for Tutor Zone */
@media (max-width: 992px) {
  .tutor-admin-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .admin-column {
    border-right: none !important;
    padding-right: 0 !important;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 2rem;
    margin-bottom: 1rem;
  }

  .admin-column:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
}

/* Session Identity Selector in Header */
.session-selector-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  margin-left: auto;
  margin-right: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.session-label {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-indigo);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.session-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  padding-right: 1.5rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 1rem;
}

.session-select:hover {
  color: white;
}

.glow-text {
  text-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* ===================================================
     PREMIUM GLASSMORPHIC AUTHENTICATION STYLES
     =================================================== */

/* Auth Screen Overlay Wrapper */
.auth-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--auth-wrapper-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  padding: 0;
  transition: opacity 0.5s ease;
}

/* Auth Topbar Styles */
.auth-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1.25rem 2rem;
  background: rgba(3, 7, 18, 0.25);
  border-bottom: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1001;
  box-sizing: border-box;
}

[data-theme="light"] .auth-topbar {
  background: rgba(255, 255, 255, 0.25);
}

.auth-topbar-left {
  display: flex;
  align-items: center;
}

.auth-logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-logo-icon {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 0 12px var(--accent-indigo-glow);
  font-family: var(--font-title);
  letter-spacing: -0.025em;
}

.auth-logo-text {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: var(--logo-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-lang-selector {
  display: flex;
  gap: 0.25rem;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  padding: 0.2rem;
  border-radius: 8px;
  align-items: center;
}

.auth-lang-selector .lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-title);
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  user-select: none;
}

.auth-lang-selector .lang-btn:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.auth-lang-selector .lang-btn.active {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* Cards Wrapper */
.auth-cards-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2.5rem 1.5rem;
  box-sizing: border-box;
}

/* Auth Footer */
.auth-footer {
  width: 100%;
  padding: 0.7rem;
  text-align: center;
  border-top: none;
  background: rgba(3, 7, 18, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1001;
  box-sizing: border-box;
  margin: 0;
}

[data-theme="light"] .auth-footer {
  background: rgba(255, 255, 255, 0.15);
}

.auth-footer p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  font-family: var(--font-body);
  opacity: 0.8;
}

/* Auth glass cards */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin: auto;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

.auth-header h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.auth-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
  background-color: var(--input-bg, rgba(3, 7, 18, 0.4)) !important;
}

[data-theme="light"] input:disabled,
[data-theme="light"] select:disabled,
[data-theme="light"] textarea:disabled {
  background-color: rgba(226, 232, 240, 0.6) !important;
  color: #94a3b8 !important;
  border-color: rgba(203, 213, 225, 0.8) !important;
}

.auth-error {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

.auth-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

.auth-btn {
  border: none;
  border-radius: 10px;
  padding: 0.85rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-indigo,
.btn-emerald {
  color: #ffffff !important;
  border: none;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-indigo {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-indigo:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.auth-footer-links {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.auth-footer-links a {
  color: var(--accent-indigo);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer-links a:hover {
  text-decoration: underline;
}

/* Auth Responsiveness */
@media (max-width: 480px) {
  .auth-wrapper {
    padding: 0 !important;
  }

  .auth-topbar {
    padding: 1rem 1.25rem;
  }

  .auth-cards-container {
    padding: 1.5rem 1rem;
  }

  .auth-footer {
    padding: 1.25rem 1rem;
  }

  .auth-card {
    padding: 1.5rem;
    border-radius: 16px;
    margin: auto;
  }

  .auth-header h2 {
    font-size: 1.5rem;
  }
}

/* Modal overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 1.5rem;
}

.submodal-overlay,
.modal-overlay.submodal-overlay {
  z-index: 200000 !important;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(17, 25, 40, 0.97) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-title-icon {
  font-size: 1.5rem;
}

.modal-header h3 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  flex-grow: 1;
  margin-left: 0.75rem;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-close-modal:hover {
  color: var(--accent-rose);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked+.slider {
  background-color: var(--accent-indigo);
}

input:checked+.slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Light theme overrides for toggle switch slider */
[data-theme="light"] .slider {
  background-color: rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .slider:before {
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] input:checked+.slider {
  background-color: var(--accent-indigo);
  border-color: transparent;
}

.security-sec-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.security-sec-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Deadline styles */
.deadline-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.deadline-badge.normal {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.deadline-badge.urgent {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.deadline-badge.overdue {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
  animation: pulse-red-bg 2s infinite;
}

/* Pulse keyframes */
@keyframes pulse-red-bg {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(244, 63, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
  }
}

@keyframes pulse-scale {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0);
  }
}

.task-item.deadline-overdue {
  border-color: rgba(244, 63, 94, 0.3) !important;
  background: rgba(244, 63, 94, 0.015) !important;
}

.task-item.deadline-urgent {
  border-color: rgba(245, 158, 11, 0.3) !important;
  background: rgba(245, 158, 11, 0.015) !important;
}

/* Profile header security buttons and layout */
.profile-header-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  margin-right: 1.5rem;
}

.avatar-header {
  width: 36px;
  height: 36px;
  max-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: white;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-meta-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.profile-meta-role {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
}

.btn-security-settings {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-security-settings:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-indigo);
  color: #fff;
}

.btn-logout {
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.15);
  border-radius: 8px;
  color: var(--accent-rose);
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
  transform: translateY(-1px);
}

/* Badge attributions */
.badge-manager {
  background: rgba(99, 102, 241, 0.1) !important;
  color: var(--accent-indigo) !important;
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

.badge-personal {
  background: rgba(6, 182, 212, 0.1) !important;
  color: var(--accent-cyan) !important;
  border: 1px solid rgba(6, 182, 212, 0.2) !important;
}

/* ===================================================
   KANBAN BOARD STYLES
   =================================================== */
.kanban-board-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kanban-columns {
  display: flex !important;
  gap: 1.5rem !important;
  overflow-x: auto !important;
  padding-bottom: 1.5rem !important;
  align-items: flex-start !important;
  width: 100% !important;
}

/* Custom Scrollbar for Kanban Board */
.kanban-columns::-webkit-scrollbar {
  height: 8px;
}

.kanban-columns::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.kanban-columns::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: background 0.2s;
}

.kanban-columns::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===================================================
   KANBAN COLUMN RESIZER STYLES
   =================================================== */

.kanban-column-resizer {
  position: absolute;
  top: 0;
  right: -8px;
  width: 16px;
  height: 100%;
  cursor: col-resize;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

.kanban-column-resizer::after {
  content: '';
  width: 4px;
  height: 38px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s, height 0.2s, width 0.2s, box-shadow 0.2s;
}

.kanban-column-resizer:hover::after,
.kanban-column-resizer.is-resizing::after {
  background: var(--accent-cyan, #06b6d4);
  height: 70px;
  width: 5px;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.8);
}

.kanban-column {
  background: var(--kanban-column-bg);
  border: 1px solid var(--kanban-column-border);
  border-top: 4px solid var(--card-border);
  border-radius: 16px;
  padding: 0.75rem 0.5rem 0.5rem 0.5rem;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background-color 0.2s, border-color 0.2s, border-width 0.15s, transform 0.15s;
  backdrop-filter: blur(10px);
  position: relative;
  flex: 1 1 0px;
  min-width: 270px;
  max-width: none;
}

.kanban-column[data-column-key="todo"] {
  border-top-color: var(--text-muted) !important;
}

.kanban-column[data-column-key="ongoing"] {
  border-top-color: var(--accent-cyan) !important;
}

.kanban-column[data-column-key="done"] {
  border-top-color: var(--accent-emerald) !important;
}

.kanban-column[data-column-key="cancelled"] {
  border-top-color: var(--accent-rose) !important;
}

.kanban-column:not([data-column-key="todo"]):not([data-column-key="ongoing"]):not([data-column-key="done"]):not([data-column-key="cancelled"]) {
  border-top-color: var(--accent-purple) !important;
}

.kanban-column.drag-over {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

.kanban-column-header {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--card-border);
}

.kanban-column-header.todo {
  color: var(--text-secondary);
  border-color: rgba(148, 163, 184, 0.2);
}

.kanban-column-header.ongoing {
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.2);
}

.kanban-column-header.done {
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.2);
}

.kanban-column-header.cancelled {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.2);
}

.kanban-column-header.custom {
  color: var(--accent-purple);
  border-color: rgba(168, 85, 247, 0.2);
}

.kanban-column.drag-over-left {
  border-left: 3px dashed var(--accent-indigo) !important;
  transform: translateX(4px);
}

.kanban-column.drag-over-right {
  border-right: 3px dashed var(--accent-indigo) !important;
  transform: translateX(-4px);
}

.kanban-column.column-dragging {
  opacity: 0.4;
  border: 2px dashed var(--accent-indigo) !important;
}

.kanban-count {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  color: var(--text-secondary);
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex-grow: 1;
  min-height: 400px;
}

.kanban-card {
  background: var(--kanban-card-bg);
  border: 1px solid var(--kanban-card-border);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  cursor: grab;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

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

.kanban-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-indigo);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25);
}

body.dragging-active .kanban-card:not(.dragging) {
  pointer-events: none !important;
}


.kanban-card-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-indigo);
  letter-spacing: 0.05em;
}

.kanban-card-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.kanban-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.kanban-card-controls {
  display: flex;
  gap: 0.25rem;
}

.kanban-btn-shift {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.kanban-btn-shift:hover {
  background: var(--accent-indigo);
  color: white;
  border-color: var(--accent-indigo);
}

.kanban-card-category-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
  display: inline-block;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-indigo);
}

.kanban-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  border-left: 2px solid var(--card-border);
  padding-left: 0.5rem;
  margin-top: 0.15rem;
}

.kanban-card-comment-section {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kanban-card-comment-section .comment-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.comment-display-trigger {
  background: rgba(0, 0, 0, 0.015);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: background 0.2s, border-color 0.2s;
}

[data-theme="dark"] .comment-display-trigger {
  background: rgba(255, 255, 255, 0.015);
}

.comment-display-trigger:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--accent-indigo-glow);
}

.comment-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.comment-link-badge:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

.comment-edit-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-edit-input-wrapper .kanban-comment-input {
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1.5px solid var(--accent-indigo);
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.collab-avatar-circle {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.15s;
  position: relative;
}

.collab-avatar-circle:hover {
  transform: scale(1.2) translateY(-1px);
  z-index: 10 !important;
}

.add-collab-circle {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, color 0.2s, background 0.2s;
  position: relative;
}

.add-collab-circle:hover {
  transform: scale(1.2) translateY(-1px);
  border-color: var(--accent-indigo) !important;
  color: var(--accent-indigo) !important;
  background: rgba(99, 102, 241, 0.12) !important;
}

/* Collaborator Transfer Modal Items */
.collab-transfer-item:hover {
  border-color: var(--accent-indigo) !important;
  background: rgba(99, 102, 241, 0.06) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.collab-transfer-item.selected {
  border-color: var(--accent-indigo) !important;
  background: rgba(99, 102, 241, 0.1) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.collab-transfer-item:active {
  cursor: grabbing;
}

/* Light mode modal container & submodal explicit overrides */
[data-theme="light"] .modal-overlay .modal-card,
[data-theme="light"] .modal-card,
[data-theme="light"] #add-members-submodal > div,
[data-theme="light"] #modal-task-collabs > div,
[data-theme="light"] #modal-select-collab > div {
  background: #ffffff !important;
  color: var(--text-primary);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
}

[data-theme="light"] #sub-member-list {
  background: #ffffff !important;
}

[data-theme="light"] .sub-member-row:hover {
  background: rgba(99, 102, 241, 0.08) !important;
}

[data-theme="light"] .collab-transfer-item {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

[data-theme="light"] .collab-transfer-item:hover {
  background: rgba(99, 102, 241, 0.06) !important;
}

.collab-panel-dropzone {
  transition: outline 0.15s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
}

.collab-panel-dropzone::-webkit-scrollbar {
  width: 4px;
}

.collab-panel-dropzone::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 4px;
}

/* ===================================================
   WAREHOUSE STYLES
   =================================================== */
.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.warehouse-item {
  background: var(--warehouse-item-bg);
  border: 1px solid var(--warehouse-item-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.warehouse-item:hover {
  background: var(--warehouse-item-hover-bg);
  border-color: var(--accent-emerald);
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.2), 0 0 15px rgba(16, 185, 129, 0.05);
}

@keyframes warehouseHighlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.8), 0 8px 30px rgba(99, 102, 241, 0.4);
    border-color: var(--accent-indigo);
    transform: translateY(-4px) scale(1.02);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(99, 102, 241, 0), 0 12px 40px rgba(99, 102, 241, 0.5);
    border-color: #a855f7;
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(0) scale(1);
  }
}

.warehouse-item.highlight-pulse-task {
  animation: warehouseHighlightPulse 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
  border: 2px solid var(--accent-indigo) !important;
}

/* Warehouse Admin Form Toggle Buttons */
.btn-toggle-warehouse-form {
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-toggle-warehouse-form:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--card-border);
}

[data-theme="light"] .btn-toggle-warehouse-form:hover {
  background: rgba(15, 23, 42, 0.04);
}

.btn-toggle-warehouse-form.active {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.warehouse-item-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.warehouse-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.warehouse-item-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.8rem;
}

.warehouse-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
  margin-top: auto;
}

[data-theme="light"] .warehouse-item-footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}

/* Category tags color coding */
.badge-category {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.badge-category.research {
  background: rgba(245, 158, 11, 0.12) !important;
  color: var(--accent-amber, #f59e0b) !important;
  border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

.badge-category.setup {
  background: rgba(14, 165, 233, 0.12) !important;
  color: var(--accent-cyan, #0ea5e9) !important;
  border: 1px solid rgba(14, 165, 233, 0.2) !important;
}

.badge-category.design {
  background: rgba(236, 72, 153, 0.12) !important;
  color: var(--accent-pink, #ec4899) !important;
  border: 1px solid rgba(236, 72, 153, 0.2) !important;
}

.badge-category.development,
.badge-category.implementation {
  background: rgba(99, 102, 241, 0.12) !important;
  color: var(--accent-indigo, #6366f1) !important;
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

.badge-category.testing {
  background: rgba(244, 63, 94, 0.12) !important;
  color: var(--accent-rose, #f43f5e) !important;
  border: 1px solid rgba(244, 63, 94, 0.2) !important;
}

.badge-category.generic {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.wh-project-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.wh-week-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
  text-transform: uppercase;
}

.btn-edit-warehouse-task,
.btn-delete-warehouse-task {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.725rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-edit-warehouse-task {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--accent-indigo);
}

.btn-edit-warehouse-task:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-indigo);
  transform: translateY(-1px);
}

.btn-delete-warehouse-task {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}

.btn-delete-warehouse-task:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: var(--accent-rose);
  transform: translateY(-1px);
}

.btn-claim-task {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #ffffff;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-claim-task:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}

.btn-claim-task:active {
  transform: translateY(0);
}

/* ===================================================
   CHAT & SOCIAL STYLES (SLACK-LIKE / DISCORD HYBRID)
   =================================================== */
.chat-container {
  display: flex;
  height: calc(100vh - 110px);
  min-height: 400px;
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid var(--chat-container-border);
  border-radius: 12px;
  background: var(--chat-container-bg);
  backdrop-filter: blur(16px);
}

/* Prevent page scrolling on desktop when Chat or Planning (Mon Suivi) tabs are active */
@media (min-width: 769px) {

  body.chat-active,
  body.planning-active {
    overflow: hidden !important;
  }
}


.chat-sidebar {
  width: 250px;
  background: var(--chat-sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-sidebar-resizer {
  width: 2px;
  cursor: col-resize;
  background: var(--chat-sidebar-border);
  position: relative;
  z-index: 50;
  height: 100%;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.chat-sidebar-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  right: -4px;
  cursor: col-resize;
  z-index: 51;
}

.chat-sidebar-resizer:hover,
.chat-sidebar-resizer.resizing {
  background: var(--accent-indigo, #6366f1) !important;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.chat-sidebar-section {
  display: flex;
  flex-direction: column;
}

.chat-sidebar-header {
  padding: 0.5rem 1.25rem 0rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.chat-sidebar-header h3 {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-channels-list {
  overflow-y: auto;
  padding: 0.5rem;
  max-height: 250px;
}

/* Direct messages search */
.chat-dms-search-wrapper {
  position: relative;
  padding: 0.5rem 0.75rem;
}

.chat-dms-search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.chat-dms-search {
  width: 100%;
  padding: 0.45rem 0.6rem 0.45rem 1.9rem;
  border-radius: 6px;
  border: 1px solid var(--chat-container-border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  transition: all 0.2s var(--transition-fast);
}

.chat-dms-search::placeholder {
  color: var(--text-muted);
}

.chat-dms-search:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

/* Channel notification preferences */
#modal-channel-notifications .modal-card {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

#modal-channel-notifications .modal-header {
  flex-shrink: 0;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

#modal-channel-notifications #channel-notif-form {
  overflow-y: auto;
  padding-right: 0.25rem;
}

.notif-pref-group {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
}

.notif-pref-section-title {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
}

.notif-pref-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.6rem 0;
  color: var(--text-secondary);
  cursor: pointer;
}

.notif-pref-row:not(:last-child) {
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 0.25rem;
}

.notif-pref-label {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.chat-channel-item {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.15rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s var(--transition-fast);
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  font-weight: 500;
}

.chat-channel-item:hover {
  background: var(--msg-hover-bg);
  color: var(--text-primary);
}

.chat-channel-item.active {
  background: var(--chat-active-bg);
  border: 1px solid var(--chat-active-border);
  color: var(--chat-active-color);
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.chat-channel-item .channel-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.channel-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.channel-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

[data-theme="light"] .channel-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.channel-action-btn.channel-delete-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

/* User Card bottom left sidebar */
.chat-sidebar-self-card {
  padding: 1rem;
  background: var(--chat-self-card-bg);
  border-top: 1px solid var(--chat-self-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.presence-avatar-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.presence-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  display: block;
}

.presence-status-dot.online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald-glow);
  animation: status-pulse 2s infinite;
}

.presence-status-dot.offline {
  background-color: var(--text-muted);
}

@keyframes status-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--chat-main-bg);
  position: relative;
  min-width: 0;
  /* allows text truncation */
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--chat-header-border);
  display: flex;
  align-items: center;
  background: var(--chat-header-bg);
}

.chat-header #active-channel-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  font-family: var(--font-title);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-header .channel-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--chat-messages-bg);
}

/* Beautiful custom thin scrollbar for chat */
.chat-messages::-webkit-scrollbar,
.chat-channels-list::-webkit-scrollbar,
.chat-members-list::-webkit-scrollbar,
.thread-messages-list::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-channels-list::-webkit-scrollbar-thumb,
.chat-members-list::-webkit-scrollbar-thumb,
.thread-messages-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.message-item {
  display: flex;
  gap: 1rem;
  max-width: 100%;
  position: relative;
  padding: 0.4rem 1.5rem;
  border-radius: 4px;
  transition: background 0.1s ease;
  align-self: flex-start;
}

.message-item:hover {
  background: var(--msg-hover-bg);
}

.message-item.me {
  align-self: flex-start;
  flex-direction: row;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.msg-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.msg-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.msg-meta strong {
  color: var(--text-primary);
  font-weight: 700;
}

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

.message-item.me .msg-meta {
  flex-direction: row;
}

.msg-bubble {
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
}

.message-item.me .msg-bubble {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* Hover action overlay on messages */
.msg-hover-actions {
  position: absolute;
  top: -16px;
  right: 1.5rem;
  background: var(--msg-hover-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 6px;
  display: flex;
  gap: 0.2rem;
  padding: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.message-item.me .msg-hover-actions {
  right: 1.5rem;
  left: auto;
}

.message-item:hover .msg-hover-actions {
  opacity: 1;
  pointer-events: auto;
}

.msg-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.1s;
}

.msg-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Reactions design system */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.message-item.me .msg-reactions {
  flex-direction: row-reverse;
}

.reaction-bubble {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.15s var(--transition-fast);
  user-select: none;
  color: var(--text-secondary);
}

.reaction-bubble:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.reaction-bubble.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
}

/* ===================================================
   FACEBOOK COMMENT DESIGN SYSTEM
   =================================================== */

.msg-content-wrapper-fb {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.msg-bubble-fb {
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 8px 16px;
  position: relative;
  width: fit-content;
  max-width: 90%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

[data-theme="light"] .msg-bubble-fb {
  background: #e4e6eb;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .msg-bubble-fb {
  background: #242526;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Media message bubbles (image, document, vocal/audio) - no bubble background/border, display bubble container only for text messages */
.msg-bubble-fb.is-media,
.msg-bubble-fb:has(.chat-image-wrapper),
.msg-bubble-fb:has(.chat-file-card),
.msg-bubble-fb:has(.chat-file-container),
.msg-bubble-fb:has(audio),
.chat-messages .message-item.me .msg-bubble-fb.is-media,
.chat-messages .message-item.me .msg-bubble-fb:has(.chat-image-wrapper),
.chat-messages .message-item.me .msg-bubble-fb:has(.chat-file-card),
.chat-messages .message-item.me .msg-bubble-fb:has(.chat-file-container),
.chat-messages .message-item.me .msg-bubble-fb:has(audio),
[data-theme="light"] .chat-messages .message-item.me .msg-bubble-fb.is-media,
[data-theme="light"] .chat-messages .message-item.me .msg-bubble-fb:has(.chat-image-wrapper),
[data-theme="light"] .chat-messages .message-item.me .msg-bubble-fb:has(.chat-file-card),
[data-theme="light"] .chat-messages .message-item.me .msg-bubble-fb:has(.chat-file-container),
[data-theme="light"] .chat-messages .message-item.me .msg-bubble-fb:has(audio),
[data-theme="dark"] .chat-messages .message-item.me .msg-bubble-fb.is-media,
[data-theme="dark"] .chat-messages .message-item.me .msg-bubble-fb:has(.chat-image-wrapper),
[data-theme="dark"] .chat-messages .message-item.me .msg-bubble-fb:has(.chat-file-card),
[data-theme="dark"] .chat-messages .message-item.me .msg-bubble-fb:has(.chat-file-container),
[data-theme="dark"] .chat-messages .message-item.me .msg-bubble-fb:has(audio) {
  background: transparent !important;
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.msg-bubble-fb.is-media .chat-image-wrapper,
.msg-bubble-fb:has(.chat-image-wrapper) .chat-image-wrapper,
.msg-bubble-fb.is-media .chat-file-card,
.msg-bubble-fb:has(.chat-file-card) .chat-file-card,
.msg-bubble-fb.is-media .chat-file-container .chat-file-card,
.msg-bubble-fb:has(.chat-file-container) .chat-file-container .chat-file-card {
  margin-top: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.msg-bubble-fb.is-media audio,
.msg-bubble-fb:has(audio) audio,
.msg-text-fb audio {
  margin-top: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  border-radius: 25px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="dark"] .msg-bubble-fb.is-media .chat-image-wrapper,
[data-theme="dark"] .msg-bubble-fb:has(.chat-image-wrapper) .chat-image-wrapper,
[data-theme="dark"] .msg-bubble-fb.is-media .chat-file-card,
[data-theme="dark"] .msg-bubble-fb:has(.chat-file-card) .chat-file-card,
[data-theme="dark"] .msg-bubble-fb.is-media .chat-file-container .chat-file-card,
[data-theme="dark"] .msg-bubble-fb:has(.chat-file-container) .chat-file-container .chat-file-card,
[data-theme="dark"] .msg-bubble-fb.is-media audio,
[data-theme="dark"] .msg-bubble-fb:has(audio) audio,
[data-theme="dark"] .msg-text-fb audio {
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

.msg-meta-fb {
  margin-bottom: 2px;
  font-size: 0.85rem;
}

.msg-meta-fb strong {
  color: var(--text-primary);
  font-weight: 700;
}

[data-theme="light"] .msg-meta-fb strong {
  color: #050505;
}

.msg-text-fb {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-text-fb:has(.chat-image-wrapper),
.msg-text-fb:has(.chat-file-card),
.msg-text-fb:has(audio) {
  white-space: normal;
}

[data-theme="light"] .msg-text-fb {
  color: #050505;
}

.msg-text-fb a,
.chat-message-link {
  color: #3b82f6;
  text-decoration: underline;
  word-break: break-all;
  transition: opacity 0.15s ease;
}

[data-theme="dark"] .msg-text-fb a,
[data-theme="dark"] .chat-message-link {
  color: #ffffff !important;
  text-decoration: underline;
}

.chat-messages .message-item.me .msg-text-fb a,
.chat-messages .message-item.me .chat-message-link,
.message-item.me .msg-text-fb a,
.message-item.me .chat-message-link {
  color: #ffffff !important;
  text-decoration: underline;
  font-weight: 500;
}

.msg-text-fb a:hover,
.chat-message-link:hover {
  opacity: 0.85;
  text-decoration: underline;
}

/* Reactions Summary capsule on bottom-right of bubble */
.msg-reactions-fb-summary {
  position: absolute;
  bottom: -20px;
  right: 12px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--bg-primary);
  border-radius: 12px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 3;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}

.msg-reactions-fb-summary:hover {
  transform: scale(1.05);
}

[data-theme="light"] .msg-reactions-fb-summary {
  background: #ffffff;
  border-color: #f0f2f5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.msg-reactions-fb-summary .emojis {
  letter-spacing: -2px;
  margin-right: 2px;
}

.msg-reactions-fb-summary .count {
  color: var(--text-secondary);
}

[data-theme="light"] .msg-reactions-fb-summary .count {
  color: #65676b;
}

/* Action Line below the bubble */
.msg-actions-fb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-left: 12px;
  margin-top: 1px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

[data-theme="light"] .msg-actions-fb {
  color: #65676b;
}

.msg-content-wrapper-fb:has(.msg-reactions-fb-summary) .msg-actions-fb {
  margin-top: 12px !important;
}

.msg-time-fb {
  color: var(--text-muted);
  cursor: default;
}

[data-theme="light"] .msg-time-fb {
  color: #65676b;
}

.msg-action-btn-fb {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

[data-theme="light"] .msg-action-btn-fb {
  color: #65676b;
}

.msg-action-btn-fb:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

[data-theme="light"] .msg-action-btn-fb:hover {
  color: #050505;
}

.msg-action-btn-fb.liked {
  color: var(--accent-indigo) !important;
}

[data-theme="light"] .msg-action-btn-fb.liked {
  color: #1877f2 !important;
  /* Facebook Blue in light theme */
}

.msg-replies-count-fb {
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
}

[data-theme="light"] .msg-replies-count-fb {
  color: #65676b;
}

.msg-replies-count-fb:hover {
  text-decoration: underline;
}

/* Like button hover wrapper & reaction picker panel */
.like-action-wrapper-fb {
  position: relative;
  display: inline-block;
}

.reactions-hover-panel-fb {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 4px 8px;
  display: flex;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 20;
}

.reactions-hover-panel-fb::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 16px;
  background: transparent;
}

[data-theme="light"] .reactions-hover-panel-fb {
  background: #ffffff;
  border-color: #e4e6eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.like-action-wrapper-fb:hover .reactions-hover-panel-fb {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

.hover-reaction-btn {
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid transparent;
}

.hover-reaction-btn:hover {
  transform: scale(1.35) translateY(-2px);
}

.hover-reaction-btn.active {
  background: rgba(99, 102, 241, 0.25) !important;
  border-color: rgba(99, 102, 241, 0.45) !important;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
  transform: scale(1.15);
}

[data-theme="light"] .hover-reaction-btn.active {
  background: rgba(24, 119, 242, 0.18) !important;
  border-color: rgba(24, 119, 242, 0.4) !important;
  box-shadow: 0 0 6px rgba(24, 119, 242, 0.25);
}

/* Thread notification badge */
.msg-thread-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.4rem;
  font-weight: 600;
  width: fit-content;
  transition: all 0.15s ease;
}

.msg-thread-badge:hover {
  background: rgba(6, 182, 212, 0.15);
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.1);
  transform: translateY(-1px);
}

.message-item.me .msg-thread-badge {
  align-self: flex-end;
}

/* Typing indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}

.typing-dots .dot {
  width: 5px;
  height: 5px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dots .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots .dot:nth-child(2) {
  animation-delay: -0.16s;
}

.typing-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

@keyframes typing-bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* Input area */
.chat-input-area {
  margin: 0.5rem;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
  align-items: flex-end;
  /* Anchors buttons to the bottom of the row */
  display: flex;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Composer pill (the visual input box container) */
.chat-composer-pill {
  flex: 1;
  min-width: 0;
  /* Prevents overflow inside flex containers */
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--chat-input-bg);
  border: 1px solid var(--chat-input-border);
  border-radius: 20px;
  padding: 0.35rem 0.75rem 0.35rem 1.25rem;
  box-shadow: var(--card-shadow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-composer-pill:focus-within {
  border-color: var(--accent-indigo);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.18), 0 0 15px rgba(99, 102, 241, 0.05);
  background: var(--chat-input-focus-bg);
}

/* Microphone/Trash composer action buttons (outside the pill) */
.chat-composer-action-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  flex-shrink: 0;
  margin-bottom: 2px;
  /* Small vertical adjustment to align with bottom of the pill */
  overflow: hidden;
  transition: background 0.2s ease,
    color 0.2s ease,
    width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease,
    transform 0.2s ease,
    margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  outline: none;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-collapse-btn svg,
.sidebar-collapse-btn i {
  stroke-width: 1.5px !important;
}

.chat-composer-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

[data-theme="light"] .chat-composer-action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* Emoji composer button (inside the pill) */
.chat-composer-emoji-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  outline: none;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
}

.chat-composer-emoji-btn:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

/* Smooth collapse of mic and attach icons when textarea has text */
.chat-input-area.has-text #btn-chat-mic,
.chat-input-area.has-text #btn-chat-attach {
  width: 0 !important;
  opacity: 0 !important;
  transform: scale(0) !important;
  margin-right: -0.5rem !important;
  pointer-events: none !important;
}

.chat-composer-pill textarea,
.chat-composer-pill input {
  flex: 1;
  min-width: 0;
  /* Prevents flex content overflow */
  background: transparent !important;
  border: none !important;
  padding: 0.25rem 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none !important;
  box-shadow: none !important;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  height: 24px;
  max-height: 120px;
  overflow-y: auto;
}

/* Messenger-style Glassmorphic Emoji Picker Popover */
.emoji-picker-popup {
  position: absolute;
  bottom: 78px;
  right: 16px;
  left: auto;
  width: 360px;
  max-height: 420px;
  padding: 0;
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: blur(16px);
  overflow: hidden;
  font-family: var(--font-body), "Noto Color Emoji", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

.emoji-picker-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem 0.5rem 1rem;
  border-bottom: none;
  background: transparent;
}

.emoji-search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  width: 100%;
}

[data-theme="light"] .emoji-search-wrapper {
  background: rgba(0, 0, 0, 0.04);
}

.emoji-picker-search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.emoji-picker-search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 0;
}

.emoji-picker-search::placeholder {
  color: var(--text-tertiary);
}

.emoji-picker-categories {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.1rem;
  padding: 0.5rem;
  border-top: 1px solid var(--card-border);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.emoji-category-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.emoji-category-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
}

[data-theme="light"] .emoji-category-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.emoji-category-btn.active {
  background: transparent !important;
  color: var(--accent-indigo) !important;
  box-shadow: none !important;
}

[data-theme="light"] .emoji-category-btn.active {
  background: transparent !important;
  color: var(--accent-indigo) !important;
  box-shadow: none !important;
}

.emoji-category-btn i,
.emoji-category-btn svg {
  width: 16px;
  height: 16px;
}

.emoji-picker-content {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.6rem 0.85rem 1rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.emoji-picker-content::-webkit-scrollbar {
  display: none;
}

.emoji-picker-section {
  margin-bottom: 1rem;
}

.emoji-picker-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin: 0 0 0.5rem 0.25rem;
  user-select: none;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.25rem;
}

.emoji-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  font-size: 1.45rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 10px;
  transition: all 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  background: transparent;
  font-family: "Noto Color Emoji", "Segoe UI Emoji", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.emoji-picker-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.22);
}

[data-theme="light"] .emoji-picker-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

.emoji-picker-item:active {
  transform: scale(1.05);
}

.emoji-picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--text-tertiary);
  text-align: center;
  gap: 0.5rem;
}

.emoji-picker-empty i,
.emoji-picker-empty svg {
  width: 36px;
  height: 36px;
  opacity: 0.5;
}

.emoji-picker-empty p {
  margin: 0;
  font-size: 0.85rem;
}

/* Mentions Autocomplete Popover */
.mentions-popup {
  position: absolute;
  bottom: 75px;
  left: 20px;
  width: 260px;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.mention-item:hover,
.mention-item.active {
  background: var(--msg-hover-bg);
  color: var(--text-primary);
}

.mention-item .mention-name {
  font-weight: 600;
}

.mention-item .mention-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Right Sidebar: Members directory */
.chat-members-sidebar {
  width: 220px;
  background: var(--chat-members-bg);
  border-left: 1px solid var(--chat-members-border);
  display: none;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-members-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-member-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s var(--transition-fast);
}

.chat-member-item:hover {
  background: rgba(99, 102, 241, 0.08) !important;
  transform: translateX(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chat-member-item .member-name-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.chat-member-item .member-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.chat-member-item .member-role {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Sliding Collapsible Thread Drawer */
.chat-thread-drawer {
  width: 360px;
  background: var(--thread-drawer-bg);
  border-left: 1px solid var(--thread-drawer-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
}

.thread-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--thread-header-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--thread-header-bg);
}

.btn-close-thread:hover {
  color: var(--accent-rose) !important;
  transform: scale(1.1);
}

.thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.thread-parent-message-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.85rem;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.thread-divider {
  display: flex;
  align-items: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0.5rem 0;
}

.thread-divider::after {
  content: '';
  flex: 1;
  margin-left: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.thread-messages-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  overflow-y: auto;
}

.thread-input-area {
  padding: 1rem 1.25rem;
  background: var(--thread-input-bg);
  border-top: 1px solid var(--thread-input-border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.thread-input-area input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.82rem;
}

.thread-input-area input:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

.btn-send-msg {
  background: var(--gradient-indigo);
  border: none;
  width: 44px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
}

.btn-send-msg i,
.btn-send-msg svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.btn-send-msg:hover {
  transform: scale(1.05);
}

/* Responsive adjustment for chat container */
@media (max-width: 1100px) {
  .chat-thread-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    height: 100%;
    background: rgba(11, 15, 25, 0.98);
  }
}

@media (max-width: 900px) {
  .chat-members-sidebar {
    display: none;
  }
}

@media (max-width: 650px) {
  .chat-sidebar {
    width: 60px;
  }

  .chat-sidebar-header h3,
  .chat-sidebar-self-card div div,
  .chat-channel-item span+text,
  .chat-channel-item {
    font-size: 0;
  }

  .chat-channel-item span {
    font-size: 1.1rem;
    margin: 0 auto;
  }

  .chat-sidebar-header {
    justify-content: center;
    padding: 1rem 0;
  }

  #btn-add-channel {
    display: none;
  }

  .chat-channel-item .channel-actions {
    display: none;
  }
}

/* ===================================================
   INSIGHTS & CHARTS STYLES
   =================================================== */
/* Insights team performance table */
.insights-table {
  width: 100%;
  border-collapse: collapse;
}

.insights-table th {
  text-align: left;
  padding: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--card-border);
}

.insights-table td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* KPI Grid */
.insights-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* Compact KPI Cards */
.insights-kpi-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.insights-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.insights-kpi-card .kpi-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.insights-kpi-card .kpi-info {
  display: flex;
  flex-direction: column;
}

.insights-kpi-card .kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-family: var(--font-title);
}

.insights-kpi-card .kpi-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 0.2rem;
}

/* Highlights Panels Grid */
.insights-highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .insights-highlights-grid {
    grid-template-columns: 1fr;
  }
}

.insights-highlight-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insights-highlight-card.top-performer {
  border-left: 4px solid var(--accent-amber);
}

.insights-highlight-card.at-risk {
  border-left: 4px solid var(--accent-rose);
}

.insights-highlight-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.highlight-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.highlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
}

.highlight-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.highlight-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.highlight-user-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Charts Grid */
.insights-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

/* Custom Table overrides for insights */
.insights-table {
  width: 100%;
}

.insights-table th {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  font-size: 0.75rem;
}

.insights-table td {
  padding: 1rem 0.75rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

@media (max-width: 768px) {
  .chat-container {
    flex-direction: column;
    height: auto;
  }

  .chat-sidebar {
    width: 100%;
    height: 150px;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }
}

/* Premium Animations & Effects */
@keyframes avatar-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.45);
  }

  70% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(251, 191, 36, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
  }
}

@keyframes pulse-glow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

@keyframes pulse-glow-cyan {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.45);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(6, 182, 212, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
  }
}

/* ===================================================
   FLOATING GLASSMORPHIC LANGUAGE SWITCHER (FR/EN)
   =================================================== */
/* Floating controls container grouping theme & language selectors */
.floating-controls-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  padding: 0.2rem;
  border-radius: 30px;
  z-index: 10000;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-controls-container:hover {
  border-color: var(--accent-indigo);
  box-shadow: var(--card-hover-shadow);
}

.floating-controls-container .lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  height: 30px;
  padding: 0 0.65rem;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-title);
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  user-select: none;
}

.floating-controls-container .lang-btn:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.floating-controls-container .lang-btn.active {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Hide the floating selector when the user is logged in to avoid stat / layout overlap */
body.logged-in .floating-controls-container {
  display: none !important;
}

/* Integrated header language switcher (Desktop only) */
.lang-selector-header {
  display: none;
  /* Controlled responsively */
  gap: 0.25rem;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  padding: 0.2rem;
  border-radius: 8px;
  align-items: center;
}

.lang-selector-header .lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-title);
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  user-select: none;
}

.lang-selector-header .lang-btn:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.lang-selector-header .lang-btn.active {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* Responsive configurations for both language selectors */
@media (min-width: 769px) {

  /* Show the integrated header selector only when logged in */
  body.logged-in .lang-selector-header {
    display: flex;
  }
}

@media (max-width: 768px) {

  /* Hide the integrated header switcher on mobile to save space */
  .slim-topbar .lang-selector-header {
    display: none !important;
  }

  /* Always display the floating controls container at the bottom-right on mobile when not logged in */
  .floating-controls-container {
    display: flex !important;
    position: fixed;
    top: auto !important;
    bottom: 1.25rem !important;
    right: 1.25rem !important;
    box-shadow: 0 -8px 32px 0 rgba(0, 0, 0, 0.35);
  }
}

/* CI/CD automated deploy trigger */

/* ===================================================
   LUCIDE SVG ICON SYSTEM INTEGRATION
   =================================================== */
.icon-inline {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
  display: inline-block;
  stroke-width: 1.8;
}

.icon-inline-right {
  margin-right: 0.35rem;
}

.icon-inline-left {
  margin-left: 0.35rem;
}

/* Auth Cards Logo Lucide Glow */
.auth-logo i,
.auth-logo svg {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--accent-indigo);
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.6));
}

/* Custom styles for Status and Priority items in list cards */
.status-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0.25rem;
}

.status-todo i {
  color: var(--accent-rose);
  filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.2));
}

.status-ongoing i {
  color: var(--accent-amber);
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.2));
}

.status-done i {
  color: var(--accent-emerald);
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.2));
}

/* Fine-tune dashboard indicators & headers */
.lucide-header-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #ffffff;
  stroke-width: 2;
}

/* Navigation elements */
.nav-tab i {
  width: 1.1rem;
  height: 1.1rem;
  stroke-width: 2;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.nav-tab:hover i,
.nav-tab.active i {
  transform: scale(1.1);
  filter: drop-shadow(0 0 6px var(--accent-indigo));
}

/* Premium Loading Spinner & Early Loading State */
.app-loading-authenticated #card-login {
  display: none !important;
}

.app-loading-authenticated #card-loading {
  display: block !important;
}

/* Global App Page Loader */
#global-app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#global-app-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner-premium {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  border-top-color: var(--accent-indigo);
  border-right-color: var(--accent-cyan);
  animation: spin-premium 1s linear infinite;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

@keyframes spin-premium {
  to {
    transform: rotate(360deg);
  }
}

/* Premium Theme Switcher Styles */
.theme-toggle-floating {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.theme-toggle-floating:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn-theme-toggle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

[data-theme="light"] .btn-theme-toggle,
[data-theme="light"] .btn-security-settings {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-indigo);
  color: var(--text-primary);
}

[data-theme="light"] .btn-theme-toggle:hover,
[data-theme="light"] .btn-security-settings:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-primary) !important;
  border-color: var(--accent-indigo) !important;
}

/* Responsive configurations for theme switcher handled by unified container */

/* ===================================================
   ONTRACK RESPONSIVE DESIGN SYSTEM OVERRIDES
   =================================================== */

@media (max-width: 1024px) {

  /* Adjust profiles list for medium viewports */
  #dynamic-profiles-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  }

  /* Mobile Weekly Planning (Mon Suivi) Fixed Layout and Scrollable Kanban */
  html:has(body.planning-active),
  body.planning-active {
    overflow: hidden !important;
    height: 100vh !important;
  }

  /* Fade-in animation without transform to avoid position: fixed container issues on mobile */
  .tab-content.active {
    animation: fadeInMobile var(--transition-normal) !important;
  }

  @keyframes fadeInMobile {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  body.planning-active main {
    height: calc(100vh - 72px) !important;
    margin: 0 !important;
    padding: 0.5rem !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.planning-active #planning {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  body.planning-active .weekly-layout {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    gap: 0.5rem !important;
  }

  body.planning-active .weekly-checklist-area {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0 !important;
    height: auto !important;
  }

  body.planning-active .active-checklist-card {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    padding: 1rem !important;
  }

  body.planning-active .tasks-checklist {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
  }

  body.planning-active .kanban-board-container {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0 !important;
  }

  body.planning-active .kanban-columns {
    flex: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    align-items: stretch !important;
    min-height: 0 !important;
    gap: 1.25rem !important;
    padding-bottom: 0.5rem !important;
  }

  body.planning-active .kanban-column {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    min-width: 85vw !important;
    max-width: 85vw !important;
    flex: 0 0 85vw !important;
    scroll-snap-align: start !important;
  }

  body.planning-active .kanban-cards-container {
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    padding-right: 4px !important;
  }

  /* Weekly Sidebar (Projects & Members) slide-over drawer on mobile */
  .weekly-sidebar {
    position: fixed !important;
    top: 72px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-height: calc(100vh - 72px) !important;
    height: calc(100vh - 72px) !important;
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--card-border) !important;
    z-index: 180 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.25rem !important;
    overflow-y: auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .weekly-sidebar.show-mobile {
    transform: translateX(0) !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5) !important;
  }

  /* Backdrop for the weekly sidebar */
  .weekly-sidebar-backdrop {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 170;
    transition: opacity 0.3s ease;
  }

  .weekly-sidebar-backdrop.show {
    display: block !important;
  }

  /* Extended Floating Action Button (FAB) to Open Projects & Members List */
  .btn-toggle-weekly-sidebar {
    position: fixed !important;
    right: 16px !important;
    bottom: 20px !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    padding: 0.65rem 1.15rem !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, var(--accent-indigo), #6366f1) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45) !important;
    z-index: 190 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    outline: none !important;
    margin: 0 !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }

  .btn-toggle-weekly-sidebar:hover {
    transform: translateY(-2px) scale(1.03) !important;
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.55) !important;
  }

  .btn-toggle-weekly-sidebar:active {
    transform: translateY(0) scale(0.97) !important;
  }

  .btn-toggle-weekly-sidebar span {
    display: inline-block !important;
    font-family: var(--font-title) !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
  }

  .btn-toggle-weekly-sidebar i {
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  /* Stack checklist header vertically on mobile to prevent title and buttons squishing */
  body.planning-active .checklist-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    padding-left: 0 !important;
  }
}

@media (max-width: 1200px) {

  /* 1. Global Layout & Spacing */
  main {
    margin: 1rem auto !important;
    padding: 0 1rem !important;
  }

  .glass-card {
    /*padding: 1.25rem !important;*/
    border-radius: 16px !important;
  }

  /* 2. Header Layout (Logo, Profile, and Stats) */
  header {
    padding: 1rem !important;
  }

  .header-container {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: stretch !important;
  }



  .header-stats {
    width: 100% !important;
    justify-content: space-around !important;
    margin-top: 0.5rem !important;
    gap: 0.5rem !important;
  }

  .header-stat-item {
    align-items: center !important;
    border-left: none !important;
    padding-left: 0 !important;
    flex: 1 !important;
  }

  /* 3. Navigation Tabs Scrollable Strip */
  .nav-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    display: flex !important;
    justify-content: flex-start !important;
    padding: 0.35rem !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    /* Firefox */
    -ms-overflow-style: none !important;
    /* IE 10+ */
  }

  .nav-tabs::-webkit-scrollbar {
    display: none !important;
    /* Safari and Chrome */
  }

  .tab-btn {
    flex: 0 0 auto !important;
  }
}

/* Mobile Filter FAB - hidden on desktop */
.mobile-filter-fab {
  display: none !important;
}

@media (max-width: 768px) {

  /* Emoji Picker Responsive Adjustment */
  .emoji-picker-popup {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    bottom: 74px !important;
    max-height: 350px !important;
  }

  .emoji-picker-content {
    padding: 0.5rem 0.5rem 0.75rem !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .emoji-picker-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 0.2rem !important;
  }

  .emoji-picker-item {
    font-size: 1.3rem !important;
    padding: 0.15rem !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  .emoji-picker-categories {
    padding: 0.4rem 0.15rem !important;
    gap: 0.02rem !important;
    justify-content: space-around !important;
  }

  .emoji-category-btn {
    width: 23px !important;
    height: 23px !important;
    min-width: 23px !important;
    border-radius: 5px !important;
  }

  .emoji-category-btn i,
  .emoji-category-btn svg {
    width: 12px !important;
    height: 12px !important;
  }

  /* 4. Form Layouts Stacking (Overrides Inline Styles) */
  #add-warehouse-task-form,
  #form-personal-task {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  #add-warehouse-task-form .form-group,
  #form-personal-task .form-group {
    grid-column: span 1 !important;
  }

  #add-warehouse-task-form button[type="submit"],
  #form-personal-task button[type="submit"] {
    grid-column: span 1 !important;
    width: 100% !important;
  }

  /* Urgency Banner Stacking */
  .urgency-banner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
  }

  .urgency-banner button {
    width: 100% !important;
  }

  /* 5. Responsive Chat Layout Overrides */
  html:has(body.chat-active),
  body.chat-active {
    overflow: hidden !important;
    height: 100vh !important;
  }

  body.chat-active main {
    height: calc(100vh - 72px) !important;
    margin: 0 !important;
    padding: 0.5rem !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.chat-active #chat {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .chat-container {
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    position: relative !important;
  }

  .chat-sidebar-resizer {
    display: none !important;
  }

  /* Default mobile view: show sidebar (channels), hide conversation pane */
  .chat-container .chat-sidebar {
    width: 100% !important;
    height: 100% !important;
    border-right: none !important;
    border-bottom: none !important;
    display: flex !important;
  }

  .chat-container .chat-main {
    display: none !important;
  }

  .chat-container .btn-chat-back {
    display: none !important;
  }

  /* Active chat view: hide sidebar, show conversation pane */
  .chat-container.mobile-show-chat .chat-sidebar {
    display: none !important;
  }

  .chat-container.mobile-show-chat .chat-main {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    flex-direction: column !important;
    min-height: 0 !important;
  }

  .chat-container.mobile-show-chat .btn-chat-back {
    display: flex !important;
  }

  /* Compact video call button on mobile */
  .chat-container .btn-call-trigger .btn-call-text {
    display: none !important;
  }

  .chat-container .btn-call-trigger {
    padding: 0.45rem !important;
    width: 36px !important;
    height: 36px !important;
    justify-content: center !important;
  }

  /* Mobile Sidebar Container & Lists Styling */
  .chat-sidebar {
    background: var(--bg-primary) !important;
    padding: 0 !important;
  }

  .chat-unified-search-wrapper {
    margin: 0.4rem 0 0.5rem 0 !important;
    padding: 0 0.75rem !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: auto !important;
  }

  .chat-unified-search-icon {
    left: 1.45rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  #chat-unified-search {
    width: 100% !important;
    height: 38px !important;
    padding: 0.45rem 0.75rem 0.45rem 2.25rem !important;
    border-radius: 12px !important;
    border: 1px solid var(--card-border) !important;
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    font-size: 0.82rem !important;
    outline: none !important;
    box-sizing: border-box !important;
  }

  .chat-sidebar-tabs {
    margin: 0 0.75rem 0.6rem 0.75rem !important;
    background: var(--bg-tertiary) !important;
    border-radius: 12px !important;
    padding: 3px !important;
    border: 1px solid var(--card-border) !important;
  }

  .chat-sidebar-tab {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    border-radius: 9px !important;
    padding: 0.45rem 0 !important;
  }

  .chat-channels-list {
    max-height: none !important;
    padding: 0.25rem 0.75rem 5.5rem 0.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  /* Sleek modern card design for sidebar conversation items on mobile */
  .chat-sidebar-item {
    height: auto !important;
    min-height: 64px !important;
    padding: 0.7rem 0.85rem !important;
    border-radius: 14px !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--card-border) !important;
    margin-bottom: 0 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .chat-sidebar-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05)) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12) !important;
    border-radius: 14px !important;
    transform: none !important;
  }

  .chat-sidebar-item:active {
    transform: scale(0.98) !important;
  }

  .chat-sidebar-avatar-wrapper {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
  }

  .chat-sidebar-avatar-wrapper .msg-avatar {
    width: 44px !important;
    height: 44px !important;
    font-size: 0.9rem !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  }

  .chat-sidebar-item-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .chat-sidebar-item-name {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    min-width: 0 !important;
    flex: 1 !important;
    color: var(--text-primary) !important;
  }

  .chat-sidebar-item-title {
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .channel-type-badge {
    font-size: 0.55rem !important;
    padding: 0.15rem 0.45rem !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    flex-shrink: 0 !important;
    margin-left: 0 !important;
  }

  .chat-sidebar-item-snippet {
    font-size: 0.78rem !important;
    color: var(--text-secondary) !important;
    line-height: 1.3 !important;
  }

  .chat-sidebar-item-time {
    font-size: 0.7rem !important;
    color: var(--text-secondary) !important;
    opacity: 0.8 !important;
    flex-shrink: 0 !important;
  }

  /* Fixed bottom user profile card on mobile - theme adaptable */
  .chat-sidebar-self-card {
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 10 !important;
    background: var(--bg-secondary) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid var(--card-border) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
  }

  /* --- Mobile Warehouse Filter FAB & Modal --- */
  .mobile-filter-fab {
    display: flex !important;
    position: fixed !important;
    bottom: 24px !important;
    right: 20px !important;
    z-index: 9999 !important;
    background: linear-gradient(135deg, var(--accent-indigo), #4f46e5) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 0.75rem 1.25rem !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45) !important;
    cursor: pointer !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease !important;
  }

  .mobile-filter-fab:active {
    transform: scale(0.94) !important;
  }

  /* Hide desktop warehouse filter bar on mobile screens */
  .warehouse-filter-bar {
    display: none !important;
  }

  /* Hide mobile warehouse FAB button when any modal overlay is active */
  body:has(.modal-overlay[style*="display: flex"]) .mobile-filter-fab,
  body:has(.modal-overlay[style*="display: block"]) .mobile-filter-fab {
    display: none !important;
  }

  /* Responsive Mobile Modals (Add Task, Edit Task, etc.) */
  .modal-overlay {
    padding: 0.5rem !important;
    z-index: 100000 !important;
  }

  .submodal-overlay,
  .modal-overlay.submodal-overlay {
    z-index: 200000 !important;
  }

  .custom-dialog-overlay {
    z-index: 300000 !important;
    padding: 0.5rem !important;
  }

  #toast-container {
    bottom: 1rem !important;
    left: 1rem !important;
    right: 1rem !important;
    z-index: 999999 !important;
    align-items: center !important;
  }

  .toast-item {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .modal-card,
  .modal-card.fixed-layout {
    width: 95% !important;
    max-width: 500px !important;
    margin: auto !important;
    border-radius: 18px !important;
    max-height: 92vh !important;
  }

  .modal-header {
    padding: 1rem 1rem 0.65rem 1rem !important;
    margin: 0 0 0.5rem 0 !important;
  }

  .modal-header h3 {
    font-size: 1.05rem !important;
  }

  .modal-tabs-header {
    margin: 0 1rem 0.65rem 1rem !important;
    display: flex !important;
    gap: 4px !important;
    padding: 3px !important;
    background: var(--bg-tertiary) !important;
    border-radius: 12px !important;
    border: 1px solid var(--card-border) !important;
  }

  .modal-tab-btn {
    flex: 1 !important;
    font-size: 0.73rem !important;
    padding: 0.5rem 0.35rem !important;
    border-radius: 9px !important;
    gap: 0.35rem !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 40px !important;
  }

  .modal-tab-btn span {
    font-size: 0.73rem !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    text-overflow: clip !important;
    overflow: visible !important;
    word-break: break-word !important;
    text-align: center !important;
  }

  .modal-scroll-content {
    padding: 0.25rem 1rem 1rem 1rem !important;
    gap: 0.85rem !important;
  }

  /* Stack 2-column grid forms into single full-width columns on mobile */
  .modal-scroll-content div[style*="grid-template-columns"],
  .modal-card div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Mobile Modal Footer: Full-width stacked buttons for max legibility */
  .modal-footer {
    padding: 0.85rem 1rem !important;
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
  }

  .modal-footer button {
    width: 100% !important;
    flex: none !important;
    padding: 0.65rem 1rem !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
  }

  /* =============================================
     MANAGER INSIGHTS MOBILE DASHBOARD STYLES
     ============================================= */
  #insights .insights-container {
    padding: 0 !important;
  }

  #insights .insights-header {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 16px !important;
  }

  #insights .insights-header .card-title-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  #insights .insights-header .card-title {
    font-size: 1.1rem !important;
  }

  #insights .insights-header p {
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
    margin-top: 0.35rem !important;
  }

  #insights-project-dropdown-btn {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.78rem !important;
  }

  /* Executive 2x2 KPI Grid for Mobile */
  .insights-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  .insights-kpi-card {
    padding: 0.85rem 0.75rem !important;
    gap: 0.65rem !important;
    border-radius: 14px !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--card-border) !important;
  }

  .insights-kpi-card .kpi-icon-wrapper {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
  }

  .insights-kpi-card .kpi-value {
    font-size: 1.3rem !important;
    line-height: 1.1 !important;
  }

  .insights-kpi-card .kpi-label {
    font-size: 0.64rem !important;
    margin-top: 0.15rem !important;
  }

  /* Highlights Cards on Mobile */
  .insights-highlights-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    margin-bottom: 1rem !important;
  }

  .insights-highlight-card {
    padding: 1rem !important;
    border-radius: 14px !important;
  }

  /* Charts Container on Mobile */
  .insights-charts-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    margin-bottom: 1rem !important;
  }

  .insights-charts-grid .insight-card {
    padding: 1rem !important;
    border-radius: 16px !important;
  }

  .insights-charts-grid .insight-card div[style*="height: 250px"] {
    height: 210px !important;
  }

  /* Team Performance Table on Mobile */
  .table-responsive {
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
  }

  .insights-table th {
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    padding: 0.6rem 0.5rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
  }

  .insights-table td {
    padding: 0.75rem 0.5rem !important;
    white-space: nowrap !important;
    font-size: 0.82rem !important;
  }

  .insights-table .user-cell {
    gap: 0.5rem !important;
  }

  .insights-table .user-cell .msg-avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.7rem !important;
  }

  .insights-table .user-cell strong {
    font-size: 0.8rem !important;
  }

  /* =============================================
     ADMINISTRATION PORTAL MOBILE STYLES
     ============================================= */
  #admin-portal .glass-card {
    padding: 1rem !important;
    margin-top: 1rem !important;
    border-radius: 16px !important;
  }

  #admin-portal .card-title {
    font-size: 1.1rem !important;
  }

  #admin-portal h4 {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .admin-header-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  #admin-projects-filter-group {
    flex: 1 !important;
    display: flex !important;
    min-width: 130px !important;
  }

  #admin-projects-filter-group button {
    flex: 1 !important;
    text-align: center !important;
    padding: 0.4rem 0.5rem !important;
  }

  #btn-open-create-project-modal,
  #btn-open-add-user-modal {
    flex: 1 !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    padding: 0.5rem 0.65rem !important;
    white-space: nowrap !important;
    height: 36px !important;
  }

  #admin-projects-count,
  #admin-users-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    height: 26px !important;
    padding: 0 0.6rem !important;
  }

  #admin-portal .filters-row {
    flex-direction: column !important;
    gap: 0.65rem !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
  }

  #admin-portal .filters-row .search-input-wrapper,
  #admin-portal .filters-row .filter-select-wrapper {
    width: 100% !important;
    min-width: 100% !important;
  }

  #admin-portal .filters-row input,
  #admin-portal .filters-row select {
    height: 40px !important;
    font-size: 0.85rem !important;
    box-sizing: border-box !important;
  }

  .premium-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
  }

  .premium-table th {
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    padding: 0.65rem 0.6rem !important;
  }

  .premium-table td {
    padding: 0.65rem 0.6rem !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
  }

  .pagination-container {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.65rem !important;
    padding: 0.85rem 0.5rem !important;
  }

  .pagination-info {
    font-size: 0.78rem !important;
    text-align: center !important;
  }

  .pagination-controls {
    justify-content: center !important;
  }

  .chat-messages {
    padding: 0.75rem !important;
    gap: 0.75rem !important;
  }

  .message-item {
    padding: 0.4rem 0.5rem !important;
  }

  /* Hide own avatar and adjust bubble spacing on mobile for own messages */
  .chat-messages .message-item.me .msg-avatar {
    display: none !important;
  }

  .chat-messages .message-item.me .msg-reply-ref {
    padding-right: 12px !important;
  }

  .chat-messages .message-item.me .reply-line-connector {
    right: 12px !important;
  }

  .chat-header {
    padding: 0.6rem 0.75rem !important;
    position: relative !important;
  }

  .chat-header-actions-unified {
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
  }

  .chat-header-action-btn-unified {
    padding: 4px !important;
    flex-shrink: 0 !important;
    width: 32px !important;
    height: 32px !important;
  }

  .chat-header .channel-desc,
  #active-channel-desc {
    display: none !important;
  }

  #chat-channel-meta-badge {
    display: none !important;
  }

  #active-channel-name {
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block !important;
    vertical-align: middle;
  }

  /* Responsive overlay search bar when active on mobile */
  .chat-search-wrapper.active {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    width: calc(100% - 1rem) !important;
    max-width: none !important;
    z-index: 50 !important;
    background: var(--bg-secondary, #111827) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
    height: 38px !important;
    border-radius: 20px !important;
    padding: 0 8px 0 4px !important;
    display: flex !important;
    align-items: center !important;
  }

  .chat-search-wrapper.active input {
    display: block !important;
    width: 100% !important;
    font-size: 0.85rem !important;
  }

  .chat-input-area {
    margin: 0 0.5rem 0.5rem 0.5rem !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    gap: 0.25rem !important;
  }

  /* Mobile sizes for the composer pill container */
  .chat-composer-pill {
    padding: 0.3rem 0.5rem 0.3rem 0.85rem !important;
    border-radius: 18px !important;
    gap: 0.25rem !important;
  }

  /* Square sizes for the action buttons outside the pill on mobile */
  .chat-composer-action-btn {
    width: 34px !important;
    height: 34px !important;
    margin-bottom: 1px !important;
  }

  .chat-input-area.has-text #btn-chat-mic,
  .chat-input-area.has-text #btn-chat-attach {
    margin-right: -0.25rem !important;
  }

  /* Make chat text input 16px to prevent iOS Safari auto-zoom, and clean up padding */
  .chat-composer-pill textarea,
  .chat-composer-pill input {
    font-size: 16px !important;
    padding: 0.25rem 0 !important;
  }

  /* Format send button as a perfect centered circle on mobile */
  .btn-send-msg {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  /* Thread Drawer Overlay on Mobile */
  .chat-thread-drawer {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 200 !important;
  }

  /* 6. Kanban Planning columns on mobile */
  .tasks-checklist {
    display: flex !important;
    gap: 1.25rem !important;
    overflow-x: auto !important;
    padding-bottom: 1rem !important;
    align-items: flex-start !important;
    scroll-snap-type: x mandatory !important;
  }

  .tasks-checklist .kanban-column {
    min-width: 85vw !important;
    scroll-snap-align: start !important;
  }

  /* 7. Profiles List */
  #dynamic-profiles-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1.25rem !important;
  }

  /* 8. Tutor/Admin Grid Stacking */
  .tutor-admin-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .tutor-admin-grid .admin-column {
    border-right: none !important;
    padding-right: 0 !important;
  }

  /* 9. Active project selector bar stacking */
  .planning-project-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
  }

  .planning-project-bar select {
    width: 100% !important;
  }

  /* 10. Form grid vertical stacking */
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Overview (Aperçu) Tab overrides */
  .summary-grid {
    grid-template-columns: 1fr !important;
  }

  .profiles-container {
    grid-template-columns: 1fr !important;
  }

  /* Warehouse (Entrepôt) Tab overrides */
  .warehouse-grid {
    grid-template-columns: 1fr !important;
  }

  /* Topbar Mobile Optimizations */
  .slim-topbar .profile-meta-info,
  .slim-topbar .profile-meta-avatar,
  #profile-display-avatar {
    display: none !important;
  }

  .slim-topbar .logo-text p {
    display: block !important;
    font-size: 0.5rem !important;
  }
}

@media (max-width: 480px) {

  /* Profiles List Mobile Improvements */
  #dynamic-profiles-container {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .profile-card {
    border-radius: 12px !important;
  }

  .profile-header {
    padding: 0 1rem !important;
    gap: 1rem !important;
  }

  .profile-detail-grid {
    padding: 0 1rem !important;
    gap: 0.5rem !important;
  }

  .profile-tech-section {
    padding: 1rem !important;
  }

  .profile-avatar {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.25rem !important;
  }

  .profile-title-group h3 {
    font-size: 1.05rem !important;
  }



  .lang-selector-header {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Edit task modal layout stacking on small mobile screens */
  #form-edit-task>div {
    grid-template-columns: 1fr !important;
  }

  /* Checklist meta indicators vertical stacking */
  .checklist-meta-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
}

/* Prevent double scrollbar by disabling body overflow when not logged in */
body:not(.logged-in) {
  overflow: hidden !important;
  height: 100vh !important;
}



/* ===================================================
   ADD CHANNEL BUTTON AND MODALS THEME CORRECTIONS
   =================================================== */

/* Plus button styling */
#btn-add-channel {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  outline: none;
}

#btn-add-channel:hover {
  background: var(--gradient-indigo);
  color: #ffffff;
  border-color: transparent;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

#btn-add-channel i {
  width: 14px;
  height: 14px;
  display: block;
}

/* Light theme overrides for modals */
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.25) !important;
}

[data-theme="light"] .modal-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .modal-header {
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .modal-card label {
  color: var(--text-secondary) !important;
}

[data-theme="light"] .modal-card input,
[data-theme="light"] .modal-card select,
[data-theme="light"] .modal-card textarea {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

[data-theme="light"] .modal-card input:focus,
[data-theme="light"] .modal-card select:focus,
[data-theme="light"] .modal-card textarea:focus {
  border-color: var(--accent-indigo) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

[data-theme="light"] .modal-card input::placeholder,
[data-theme="light"] .modal-card textarea::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .security-section hr {
  border-top-color: rgba(15, 23, 42, 0.08) !important;
}

/* ===================================================
   VIDEO CALL MODAL — always dark regardless of theme
   =================================================== */
#modal-video-call .modal-card,
[data-theme="light"] #modal-video-call .modal-card {
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

#modal-video-call .modal-card h3,
#modal-video-call .modal-card p,
#modal-video-call .modal-card span,
#modal-video-call .modal-card button {
  color: #ffffff !important;
}

#modal-video-call .modal-card #outgoing-call-status,
#modal-video-call .modal-card #incoming-call-user-name+p {
  color: rgba(255, 255, 255, 0.75) !important;
}

#btn-close-call-modal {
  color: #e8eaed !important;
}

#btn-close-call-modal:hover {
  background: #4a4e51 !important;
  color: #ffffff !important;
}

/* ===================================================
   TOAST NOTIFICATION SYSTEM
   =================================================== */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 999999 !important;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 320px;
  max-width: 450px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-item.toast-rose {
  border-left: 4px solid var(--accent-rose);
}

.toast-item.toast-emerald {
  border-left: 4px solid var(--accent-emerald);
}

.toast-item.toast-amber {
  border-left: 4px solid var(--accent-amber);
}

.toast-item.toast-indigo {
  border-left: 4px solid var(--accent-indigo);
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-rose .toast-icon {
  color: var(--accent-rose);
}

.toast-emerald .toast-icon {
  color: var(--accent-emerald);
}

.toast-amber .toast-icon {
  color: var(--accent-amber);
}

.toast-indigo .toast-icon {
  color: var(--accent-indigo);
}

.toast-text {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.btn-close-toast {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem;
  transition: color 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.btn-close-toast:hover {
  color: var(--text-primary);
  transform: scale(1.15);
}

/* Recovery Codes Modal Premium Adaptive Layout */
.recovery-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  font-family: 'Outfit', 'Inter', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--body-bg);
  border: 1px solid var(--card-border);
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.recovery-code-badge {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  text-align: center;
  font-size: 1.05rem;
  color: var(--accent-indigo);
  letter-spacing: 0.05em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  user-select: all;
}

.recovery-code-badge:hover {
  border-color: var(--accent-indigo);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.recovery-warning-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  text-align: left;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.btn-premium-action-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-indigo);
  background: transparent;
  border: 1.5px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-premium-action-outline:hover {
  color: #ffffff;
  background: var(--gradient-indigo);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

.btn-premium-action-outline:active {
  transform: translateY(0);
}

/* Custom Modal Dialog overrides */
/* Custom Modal Dialog overrides with high-end glassmorphic and glowing styles */
.custom-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 300000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: dialogFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-dialog-overlay.fade-out {
  animation: dialogFadeOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-dialog-card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem 2.25rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: dialogScaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Subtle type-based ambient glows and borders */
.custom-dialog-card.dialog-success {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(16, 185, 129, 0.1);
}

.custom-dialog-card.dialog-error {
  border-color: rgba(244, 63, 94, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(244, 63, 94, 0.1);
}

.custom-dialog-card.dialog-info {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(99, 102, 241, 0.1);
}

.custom-dialog-card.dialog-confirm {
  border-color: rgba(6, 182, 212, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(6, 182, 212, 0.1);
}

.custom-dialog-card.dialog-danger {
  border-color: rgba(244, 63, 94, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(244, 63, 94, 0.1);
}

.custom-dialog-card.scale-down {
  animation: dialogScaleDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Beautiful Icon Containers with pulse animation and glows */
.custom-dialog-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.01);
  animation: iconPulse 2s infinite ease-in-out;
}

.dialog-success .custom-dialog-icon {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald) !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
}

.dialog-error .custom-dialog-icon {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose) !important;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.05);
}

.dialog-info .custom-dialog-icon {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--accent-indigo) !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.05);
}

.dialog-confirm .custom-dialog-icon {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan) !important;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.05);
}

.dialog-danger .custom-dialog-icon {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose) !important;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.05);
}

.custom-dialog-icon i {
  width: 32px;
  height: 32px;
}

@keyframes iconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }
}

.custom-dialog-content {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 2rem;
  word-break: break-word;
}

.custom-dialog-actions {
  display: flex;
  gap: 0.85rem;
  width: 100%;
  justify-content: center;
}

.custom-dialog-actions.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.custom-dialog-btn {
  padding: 0.8rem 1.75rem;
  border-radius: 12px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.custom-dialog-btn:active {
  transform: scale(0.96);
}

/* OK Button */
.custom-dialog-btn.btn-ok {
  background: var(--gradient-indigo);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.custom-dialog-btn.btn-ok:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

/* Confirm OK */
.custom-dialog-btn.btn-confirm-ok {
  background: var(--gradient-indigo);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.custom-dialog-btn.btn-confirm-ok:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

/* Confirm Danger */
.custom-dialog-btn.btn-confirm-danger {
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  color: #fff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.25);
}

.custom-dialog-btn.btn-confirm-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.35);
}

/* Cancel Button */
.custom-dialog-btn.btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.custom-dialog-btn.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Animations */
@keyframes dialogFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes dialogFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes dialogScaleUp {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes dialogScaleDown {
  from {
    transform: scale(1);
    opacity: 1;
  }

  to {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* Light Theme tweaks */
[data-theme="light"] .custom-dialog-overlay {
  background: rgba(15, 23, 42, 0.25);
}

[data-theme="light"] .custom-dialog-card.dialog-success {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06), 0 0 30px rgba(16, 185, 129, 0.05);
}

[data-theme="light"] .custom-dialog-card.dialog-error {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06), 0 0 30px rgba(244, 63, 94, 0.05);
}

[data-theme="light"] .custom-dialog-card.dialog-info {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06), 0 0 30px rgba(99, 102, 241, 0.05);
}

[data-theme="light"] .custom-dialog-card.dialog-confirm {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06), 0 0 30px rgba(6, 182, 212, 0.05);
}

[data-theme="light"] .custom-dialog-card.dialog-danger {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06), 0 0 30px rgba(244, 63, 94, 0.05);
}

[data-theme="light"] .custom-dialog-icon {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .dialog-success .custom-dialog-icon {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .dialog-error .custom-dialog-icon {
  background: rgba(244, 63, 94, 0.06);
  border-color: rgba(244, 63, 94, 0.15);
}

[data-theme="light"] .dialog-info .custom-dialog-icon {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .dialog-confirm .custom-dialog-icon {
  background: rgba(6, 182, 212, 0.06);
  border-color: rgba(6, 182, 212, 0.15);
}

[data-theme="light"] .dialog-danger .custom-dialog-icon {
  background: rgba(244, 63, 94, 0.06);
  border-color: rgba(244, 63, 94, 0.15);
}

[data-theme="light"] .custom-dialog-btn.btn-cancel {
  background: rgba(15, 23, 42, 0.03);
  color: var(--text-secondary);
  border-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .custom-dialog-btn.btn-cancel:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
  border-color: rgba(15, 23, 42, 0.12);
}

/* ===================================================
   SIDEBAR REDESIGN LAYOUT AND TRANSITIONS
   =================================================== */

/* App Level Flex Container */
#ontrack-app-content {
  display: flex !important;
  min-height: 100vh;
  position: relative;
  width: 100%;
}

/* Sidebar default styling (Desktop >= 1024px expanded) */
.sidebar {
  position: fixed;
  top: 72px;
  /* Height of the topbar */
  left: 0;
  bottom: 0;
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  z-index: 150;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--card-shadow);
}

/* Disable user profile content (avatar, name, role) in sidebar on desktop & tablet */
@media (min-width: 769px) {
  .sidebar-header .sidebar-profile-inner {
    display: none !important;
  }

  .sidebar-header {
    justify-content: flex-end !important;
    height: 48px !important;
    padding: 0.5rem 0.75rem !important;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  height: 64px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .sidebar-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .sidebar-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex-grow: 1;
}

.sidebar-nav .tab-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-family: var(--font-title);
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.sidebar-nav .tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-nav .tab-btn.active {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Sidebar User Profile Card Inner Content */
.sidebar-profile-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.sidebar-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
  background: var(--gradient-indigo);
  box-shadow: var(--shadow-sm);
}

.sidebar-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-profile-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-role {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Handle collapsed sidebar header layout */
body.sidebar-collapsed .sidebar-header {
  flex-direction: column !important;
  height: auto !important;
  padding: 0.75rem 0 !important;
  gap: 0.5rem !important;
  justify-content: center !important;
}

body.sidebar-collapsed .sidebar-profile-info {
  display: none !important;
}

body.sidebar-collapsed .sidebar-profile-inner {
  justify-content: center;
  width: 100%;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  margin: 0 auto !important;
}

/* Sidebar Footer & Bottom Controls */
.sidebar-footer {
  padding: 1rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.sidebar-ctrl-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
}

.sidebar-ctrl-row.lang-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* Lang toggle styling in sidebar */
.sidebar-lang-selector {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-tertiary);
  padding: 0.2rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  width: fit-content !important;
}

.sidebar-lang-selector .lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-lang-selector .lang-btn.active {
  background: var(--accent-indigo);
  color: white;
}

/* Custom button styles for theme and logout in sidebar */
.sidebar-ctrl-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  outline: none;
}

.sidebar-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.sidebar-ctrl-btn.btn-logout {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.15);
  background: rgba(244, 63, 94, 0.02);
}

.sidebar-ctrl-btn.btn-logout:hover {
  color: #fff;
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.25);
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  outline: none;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* App Wrapper default styling */
.app-wrapper {
  margin-left: 240px;
  margin-top: 72px;
  /* Top bar height push */
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: calc(100% - 240px);
  flex-grow: 1;
}

/* Slim Fixed Top Bar */
.slim-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 200;
  /* Stays above sidebar */
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.hamburger-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: none;
  /* hidden on desktop */
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  outline: none;
}

.hamburger-menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Collapsed state (mainly for Desktop >= 1024px) */
body.sidebar-collapsed .sidebar {
  width: 64px;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar-header {
  justify-content: center !important;
}

body.sidebar-collapsed .sidebar .logo-text,
body.sidebar-collapsed .sidebar-footer .ctrl-text,
body.sidebar-collapsed .sidebar-footer .ctrl-label {
  display: none !important;
}

body.sidebar-collapsed .sidebar-nav .tab-btn {
  justify-content: center !important;
  align-items: center !important;
  padding: 0.75rem 0 !important;
  width: 100% !important;
}

body.sidebar-collapsed .sidebar-nav .tab-btn .tab-text {
  display: none !important;
}

body.sidebar-collapsed .sidebar-nav .tab-btn i,
body.sidebar-collapsed .sidebar-nav .tab-btn svg {
  margin: 0 !important;
  font-size: 1.3rem !important;
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  min-height: 17px !important;
  flex-shrink: 0 !important;
}

body.sidebar-collapsed .sidebar-footer {
  padding: 1rem 0 !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

body.sidebar-collapsed .sidebar-ctrl-row {
  padding: 0 !important;
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}

body.sidebar-collapsed .sidebar-ctrl-row.lang-row {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

body.sidebar-collapsed .sidebar-lang-selector {
  flex-direction: column !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  gap: 0.4rem !important;
  width: 100% !important;
  align-items: center !important;
}

body.sidebar-collapsed .sidebar-lang-selector .lang-btn {
  width: 36px !important;
  height: 24px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  font-size: 0.7rem !important;
}

body.sidebar-collapsed .sidebar-ctrl-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  font-size: 0 !important;
  /* hide text node */
}

body.sidebar-collapsed .sidebar-ctrl-btn i,
body.sidebar-collapsed .sidebar-ctrl-btn svg {
  margin: 0 !important;
  font-size: 1.15rem !important;
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}

body.sidebar-collapsed .app-wrapper {
  margin-left: 64px;
  width: calc(100% - 64px);
}

/* ── Hover-to-expand when sidebar is unpinned (collapsed) ── */
/* Revert ALL collapsed overrides back to the base expanded values on hover */

body.sidebar-collapsed .sidebar:hover {
  width: 240px;
  overflow: visible;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35), var(--card-shadow);
  z-index: 200;
}

/* Header: revert to base expanded layout */
body.sidebar-collapsed .sidebar:hover .sidebar-header {
  flex-direction: row !important;
  height: 48px !important;
  padding: 0.5rem 0.75rem !important;
  gap: 0 !important;
  justify-content: flex-end !important;
}

body.sidebar-collapsed .sidebar:hover .sidebar-collapse-btn {
  margin: 0 !important;
}

/* Show text labels hidden by collapsed state */
body.sidebar-collapsed .sidebar:hover .logo-text,
body.sidebar-collapsed .sidebar:hover .sidebar-footer .ctrl-text {
  display: inline !important;
}

body.sidebar-collapsed .sidebar:hover .sidebar-footer .ctrl-label {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

/* Nav buttons: revert to base expanded layout */
body.sidebar-collapsed .sidebar:hover .sidebar-nav .tab-btn {
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 0.75rem 1rem !important;
  width: 100% !important;
}

body.sidebar-collapsed .sidebar:hover .sidebar-nav .tab-btn .tab-text {
  display: inline !important;
}

body.sidebar-collapsed .sidebar:hover .sidebar-nav .tab-btn i,
body.sidebar-collapsed .sidebar:hover .sidebar-nav .tab-btn svg {
  margin-right: 0.65rem !important;
  font-size: inherit !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
}

/* Footer: revert to base expanded layout */
body.sidebar-collapsed .sidebar:hover .sidebar-footer {
  padding: 1rem 0.5rem !important;
  align-items: stretch !important;
  gap: 0.5rem !important;
}

/* Ctrl rows: revert to base expanded layout */
body.sidebar-collapsed .sidebar:hover .sidebar-ctrl-row {
  padding: 0.25rem 0.5rem !important;
  width: auto !important;
  justify-content: flex-start !important;
}

body.sidebar-collapsed .sidebar:hover .sidebar-ctrl-row.lang-row {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
}

/* Lang selector: revert to base expanded layout */
body.sidebar-collapsed .sidebar:hover .sidebar-lang-selector {
  flex-direction: row !important;
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--card-border) !important;
  padding: 0.2rem !important;
  gap: 0.25rem !important;
  width: fit-content !important;
}

body.sidebar-collapsed .sidebar:hover .sidebar-lang-selector .lang-btn {
  width: auto !important;
  height: auto !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 4px !important;
  font-size: 0.75rem !important;
}

/* Ctrl buttons: revert to base expanded layout */
body.sidebar-collapsed .sidebar:hover .sidebar-ctrl-btn {
  width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
  padding: 0.6rem 1rem !important;
  margin: 0 !important;
  font-size: 0.85rem !important;
  gap: 0.75rem !important;
  justify-content: flex-start !important;
}

body.sidebar-collapsed .sidebar:hover .sidebar-ctrl-btn i,
body.sidebar-collapsed .sidebar:hover .sidebar-ctrl-btn svg {
  margin: 0 !important;
  font-size: inherit !important;
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
}

/* Responsive Rules */
/* Tablet Layout (768px to 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
  .hamburger-menu-btn {
    display: flex;
  }

  .sidebar {
    width: 64px;
    top: 72px !important;
  }

  .sidebar-header {
    flex-direction: column !important;
    height: auto !important;
    padding: 0.75rem 0 !important;
    gap: 0.5rem !important;
    justify-content: center !important;
  }

  .sidebar-profile-inner {
    justify-content: center !important;
    width: 100% !important;
  }

  .sidebar .logo-text,
  .sidebar-footer .ctrl-text,
  .sidebar-footer .ctrl-label,
  .sidebar-profile-info {
    display: none !important;
  }

  .sidebar-nav .tab-btn {
    justify-content: center !important;
    padding: 0.75rem !important;
  }

  .sidebar-nav .tab-btn .tab-text {
    display: none !important;
  }

  .sidebar-nav .tab-btn i,
  .sidebar-nav .tab-btn svg {
    margin: 0 !important;
    font-size: 1.2rem !important;
    width: 18px !important;
    height: 18px !important;
  }

  .sidebar-footer {
    padding: 1rem 0 !important;
    align-items: center !important;
    gap: 0.75rem !important;
  }

  .sidebar-ctrl-row {
    padding: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  .sidebar-ctrl-row.lang-row {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .sidebar-lang-selector {
    flex-direction: column !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    gap: 0.4rem !important;
    width: 100% !important;
    align-items: center !important;
  }

  .sidebar-lang-selector .lang-btn {
    width: 36px !important;
    height: 24px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
  }

  .sidebar-ctrl-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    font-size: 0 !important;
  }

  .sidebar-ctrl-btn i,
  .sidebar-ctrl-btn svg {
    margin: 0 !important;
    font-size: 1.15rem !important;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
  }

  .sidebar-collapse-btn {
    display: none;
  }

  .app-wrapper {
    margin-left: 64px;
    width: calc(100% - 64px);
  }

  /* When Tablet expands sidebar via hamburger */
  body.sidebar-expanded-tablet .sidebar {
    width: 240px;
  }

  body.sidebar-expanded-tablet .sidebar-header {
    flex-direction: row !important;
    height: 64px !important;
    padding: 0.5rem 1rem !important;
    justify-content: space-between !important;
  }

  body.sidebar-expanded-tablet .sidebar-profile-inner {
    justify-content: flex-start !important;
  }

  body.sidebar-expanded-tablet .sidebar .logo-text,
  body.sidebar-expanded-tablet .sidebar-footer .ctrl-text,
  body.sidebar-expanded-tablet .sidebar-footer .ctrl-label,
  body.sidebar-expanded-tablet .sidebar-profile-info {
    display: block !important;
  }

  body.sidebar-expanded-tablet .sidebar-nav .tab-btn {
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    font-size: 0.9rem !important;
  }

  body.sidebar-expanded-tablet .sidebar-nav .tab-btn i,
  body.sidebar-expanded-tablet .sidebar-nav .tab-btn svg {
    margin-right: 0.5rem !important;
    font-size: 1.1rem !important;
    width: 16px !important;
    height: 16px !important;
  }

  body.sidebar-expanded-tablet .sidebar-ctrl-btn {
    justify-content: flex-start;
    padding: 0.6rem 1rem;
    font-size: 0.85rem !important;
  }

  body.sidebar-expanded-tablet .sidebar-ctrl-btn i,
  body.sidebar-expanded-tablet .sidebar-ctrl-btn svg {
    margin-right: 0.5rem !important;
    font-size: 1rem !important;
    width: 15px !important;
    height: 15px !important;
  }

  body.sidebar-expanded-tablet .sidebar-ctrl-row.lang-row {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Mobile Layout (< 768px) */
@media (max-width: 767px) {
  .hamburger-menu-btn {
    display: flex;
  }

  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    top: 0 !important;
    /* Full screen height drawer on mobile */
    height: 100% !important;
  }

  .sidebar-header {
    flex-direction: row !important;
    height: 64px !important;
    padding: 0.5rem 1rem !important;
    justify-content: flex-start !important;
  }

  .sidebar-profile-inner {
    justify-content: flex-start !important;
  }

  .sidebar-collapse-btn {
    display: none;
  }

  .app-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .slim-topbar {
    padding: 0.75rem 1rem;
  }

  .slim-topbar .header-stats {
    display: none !important;
    /* Hide stats in topbar on mobile to fit screen */
  }

  body.sidebar-mobile-open .sidebar {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 250 !important;
    /* Position drawer above fixed topbar on mobile */
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 140;
    transition: opacity 0.3s ease;
  }

  body.sidebar-mobile-open .sidebar-backdrop {
    display: block;
  }
}

/* Accessibility & General layout fixes */
.tab-btn:focus-visible,
.sidebar-ctrl-btn:focus-visible,
.sidebar-collapse-btn:focus-visible,
.hamburger-menu-btn:focus-visible {
  outline: 2px solid var(--accent-indigo);
  outline-offset: 2px;
}

/* ===================================================
   LIGHT THEME PREMIUM STYLE CORRECTIONS FOR SIDEBAR
   =================================================== */
[data-theme="light"] .sidebar {
  background: #f8fafc;
  border-right-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .sidebar-header {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .sidebar-footer {
  background: rgba(15, 23, 42, 0.02);
  border-top-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .sidebar-lang-selector {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .sidebar-lang-selector .lang-btn {
  color: var(--text-muted);
}

[data-theme="light"] .sidebar-lang-selector .lang-btn.active {
  background: var(--accent-indigo);
  color: white;
}

[data-theme="light"] .sidebar-lang-selector .lang-btn:not(.active):hover {
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .sidebar-ctrl-btn {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
}

[data-theme="light"] .sidebar-ctrl-btn:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-primary);
  border-color: rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .sidebar-ctrl-btn.btn-logout {
  color: #e11d48;
  /* Premium Rose/Red text */
  border-color: rgba(225, 29, 72, 0.2);
  background: rgba(225, 29, 72, 0.04);
}

[data-theme="light"] .sidebar-ctrl-btn.btn-logout:hover {
  color: #fff;
  background: #e11d48;
  border-color: #e11d48;
}

[data-theme="light"] .tab-btn:hover {
  background: rgba(15, 23, 42, 0.03);
  color: var(--text-primary);
}

[data-theme="light"] .sidebar-collapse-btn:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-primary);
}

/* ===================================================
   SETTINGS PAGE LAYOUT & PREMIUM STYLING
   =================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .card-title-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .admin-section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .admin-header-actions {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 1rem !important;
  }

  .admin-header-actions button {
    flex-grow: 1 !important;
    justify-content: center !important;
  }
}

.settings-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem !important;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.settings-card-icon {
  color: var(--accent-indigo);
  width: 20px;
  height: 20px;
}

.settings-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-label {
  display: block;
  font-size: 0.8rem !important;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: 0.05em;
}

.settings-desc {
  font-size: 0.85rem !important;
  color: var(--text-muted);
  margin: 0 !important;
  line-height: 1.4;
}

.settings-divider {
  border: 0;
  border-top: 1px solid var(--card-border);
  margin: 1.25rem 0;
}

.form-group-custom {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group-custom label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}

.form-group-custom input {
  width: 100%;
}

/* ─── Phone Picker ────────────────────────────────────────────── */
.phone-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  position: relative;
}

.phone-input-group > input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
}

/* Wrapper holds trigger + dropdown */
.phone-picker-wrapper {
  position: relative;
  flex: 0 0 auto;
}


/* Trigger button */
.phone-picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.75rem;
  height: 100%;
  min-height: 42px;
  min-width: 105px;
  background: var(--input-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--card-border, rgba(255,255,255,0.12));
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body, inherit);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.phone-picker-trigger:hover {
  border-color: var(--accent-indigo, #6366f1);
  background: rgba(99, 102, 241, 0.08);
}

.phone-picker-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.phone-picker-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.phone-picker-code-text {
  letter-spacing: 0.02em;
  color: var(--accent-indigo, #6366f1);
}

.phone-picker-chevron {
  margin-left: auto;
  color: var(--text-muted, #888);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-picker-trigger[aria-expanded="true"] .phone-picker-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.phone-picker-dropdown {
  position: fixed;           /* coordinates set dynamically by JS */
  top: 0;
  left: 0;
  width: 300px;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--card-border, rgba(255,255,255,0.12));
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 4px 16px rgba(0,0,0,0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 99999;
}

.phone-picker-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Search bar inside dropdown */
.phone-picker-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--card-border, rgba(255,255,255,0.08));
  background: rgba(255,255,255,0.03);
  position: sticky;
  top: 0;
  z-index: 1;
}

.phone-picker-search-wrap svg {
  color: var(--text-muted, #888);
  flex-shrink: 0;
}

.phone-picker-search {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-body, inherit);
}

.phone-picker-search::placeholder {
  color: var(--text-muted, #8888aa);
  font-style: italic;
  opacity: 1;
}

/* Scrollable list */
.phone-picker-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.3) transparent;
}

.phone-picker-list::-webkit-scrollbar {
  width: 4px;
}

.phone-picker-list::-webkit-scrollbar-track {
  background: transparent;
}

.phone-picker-list::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 10px;
}

/* Individual item */
.phone-picker-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 0;
}

.phone-picker-item:hover {
  background: rgba(99, 102, 241, 0.1);
}

.phone-picker-item.selected {
  background: rgba(99, 102, 241, 0.15);
}

.phone-picker-item.selected .ppi-name {
  color: var(--accent-indigo, #6366f1);
  font-weight: 600;
}

.phone-picker-item.selected .ppi-code {
  color: var(--accent-indigo, #6366f1);
}

.ppi-flag {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.ppi-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ppi-code {
  font-size: 0.78rem;
  color: var(--text-muted, #888);
  font-weight: 600;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* No results */
.phone-picker-no-results {
  display: none;
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted, #888);
  font-size: 0.82rem;
  font-style: italic;
}


/* Segmented Controls styling */
.theme-selector-segmented,
.lang-selector-segmented {
  display: flex;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  padding: 0.2rem;
  border-radius: 8px;
  gap: 0.25rem;
  width: fit-content;
}

.theme-select-btn,
.lang-select-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  user-select: none;
}

.theme-select-btn:hover,
.lang-select-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.theme-select-btn.active,
.lang-select-btn.active {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* Settings Profile Container */
.settings-profile-container {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.avatar-preview-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  border: 2px solid var(--card-border);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Light Theme segmented controls overrides */
[data-theme="light"] .theme-selector-segmented,
[data-theme="light"] .lang-selector-segmented {
  background: rgba(15, 23, 42, 0.04) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .theme-select-btn:hover,
[data-theme="light"] .lang-select-btn:hover {
  background: rgba(15, 23, 42, 0.03);
}

.settings-unified-card {
  width: 100%;
  box-sizing: border-box;
}

.settings-section-block {
  width: 100%;
  animation: fadeIn var(--transition-normal);
}

body.settings-active footer,
body.planning-active footer,
body.chat-active footer {
  display: none !important;
}

/* Master-Detail Executive Settings Layout - Fixed Sidebar & Topbar with Center Scrolling */
@media (min-width: 993px) {
  #settings.tab-content.active {
    height: calc(100vh - 110px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  #settings .dashboard-header-container {
    margin-bottom: 1rem !important;
    flex-shrink: 0 !important;
  }

  #settings .settings-container {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  #settings .settings-layout-wrapper {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    gap: 2rem !important;
    overflow: hidden !important;
    margin-top: 0.5rem !important;
  }

  #settings .settings-nav-sidebar {
    width: 290px !important;
    flex-shrink: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    position: static !important;
  }

  #settings .settings-content-stream {
    flex: 1 !important;
    min-width: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    padding-right: 0.5rem !important;
    scroll-behavior: smooth !important;
  }
}

.settings-layout-wrapper {
  display: flex !important;
  gap: 2rem !important;
  align-items: flex-start !important;
  margin-top: 1.5rem !important;
  width: 100% !important;
}

/* Left Sub-Navigation & Summary Sidebar */
.settings-nav-sidebar {
  width: 290px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.settings-profile-summary-card {
  border-radius: 16px !important;
  padding: 1.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .settings-profile-summary-card {
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.04) !important;
}

.avatar-wrapper-hero {
  position: relative !important;
  margin-bottom: 0.85rem !important;
}

.avatar-online-dot {
  position: absolute !important;
  bottom: 2px !important;
  right: 2px !important;
  width: 14px !important;
  height: 14px !important;
  background: #10b981 !important;
  border: 2.5px solid var(--card-bg, #0f172a) !important;
  border-radius: 50% !important;
}

.profile-summary-info {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.summary-name {
  font-family: var(--font-title) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
}

.summary-role-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: var(--accent-indigo) !important;
  background: rgba(99, 102, 241, 0.12) !important;
  padding: 0.3rem 0.75rem !important;
  border-radius: 20px !important;
  margin-top: 0.2rem !important;
}

.summary-role-badge svg,
.summary-role-badge i {
  width: 14px !important;
  height: 14px !important;
}

.settings-sub-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
}

.sub-nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  border-radius: 10px !important;
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  transition: all 0.2s ease !important;
}

.sub-nav-item svg,
.sub-nav-item i {
  width: 18px !important;
  height: 18px !important;
  transition: transform 0.2s ease !important;
}

.sub-nav-item:hover {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.sub-nav-item:hover svg {
  transform: translateX(2px) !important;
}

[data-theme="light"] .sub-nav-item:hover {
  background: rgba(15, 23, 42, 0.04) !important;
}

.sub-nav-item.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3) !important;
}

.sub-nav-item.active svg,
.sub-nav-item.active i {
  color: #ffffff !important;
}

/* Right Main Content Stream */
.settings-content-stream {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.75rem !important;
}

.settings-section-card {
  border-radius: 16px !important;
  padding: 2rem !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  scroll-margin-top: 1.5rem !important;
}

.settings-section-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16) !important;
}

[data-theme="light"] .settings-section-card {
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .settings-section-card:hover {
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08) !important;
}

.settings-card-header {
  display: flex !important;
  align-items: flex-start !important;
  gap: 1rem !important;
  margin-bottom: 1.5rem !important;
  border-bottom: 1px solid var(--card-border) !important;
  padding-bottom: 1.25rem !important;
}

.header-icon-badge {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(99, 102, 241, 0.12) !important;
  color: var(--accent-indigo) !important;
  flex-shrink: 0 !important;
  font-size: 1.15rem !important;
}

.header-icon-badge svg,
.header-icon-badge i {
  width: 22px !important;
  height: 22px !important;
}

.settings-card-header h3 {
  font-family: var(--font-title) !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
}

.section-subtitle {
  font-size: 0.85rem !important;
  color: var(--text-secondary) !important;
  margin: 0.2rem 0 0 0 !important;
  font-weight: 400 !important;
}

.settings-card-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
}

.settings-form-flow {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
  width: 100% !important;
}

.form-row-2col {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1.25rem !important;
}

.form-group-custom {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.4rem !important;
}

.form-group-custom label {
  font-size: 0.75rem !important;
  color: var(--text-secondary) !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
}

.form-group-custom input {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--card-border) !important;
  color: var(--text-primary) !important;
  padding: 0.75rem 1rem !important;
  border-radius: 10px !important;
  font-size: 0.9rem !important;
  font-family: inherit !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="light"] .form-group-custom input {
  background: rgba(15, 23, 42, 0.02) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

.form-group-custom input:focus {
  outline: none !important;
  border-color: var(--accent-indigo) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="light"] .form-group-custom input:focus {
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.form-actions-row {
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 0.5rem !important;
}

.form-actions-row button {
  padding: 0.7rem 1.5rem !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25) !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
}

.form-actions-row button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35) !important;
}

/* Settings Row Items (Appearance & Controls) */
.settings-row-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.5rem !important;
  padding: 1.25rem !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  transition: background-color 0.2s ease !important;
}

.settings-row-item:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="light"] .settings-row-item {
  background: rgba(15, 23, 42, 0.02) !important;
  border: 1px solid rgba(15, 23, 42, 0.03) !important;
}

[data-theme="light"] .settings-row-item:hover {
  background: rgba(15, 23, 42, 0.04) !important;
}

.settings-row-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
  flex: 1 !important;
}

.settings-row-info .settings-label {
  margin: 0 !important;
}

/* Toggle Row Styling */
.setting-toggle-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.5rem !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  padding: 1.25rem !important;
  border-radius: 12px !important;
  transition: background-color 0.2s ease !important;
}

.setting-toggle-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="light"] .setting-toggle-row {
  background: rgba(15, 23, 42, 0.02) !important;
  border: 1px solid rgba(15, 23, 42, 0.03) !important;
}

[data-theme="light"] .setting-toggle-row:hover {
  background: rgba(15, 23, 42, 0.04) !important;
}

.highlight-security-row {
  background: rgba(99, 102, 241, 0.05) !important;
  border: 1px solid rgba(99, 102, 241, 0.15) !important;
}

.badge-title-flex {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.status-pill-badge {
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  padding: 0.25rem 0.65rem !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--card-border) !important;
}

.settings-sub-block {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
  margin-top: 0.5rem !important;
  padding-top: 1.5rem !important;
  border-top: 1px solid var(--card-border) !important;
}

.sub-block-title {
  font-family: var(--font-title) !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

/* Avatar preview visual upgrade */
#settings-page-avatar-preview {
  width: 80px !important;
  height: 80px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
  color: white !important;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
  border: 4px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3) !important;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
  user-select: none !important;
  margin: 0 auto !important;
}

#settings-page-avatar-preview:hover {
  transform: scale(1.06) rotate(3deg) !important;
  border-color: #ffffff !important;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45) !important;
}

[data-theme="light"] #settings-page-avatar-preview {
  border-color: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12) !important;
}

/* Drag-and-drop avatar zone styles */
.avatar-drag-drop-zone {
  position: relative;
  border: 2px dashed rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.01);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin-top: 0.5rem;
}

[data-theme="light"] .avatar-drag-drop-zone {
  border-color: rgba(99, 102, 241, 0.2);
  background: rgba(0, 0, 0, 0.005);
}

.avatar-drag-drop-zone:hover,
.avatar-drag-drop-zone.dragover {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.08);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.dropzone-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-indigo);
  opacity: 0.8;
  margin-bottom: 0.25rem;
  transition: transform 0.2s;
}

.avatar-drag-drop-zone:hover .dropzone-icon {
  transform: translateY(-2px);
}

.dropzone-text-primary {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-link {
  color: var(--accent-indigo);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone-text-secondary {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Dropzone Preview State */
.dropzone-preview-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
}

.dropzone-preview-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-indigo);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.dropzone-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dropzone-preview-details {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 0.5rem;
}

.dropzone-filename {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.btn-remove-selected-avatar {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-remove-selected-avatar:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: var(--accent-rose);
  transform: scale(1.05);
}

.btn-remove-selected-avatar svg {
  width: 13px;
  height: 13px;
}

@media (max-width: 992px) {
  #settings.tab-content.active {
    height: auto !important;
    overflow: visible !important;
  }

  .settings-layout-wrapper {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .settings-nav-sidebar {
    display: none !important;
  }

  .settings-content-stream {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  .settings-section-card {
    padding: 1.25rem !important;
    border-radius: 14px !important;
  }

  /* =============================================
     SETTINGS PAGE MOBILE OVERRIDES
     ============================================= */
  .settings-section-card {
    padding: 1.15rem 1rem !important;
    border-radius: 16px !important;
    margin-bottom: 1.25rem !important;
  }

  .settings-card-header {
    gap: 0.75rem !important;
    margin-bottom: 1.25rem !important;
  }

  .settings-card-header h3 {
    font-size: 1.1rem !important;
  }

  .settings-card-header .section-subtitle {
    font-size: 0.78rem !important;
  }

  .settings-row-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
    background: var(--bg-tertiary) !important;
    border-radius: 14px !important;
    border: 1px solid var(--card-border) !important;
    margin-bottom: 0.85rem !important;
  }

  .settings-row-info .settings-label {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
  }

  .settings-row-info .settings-desc {
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
    margin-top: 0.25rem !important;
    display: block !important;
  }

  .theme-selector-segmented,
  .lang-selector-segmented {
    display: flex !important;
    width: 100% !important;
    gap: 4px !important;
    background: var(--bg-secondary) !important;
    padding: 4px !important;
    border-radius: 12px !important;
    border: 1px solid var(--card-border) !important;
    box-sizing: border-box !important;
  }

  .theme-select-btn,
  .lang-select-btn {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    padding: 0.55rem 0.35rem !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    border-radius: 9px !important;
    border: none !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .theme-select-btn i,
  .theme-select-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  /* 2FA & Notification Toggle Rows on Mobile */
  .setting-toggle-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.65rem 0.85rem !important;
    padding: 1rem !important;
    background: var(--bg-tertiary) !important;
    border-radius: 14px !important;
    border: 1px solid var(--card-border) !important;
    margin-bottom: 0.85rem !important;
  }

  .setting-toggle-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .badge-title-flex {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .badge-title-flex .settings-label {
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin: 0 !important;
    line-height: 1.25 !important;
  }

  .setting-toggle-info .settings-desc {
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
    margin-top: 0.35rem !important;
    display: block !important;
    color: var(--text-secondary) !important;
  }

  .toggle-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
  }

  .status-pill-badge {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.55rem !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
  }

  .settings-sub-block {
    margin-top: 1.25rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid var(--card-border) !important;
  }

  .form-row-2col {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

/* --- Message Options Menu & Inline Editor --- */
.msg-bubble-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  position: relative;
}

.msg-menu-wrapper {
  position: relative;
  display: inline-block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.message-item:hover .msg-menu-wrapper {
  opacity: 1;
  pointer-events: auto;
}

.msg-options-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.msg-options-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .msg-options-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #050505;
}

/* --- Messenger Style Hover Actions Overlay --- */
.msg-hover-actions-fb {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

/* Make hover actions visible on hover, or when a dropdown/reaction panel is active */
.msg-bubble-container:hover .msg-hover-actions-fb,
.msg-hover-actions-fb:has(.msg-options-menu.show),
.msg-hover-actions-fb:has(.reactions-hover-panel-fb.show) {
  opacity: 1;
  pointer-events: auto;
}

.msg-hover-btn-fb {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.msg-hover-btn-fb:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .msg-hover-btn-fb:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #050505;
}

.msg-hover-btn-fb svg {
  width: 24px;
  height: 24px;
  stroke-width: 2px;
}

/* Ensure wrapper inside hover actions doesn't hide itself */
.msg-hover-actions-fb .msg-menu-wrapper {
  opacity: 1;
  pointer-events: auto;
}

/* Reaction Trigger positioning wrapper */
.reaction-trigger-wrapper {
  position: relative;
}

/* Override reaction panel positioning inside the hover trigger wrapper */
.reaction-trigger-wrapper .reactions-hover-panel-fb {
  position: absolute;
  bottom: 32px; /* Float nicely above the smiley icon */
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reaction-trigger-wrapper:hover .reactions-hover-panel-fb,
.reaction-trigger-wrapper .reactions-hover-panel-fb.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

/* Options menu alignments for own messages */
.msg-menu-wrapper {
  position: relative;
}

.chat-messages .message-item.me .msg-options-menu {
  left: 0 !important;
  right: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Reverse hover action menu layout direction for own messages to keep emoji icon closest to bubble */
.chat-messages .message-item.me .msg-hover-actions-fb {
  flex-direction: row-reverse;
}

.msg-options-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  transform: scale(0.95);
  margin-top: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  min-width: 135px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.msg-options-menu.open-upward {
  top: auto !important;
  bottom: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 6px !important;
}

.chat-messages .message-item.me .msg-options-menu.open-upward {
  left: 0 !important;
  right: auto !important;
  top: auto !important;
  bottom: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 6px !important;
}

.msg-options-menu.show {
  display: flex;
  transform: scale(1);
}

[data-theme="light"] .msg-options-menu {
  background: #ffffff;
  border-color: #e4e6eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.msg-options-menu .menu-item {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  transition: all 0.1s ease;
  font-weight: 500;
}

.msg-options-menu .menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .msg-options-menu .menu-item {
  color: #65676b;
}

[data-theme="light"] .msg-options-menu .menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #050505;
}

.msg-options-menu .menu-item.delete-btn-fb {
  color: var(--accent-rose);
}

.msg-options-menu .menu-item.delete-btn-fb:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.inline-editor-container {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.inline-editor-textarea {
  width: 100%;
  min-height: 60px;
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--card-border) !important;
  resize: vertical;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
}

.inline-editor-textarea:focus {
  border-color: var(--accent-indigo) !important;
}

[data-theme="light"] .inline-editor-textarea {
  background: #ffffff !important;
  color: #050505 !important;
  border-color: #ccd0d5 !important;
}

[data-theme="light"] .inline-editor-textarea:focus {
  border-color: #1877f2 !important;
}

.btn-save-edit {
  background: var(--accent-indigo);
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.btn-save-edit:hover {
  opacity: 0.9;
}

[data-theme="light"] .btn-save-edit {
  background: #1877f2;
}

.btn-cancel-edit {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.15s ease;
}

.btn-cancel-edit:hover {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .btn-cancel-edit {
  background: #e4e6eb;
  color: #050505;
}

[data-theme="light"] .btn-cancel-edit:hover {
  background: #d8dadf;
}

/* ===================================================
   DISCORD-STYLE INLINE REPLY STYLES
   =================================================== */

/* Input Reply Target Preview Bar */
.chat-reply-preview-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 0.5rem 1.25rem;
  margin: 0 1.5rem -1px 1.5rem;
  /* overlaps top border of input area */
  position: relative;
  z-index: 5;
}

.chat-staged-attachments {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 1.25rem;
  margin: 0 1.5rem -1px 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  position: relative;
  z-index: 5;
}

[data-theme="light"] .chat-reply-preview-container,
[data-theme="light"] .chat-staged-attachments {
  background: #f1f5f9;
}

.reply-preview-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 0;
  flex: 1;
}

.reply-corner-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.reply-target-text-preview {
  font-style: italic;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
  margin-left: 0.5rem;
}

.btn-close-reply {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: all 0.15s ease;
  outline: none;
}

.btn-close-reply:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .btn-close-reply:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-close-reply svg {
  width: 14px;
  height: 14px;
}

/* Reply Reference inside Chat Message Item */
.message-item {
  display: block !important;
  /* allow reply reference to sit on top */
  width: 100%;
}

.message-item.hidden-search {
  display: none !important;
}

.message-item.is-reply {
  padding-top: 0.5rem;
}

.msg-reply-ref {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 52px;
  /* align with text wrapper: avatar (36px) + gap (16px) */
  position: relative;
  height: 22px;
  margin-bottom: 2px;
}

.reply-line-connector {
  position: absolute;
  top: 11px;
  /* middle of msg-reply-ref */
  left: 33px;
  /* centers with replier avatar center (24px + 18px = 42px). Rel left: 42px - 52px = -10px, wait! If relative to .msg-reply-ref which starts at 52px left: absolute left should be -10px if we want to align it with avatar. Wait, let's just make it relative to the message-item or use absolute positioning on msg-reply-ref. Since msg-reply-ref has padding-left: 52px, a child positioned at left: 24px will be exactly at the message-item left: 24px! Wait, padding-left pushes text content to 52px, but absolute children can be placed anywhere in the 52px space! So left: 42px (replier avatar center) is correct if we position relative to message-item, or left: 33px is a nice visually aligned connector curve. Let's do left: 33px to keep it tight and matching Discord. */
  width: 15px;
  height: 15px;
  border-left: 2px solid var(--card-border);
  border-top: 2px solid var(--card-border);
  border-top-left-radius: 6px;
  opacity: 0.7;
}

[data-theme="light"] .reply-line-connector {
  border-color: #ccd0d5;
}

.reply-ref-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.reply-ref-username {
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.reply-ref-username:hover {
  text-decoration: underline;
  color: var(--text-primary);
}

.reply-ref-text {
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
  color: var(--text-muted);
  cursor: pointer;
}

.reply-ref-text:hover {
  color: var(--text-secondary);
}

.msg-reply-body {
  display: flex;
  gap: 1rem;
  width: 100%;
}

/* Flash Highlight Animation for clicked parent message */
@keyframes flashHighlight {
  0% {
    background: rgba(99, 102, 241, 0.25);
  }

  100% {
    background: transparent;
  }
}

.message-item.flash-highlight {
  animation: flashHighlight 1.5s ease;
}

/* Custom Styled Lucide Icons for Emoji Reactions */
.reaction-picker-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.5px;
  transition: transform 0.1s ease;
}

.reaction-icon-img {
  width: 13px;
  height: 13px;
  stroke-width: 2.5px;
  display: inline-block;
  vertical-align: middle;
}

/* Specific premium colors matching the theme */
.emoji-thumbs {
  color: #3b82f6 !important;
  /* Premium Sky Blue */
  stroke: #3b82f6 !important;
  fill: rgba(59, 130, 246, 0.15);
}

.emoji-heart {
  color: #f43f5e !important;
  /* Premium Rose Red */
  stroke: #f43f5e !important;
  fill: rgba(244, 63, 94, 0.15);
}

.emoji-flame {
  color: #f59e0b !important;
  /* Premium Amber Orange */
  stroke: #f59e0b !important;
  fill: rgba(245, 158, 11, 0.15);
}

.hover-reaction-btn:hover .reaction-picker-icon {
  transform: scale(1.1);
}

/* Summary emojis flex adjustments */
.msg-reactions-fb-summary .emojis {
  display: flex;
  align-items: center;
  gap: 2px;
  letter-spacing: normal !important;
  /* reset spacing */
}

/* Custom color classes for active J'adore (Heart) and Génial (Flame) button states */
.msg-action-btn-fb.like-btn-fb.liked.liked-heart {
  color: #f43f5e !important;
  /* Premium Rose Red */
}

.msg-action-btn-fb.like-btn-fb.liked.liked-flame {
  color: #f59e0b !important;
  /* Premium Amber Orange */
}

/* --- Right-Aligned Own Messages (Main Chat Only) --- */
.chat-messages .message-item.me .msg-reply-body {
  flex-direction: row-reverse;
}

.chat-messages .message-item.me .msg-content-wrapper-fb {
  align-items: flex-end;
}

.chat-messages .message-item.me .msg-bubble-container {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

/* Premium gradient bubble for own messages in dark mode */
.chat-messages .message-item.me .msg-bubble-fb {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25) !important;
}

/* Soft gradient bubble for own messages in light mode */
[data-theme="light"] .chat-messages .message-item.me .msg-bubble-fb {
  background: linear-gradient(135deg, var(--accent-indigo), #4f46e5) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
}

.chat-messages .message-item.me .msg-meta-fb {
  display: none !important;
}

.chat-messages .message-item.me .msg-text-fb {
  color: #ffffff !important;
}

/* Reactions summary position for own messages */
.chat-messages .message-item.me .msg-reactions-fb-summary {
  right: auto !important;
  left: 12px !important;
}

/* Action line alignment for own messages */
.chat-messages .message-item.me .msg-actions-fb {
  flex-direction: row-reverse;
  padding-left: 0 !important;
  padding-right: 12px !important;
}

/* Reply Reference alignment for own messages */
.chat-messages .message-item.me .msg-reply-ref {
  justify-content: flex-start;
  padding-left: 0 !important;
  padding-right: 52px !important;
  flex-direction: row-reverse;
}

.chat-messages .message-item.me .reply-line-connector {
  left: auto !important;
  right: 33px !important;
  border-left: none !important;
  border-right: 2px solid var(--card-border) !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 6px !important;
}

[data-theme="light"] .chat-messages .message-item.me .reply-line-connector {
  border-color: #ccd0d5 !important;
}

/* ===================================================
   WAREHOUSE SPLIT LAYOUT AND STICKY FILTERS
   =================================================== */

.warehouse-split-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
  margin-top: 1rem;
}

.warehouse-filter-bar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  z-index: 10;
  padding: 1.5rem;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.warehouse-filters-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.warehouse-filters-grid .form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  font-family: var(--font-title);
  font-weight: 600;
  text-transform: uppercase;
}

.warehouse-filters-grid .form-group input,
.warehouse-filters-grid .form-group select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  height: 42px;
  outline: none;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.warehouse-filters-grid .form-group input:focus,
.warehouse-filters-grid .form-group select:focus {
  border-color: var(--accent-emerald);
}

.warehouse-grid {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .warehouse-split-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .warehouse-filter-bar {
    width: 100%;
    position: static;
    margin-bottom: 1rem;
  }

  .warehouse-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
  }

  .warehouse-filters-grid button {
    grid-column: span 1;
    margin-top: 0 !important;
  }
}

/* ===================================================
   MODAL TABS AND PREMIUM FORM STYLES
   =================================================== */

.modal-tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  flex: 1;
}

.modal-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .modal-tab-btn:hover {
  background: rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
}

.modal-tab-btn.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35) !important;
}

.modal-tabs-header {
  display: flex;
  gap: 0.5rem;
  margin: 0 2rem 1.25rem 2rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

[data-theme="light"] .modal-tabs-header {
  background: rgba(15, 23, 42, 0.05) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

.modal-tab-panel {
  display: none;
  animation: modalFadeIn 0.3s ease-in-out;
}

.modal-tab-panel.active {
  display: block;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Style file inputs in modal for premium look */
#modal-panel-ai input[type="file"] {
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}

#modal-panel-ai input[type="file"]::file-selector-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
}

#modal-panel-ai input[type="file"]::file-selector-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Fixed header/footer layout modal classes */
.modal-card.fixed-layout {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  padding: 0;
}

.modal-card.fixed-layout form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  margin: 0;
}

.modal-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 2rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 2rem;
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

[data-theme="light"] .modal-footer {
  background: rgba(15, 23, 42, 0.03) !important;
  border-top-color: rgba(15, 23, 42, 0.08) !important;
}

.btn-secondary {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .btn-secondary {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.05) !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(15, 23, 42, 0.1) !important;
}

.premium-week-select {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--accent-cyan);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.premium-week-select:focus,
.premium-week-select:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
}

.premium-week-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
}

/* Modal Overlay & Card Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  width: 100%;
  max-width: 550px;
  overflow-x: hidden;
  box-sizing: border-box;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--card-shadow), 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* AI Task Cards Redesign */
.ai-task-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: all var(--transition-fast);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ai-task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
  border-color: rgba(99, 102, 241, 0.25);
}

.ai-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ai-card-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Styled selects like pills */
.ai-card-select-week,
.ai-card-select-category {
  background: rgba(99, 102, 241, 0.1) !important;
  color: var(--accent-indigo) !important;
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
  padding: 0.25rem 0.6rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  outline: none !important;
  cursor: pointer !important;
  height: 26px !important;
  line-height: 1 !important;
  transition: all var(--transition-fast);
}

.ai-card-select-category {
  background: rgba(6, 182, 212, 0.1) !important;
  color: var(--accent-cyan) !important;
  border: 1px solid rgba(6, 182, 212, 0.2) !important;
}

.ai-card-select-week:hover,
.ai-card-select-week:focus {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: var(--accent-indigo) !important;
}

.ai-card-select-category:hover,
.ai-card-select-category:focus {
  background: rgba(6, 182, 212, 0.2) !important;
  border-color: var(--accent-cyan) !important;
}

.ai-card-select-week option,
.ai-card-select-category option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 500;
  border-radius: 8px;
}

.btn-delete-ai-card {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all var(--transition-fast);
  height: 28px;
  width: 28px;
}

.btn-delete-ai-card:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

/* Frameless editable inputs */
.ai-card-title-input {
  background: transparent !important;
  color: var(--text-primary) !important;
  border: none !important;
  border-bottom: 1px dashed transparent !important;
  padding: 0.25rem 0 !important;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  outline: none !important;
  width: 100%;
  resize: none;
  overflow: hidden;
  min-height: 28px;
  transition: border-color var(--transition-fast);
  line-height: 1.3;
}

.ai-card-title-input:focus {
  border-bottom-color: var(--accent-indigo) !important;
}

.ai-card-desc-textarea {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: none !important;
  padding: 0.25rem 0 !important;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none !important;
  width: 100%;
  resize: none;
  overflow: hidden;
  min-height: 50px;
  line-height: 1.4;
}

.ai-card-desc-textarea:focus {
  color: var(--text-primary) !important;
}

/* Admin Portal Section Header */
.admin-section-header {
  color: var(--text-primary);
  font-family: var(--font-title);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Premium Projects Table & Pagination CSS */
.premium-table-container {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-top: 1.5rem;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.premium-table-container:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: var(--card-hover-shadow);
}

.premium-table-wrapper {
  overflow-x: auto;
}

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-family: var(--font-body);
}

.premium-table th {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

[data-theme="light"] .premium-table th {
  background: rgba(15, 23, 42, 0.02);
}

.premium-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 0.875rem;
  vertical-align: middle;
  transition: background-color var(--transition-fast);
}

.premium-table tr:last-child td {
  border-bottom: none;
}

.premium-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

[data-theme="light"] .premium-table tr:hover td {
  background: rgba(15, 23, 42, 0.01);
}

/* Sorting Header Styles */
.sortable-header {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-fast);
}

.sortable-header:hover {
  color: var(--text-primary);
}

.sort-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.sortable-header:hover .sort-icon {
  color: var(--text-secondary);
}

.sort-active {
  color: var(--accent-indigo) !important;
}

.sort-active .sort-icon {
  color: var(--accent-indigo) !important;
}

/* Pagination Section Styles */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.01);
  flex-wrap: wrap;
  gap: 1rem;
}

[data-theme="light"] .pagination-container {
  background: rgba(15, 23, 42, 0.005);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .pagination-btn {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .pagination-btn:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.15);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: var(--accent-indigo) !important;
  color: white !important;
  border-color: var(--accent-indigo) !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* ===================================================
   DESKTOP DYNAMIC SCROLLBAR FOR KANBAN
   =================================================== */
@media (min-width: 1025px) {
  .weekly-checklist-area {
    overflow-y: hidden !important;
  }

  .weekly-checklist-area .active-checklist-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .tasks-checklist {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .kanban-board-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .kanban-columns {
    flex: 1;
    display: flex !important;
    overflow-x: auto !important;
    align-items: stretch !important;
    min-height: 0;
    padding-bottom: 0.5rem !important;
  }

  .kanban-column {
    height: 100% !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 0px;
    min-width: 270px;
    max-width: none;
  }

  .kanban-cards-container {
    flex: 1;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-right: 4px;
  }

  /* Scrollbars inside Kanban columns */
  .kanban-cards-container::-webkit-scrollbar {
    width: 6px;
  }

  .kanban-cards-container::-webkit-scrollbar-track {
    background: transparent;
  }

  .kanban-cards-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
  }

  .kanban-cards-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* Column Shift Buttons styling */
.column-shift-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s, transform 0.15s;
}

.column-shift-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.15);
}

.column-shift-btn i {
  color: var(--accent-indigo) !important;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.column-shift-btn:hover i {
  opacity: 1;
}

/* Kanban card loading overlay (drag-move in-flight) */
.kanban-card {
  position: relative;
}
.kanban-card-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.55);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: fadeInOverlay 0.15s ease;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
.kanban-card-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent-cyan, #06b6d4);
  border-radius: 50%;
  animation: spinCard 0.6s linear infinite;
}
@keyframes spinCard {
  to { transform: rotate(360deg); }
}

/* Ajouter une Colonne Button design */
.btn-add-column {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  border: 1.5px solid rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-indigo) !important;
}

.btn-add-column:hover {
  background: var(--accent-indigo) !important;
  border-color: var(--accent-indigo) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-add-column i {
  color: inherit !important;
  transition: color var(--transition-fast);
}

/* Light mode override for btn-add-column */
[data-theme="light"] .btn-add-column {
  background: rgba(79, 70, 229, 0.05) !important;
  border: 1.5px solid rgba(79, 70, 229, 0.45) !important;
  color: #4f46e5 !important;
}

[data-theme="light"] .btn-add-column:hover {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25) !important;
}

/* Column Delete Button styling */
.column-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s, transform 0.15s;
}

.column-delete-btn:hover {
  background: rgba(244, 63, 94, 0.1);
  transform: scale(1.15);
}

.column-delete-btn i {
  color: var(--accent-rose) !important;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.column-delete-btn:hover i {
  opacity: 1;
}

/* Light mode overrides for column icon buttons hover states */
[data-theme="light"] .column-shift-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .column-delete-btn:hover {
  background: rgba(244, 63, 94, 0.08);
}

/* Kanban Column Placeholder style for Adding Columns */
.kanban-column.add-column-placeholder {
  min-width: 280px !important;
  max-width: 280px !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5rem !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 2px dashed rgba(99, 102, 241, 0.25) !important;
  border-radius: 12px !important;
  transition: all var(--transition-fast) !important;
  box-sizing: border-box !important;
}

[data-theme="light"] .kanban-column.add-column-placeholder {
  background: rgba(15, 23, 42, 0.01) !important;
  border: 2px dashed rgba(79, 70, 229, 0.18) !important;
}

.kanban-column.add-column-placeholder:hover {
  background: rgba(99, 102, 241, 0.04) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
}

[data-theme="light"] .kanban-column.add-column-placeholder:hover {
  background: rgba(79, 70, 229, 0.03) !important;
  border-color: rgba(79, 70, 229, 0.45) !important;
}

/* ===================================================
   TEAM PAGE HIERARCHICAL TREE LAYOUT
   =================================================== */
.hierarchy-tree-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  width: 100%;
}

.hierarchy-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hierarchy-level-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.4rem;
  border-radius: 30px;
  font-family: var(--font-title);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.hierarchy-level-header:hover {
  transform: translateY(-2px);
}

.level-admin .hierarchy-level-header {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.03));
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.12);
}

.level-supervisor .hierarchy-level-header {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.03));
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
}

.level-collaborator .hierarchy-level-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.03));
  color: var(--accent-indigo);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

/* Light mode overrides */
[data-theme="light"] .level-admin .hierarchy-level-header {
  background: rgba(239, 68, 68, 0.06) !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.12) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08) !important;
}

[data-theme="light"] .level-supervisor .hierarchy-level-header {
  background: rgba(245, 158, 11, 0.06) !important;
  color: #d97706 !important;
  border-color: rgba(245, 158, 11, 0.12) !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.08) !important;
}

[data-theme="light"] .level-collaborator .hierarchy-level-header {
  background: rgba(99, 102, 241, 0.08) !important;
  color: #4f46e5 !important;
  border-color: rgba(99, 102, 241, 0.15) !important;
}

.hierarchy-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
  justify-content: center;
}

.hierarchy-level-grid.single-item {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.hierarchy-level-grid.single-item>.profile-card {
  width: 320px;
  flex-shrink: 0;
}

.hierarchy-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0.6;
  font-size: 1.5rem;
  height: 24px;
  animation: pulseConnector 2s infinite ease-in-out;
}

@keyframes pulseConnector {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  50% {
    transform: translateY(4px);
    opacity: 0.8;
  }
}

@media (max-width: 768px) {
  .hierarchy-level-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1.25rem !important;
  }

  .hierarchy-level-grid.single-item>.profile-card {
    width: 100% !important;
    max-width: 350px !important;
  }
}

@media (max-width: 480px) {
  .hierarchy-level-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .hierarchy-level-grid.single-item>.profile-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Chat Image and File Card Styles */
.chat-image-wrapper {
  margin-top: 6px;
  position: relative;
  max-width: 280px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .chat-image-wrapper {
  border-color: rgba(0, 0, 0, 0.18) !important;
}

.chat-image-wrapper:hover {
  transform: scale(1.02);
}

.chat-image-wrapper img {
  width: 100%;
  max-height: 250px;
  display: block;
  object-fit: cover;
  cursor: zoom-in;
}

.chat-image-wrapper .image-download-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #e8eaed !important;
  color: #5f6368 !important;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid #d2d6dc !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.chat-image-wrapper .image-download-btn:hover {
  background: var(--accent-indigo) !important;
  color: #fff !important;
  border-color: var(--accent-indigo) !important;
  transform: scale(1.1);
}

.chat-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f9fa !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  padding: 10px 14px;
  border-radius: 12px;
  margin-top: 6px;
  max-width: 320px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-file-card:hover {
  background: #e8eaed !important;
  border-color: #d2d6dc !important;
}

.chat-file-card .file-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15) !important;
  color: var(--accent-indigo) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-file-card .file-details {
  flex: 1;
  min-width: 0;
}

.chat-file-card .file-details .file-name {
  font-weight: 500;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #202124 !important;
}

.chat-file-card .file-details .file-size {
  font-size: 0.72rem;
  color: #5f6368 !important;
  margin-top: 1px;
}

.chat-file-card .file-download-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8eaed !important;
  color: #5f6368 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  border: 1px solid #d2d6dc !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
  transition: transform 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
}

.chat-file-card .file-download-btn:hover {
  transform: scale(1.1);
  background: var(--accent-indigo) !important;
  color: #fff !important;
  border-color: var(--accent-indigo) !important;
}

/* Custom styling for download icons inside circular buttons to make them sharp and balanced */
.chat-image-wrapper .image-download-btn svg,
.chat-file-card .file-download-btn svg {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 2.5px !important;
  display: block;
}

/* Spinner inline animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner-inline {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* Custom Channel Visibility Selection Cards */
.visibility-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.4rem;
  width: 100%;
  box-sizing: border-box;
}

.visibility-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem 0.75rem;
  border-radius: 12px;
  background: var(--input-bg, rgba(15, 23, 42, 0.4));
  border: 1.5px solid var(--card-border, rgba(255, 255, 255, 0.1));
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.visibility-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.visibility-card input[type="radio"] {
  position: absolute;
  top: 0.75rem;
  right: 0.6rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent-indigo, #6366f1);
  width: 1.1rem;
  height: 1.1rem;
}

.visibility-card:has(input[type="radio"]:checked) {
  border-color: var(--accent-indigo, #6366f1);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(139, 92, 246, 0.08));
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25), inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.visibility-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  width: 100%;
  padding-right: 1.4rem;
  min-width: 0;
  box-sizing: border-box;
}

.visibility-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.visibility-card-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2px;
}

.visibility-card:has(input[type="radio"]:checked) .visibility-card-icon {
  background: var(--gradient-indigo, linear-gradient(135deg, #6366f1, #8b5cf6));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.visibility-card-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.visibility-card-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

/* Hide native Edge/IE password reveal button to prevent duplicate eye icons */
input::-ms-reveal,
input::-ms-clear {
  display: none !important;
}

/* Topbar Notification Bell & Dropdown Styles */
.topbar-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .topbar-icon-btn {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.topbar-icon-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.topbar-icon-btn svg {
  width: 19px;
  height: 19px;
  transition: transform 0.2s ease;
}

.topbar-icon-btn:hover svg {
  transform: rotate(12deg);
}

.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: -10px;
  width: 480px;
  background: var(--bg-secondary, #0f172a) !important;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.15);
  z-index: 100000;
  overflow: hidden;
  animation: dropdownPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

[data-theme="light"] .notification-dropdown {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2), 0 0 1px 1px rgba(15, 23, 42, 0.08);
}

@keyframes dropdownPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.notification-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  background: transparent !important;
}

[data-theme="light"] .notification-header {
  background: transparent !important;
}

.notification-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.notification-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.notification-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-header-icon svg {
  width: 16px;
  height: 16px;
}

.notification-header-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-title);
  letter-spacing: -0.01em;
}

.notification-header-pill {
  background: var(--accent-indigo);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.notification-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.header-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.48rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-action-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.header-action-btn:hover svg {
  transform: scale(1.1);
}

.header-action-btn.indigo {
  color: #a5b4fc !important;
  background: rgba(99, 102, 241, 0.18) !important;
  border-color: rgba(129, 140, 248, 0.35) !important;
}

.header-action-btn.indigo:hover {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  color: #ffffff !important;
  border-color: #6366f1 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
  transform: translateY(-1px);
}

.header-action-btn.rose {
  color: #fda4af !important;
  background: rgba(244, 63, 94, 0.18) !important;
  border-color: rgba(251, 113, 133, 0.35) !important;
}

.header-action-btn.rose:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
  color: #ffffff !important;
  border-color: #f43f5e !important;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4) !important;
  transform: translateY(-1px);
}

[data-theme="light"] .header-action-btn.indigo {
  color: #4f46e5 !important;
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
}

[data-theme="light"] .header-action-btn.rose {
  color: #e11d48 !important;
  background: rgba(244, 63, 94, 0.1) !important;
  border-color: rgba(244, 63, 94, 0.25) !important;
}

.btn-delete-notif {
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  opacity: 0.6 !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
  align-self: center !important;
  margin-left: 0.5rem !important;
  padding: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

.btn-delete-notif svg,
.btn-delete-notif i {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 2.2 !important;
  pointer-events: none !important;
}

.notification-item:hover .btn-delete-notif {
  opacity: 0.85 !important;
}

.btn-delete-notif:hover {
  opacity: 1 !important;
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.15) !important;
  transform: scale(1.1) !important;
}

.notification-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.notification-list::-webkit-scrollbar {
  width: 5px;
}

.notification-list::-webkit-scrollbar-track {
  background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}

.notification-item {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid transparent;
  display: flex;
  gap: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--card-border);
}

[data-theme="light"] .notification-item:hover {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(15, 23, 42, 0.08);
}

.notification-item.unread {
  background: rgba(99, 102, 241, 0.07);
  border-color: rgba(99, 102, 241, 0.18);
}

[data-theme="light"] .notification-item.unread {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.18);
}

.notification-item.unread:hover {
  background: rgba(99, 102, 241, 0.12);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-indigo);
  box-shadow: 0 0 8px var(--accent-indigo);
}

.notification-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.notification-item:hover .notification-icon-wrapper {
  transform: scale(1.05);
}

.notification-icon-wrapper svg {
  width: 18px;
  height: 18px;
}

.notification-icon-wrapper.project {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(99, 102, 241, 0.2));
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.notification-icon-wrapper.project-approved {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.22));
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.notification-icon-wrapper.project-rejected {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.22), rgba(225, 29, 72, 0.22));
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.2);
}

.notif-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.notif-status-badge.approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.notif-status-badge.rejected {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.notification-icon-wrapper.task {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.notification-icon-wrapper.chat {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.notification-icon-wrapper.system {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.notification-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.notification-title {
  font-family: var(--font-title);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification-message {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

[data-theme="light"] .notification-message {
  color: #334155;
}

.notification-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}

.notification-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Chat Message Highlight on Notification Click */
.message-item.highlight-message {
  animation: highlightMessageGlow 2.5s ease forwards;
  border-radius: 12px;
}

@keyframes highlightMessageGlow {
  0% {
    background-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    transform: scale(1.01);
  }

  70% {
    background-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    transform: scale(1);
  }

  100% {
    background-color: transparent;
    box-shadow: none;
    transform: scale(1);
  }
}

/* Responsive Mobile Styles for Notification Popover */
@media (max-width: 768px) {
  .notification-dropdown {
    position: fixed !important;
    top: 64px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    background: var(--bg-secondary, #0f172a) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--card-border) !important;
    z-index: 100000 !important;
    animation: dropdownPopMobile 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  [data-theme="light"] .notification-dropdown {
    background: #ffffff !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.12) !important;
  }

  @keyframes dropdownPopMobile {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .notification-header {
    padding: 0.85rem 1rem;
    gap: 0.6rem;
  }

  .notification-header-actions {
    gap: 0.4rem;
  }

  .header-action-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
  }

  .notification-list {
    max-height: 55vh;
    padding: 0.5rem 0.6rem;
  }

  .notification-item {
    padding: 0.75rem 0.85rem;
  }
}

/* ===========================================
   ROLE MANAGEMENT STYLES
   =========================================== */

.role-cards-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 280px;
  grid-template-rows: auto auto 1fr auto;
  gap: 0 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.75rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Custom horizontal scrollbar */
.role-cards-grid::-webkit-scrollbar {
  height: 6px;
}
.role-cards-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
}
.role-cards-grid::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}
.role-cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

.role-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
}

.role-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--role-color, #6366f1);
  border-radius: 14px 14px 0 0;
}

.role-card:hover {
  border-color: var(--role-color, rgba(99, 102, 241, 0.4));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.role-card.drag-over-left {
  border-left: 3px solid var(--accent-indigo) !important;
}

.role-card.drag-over-right {
  border-right: 3px solid var(--accent-indigo) !important;
}

.role-card.role-dragging {
  opacity: 0.4;
}

.role-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.role-card-name {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.role-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.role-card-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.role-card-permissions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.role-perm-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

/* Placeholder for permissions the role doesn't have — dimmed but takes space */
.role-perm-tag.role-perm-placeholder {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  opacity: 0.35;
}

/* 3-dot menu wrapper */
.role-card-menu-wrapper {
  position: relative;
}

.btn-role-menu {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}
.btn-role-menu:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Dropdown menu */
.role-card-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  min-width: 150px;
  padding: 0.35rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  flex-direction: column;
  gap: 0.15rem;
}
.role-card-dropdown.open {
  display: flex;
}

.role-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
.role-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
}
.role-dropdown-item.danger:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--accent-rose);
}

/* Users section inside role card */
.role-card-users-section {
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border);
  align-self: end;
}

.role-card-users-header {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.role-card-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 65px;
  padding: 0.3rem;
  border-radius: 8px;
  border: 2px dashed transparent;
  transition: all 0.25s ease;
}
.role-card-users-list.drag-over {
  border-color: var(--role-color, var(--accent-indigo));
  background: rgba(99, 102, 241, 0.06);
}

/* User row (draggable) */
.role-user-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
  width: 100%;
}
.role-user-row:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
}
.role-user-row.dragging {
  opacity: 0.35;
  transform: scale(0.97);
  border-color: var(--accent-indigo);
}
.role-user-row:active {
  cursor: grabbing;
}

.role-user-grip {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  opacity: 0.3;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.role-user-row:hover .role-user-grip {
  opacity: 0.7;
}

.role-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--role-color, var(--accent-indigo)), var(--accent-purple));
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.role-user-fullname {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-user-more {
  justify-content: center;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: default;
  border: 1px dashed rgba(148, 163, 184, 0.2);
}

.role-users-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.75rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Color picker dots */
.role-color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-color-dot:hover {
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.role-color-dot.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-primary);
}

/* Permission checkbox items in the modal */
.role-perm-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-perm-checkbox-item:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.2);
}

.role-perm-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #a855f7;
  cursor: pointer;
}

.role-perm-checkbox-item .perm-label {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.role-perm-checkbox-item .perm-key {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Profile card role change button */
.btn-change-role {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-purple, #a855f7);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.btn-change-role:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-1px);
}

/* Role empty state */
.role-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.role-empty-state i {
  color: var(--accent-purple, #a855f7);
  opacity: 0.4;
  margin-bottom: 1rem;
}

.role-empty-state h4 {
  font-family: var(--font-title);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.role-empty-state p {
  font-size: 0.85rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Custom role badge inline */
.custom-role-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-left: 0.35rem;
}

@media (max-width: 768px) {
  .role-cards-grid {
    gap: 0 0.75rem;
    grid-auto-columns: 240px;
  }
  
  .btn-change-role {
    position: static;
    margin-top: 0.5rem;
  }
}

/* Collaborator delete button hover visibility inside the card */
.weekly-intern-btn .delete-collab-btn {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, color 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--accent-rose);
}

.weekly-intern-btn:hover .delete-collab-btn {
  opacity: 0.7;
  visibility: visible;
}

.weekly-intern-btn:hover .delete-collab-btn:hover {
  opacity: 1;
}

.weekly-intern-btn.active .delete-collab-btn {
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
  #chat-message-search {
    width: 110px !important;
    font-size: 0.75rem !important;
    padding: 0.35rem 1.5rem 0.35rem 1.8rem !important;
  }
}

/* --- macOS Style Dots --- */
.chat-sidebar-mac-dots {
  display: flex;
  gap: 6px;
  padding: 1.25rem 1.25rem 0.5rem 1.25rem;
  align-items: center;
}
.chat-sidebar-mac-dots .mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.chat-sidebar-mac-dots .mac-dot.red { background-color: #ff5f56; }
.chat-sidebar-mac-dots .mac-dot.yellow { background-color: #ffbd2e; }
.chat-sidebar-mac-dots .mac-dot.green { background-color: #27c93f; }

/* --- Unified Search Bar --- */
.chat-unified-search-wrapper {
  position: relative;
  padding: 0 0.85rem;
  margin-bottom: 0.6rem;
  width: 100%;
  box-sizing: border-box;
}
.chat-unified-search-icon {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 2;
}
#chat-unified-search {
  width: 100%;
  height: 38px;
  padding: 0.45rem 0.75rem 0.45rem 2.25rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  text-overflow: ellipsis;
}
#chat-unified-search::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}
#chat-unified-search:focus {
  border-color: var(--accent-indigo);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* --- Sidebar Tabs Navigation --- */
.chat-sidebar-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 3px;
  margin: 0 0.85rem 0.6rem 0.85rem;
  border: 1px solid var(--card-border);
  box-sizing: border-box;
}
.chat-sidebar-tab {
  flex: 1;
  padding: 0.45rem 0;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.chat-sidebar-tab:hover:not(.active) {
  color: var(--text-primary);
}
.chat-sidebar-tab.active {
  background: var(--bg-secondary);
  color: var(--accent-indigo) !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* --- Premium Chat Sidebar Items --- */
.chat-sidebar-item {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.75rem !important;
  padding: 0.75rem 0.85rem !important;
  border-radius: 12px !important;
  margin-bottom: 0.25rem !important;
  height: 64px !important;
  color: var(--text-primary) !important;
  border: none !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}
.chat-sidebar-item.active {
  background: rgba(99, 102, 241, 0.12) !important;
  border-left: 3px solid var(--accent-indigo) !important;
  border-radius: 0 12px 12px 0 !important;
}
.chat-sidebar-item:hover {
  background: var(--bg-tertiary) !important;
  transform: translateX(4px) !important;
  cursor: pointer !important;
}
.chat-sidebar-item.active:hover {
  background: rgba(99, 102, 241, 0.18) !important;
}
.chat-sidebar-avatar-wrapper {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.chat-sidebar-avatar-wrapper .msg-avatar {
  width: 42px !important;
  height: 42px !important;
  font-size: 0.85rem !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  color: #fff !important;
}
.chat-sidebar-avatar-wrapper .presence-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}
.chat-sidebar-avatar-wrapper .presence-status-dot.online {
  background-color: #27c93f;
}
.chat-sidebar-avatar-wrapper .presence-status-dot.offline {
  background-color: #a0aec0;
}
.chat-sidebar-item-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 0.2rem;
}
.chat-sidebar-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.chat-sidebar-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.chat-sidebar-item-meta {
  display: flex;
  align-items: center;
  position: relative;
  height: 16px;
}
.chat-sidebar-item-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.chat-sidebar-item:hover .chat-sidebar-item-time {
  display: none;
}
.chat-sidebar-item .channel-actions {
  display: none !important;
}
.chat-sidebar-item:hover .channel-actions {
  display: flex !important;
  opacity: 1 !important;
}
.chat-sidebar-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.chat-sidebar-item-snippet {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
}
.chat-sidebar-item.active .chat-sidebar-item-snippet {
  color: var(--text-secondary) !important;
  opacity: 0.8;
}
.chat-sidebar-item-unread-badge {
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1;
}

/* Override squash styling for add-channel button in unified view */
#btn-add-channel.btn-add-channel-unified {
  width: 100% !important;
  height: auto !important;
  padding: 0.6rem 1rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  background: var(--accent-indigo) !important;
  color: #ffffff !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  transform: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

#btn-add-channel.btn-add-channel-unified:hover {
  background: var(--accent-indigo-hover, #4f46e5) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}
#chat-unified-search {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.25rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  transition: all 0.2s ease;
}
#chat-unified-search:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}



/* --- Premium Chat Sidebar Items --- */
.chat-sidebar-item {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.75rem !important;
  padding: 0.75rem 0.85rem !important;
  border-radius: 12px !important;
  margin-bottom: 0.25rem !important;
  height: 64px !important;
  color: var(--text-primary) !important;
  border: none !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}
.chat-sidebar-item.active {
  background: rgba(99, 102, 241, 0.12) !important;
  border-left: 3px solid var(--accent-indigo) !important;
  border-radius: 0 12px 12px 0 !important;
}
.chat-sidebar-item:hover {
  background: var(--bg-tertiary) !important;
  transform: translateX(4px) !important;
  cursor: pointer !important;
}
.chat-sidebar-item.active:hover {
  background: rgba(99, 102, 241, 0.18) !important;
}
.chat-sidebar-avatar-wrapper {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.chat-sidebar-avatar-wrapper .msg-avatar {
  width: 42px !important;
  height: 42px !important;
  font-size: 0.85rem !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  color: #fff !important;
}
.chat-sidebar-avatar-wrapper .presence-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}
.chat-sidebar-avatar-wrapper .presence-status-dot.online {
  background-color: #27c93f;
}
.chat-sidebar-avatar-wrapper .presence-status-dot.offline {
  background-color: #a0aec0;
}
.chat-sidebar-item-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 0.2rem;
}
.chat-sidebar-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.chat-sidebar-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.chat-sidebar-item-meta {
  display: flex;
  align-items: center;
  position: relative;
  height: 16px;
}
.chat-sidebar-item-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.chat-sidebar-item:hover .chat-sidebar-item-time {
  display: none;
}
.chat-sidebar-item .channel-actions {
  display: none !important;
}
.chat-sidebar-item:hover .channel-actions {
  display: flex !important;
  opacity: 1 !important;
}
.chat-sidebar-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.chat-sidebar-item-snippet {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
}
.chat-sidebar-item.active .chat-sidebar-item-snippet {
  color: var(--text-secondary) !important;
  opacity: 0.8;
}
.chat-sidebar-item-unread-badge {
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 4px !important;
  line-height: 1 !important;
}

/* Override squash styling for add-channel button in unified view */
#btn-add-channel.btn-add-channel-unified {
  width: 100% !important;
  height: auto !important;
  padding: 0.6rem 1rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  background: var(--accent-indigo) !important;
  color: #ffffff !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  transform: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

#btn-add-channel.btn-add-channel-unified:hover {
  background: var(--accent-indigo-hover, #4f46e5) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
}

#btn-add-channel.btn-add-channel-unified i {
  width: 16px !important;
  height: 16px !important;
}

/* Edit and delete channel action button styles */
.channel-action-btn {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 4px !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}
.channel-action-btn:hover {
  background: rgba(99, 102, 241, 0.15) !important;
}
.channel-edit-btn {
  color: var(--text-secondary) !important;
}
.channel-edit-btn:hover {
  color: var(--accent-indigo) !important;
}
.channel-delete-btn {
  color: var(--accent-rose) !important;
}
.channel-delete-btn:hover {
  color: #ff3366 !important;
}

/* Compact style for bottom user card */
.chat-sidebar-self-card {
  padding: 0.5rem 0.85rem !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  height: 52px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
}

/* Ensure unified list is allowed to grow and push profile card to bottom */
#chat-channels-list {
  flex: 1 1 auto !important;
  max-height: none !important;
}

/* --- Unified Chat Header Styles --- */
.chat-header {
  padding: 0.75rem 1.25rem !important;
  border-bottom: 1px solid var(--card-border) !important;
}

.chat-header-avatar-wrapper .msg-avatar {
  width: 40px !important;
  height: 40px !important;
  font-size: 0.85rem !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  color: #fff !important;
}

.chat-header-avatar-wrapper .presence-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.chat-header-avatar-wrapper .presence-status-dot.online {
  background-color: #27c93f;
}

.chat-header-avatar-wrapper .presence-status-dot.offline {
  background-color: #a0aec0;
}

.chat-header-actions-unified {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.chat-header-action-btn-unified {
  background: none !important;
  border: none !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  padding: 6px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  outline: none !important;
}

.chat-header-action-btn-unified:hover {
  background: rgba(99, 102, 241, 0.1) !important;
  color: var(--accent-indigo) !important;
}

.chat-header-action-btn-unified i,
.chat-header-action-btn-unified svg {
  width: 20px !important;
  height: 20px !important;
  stroke-width: 1.8 !important;
}

/* --- Chat Info Sidebar Styles --- */
.chat-info-sidebar {
  display: none;
  flex-direction: column;
  width: 320px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--card-border);
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.chat-info-sidebar #btn-close-info-sidebar:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
}

.info-sidebar-socials {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 0.5rem 0;
}

.info-social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  transition: transform 0.2s ease, filter 0.2s ease;
  text-decoration: none;
}

.info-social-icon:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.info-social-icon.facebook {
  background: #3b5998;
}

.info-social-icon.twitter {
  background: #1da1f2;
}

.info-social-icon.instagram {
  background: #e1306c;
}

.info-social-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.info-media-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--card-border);
}

.info-media-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#btn-leave-channel {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#btn-leave-channel:hover {
  opacity: 0.8;
  color: var(--accent-rose) !important;
  background: transparent !important;
}

/* Responsive Overrides for Info Sidebar */
@media (max-width: 768px) {
  .chat-container .chat-info-sidebar {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    height: 100% !important;
    z-index: 100 !important;
    width: 100% !important;
    box-shadow: -4px 0 12px rgba(0,0,0,0.15) !important;
  }
}

/* Sidebar Tabs styling */
.sidebar-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--card-border);
}

.sidebar-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.sidebar-tab-btn.active {
  background: var(--accent-indigo);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.sidebar-tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Sidebar Tab Content Pane */
.sidebar-tab-pane {
  display: none;
  width: 100%;
}

.sidebar-tab-pane.active {
  display: block;
}

.sidebar-file-card,
.sidebar-link-card {
  transition: all 0.2s ease;
}

.sidebar-file-card:hover,
.sidebar-link-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-indigo) !important;
}

.chat-search-wrapper {
  display: flex;
  align-items: center;
  gap: 0px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  width: 32px;
  height: 32px;
  justify-content: center;
  overflow: hidden;
}

.chat-search-wrapper #btn-trigger-search {
  flex-shrink: 0;
}

.chat-search-wrapper input {
  display: none;
  background: none !important;
  border: none !important;
  font-size: 0.8rem;
  color: var(--text-primary);
  outline: none !important;
  width: 0;
  padding: 0;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-search-wrapper #btn-clear-chat-search {
  display: none;
  background: none !important;
  border: none !important;
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 4px;
  outline: none !important;
  flex-shrink: 0;
}

/* Expanded/Active state */
.chat-search-wrapper.active {
  background: var(--bg-tertiary);
  border-color: var(--card-border);
  width: 220px;
  padding: 2px 10px 2px 2px;
  border-radius: 20px;
  justify-content: flex-start;
  gap: 6px;
  height: auto;
}

.chat-search-wrapper.active input {
  display: block;
  width: 100%;
}

.chat-search-wrapper.active #btn-trigger-search {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

/* Reaction Details Modal Styles */
.reaction-tab {
  background: transparent;
  border: none;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.2s ease;
  outline: none;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.reaction-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.reaction-tab.active {
  background: rgba(99, 102, 241, 0.12) !important;
  color: var(--accent-indigo) !important;
}

.reaction-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.reaction-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reaction-user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.reaction-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.reaction-user-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.reaction-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.reaction-user-subtext {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.reaction-user-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sizing overrides for SVG reactions inside the details modal */
.reaction-user-emoji .reaction-icon-img {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.2px !important;
}

.reaction-tab .reaction-icon-img {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 2.2px !important;
}

.modal-tab-emoji-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   CALL MODAL — GOOGLE MEET STYLE
   ============================================= */

/* Modal Card */
.call-modal-card {
  max-width: 720px !important;
  width: 94% !important;
  background: #202124 !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
  overflow: visible;
  padding: 0 !important;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Remove old decorative pseudo-elements */
.call-modal-card::after,
.call-modal-card::before {
  display: none !important;
}

/* Ringing / Pre-call Layout (Stitch design) */
.call-modal-card:has(#call-screen-outgoing:not([style*="display: none"])),
.call-modal-card:has(#call-screen-incoming:not([style*="display: none"])) {
  max-width: 520px !important;
  width: 90% !important;
}

.call-screen-layout {
  padding: 3rem 2rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  min-height: 320px;
  background: #202124;
  border-radius: 16px;
}

/* Avatar Circles (Stitch design) */
.outgoing-call-avatar,
.incoming-call-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #1a73e8;
  color: #ffffff;
  font-size: 28px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 0 10px rgba(26, 115, 232, 0.18);
  font-family: Google Sans, Roboto, Inter, sans-serif;
  position: relative;
  z-index: 2;
  animation: pulse-avatar-ring 2.2s infinite ease-out;
}

.incoming-call-avatar {
  background: #34a853;
  box-shadow: 0 0 0 10px rgba(52, 168, 83, 0.18);
  animation: pulse-avatar-ring-green 2.2s infinite ease-out;
}

@keyframes pulse-avatar-ring {
  0% {
    box-shadow: 0 0 0 0px rgba(26, 115, 232, 0.5);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(26, 115, 232, 0);
  }
  100% {
    box-shadow: 0 0 0 0px rgba(26, 115, 232, 0);
  }
}

@keyframes pulse-avatar-ring-green {
  0% {
    box-shadow: 0 0 0 0px rgba(52, 168, 83, 0.5);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(52, 168, 83, 0);
  }
  100% {
    box-shadow: 0 0 0 0px rgba(52, 168, 83, 0);
  }
}

/* Title & Subtitle (Stitch design) */
.call-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  font-family: Google Sans, Roboto, Inter, sans-serif;
  letter-spacing: 0;
  text-align: center;
}

.call-subtitle {
  color: #9aa0a6;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 2.25rem;
  text-align: center;
}

.call-action-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #9aa0a6;
  text-transform: uppercase;
  margin-top: 8px;
  text-align: center;
  font-family: inherit;
}

.call-action-label.success {
  color: #34a853;
}

.call-subtitle {
  color: #9aa0a6;
  font-size: 0.875rem;
  font-weight: 400;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

/* Remove the old pulsing dot */
.call-subtitle::before {
  display: none;
}

/* ---- Call Control Buttons (Google Meet style) ---- */
.btn-call-action {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #3c4043;
  color: #e8eaed;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  outline: none;
  box-shadow: none;
}

.btn-call-action:hover {
  background: #4a4e51;
}

.btn-call-action:active {
  transform: scale(0.95);
}

/* Active state (e.g., screenshare ON) — Google blue */
.btn-call-action.active {
  background: #1a73e8 !important;
  border: none !important;
  color: #fff !important;
  box-shadow: none;
}

.btn-call-action.active:hover {
  background: #1565c0 !important;
  border: none !important;
  color: #fff !important;
  transform: none;
  box-shadow: none;
}

/* Muted state (mic off, camera off) — Google red */
.btn-call-action.muted {
  background: #ea4335 !important;
  border: none !important;
  color: #fff !important;
}

.btn-call-action.muted:hover {
  background: #d33426 !important;
  border: none !important;
  color: #fff !important;
  transform: none;
  box-shadow: none;
}

/* Recording active */
.btn-call-action.recording {
  background: #ea4335 !important;
  border: none !important;
  color: #fff !important;
}

/* Danger / Hang-up button — Google red */
.btn-call-action.danger {
  width: 48px;
  height: 48px;
  background: #ea4335;
  border: none;
  box-shadow: none;
}

.btn-call-action.danger:hover {
  background: #d33426;
  box-shadow: none;
  transform: none;
}

/* Accept button — Google green, circular */
.btn-call-action.success {
  background: #34a853;
  border: none;
  box-shadow: none;
  padding: 0;
  width: 48px;
  border-radius: 50%;
  height: 48px;
  font-weight: 500;
  gap: 0;
  color: #fff;
}

.btn-call-action.success:hover {
  background: #2d9249;
  box-shadow: none;
  transform: none;
}

/* Decline button — Google red, circular */
.btn-call-action.decline {
  background: #ea4335;
  border: none;
  box-shadow: none;
  padding: 0;
  width: 48px;
  border-radius: 50%;
  height: 48px;
  font-weight: 500;
  gap: 0;
  color: #fff;
}

.btn-call-action.decline:hover {
  background: #d33426;
  box-shadow: none;
  transform: none;
}

/* Speaker button is MOBILE ONLY (hidden on desktop) */
#btn-call-speaker,
.btn-call-speaker {
  display: none !important;
}

/* ---- Audio Call Placeholder (Camera Off / Voice Call) ---- */
.audio-call-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #202124;
  border-radius: 16px 16px 0 0;
  border: none;
  padding: 2.5rem 2rem;
  transition: all 0.3s ease;
}

.audio-call-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 10px rgba(26, 115, 232, 0.18);
  margin-bottom: 1.25rem;
  font-family: Google Sans, Roboto, Inter, sans-serif;
  animation: pulse-avatar-ring 2.2s infinite ease-out;
}

.audio-call-name {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  font-family: Google Sans, Roboto, Inter, sans-serif;
  text-align: center;
}

.audio-call-role {
  font-size: 14px;
  font-weight: 400;
  color: #9aa0a6;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}

/* ---- Active Speaker Indicators ---- */
.remote-video-container.speaking {
  outline: 2px solid #34a853 !important;
  outline-offset: -2px;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none;
  z-index: 10;
}

#local-video-wrapper.speaking {
  outline: 2px solid #34a853 !important;
  outline-offset: -2px;
  border-color: transparent !important;
  box-shadow: none !important;
}

.remote-avatar.speaking {
  border: 3px solid #34a853 !important;
  box-shadow: none !important;
  animation: none;
}

/* Audio speaking bars */
.speaking-indicator {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 14px;
  height: 12px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.speaking-bar {
  width: 2px;
  height: 100%;
  background-color: #34a853;
  border-radius: 1px;
  animation: bounce-bar 0.6s infinite alternate ease-in-out;
  transform-origin: bottom;
}

.speaking-bar:nth-child(1) { animation-delay: 0.1s; }
.speaking-bar:nth-child(2) { animation-delay: 0.3s; }
.speaking-bar:nth-child(3) { animation-delay: 0.2s; }

@keyframes bounce-bar {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}

/* ---- IN-CALL CHAT SIDEBAR & LAYOUT ---- */
.call-main-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: calc(100% - 76px);
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
}

.call-chat-sidebar {
  display: flex;
  flex-direction: column;
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  height: 100%;
  background: #1e1f23;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  z-index: 25;
  transition: all 0.25s ease;
}

.call-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #18191c;
}

.call-chat-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
  font-family: Google Sans, Inter, Roboto, sans-serif;
}

.btn-close-call-chat {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close-call-chat:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.call-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}

.call-chat-empty-state {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #64748b;
  font-size: 0.82rem;
}

.call-chat-empty-state p {
  margin: 4px 0 2px 0;
  font-weight: 600;
  color: #94a3b8;
}

/* ---- Social Chat Message Layout with Avatars & Action Tools ---- */
.call-chat-msg {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  max-width: 92%;
  position: relative;
  margin-bottom: 6px;
}

.call-chat-msg.sent-by-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.call-chat-msg.sent-by-other {
  align-self: flex-start;
}

/* User Avatar Bubble */
.call-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin-top: 2px;
}

.call-chat-msg.sent-by-me .call-chat-avatar {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.call-chat-content-wrap {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  position: relative;
}

.call-chat-msg.sent-by-me .call-chat-content-wrap {
  align-items: flex-end;
}

.call-chat-msg.sent-by-other .call-chat-content-wrap {
  align-items: flex-start;
}

/* Meta Header: Name + Time + Edited tag */
.call-chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  margin-bottom: 2px;
  padding: 0 2px;
}

.call-chat-author {
  font-weight: 600;
  color: #cbd5e1;
}

.call-chat-time {
  font-size: 0.65rem;
  color: #64748b;
}

.call-chat-edited-tag {
  font-size: 0.62rem;
  color: #94a3b8;
  font-style: italic;
}

/* Quoted Reply inside Message Bubble */
.call-chat-quoted-reply {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid #6366f1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 4px;
  color: #cbd5e1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-chat-quoted-reply strong {
  color: #a5b4fc;
  margin-right: 4px;
}

.call-chat-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.35;
  word-break: break-word;
  color: #ffffff;
}

.call-chat-msg.sent-by-me .call-chat-bubble {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.call-chat-msg.sent-by-other .call-chat-bubble {
  background: #2d2f36;
  border-bottom-left-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Row wrapping bubble and hover buttons side-by-side */
.call-chat-bubble-row {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  max-width: 100%;
}

.call-chat-msg.sent-by-me .call-chat-bubble-row {
  flex-direction: row-reverse;
}

.call-chat-msg.sent-by-other .call-chat-bubble-row {
  flex-direction: row;
}

/* Hover Action Buttons Container (Hidden by default, shown on hover beside bubble) */
.call-chat-hover-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.call-chat-msg.sent-by-me .call-chat-hover-actions {
  flex-direction: row-reverse;
}

.call-chat-msg.sent-by-other .call-chat-hover-actions {
  flex-direction: row;
}

.call-chat-msg:hover .call-chat-hover-actions {
  opacity: 1;
  pointer-events: auto;
}

.call-chat-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.call-chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: scale(1.1);
}

/* Quick Reaction Emoji Popover beside hover action button */
.call-chat-quick-reactions-popover {
  position: absolute;
  bottom: 100%;
  margin-bottom: 6px;
  background: #1e2026;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  z-index: 35;
  white-space: nowrap;
}

.call-chat-msg.sent-by-me .call-chat-quick-reactions-popover {
  right: 0;
}

.call-chat-msg.sent-by-other .call-chat-quick-reactions-popover {
  left: 0;
}

.call-chat-quick-reactions-popover span {
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.call-chat-quick-reactions-popover span:hover {
  transform: scale(1.35);
}

/* 3-Dots More Menu Dropdown */
.call-chat-more-dropdown {
  position: absolute;
  top: 100%;
  margin-top: 4px;
  background: #23252d;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  min-width: 120px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 35;
}

.call-chat-msg.sent-by-me .call-chat-more-dropdown {
  right: 0;
}

.call-chat-msg.sent-by-other .call-chat-more-dropdown {
  left: 0;
}

.call-chat-dropdown-item {
  background: transparent;
  border: none;
  color: #e2e8f0;
  padding: 6px 12px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.12s ease;
}

.call-chat-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
}

.call-chat-dropdown-item.danger {
  color: #f87171;
}

.call-chat-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.call-chat-quick-reactions-popover span {
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.call-chat-quick-reactions-popover span:hover {
  transform: scale(1.35);
}

/* Reaction Badges Container below bubble */
.call-chat-reactions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.call-chat-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #2a2d36;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1px 6px;
  font-size: 0.72rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.12s ease;
}

.call-chat-reaction-pill:hover,
.call-chat-reaction-pill.user-reacted {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
}

/* Reply Preview Bar above input footer */
.call-chat-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #252830;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #6366f1;
  font-size: 0.78rem;
}

.reply-preview-label {
  font-size: 0.7rem;
  color: #a5b4fc;
  display: block;
}

.reply-preview-text {
  margin: 0;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}

.btn-cancel-reply {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cancel-reply:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Emoji Quick Popover Panel */
.call-chat-emoji-popover {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: #252830;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.emoji-opt {
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: transform 0.12s ease;
}

.emoji-opt:hover {
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.15);
}

.btn-chat-footer-action {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-chat-footer-action:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.call-chat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #18191c;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.call-chat-footer input {
  flex: 1;
  background: #282a30;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 14px;
  color: #f8fafc;
  font-size: 0.84rem;
  outline: none;
}

.call-chat-footer input:focus {
  border-color: #6366f1;
}

.call-chat-footer button {
  background: #6366f1;
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.call-chat-footer button:hover {
  transform: scale(1.05);
  background: #4f46e5;
}

.call-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  border: 2px solid #181b20;
}

/* ---- Screenshare Layout & Fullscreen ---- */
#screenshare-container {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: none;
}

/* When screenshare is active — expand modal & side-by-side layout */
.call-modal-card:has(.has-screenshare) {
  max-width: 960px !important;
  width: 94vw !important;
  transition: max-width 0.3s ease, width 0.3s ease;
}

/* Base grid sizing — fills the video container */
#remote-videos-grid {
  height: 100%;
  min-height: 0;
}

#call-videos-container.has-screenshare:not(.has-tile-zoom) {
  display: flex !important;
  flex-direction: row !important;
  gap: 12px !important;
  padding: 12px !important;
  align-items: stretch !important;
  height: 480px !important;
}

.call-fullscreen #call-videos-container.has-screenshare:not(.has-tile-zoom) {
  height: 0 !important;
  flex: 1 1 auto !important;
}

.has-screenshare:not(.has-tile-zoom) #screenshare-container {
  display: block !important;
  flex: 1 1 auto !important;
  width: auto !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Right strip: video tiles stacked vertically on desktop */
.has-screenshare:not(.has-tile-zoom) #remote-videos-grid {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 180px !important;
  min-width: 180px !important;
  flex: 0 0 180px !important;
  height: 100% !important;
  z-index: 5 !important;
  background: transparent !important;
  overflow-y: auto !important;
  padding: 0 !important;
}

.has-screenshare:not(.has-tile-zoom) #remote-videos-grid .remote-video-container {
  width: 100% !important;
  height: 115px !important;
  min-width: unset !important;
  min-height: 115px !important;
  flex: none !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}

.has-screenshare #remote-videos-grid .remote-video-container .remote-avatar-placeholder .remote-avatar {
  width: 48px !important;
  height: 48px !important;
  font-size: 1.1rem !important;
  margin-bottom: 0 !important;
}

/* Local video in right strip */
.has-screenshare #local-video-wrapper {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  width: 100% !important;
  height: 115px !important;
  border-radius: 10px !important;
  flex-shrink: 0 !important;
}

/* Hide audio placeholder when screensharing */
.has-screenshare #call-audio-only-placeholder {
  display: none !important;
}

/* ---- Tile Zoom Layout (click a participant to zoom, like screenshare) ---- */
@media (min-width: 769px) {
  .has-tile-zoom #remote-videos-grid {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }
}

/* ---- DESKTOP ONLY TILE ZOOM RULES ---- */
@media (min-width: 769px) {
  /* Desktop Tile Zoom Container */
  .has-tile-zoom:not(.has-screenshare) #remote-videos-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    width: 100% !important;
    height: 100% !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* The zoomed tile expands to fill the main left area */
  .has-tile-zoom:not(.has-screenshare) #remote-videos-grid .remote-video-container.zoomed-tile {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 1 1 auto !important;
    width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    z-index: 10 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
  }

  /* Right-side vertical scroll column container for non-zoomed participant tiles */
  .has-tile-zoom:not(.has-screenshare) #tile-zoom-strip {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 8px !important;
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    flex: 0 0 170px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 2px 4px 2px 2px !important;
    box-sizing: border-box !important;
    z-index: 20 !important;
  }

  .has-tile-zoom:not(.has-screenshare) #tile-zoom-strip .remote-video-container {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
    height: 105px !important;
    min-height: 105px !important;
    max-height: 105px !important;
    flex: 0 0 105px !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
  }

  .has-tile-zoom:not(.has-screenshare) #tile-zoom-strip .remote-video-container .remote-avatar-placeholder .remote-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.1rem !important;
    margin-bottom: 0 !important;
  }

  /* Custom vertical scrollbar for right side column on desktop */
  .has-tile-zoom:not(.has-screenshare) #tile-zoom-strip::-webkit-scrollbar {
    width: 5px !important;
  }

  .has-tile-zoom:not(.has-screenshare) #tile-zoom-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 4px !important;
  }

  .has-tile-zoom:not(.has-screenshare) #tile-zoom-strip::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45) !important;
  }

  /* ---- DUAL SCREEN SHARE + PARTICIPANT TILE ZOOM ---- */
  .has-screenshare.has-tile-zoom {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Screenshare container becomes top tile in right strip */
  .has-screenshare.has-tile-zoom #screenshare-container {
    display: block !important;
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 180px !important;
    height: 115px !important;
    min-height: 115px !important;
    max-height: 115px !important;
    z-index: 30 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
    cursor: pointer !important;
    border: 2px solid var(--accent-indigo, #6366f1) !important;
    transition: all 0.2s ease !important;
  }

  .has-screenshare.has-tile-zoom #screenshare-container:hover {
    outline: 2px solid #ffffff !important;
    transform: scale(1.02) !important;
  }

  /* Stack participant tiles below screenshare tile in right strip */
  .has-screenshare.has-tile-zoom #remote-videos-grid .remote-video-container:not(.zoomed-tile) {
    position: absolute !important;
    right: 12px !important;
    width: 180px !important;
    height: 115px !important;
    min-height: 115px !important;
    max-height: 115px !important;
    z-index: 25 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
  }

  .has-screenshare.has-tile-zoom #remote-videos-grid .remote-video-container:not(.zoomed-tile):nth-of-type(1) { top: 137px !important; }
  .has-screenshare.has-tile-zoom #remote-videos-grid .remote-video-container:not(.zoomed-tile):nth-of-type(2) { top: 262px !important; }
  .has-screenshare.has-tile-zoom #remote-videos-grid .remote-video-container:not(.zoomed-tile):nth-of-type(3) { top: 387px !important; }
  .has-screenshare.has-tile-zoom #remote-videos-grid .remote-video-container:not(.zoomed-tile):nth-of-type(4) { top: 512px !important; }

  /* If there's only 1 tile and it's zoomed without screenshare, let it take full width */
  .has-tile-zoom:not(.has-screenshare) #remote-videos-grid:has(.remote-video-container:only-child) .remote-video-container.zoomed-tile {
    right: 12px !important;
  }

  .has-tile-zoom #remote-videos-grid .remote-video-container.zoomed-tile .remote-avatar-placeholder .remote-avatar {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
}

/* Hover style for clickable video tiles */
.remote-video-container {
  cursor: pointer;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.remote-video-container:hover {
  outline: 2px solid rgba(255, 255, 255, 0.3);
}

.remote-video-container.zoomed-tile:hover {
  outline: 2px solid var(--accent-indigo, #6366f1);
}

/* Top-right expand/fullscreen button in call-videos-container (Desktop: hover or fullscreen; Mobile: screenshare only) */
#call-videos-container > .btn-call-expand,
#btn-call-expand,
.btn-call-expand {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 30 !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
  opacity: 0;
  pointer-events: none;
}

/* Show expand button on desktop hover, fullscreen, or during active screenshare */
#call-videos-container:hover > .btn-call-expand,
.call-fullscreen #call-videos-container > .btn-call-expand,
.has-screenshare #call-videos-container > .btn-call-expand,
#call-videos-container.has-screenshare > .btn-call-expand {
  opacity: 1 !important;
  pointer-events: auto !important;
}

#call-videos-container > .btn-call-expand:hover {
  background: rgba(0, 0, 0, 0.9) !important;
  transform: scale(1.08) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

/* ---- Desktop Windowed Active In-Call Modal ---- */
.call-modal-card:has(#call-screen-active:not([style*="display: none"])) {
  max-width: 720px !important;
  width: 94% !important;
  border-radius: 16px !important;
  background: #202124 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
}

.call-modal-card:has(#call-chat-sidebar:not([style*="display: none"])) {
  max-width: 1040px !important;
}

#call-screen-active:not([style*="display: none"]) {
  display: flex !important;
  flex-direction: column !important;
  border-radius: 16px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#call-main-content-layout {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  height: 440px !important;
  position: relative !important;
  overflow: hidden !important;
}

#call-videos-container {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  background: #3c4043 !important;
  border-radius: 16px 16px 0 0 !important;
  padding: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
}

.call-controls-bar {
  display: flex !important;
  gap: 12px !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 12px 0 !important;
  background: #202124 !important;
  border-radius: 0 0 16px 16px !important;
  position: relative !important;
}

/* Always hide floating 'X' close modal button during active calls */
.call-modal-card:has(#call-screen-active:not([style*="display: none"])) #btn-close-call-modal,
#modal-video-call #call-screen-active:not([style*="display: none"]) ~ #btn-close-call-modal {
  display: none !important;
}

/* ---- Desktop Fullscreen & Active Call Mode ---- */
html.in-call-fullscreen,
body.in-call-fullscreen {
  overflow: hidden !important;
}

.call-fullscreen,
#modal-video-call.call-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 999999 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #111418 !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  scrollbar-width: none !important;
}

.call-fullscreen .call-modal-card,
#modal-video-call.call-fullscreen .call-modal-card {
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #111418 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.call-fullscreen #call-screen-active,
#modal-video-call.call-fullscreen #call-screen-active {
  display: flex !important;
  flex-direction: column !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background: #111418 !important;
}

.call-fullscreen #call-main-content-layout,
#modal-video-call.call-fullscreen #call-main-content-layout {
  display: flex !important;
  flex-direction: row !important;
  flex: 1 1 auto !important;
  width: 100vw !important;
  height: calc(100vh - 76px) !important;
  height: calc(100dvh - 76px) !important;
  position: relative !important;
  overflow: hidden !important;
}

.call-fullscreen #call-videos-container,
#modal-video-call.call-fullscreen #call-videos-container {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  background: #111418 !important;
  overflow: hidden !important;
}

.call-fullscreen .call-controls-bar,
#modal-video-call.call-fullscreen .call-controls-bar {
  flex-shrink: 0 !important;
  height: 76px !important;
  width: 100vw !important;
  background: #181b20 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
  padding: 0 16px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  z-index: 50 !important;
}

.call-fullscreen .call-modal-card .has-screenshare {
  height: 100% !important;
}

/* Hide floating 'X' close modal button ONLY in fullscreen mode */
.call-fullscreen #btn-close-call-modal {
  display: none !important;
}

/* Global scrollbar hiding for fullscreen call view */
.call-fullscreen,
.call-fullscreen *,
.call-fullscreen *::-webkit-scrollbar {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.call-fullscreen::-webkit-scrollbar,
.call-fullscreen *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

#modal-video-call[style*="display: none"],
#modal-video-call[style*="display:none"] {
  display: none !important;
}

/* ---- Mobile Responsiveness for Calls & Screenshare ---- */
@media (max-width: 768px) {

  /* Overlay container on mobile (only when open) */
  #modal-video-call:not([style*="display: none"]):not([style*="display:none"]) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 100000 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* ---------- Pre-call incoming/outgoing modal on mobile ---------- */
  .call-modal-card:has(#call-screen-outgoing:not([style*="display: none"])),
  .call-modal-card:has(#call-screen-incoming:not([style*="display: none"])) {
    max-width: 90vw !important;
    width: 360px !important;
    height: auto !important;
    min-height: 300px !important;
    border-radius: 20px !important;
    margin: auto !important;
    background: #202124 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .call-screen-layout:not([style*="display: none"]) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2.5rem 1.5rem 2rem !important;
    width: 100% !important;
    min-height: 280px !important;
    box-sizing: border-box !important;
  }

  /* ---------- Active In-Call Card on Mobile ---------- */
  .call-modal-card:has(#call-screen-active:not([style*="display: none"])) {
    max-width: 94vw !important;
    width: 390px !important;
    height: auto !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    border-radius: 20px !important;
    margin: auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #202124 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
  }

  #call-screen-active:not([style*="display: none"]) {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    padding: 0 !important;
    border-radius: 20px !important;
    background: #202124 !important;
  }

  /* ---------- Video Container on Mobile ---------- */
  #call-videos-container {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 20px 20px 0 0 !important;
    overflow: hidden !important;
    overflow-y: auto !important;
    background: #202124 !important;
    padding: 6px !important;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
  }

  /* In tile-zoom mode, disable scrolling — flex layout handles it */
  #call-videos-container.has-tile-zoom {
    overflow: hidden !important;
    overflow-y: hidden !important;
  }

  /* ---------- Normal Grid on Mobile (scrollable, 2 columns) ---------- */
  #remote-videos-grid:not(.has-screenshare):not(.has-tile-zoom) {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: minmax(120px, auto) !important;
    gap: 8px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    align-content: start !important;
    padding: 4px !important;
  }

  /* Single participant → full width single column */
  #remote-videos-grid:not(.has-screenshare):not(.has-tile-zoom) .remote-video-container:only-child {
    grid-column: 1 / -1 !important;
  }

  #remote-videos-grid:not(.has-screenshare):not(.has-tile-zoom) .remote-video-container {
    min-height: 120px !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 4 / 3;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  #remote-videos-grid:not(.has-screenshare):not(.has-tile-zoom) .remote-avatar {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.2rem !important;
  }

  /* Hide zoom / expand button on mobile screens EXCEPT during active screenshare */
  #btn-call-expand,
  .btn-call-expand,
  #call-videos-container > .btn-call-expand,
  #call-videos-container:hover > .btn-call-expand {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .has-screenshare #btn-call-expand,
  .has-screenshare .btn-call-expand,
  #call-videos-container.has-screenshare > .btn-call-expand,
  .has-screenshare #call-videos-container > .btn-call-expand {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Mobile Overlay for In-Call Chat Sidebar */
  .call-chat-sidebar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border-left: none !important;
    z-index: 100 !important;
  }

  /* Close button on mobile active call */
  .call-modal-card:has(#call-screen-active:not([style*="display: none"])) #btn-close-call-modal {
    display: none !important;
  }

  /* Recording banner on mobile */
  .call-recording-banner {
    flex-shrink: 0 !important;
  }

  /* ---------- Controls Bar on Mobile ---------- */
  .call-controls-bar {
    flex-shrink: 0 !important;
    height: 68px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 6px !important;
    padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
    gap: 6px !important;
    background: #181b20 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 0 0 16px 16px !important;
    z-index: 50 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }

  .call-controls-bar::-webkit-scrollbar {
    display: none !important;
  }

  .call-controls-bar .btn-call-action {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
  }

  .call-controls-bar .btn-call-action i,
  .call-controls-bar .btn-call-action svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* Speaker button visible on mobile view only */
  #btn-call-speaker,
  .btn-call-speaker {
    display: flex !important;
  }

  /* ---------- Screenshare on Mobile (Screen on TOP, Users at BOTTOM) ---------- */
  #call-videos-container.has-screenshare:not(.has-tile-zoom) {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 6px !important;
    overflow: hidden !important;
  }

  .has-screenshare:not(.has-tile-zoom) #screenshare-container {
    display: block !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 0 !important;
    min-height: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .has-screenshare:not(.has-tile-zoom) #remote-videos-grid {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 100% !important;
    flex: 0 0 85px !important;
    height: 85px !important;
    max-height: 85px !important;
    z-index: 5 !important;
    background: transparent !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 2px 0 !important;
  }

  .has-screenshare:not(.has-tile-zoom) #remote-videos-grid .remote-video-container {
    width: 110px !important;
    min-width: 110px !important;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    flex: 0 0 110px !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
  }

  .has-screenshare #remote-videos-grid .remote-video-container .remote-avatar-placeholder .remote-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.95rem !important;
    margin-bottom: 0 !important;
  }

  /* ---------- Tile Zoom on Mobile (Zoomed User on TOP, Strip at BOTTOM) ---------- */

  /* The grid becomes a flex column container filling the video area */
  #call-videos-container.has-tile-zoom #remote-videos-grid,
  .has-tile-zoom #remote-videos-grid {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    padding: 4px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* The zoomed tile takes all remaining space */
  .has-tile-zoom #remote-videos-grid .remote-video-container.zoomed-tile {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 1 1 0% !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    z-index: 10 !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
    overflow: hidden !important;
  }

  /* The strip container: fixed height at the bottom, horizontal scroll */
  #tile-zoom-strip {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
    flex: 0 0 90px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    z-index: 20 !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  #tile-zoom-strip::-webkit-scrollbar {
    display: none !important;
  }

  /* Each tile in the strip: fixed dimensions, no shrinking */
  #tile-zoom-strip .remote-video-container {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    flex: 0 0 110px !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
    overflow: hidden !important;
  }

  #tile-zoom-strip .remote-video-container .remote-avatar-placeholder .remote-avatar {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.9rem !important;
    margin-bottom: 0 !important;
  }

  /* Name label in strip tiles: small, truncated, bottom-left */
  #tile-zoom-strip .remote-video-container .remote-participant-label {
    font-size: 9px !important;
    padding: 1px 4px !important;
    bottom: 3px !important;
    left: 3px !important;
    max-width: calc(100% - 6px) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    border-radius: 3px !important;
  }

  #tile-zoom-strip .remote-video-container .display-name-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 80px !important;
    display: inline-block !important;
  }

  /* Hide speaking indicator and mute badge in strip (too small) */
  #tile-zoom-strip .speaking-indicator-wrapper,
  #tile-zoom-strip .remote-mute-badge {
    display: none !important;
  }
}

/* Mobile Landscape & Mobile Fullscreen Mode — Pure Screen Share Display */
@media (max-width: 950px) and (orientation: landscape), (max-width: 768px) {
  .call-fullscreen .call-modal-card,
  #modal-video-call.call-fullscreen .call-modal-card {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
  }

  .call-fullscreen #call-screen-active,
  #modal-video-call.call-fullscreen #call-screen-active {
    height: 100vh !important;
    width: 100vw !important;
    padding: 0 !important;
  }

  .call-fullscreen #call-videos-container,
  #modal-video-call.call-fullscreen #call-videos-container {
    height: 100vh !important;
    width: 100vw !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: #000 !important;
  }

  .call-fullscreen .has-screenshare,
  #modal-video-call.call-fullscreen .has-screenshare {
    height: 100vh !important;
    width: 100vw !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .call-fullscreen .has-screenshare #screenshare-container,
  #modal-video-call.call-fullscreen .has-screenshare #screenshare-container {
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
  }

  .call-fullscreen #screenshare-video,
  #modal-video-call.call-fullscreen #screenshare-video {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
  }

  /* Hide ALL extra UI elements during mobile fullscreen / landscape mode */
  .call-fullscreen .call-modal-header,
  .call-fullscreen #btn-close-call-modal,
  .call-fullscreen #remote-videos-grid,
  .call-fullscreen #local-video-wrapper,
  .call-fullscreen #screenshare-label,
  .call-fullscreen .call-controls-bar,
  .call-fullscreen div[style*="background: #202124"],
  .call-fullscreen div[style*="background:#202124"],
  #modal-video-call.call-fullscreen .call-modal-header,
  #modal-video-call.call-fullscreen #btn-close-call-modal,
  #modal-video-call.call-fullscreen #remote-videos-grid,
  #modal-video-call.call-fullscreen #local-video-wrapper,
  #modal-video-call.call-fullscreen #screenshare-label,
  #modal-video-call.call-fullscreen div[style*="background: #202124"],
  #modal-video-call.call-fullscreen div[style*="background:#202124"] {
    display: none !important;
  }

  /* ONLY show the fullscreen exit button in the bottom right corner */
  .call-fullscreen #call-videos-container > .btn-call-expand,
  #modal-video-call.call-fullscreen #call-videos-container > .btn-call-expand {
    display: flex !important;
    position: absolute !important;
    bottom: 16px !important;
    right: 16px !important;
    z-index: 99999 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* Name pills on video tiles (Google Meet style) */
.call-name-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #e8eaed;
  font-size: 12px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- Recording Banner (Google Meet style) ---- */
.call-recording-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #2d2e30;
  border-left: 3px solid #ea4335;
  animation: rec-slide-down 0.25s ease-out;
  border-radius: 0 0 16px 16px;
}

.call-recording-banner.active {
  display: flex;
}

.call-recording-banner .rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ea4335;
  flex-shrink: 0;
  animation: rec-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(234, 67, 53, 0.5);
}

.call-recording-banner .rec-label {
  font-size: 13px;
  font-weight: 600;
  color: #ea4335;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.call-recording-banner .rec-timer {
  font-size: 13px;
  font-weight: 500;
  color: #e8eaed;
  font-variant-numeric: tabular-nums;
}

.call-recording-banner .rec-separator {
  width: 1px;
  height: 16px;
  background: #5f6368;
  flex-shrink: 0;
}

.call-recording-banner .rec-info {
  font-size: 12px;
  color: #9aa0a6;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-recording-banner .btn-rec-stop {
  background: rgba(234, 67, 53, 0.15);
  color: #ea4335;
  border: 1px solid rgba(234, 67, 53, 0.3);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.call-recording-banner .btn-rec-stop:hover {
  background: rgba(234, 67, 53, 0.25);
  border-color: rgba(234, 67, 53, 0.5);
}

@keyframes rec-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes rec-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Legacy .rec-dot (used elsewhere) */
.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ea4335;
  display: inline-block;
  animation: rec-pulse 1.4s ease-in-out infinite;
}

/* ---- Google Meet-style Tooltips for Call Buttons (JS-managed) ---- */
.btn-call-action {
  position: relative;
}

#call-btn-tooltip {
  position: fixed;
  background: #e8eaed;
  color: #202124;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  font-family: 'Google Sans', 'Segoe UI', system-ui, sans-serif;
  transform: scale(0.85);
}

#call-btn-tooltip.visible {
  opacity: 1;
  transform: scale(1);
}

#call-btn-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #e8eaed;
}

/* Voice Recording Overlay (Messenger-style) */
.voice-record-overlay {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.25rem 0.5rem;
  animation: slide-up-recording 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#chat-input-form.recording-active #btn-chat-attach,
#chat-input-form.recording-active #btn-chat-mic,
#chat-input-form.recording-active #btn-chat-mic-cancel,
#chat-input-form.recording-active .chat-composer-pill,
#chat-input-form.recording-active .btn-send-msg {
  display: none !important;
}

/* Cancel Button on the left */
.voice-cancel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: var(--text-secondary) !important;
  cursor: pointer;
  transition: all 0.25s ease;
}

.voice-cancel-btn:hover {
  background: rgba(244, 63, 94, 0.2) !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
  color: #fda4af !important;
  transform: scale(1.05);
}

/* Blue Capsule Container */
.voice-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  height: 44px;
  border-radius: 999px;
  background: #0084ff !important;
  padding: 0 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 132, 255, 0.35);
}

/* Stop Button inside Blue Capsule */
.voice-stop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff !important;
  border: none !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.voice-stop-btn:hover {
  transform: scale(1.1);
}

.voice-stop-square {
  width: 10px;
  height: 10px;
  background: #0084ff;
  border-radius: 2px;
}

/* Sound Wave Animation inside Blue Capsule */
.voice-wave-container {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  flex: 1;
  justify-content: center;
  padding: 0 1.5rem;
}

.voice-wave-bar {
  width: 3px;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  animation: voice-wave-bounce 0.8s infinite alternate ease-in-out;
  transform-origin: center;
}

.voice-wave-bar:nth-child(1) { height: 30%; animation-delay: 0.1s; }
.voice-wave-bar:nth-child(2) { height: 60%; animation-delay: 0.2s; }
.voice-wave-bar:nth-child(3) { height: 40%; animation-delay: 0.3s; }
.voice-wave-bar:nth-child(4) { height: 80%; animation-delay: 0.4s; }
.voice-wave-bar:nth-child(5) { height: 50%; animation-delay: 0.2s; }
.voice-wave-bar:nth-child(6) { height: 90%; animation-delay: 0.5s; }
.voice-wave-bar:nth-child(7) { height: 40%; animation-delay: 0.1s; }
.voice-wave-bar:nth-child(8) { height: 70%; animation-delay: 0.3s; }
.voice-wave-bar:nth-child(9) { height: 30%; animation-delay: 0.2s; }
.voice-wave-bar:nth-child(10) { height: 60%; animation-delay: 0.4s; }
.voice-wave-bar:nth-child(11) { height: 50%; animation-delay: 0.1s; }
.voice-wave-bar:nth-child(12) { height: 80%; animation-delay: 0.3s; }

@keyframes voice-wave-bounce {
  0% {
    transform: scaleY(0.3);
  }
  100% {
    transform: scaleY(1);
  }
}

/* White Timer Badge */
.voice-timer-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: #fff !important;
  color: #0084ff !important;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.5px;
}

/* Send Button on the right */
.voice-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0084ff !important;
  border: none !important;
  color: #fff !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 132, 255, 0.25);
}

.voice-send-btn:hover {
  background: #0072ec !important;
  transform: scale(1.05);
}

@keyframes slide-up-recording {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ===================================================
   SIDEBAR NOTIFICATION PREFERENCES ACCORDION
   =================================================== */
.notif-accordion {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.notif-accordion:hover {
  border-color: rgba(99, 102, 241, 0.25) !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.notif-accordion-content .notif-pref-group {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.notif-accordion-content .notif-pref-group:not(:last-child) {
  border-bottom: 1px dashed var(--card-border) !important;
  padding-bottom: 0.75rem !important;
  margin-bottom: 0.75rem !important;
}

.notif-accordion-content .notif-pref-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  padding: 0.35rem 0 !important;
  border-bottom: none !important;
  margin-bottom: 0 !important;
  cursor: pointer;
}

.notif-accordion-content .notif-pref-label {
  font-size: 0.8rem !important;
  color: var(--text-secondary) !important;
}

/* Scroll to bottom button styling */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-indigo);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
}

.scroll-to-bottom-btn.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.scroll-to-bottom-btn:hover {
  background: #4f46e5;
  transform: translateX(-50%) scale(1.05);
}

.scroll-to-bottom-btn i {
  width: 18px;
  height: 18px;
}

/* Chat Date Separator */
.chat-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  position: relative;
  text-align: center;
  width: 100%;
}

.chat-date-separator::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--card-border);
  z-index: 1;
}

.chat-date-separator-text {
  position: relative;
  z-index: 2;
  background: var(--chat-messages-bg, #1e1e2e);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Skeleton Loading Shimmer Effects */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-bg {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--card-border) 37%, var(--bg-secondary) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

.image-skeleton-loader {
  width: 280px;
  height: 180px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.chat-file-container {
  margin-top: 6px;
  display: inline-block;
  max-width: 100%;
}

.file-skeleton-loader {
  width: 280px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0.75rem;
  gap: 0.75rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-skeleton-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
}

.file-skeleton-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.file-skeleton-text-1 {
  width: 140px;
  height: 12px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.file-skeleton-text-2 {
  width: 70px;
  height: 8px;
  border-radius: 4px;
}

/* Collaborator Hover Card Tooltip */
.collab-hover-card {
  position: absolute;
  z-index: 9999;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--card-border, rgba(0, 0, 0, 0.1));
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 220px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .collab-hover-card {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

.collab-hover-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.collab-hover-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.collab-hover-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.collab-hover-card-details {
  display: flex;
  flex-direction: column;
}

.collab-hover-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.collab-hover-card-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.collab-hover-card-body {
  border-top: 1px solid var(--card-border);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.collab-hover-card-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.collab-hover-card-info-value {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===================================================
   FORWARD MESSAGE SYSTEM STYLES
   =================================================== */
.msg-forwarded-banner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  font-style: italic;
}

.msg-forwarded-banner i {
  color: var(--accent-indigo);
  stroke-width: 2.5;
}

/* Style for own messages (gradient bubble) */
.chat-messages .message-item.me .msg-forwarded-banner {
  color: rgba(255, 255, 255, 0.85) !important;
}

.chat-messages .message-item.me .msg-forwarded-banner i {
  color: rgba(255, 255, 255, 0.95) !important;
}

#forward-channels-list {
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}

#forward-channels-list::-webkit-scrollbar {
  width: 6px;
}

#forward-channels-list::-webkit-scrollbar-track {
  background: transparent;
}

#forward-channels-list::-webkit-scrollbar-thumb {
  background-color: var(--card-border);
  border-radius: 10px;
}

#forward-channels-list div:hover {
  background-color: rgba(99, 102, 241, 0.15) !important;
  border-color: var(--accent-indigo) !important;
}

.btn-forward-send {
  transition: all 0.2s ease-in-out;
}

.btn-forward-send:hover {
  transform: scale(1.05);
}

.forward-message-preview {
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}

.forward-message-preview::-webkit-scrollbar {
  width: 4px;
}

.forward-message-preview::-webkit-scrollbar-track {
  background: transparent;
}

.forward-message-preview::-webkit-scrollbar-thumb {
  background-color: var(--card-border);
  border-radius: 10px;
}

.channel-type-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  text-transform: uppercase;
  margin-left: 0.4rem;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.05em;
  line-height: 1;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.channel-type-badge.badge-public {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.channel-type-badge.badge-private {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.28);
}
.channel-type-badge:hover {
  transform: translateY(-1px);
}
.channel-type-badge.badge-public:hover {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}
.channel-type-badge.badge-private:hover {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* =============================================
   CALL RECORDING STYLES
   ============================================= */

/* Recording button active state */
.btn-call-action.recording {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  animation: recording-pulse 1.5s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Recording indicator pulsing dot */
.rec-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
  animation: rec-dot-blink 1s ease-in-out infinite;
}

@keyframes rec-dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* =============================================
   CALL HISTORY PAGE STYLES
   ============================================= */

/* Refresh Button */
.ch-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple, #a855f7));
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
  white-space: nowrap;
}

.ch-refresh-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  filter: brightness(1.08);
}

.ch-refresh-btn:active {
  transform: translateY(0);
}

@keyframes chRefreshSpin {
  to { transform: rotate(360deg); }
}

.ch-refresh-btn.is-refreshing i,
.ch-refresh-btn.is-refreshing svg {
  animation: chRefreshSpin 0.8s linear infinite;
}

/* Filter Bar */
.ch-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.ch-filter-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.ch-filter-search input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.ch-filter-search input:focus {
  border-color: var(--accent-indigo);
}

.ch-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ch-filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ch-filter-date-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ch-filter-date-input {
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  width: 130px;
  transition: border-color 0.2s;
}

.ch-filter-date-input:focus {
  border-color: var(--accent-indigo);
}

.ch-filter-date-sep {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ch-filter-pills {
  display: flex;
  gap: 0.3rem;
}

.ch-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.ch-filter-pill:hover {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.06);
}

.ch-filter-pill.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  font-weight: 600;
}

.ch-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  align-self: flex-end;
}

.ch-filter-clear:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Results Info */
.ch-results-info {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Loading Skeleton */
@keyframes chSkeletonShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.ch-loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ch-skeleton-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.ch-skeleton-avatar,
.ch-skeleton-line,
.ch-skeleton-btn {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(99, 102, 241, 0.06) 50%, var(--bg-secondary) 75%);
  background-size: 800px 100%;
  animation: chSkeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.ch-skeleton-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
}

.ch-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ch-skeleton-line {
  height: 12px;
  border-radius: 6px;
}

.ch-skeleton-line.w30 { width: 30%; }
.ch-skeleton-line.w35 { width: 35%; }
.ch-skeleton-line.w40 { width: 40%; }
.ch-skeleton-line.w45 { width: 45%; }
.ch-skeleton-line.w50 { width: 50%; }
.ch-skeleton-line.w55 { width: 55%; }
.ch-skeleton-line.w60 { width: 60%; }
.ch-skeleton-line.w65 { width: 65%; }
.ch-skeleton-line.w70 { width: 70%; }

.ch-skeleton-btn {
  width: 70px;
  height: 30px;
  flex-shrink: 0;
}

/* ---- Project Overview Cards (Aperçu Page) ---- */
.project-overview-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.project-overview-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.project-overview-card.theme-indigo { border-top: 3px solid var(--accent-indigo); }
.project-overview-card.theme-purple { border-top: 3px solid var(--accent-purple, #a855f7); }
.project-overview-card.theme-cyan { border-top: 3px solid var(--accent-cyan, #06b6d4); }

.project-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.project-title-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-indigo);
}

.project-icon-wrapper svg {
  width: 20px;
  height: 20px;
}

.project-name-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.project-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.project-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.project-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tech-tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.project-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--card-border);
  display: flex !important;
  flex-direction: column !important;
  gap: 0.6rem !important;
}

.project-collab-section {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.03);
}

[data-theme="dark"] .project-collab-section {
  background: rgba(255, 255, 255, 0.03);
}

.collab-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.collab-icon svg,
i.collab-icon svg {
  width: 15px !important;
  height: 15px !important;
}

.collab-details {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.collab-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.collab-value {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Recording Cards */
.call-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.call-history-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  transition: all 0.2s ease;
  cursor: default;
}

.call-history-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

.call-history-card .ch-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.call-history-card .ch-avatar.audio-call {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}

.call-history-card .ch-avatar.video-call {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
}

.call-history-card .ch-info {
  flex: 1;
  min-width: 0;
}

.call-history-card .ch-participants {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-history-card .ch-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.call-history-card .ch-meta .ch-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.call-history-card .ch-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.call-history-card .ch-type-badge.audio {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}

.call-history-card .ch-type-badge.video {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
}

.call-history-card .ch-channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
  font-size: 0.7rem;
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-secondary);
}

.call-history-card .ch-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.call-history-card .ch-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.call-history-card .ch-actions button,
.call-history-card .ch-actions a {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.18s ease;
}

.call-history-card .ch-actions .btn-play-recording:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}

.call-history-card .ch-actions .btn-download-recording:hover {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
}

.call-history-card .ch-actions .btn-delete-recording:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* Pagination Bar (Redesigned) */
.ch-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.ch-pagination-info {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.ch-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ch-page-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.ch-page-btn:hover:not(:disabled) {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.06);
}

.ch-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ch-page-numbers {
  display: flex;
  gap: 0.25rem;
}

.ch-page-numbers .ch-page-num {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.18s ease;
}

.ch-page-numbers .ch-page-num:hover {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.05);
}

.ch-page-numbers .ch-page-num.active {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple, #a855f7));
  color: white;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.ch-page-numbers .ch-page-ellipsis {
  min-width: 28px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Recording Player Modal */
.recording-player-card {
  position: relative;
  max-width: 720px;
  width: 92%;
  background: rgba(17, 25, 40, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45), 0 0 80px rgba(99, 102, 241, 0.06);
  overflow: hidden;
  animation: saveRecordingFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-theme="light"] .recording-player-card {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(99, 102, 241, 0.18);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1), 0 0 60px rgba(99, 102, 241, 0.05);
}

.recording-player-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .recording-player-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.recording-player-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple, #a855f7));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recording-player-header-info {
  flex: 1;
  min-width: 0;
}

.recording-player-header-info h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-player-header-info .rp-meta {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.recording-player-header-info .rp-meta span {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.recording-player-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

[data-theme="light"] .recording-player-close {
  background: rgba(0, 0, 0, 0.04);
}

.recording-player-close:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.recording-player-body {
  padding: 0;
  background: #000;
  border-radius: 0;
  min-height: 0;
}

.recording-player-body video {
  width: 100%;
  display: block;
  background: #000;
}

.recording-player-body audio {
  width: 100%;
  display: block;
  padding: 2rem 1.5rem;
  background: transparent;
}

.recording-player-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .recording-player-footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.recording-player-footer .rp-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple, #a855f7));
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.recording-player-footer .rp-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  filter: brightness(1.08);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #call-history .dashboard-header-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    margin-bottom: 1.25rem !important;
    padding: 1.25rem !important;
    background: var(--bg-secondary) !important;
    border-radius: 16px !important;
    border: 1px solid var(--card-border) !important;
  }

  #call-history .dashboard-header-container > div:nth-child(2) {
    width: 100% !important;
  }

  #call-history .dashboard-header-container h2 {
    font-size: 1.15rem !important;
  }

  #call-history .dashboard-header-container p {
    font-size: 0.8rem !important;
    margin-top: 0.25rem !important;
  }

  #btn-call-history-refresh {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
    font-size: 0.82rem !important;
  }

  .ch-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1rem !important;
    gap: 0.85rem !important;
    border-radius: 16px !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--card-border) !important;
    margin-bottom: 1.25rem !important;
  }

  .ch-filter-search {
    min-width: unset !important;
    width: 100% !important;
  }

  .ch-filter-search input {
    height: 40px !important;
    font-size: 0.85rem !important;
  }

  .ch-filter-group {
    width: 100% !important;
  }

  .ch-filter-date-range {
    flex-direction: column !important;
    gap: 0.4rem !important;
    width: 100% !important;
  }

  .ch-filter-date-sep {
    display: none !important;
  }

  .ch-filter-date-input {
    width: 100% !important;
    height: 38px !important;
    font-size: 0.82rem !important;
    box-sizing: border-box !important;
  }

  .ch-filter-pills {
    display: flex !important;
    width: 100% !important;
    gap: 0.35rem !important;
    background: var(--bg-tertiary) !important;
    padding: 3px !important;
    border-radius: 10px !important;
    border: 1px solid var(--card-border) !important;
  }

  .ch-filter-pill {
    flex: 1 !important;
    justify-content: center !important;
    padding: 0.45rem 0.35rem !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
  }

  .call-history-card {
    padding: 1rem !important;
    border-radius: 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.85rem !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--card-border) !important;
  }

  .call-history-card .ch-info {
    width: 100% !important;
  }

  .call-history-card .ch-meta {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .call-history-card .ch-actions {
    width: 100% !important;
    justify-content: flex-end !important;
    border-top: 1px solid var(--card-border) !important;
    padding-top: 0.65rem !important;
    margin-top: 0.25rem !important;
  }

  .call-history-card .ch-actions button,
  .call-history-card .ch-actions a {
    height: 38px !important;
    padding: 0 0.85rem !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
  }

  .recording-player-card {
    width: 98% !important;
    border-radius: 14px !important;
  }
}

/* ===================================
   Save Recording Confirmation Modal
   =================================== */

@keyframes saveRecordingFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes saveRecordingPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.25); opacity: 0; }
}

@keyframes saveRecordingGlow {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.7; }
}

#modal-save-recording-confirm,
#modal-recording-player {
  z-index: 10000005 !important;
}

.save-recording-modal-card {
  position: relative;
  max-width: 420px;
  width: 92%;
  padding: 2.25rem 2rem 2rem;
  text-align: center;
  background: rgba(17, 25, 40, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 40px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(99, 102, 241, 0.08);
  overflow: hidden;
  animation: saveRecordingFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-theme="light"] .save-recording-modal-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 8px 40px rgba(0, 0, 0, 0.12),
    0 0 80px rgba(99, 102, 241, 0.06);
}

/* Decorative top glow */
.save-recording-modal-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 120px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
  pointer-events: none;
  animation: saveRecordingGlow 3s ease-in-out infinite;
}

[data-theme="light"] .save-recording-modal-glow {
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
}

/* Icon */
.save-recording-modal-icon {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple, #a855f7));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.save-recording-modal-icon-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.3);
  animation: saveRecordingPulse 2.5s ease-in-out infinite;
}

/* Title */
.save-recording-modal-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-title, 'Inter', sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Description */
.save-recording-modal-desc {
  margin: 0 0 1.75rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Actions */
.save-recording-modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.save-recording-btn-discard,
.save-recording-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.save-recording-btn-discard {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

[data-theme="light"] .save-recording-btn-discard {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-secondary);
}

.save-recording-btn-discard:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  transform: translateY(-1px);
}

[data-theme="light"] .save-recording-btn-discard:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.18);
}

.save-recording-btn-save {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple, #a855f7));
  border: none;
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.save-recording-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
  filter: brightness(1.1);
}

/* Responsive */
@media (max-width: 480px) {
  .save-recording-modal-card {
    width: 95%;
    padding: 1.75rem 1.25rem 1.5rem;
  }
  .save-recording-modal-actions {
    flex-direction: column;
  }
  .save-recording-btn-discard,
  .save-recording-btn-save {
    width: 100%;
    justify-content: center;
  }
}

/* Loading state */
@keyframes saveRecordingSpin {
  to { transform: rotate(360deg); }
}

@keyframes saveRecordingShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes saveRecordingPulseGlow {
  0%, 100% { box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 4px 28px rgba(99, 102, 241, 0.55), 0 0 0 3px rgba(99, 102, 241, 0.1); }
}

.save-recording-btn-save.is-loading {
  pointer-events: none;
  position: relative;
  min-width: 160px;
  background: linear-gradient(
    90deg,
    var(--accent-indigo) 0%,
    var(--accent-purple, #a855f7) 25%,
    rgba(255, 255, 255, 0.25) 50%,
    var(--accent-purple, #a855f7) 75%,
    var(--accent-indigo) 100%
  );
  background-size: 200% 100%;
  animation: saveRecordingShimmer 1.8s ease-in-out infinite, saveRecordingPulseGlow 2s ease-in-out infinite;
}

.save-recording-btn-save.is-loading span {
  visibility: visible;
}

.save-recording-btn-save.is-loading > svg,
.save-recording-btn-save.is-loading > i {
  display: none;
}

.save-recording-btn-save.is-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: saveRecordingSpin 0.65s linear infinite;
  flex-shrink: 0;
}

.save-recording-btn-discard:disabled,
.save-recording-btn-save:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.save-recording-btn-discard:disabled:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .save-recording-btn-discard:disabled:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Custom Role Searchable Dropdown */
.custom-role-option-item {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: background 0.15s ease, color 0.15s ease;
}

.custom-role-option-item:hover,
.custom-role-option-item.selected {
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent-indigo, #6366f1);
}

.custom-role-options-list::-webkit-scrollbar {
  width: 5px;
}
.custom-role-options-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
.custom-role-options-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.custom-role-options-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}

/* Premium Custom Glassmorphic Project Dropdown Component for Manager Insights */
.insights-project-custom-dropdown-container {
  position: relative;
  display: inline-block;
}

.insights-project-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.85rem 0.4rem 0.65rem;
  border-radius: 20px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.83rem;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
}

.insights-project-dropdown-btn:hover,
.insights-project-custom-dropdown-container.open .insights-project-dropdown-btn {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.18);
}

.insights-project-custom-dropdown-container.open .insights-dropdown-chevron {
  transform: rotate(180deg);
}

.insights-project-select-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insights-project-select-icon i,
.insights-project-select-icon svg {
  width: 13px;
  height: 13px;
}

.insights-header {
  position: relative !important;
  z-index: 100 !important;
  overflow: visible !important;
}

.insights-header .card-title-container {
  overflow: visible !important;
}

.insights-project-custom-dropdown-container {
  position: relative !important;
  z-index: 1000 !important;
  overflow: visible !important;
}

.insights-project-dropdown-menu {
  position: absolute !important;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: var(--bg-card, #0f172a);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(6, 182, 212, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999 !important;
  animation: insightsDropdownSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes insightsDropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.insights-project-dropdown-options {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden !important;
}

.insights-project-dropdown-options::-webkit-scrollbar {
  width: 4px;
}
.insights-project-dropdown-options::-webkit-scrollbar-track {
  background: transparent;
}
.insights-project-dropdown-options::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.3);
  border-radius: 4px;
}
.insights-project-dropdown-options::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.6);
}

.insights-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text-secondary);
  box-sizing: border-box;
}

.insights-dropdown-item:hover {
  background: rgba(6, 182, 212, 0.12);
  color: var(--text-primary);
}

.insights-dropdown-item.selected {
  background: rgba(6, 182, 212, 0.18);
  color: var(--accent-cyan);
  font-weight: 600;
}

.insights-dropdown-item-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.insights-dropdown-item-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.insights-dropdown-item-name {
  font-size: 0.85rem;
  line-height: 1.2;
}

[data-theme="light"] .insights-project-dropdown-menu {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 0 15px rgba(6, 182, 212, 0.1);
}

[data-theme="light"] .insights-dropdown-item:hover {
  background: rgba(6, 182, 212, 0.08);
}

/* Password Input Wrapper & Eye Toggle Button */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 2.5rem !important;
}

.btn-toggle-pw {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.btn-toggle-pw:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .btn-toggle-pw:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ===================================================
   GLASSMORPHIC IMAGE VIEWER (LIGHTBOX) MODAL
   =================================================== */
.image-viewer-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  margin: 0;
  overflow: hidden;
  user-select: none;
}

.image-viewer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: zoom-out;
  z-index: 1;
}

.image-viewer-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.image-viewer-header {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10;
  gap: 1rem;
}

.image-viewer-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.image-viewer-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-indigo, #6366f1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.image-viewer-title {
  font-family: var(--font-title, inherit);
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.image-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.image-viewer-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  padding: 0;
}

.image-viewer-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.image-viewer-btn:active {
  transform: translateY(0) scale(0.96);
}

.image-viewer-btn.image-viewer-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.image-viewer-zoom-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}

.image-viewer-separator {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 0.25rem;
}

.image-viewer-viewport {
  pointer-events: auto;
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: grab;
}

.image-viewer-viewport.is-dragging {
  cursor: grabbing !important;
}

.image-viewer-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.image-viewer-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform-origin: center center;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.image-viewer-img.no-transition {
  transition: none !important;
}

@media (max-width: 768px) {
  /* Full immersive dark background */
  .image-viewer-overlay {
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(30px) !important;
  }

  /* Floating header — minimal top bar */
  .image-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    border-bottom: none;
    box-shadow: none;
    z-index: 20;
    gap: 0.5rem;
  }

  /* Hide file info on mobile to maximize image space */
  .image-viewer-info {
    flex: 1;
    min-width: 0;
  }
  .image-viewer-icon-badge {
    display: none;
  }
  .image-viewer-title {
    max-width: 160px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
  }

  /* Compact action buttons */
  .image-viewer-actions {
    gap: 0.35rem;
  }
  .image-viewer-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
  }
  .image-viewer-btn i,
  .image-viewer-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  /* Close button — prominent top-right */
  .image-viewer-close-btn {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ff6b6b !important;
  }

  /* Hide zoom badge & separator on mobile */
  .image-viewer-zoom-badge {
    display: none;
  }
  .image-viewer-separator {
    display: none;
  }

  /* Viewport: fill entire screen */
  .image-viewer-viewport {
    padding: 3.5rem 0.5rem 1rem 0.5rem;
  }

  /* Image: take full width, larger on mobile */
  .image-viewer-img {
    max-width: 98vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  }
}

/* ==========================================================================
   TASK COMMENTS MINI-CHAT STYLES
   ========================================================================== */

.task-chat-modal-card {
  width: 100%;
  max-width: 860px;
  height: 88vh;
  max-height: 820px;
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 2001;
  animation: taskChatModalFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.task-chat-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.task-chat-header-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

.task-chat-desc-box {
  background: rgba(99, 102, 241, 0.04);
  border: 1px dashed rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0.75rem 1.4rem 0.25rem 1.4rem;
  max-height: 70px;
  overflow-y: auto;
  flex-shrink: 0;
}

.task-chat-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-height: 0;
}

.task-chat-timeline::-webkit-scrollbar {
  width: 6px;
}

.task-chat-timeline::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.task-chat-empty {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.task-chat-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-indigo);
}

.task-chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  position: relative;
  max-width: 88%;
}

.task-chat-msg.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.task-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-indigo), #8b5cf6);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  user-select: none;
}

.task-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.task-chat-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  align-items: flex-start;
}

.task-chat-msg.mine .task-chat-content-wrap {
  align-items: flex-end;
}

.task-chat-msg.mine .task-chat-meta {
  flex-direction: row-reverse;
}

.task-chat-msg.mine .task-chat-reactions {
  justify-content: flex-end;
}

.task-chat-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-chat-author-name {
  font-weight: 700;
  color: var(--text-primary);
}

.task-chat-role-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.task-chat-bubble {
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  width: fit-content;
  max-width: 100%;
}

.task-chat-msg.mine .task-chat-bubble {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.15));
  border-color: rgba(99, 102, 241, 0.3);
  border-top-right-radius: 4px;
}

.task-chat-msg:not(.mine) .task-chat-bubble {
  border-top-left-radius: 4px;
}

.task-chat-reply-quote {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent-indigo);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

[data-theme="light"] .task-chat-reply-quote {
  background: rgba(99, 102, 241, 0.06);
}

.task-chat-reply-quote-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-chat-reply-quote-icon {
  width: 12px;
  height: 12px;
  color: var(--accent-indigo);
  flex-shrink: 0;
}

.task-chat-reply-quote-author {
  font-weight: 700;
  color: var(--accent-indigo);
  font-size: 0.73rem;
}

.task-chat-reply-quote-body {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-chat-reply-quote-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--card-border);
  flex-shrink: 0;
}

.task-chat-reply-quote-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.task-chat-attachments-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.task-chat-image-attachment {
  max-width: 280px;
  max-height: 200px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-chat-image-attachment:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.task-chat-image-attachment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.task-chat-file-attachment {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.15s ease;
  max-width: 320px;
}

.task-chat-file-attachment:hover {
  background: var(--card-border);
  color: var(--accent-indigo);
}

.task-chat-file-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-chat-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.task-chat-file-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-chat-file-size {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.task-chat-reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: -0.65rem;
  position: relative;
  z-index: 2;
}

.task-chat-reaction-summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--bg-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}

.task-chat-reaction-summary:hover {
  transform: scale(1.05);
}

.task-chat-reaction-summary.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-indigo);
}

.task-chat-reaction-summary .emojis {
  letter-spacing: -2px;
  margin-right: 2px;
  display: flex;
  align-items: center;
}

.task-chat-reaction-summary .count {
  color: var(--text-secondary);
}

.task-chat-reaction-summary .reaction-icon-img {
  width: 14px;
  height: 14px;
}

.task-chat-reaction-summary .emoji-thumbs {
  color: #2563eb;
}

.task-chat-reaction-summary .emoji-heart {
  color: #ef4444;
}

.task-chat-reaction-summary .emoji-flame {
  color: #f97316;
}

[data-theme="light"] .task-chat-reaction-summary {
  background: #ffffff;
  border-color: #f0f2f5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ── Chat-page style hover action bar for task comments ── */

/* Bubble row: flex container that holds bubble + hover actions side by side */
.task-chat-bubble-row {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.task-chat-msg.mine .task-chat-bubble-row {
  flex-direction: row-reverse;
}

.task-chat-hover-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

/* Reverse hover action bar layout direction for own messages to keep emoji icon closest to bubble and 3-dots on the left */
.task-chat-msg.mine .task-chat-hover-actions {
  flex-direction: row-reverse;
}

.task-chat-msg:hover .task-chat-hover-actions,
.task-chat-hover-actions:has(.task-chat-options-menu.show),
.task-chat-hover-actions:has(.task-chat-reactions-panel.show) {
  opacity: 1;
  pointer-events: auto;
}

.task-chat-hover-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.task-chat-hover-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .task-chat-hover-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #050505;
}

.task-chat-hover-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}

/* Reaction trigger panel (flies out from smiley icon) */
.task-chat-reactions-panel {
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-bottom: 3px;
  transform: translateX(-50%) scale(0.85);
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3px 5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
  z-index: 20;
}

.task-chat-reactions-panel::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 6px;
}

.reaction-trigger-wrapper:hover .task-chat-reactions-panel,
.task-chat-reactions-panel.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

/* 3-dot menu wrapper */
.task-chat-menu-wrapper {
  position: relative;
}

/* Options dropdown menu */
.task-chat-options-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  transform: scale(0.95);
  margin-top: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  min-width: 135px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.task-chat-options-menu.show {
  display: flex;
  transform: scale(1);
}

.task-chat-options-menu.open-upward {
  top: auto !important;
  bottom: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 6px !important;
}

.task-chat-msg.mine .task-chat-options-menu {
  left: 0 !important;
  right: auto !important;
}

.task-chat-msg.mine .task-chat-options-menu.open-upward {
  left: 0 !important;
  right: auto !important;
  top: auto !important;
  bottom: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 6px !important;
}

[data-theme="light"] .task-chat-options-menu {
  background: #ffffff;
  border-color: #e4e6eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.task-chat-options-menu .menu-item {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  transition: all 0.1s ease;
  font-weight: 500;
  white-space: nowrap;
}

.task-chat-options-menu .menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .task-chat-options-menu .menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #050505;
}

.task-chat-options-menu .menu-item .icon-inline {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.task-chat-reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.12);
  border-top: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.45rem 1.4rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.task-chat-reply-banner-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#task-chat-reply-thumb-wrapper img {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
  display: block;
}

.task-chat-staged-attachments {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 1.4rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  flex-shrink: 0;
}

.task-chat-staged-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  color: var(--text-primary);
}

.task-chat-staged-chip-remove {
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.task-chat-staged-chip-remove:hover {
  color: var(--accent-rose);
}

.task-chat-input-container {
  padding: 0.85rem 1.4rem 1.1rem 1.4rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  flex-shrink: 0;
  position: relative;
}

.task-chat-input-wrapper {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0.3rem 0.6rem 0.3rem 0.85rem;
  gap: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.task-chat-input-wrapper:focus-within {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.task-chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.4;
  resize: none;
  max-height: 110px;
  min-height: 24px;
  outline: none;
  padding: 0.25rem 0;
}

.task-chat-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.task-chat-icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.task-chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gradient-indigo);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.task-chat-send-btn:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.4);
}

.task-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.task-chat-emoji-popover {
  position: absolute;
  bottom: 60px;
  left: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.6rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 2010;
  animation: taskChatModalFadeIn 0.15s ease;
}

.task-chat-emoji-btn {
  font-size: 1.25rem;
  padding: 0.3rem;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.task-chat-emoji-btn:hover {
  background: var(--bg-tertiary);
  transform: scale(1.2);
}

@media (max-width: 640px) {
  .task-chat-modal-card {
    height: 94vh;
    max-height: 94vh;
    border-radius: 12px;
  }
  .task-chat-header {
    padding: 0.85rem 1rem;
  }
  .task-chat-timeline {
    padding: 0.85rem 1rem;
  }
  .task-chat-input-container {
    padding: 0.6rem 1rem 0.85rem 1rem;
  }

  /* Limit description to 2 lines with ellipsis, no scrollbar */
  .task-chat-desc-box {
    overflow: hidden;
    max-height: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .task-chat-desc-box::-webkit-scrollbar {
    display: none;
  }
  .task-chat-desc-box > span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Hide role badge on mobile */
  .task-chat-role-badge {
    display: none !important;
  }
}

.kanban-card-comment-btn:hover {
  background: rgba(99, 102, 241, 0.16) !important;
  border-color: var(--accent-indigo) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

#details-comment-container:hover {
  background: rgba(99, 102, 241, 0.08) !important;
  border-color: var(--accent-indigo) !important;
}

#details-comment-container:hover #details-btn-open-chat {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4) !important;
}

/* Task Chat Full Emoji Picker — override position for modal context */
.task-chat-full-emoji-picker.emoji-picker-popup {
  position: absolute;
  bottom: 52px;
  left: 0;
  right: auto;
  width: 340px;
  max-height: 400px;
  z-index: 2100;
}

@media (max-width: 640px) {
  .task-chat-full-emoji-picker.emoji-picker-popup {
    width: calc(100vw - 32px);
    left: 50%;
    transform: translateX(-50%);
    bottom: 54px;
  }
}


/* Make comment content-wrap position relative for absolute hover-actions */
.task-chat-content-wrap {
  position: relative;
}



