/* ==========================================================================
   PulsePM - Unified Project Management Stylesheet
   Modern, Clean, Responsive Design System with Dark/Light Mode
   ========================================================================== */

:root {
  /* Color Palette - Light Mode */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #6366f1;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Brand Accents */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-text: #4338ca;

  --accent-cyan: #06b6d4;
  --accent-cyan-light: #ecfeff;
  --accent-purple: #8b5cf6;
  --accent-purple-light: #f5f3ff;
  --accent-emerald: #10b981;
  --accent-emerald-light: #ecfdf5;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fffbeb;
  --accent-rose: #f43f5e;
  --accent-rose-light: #fff1f2;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --surface-card: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-unread: #eef2ff;
  --text-primary: #0f172a;
  --primary-color: #4f46e5;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1c2640;
  --bg-subtle: #192238;
  --bg-input: #101726;
  --border-color: #24304f;
  --border-focus: #818cf8;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #1e1e38;
  --primary-text: #a5b4fc;

  --accent-cyan-light: #083344;
  --accent-purple-light: #2e1065;
  --accent-emerald-light: #064e3b;
  --accent-amber-light: #451a03;
  --accent-rose-light: #4c0519;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.6);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.7);

  --surface-card: #131b2e;
  --surface-hover: #1c2640;
  --surface-unread: rgba(99, 102, 241, 0.15);
  --text-primary: #f8fafc;
  --primary-color: #6366f1;
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.9375rem;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: var(--transition);
}

/* ==========================================================================
   Brand & Typography
   ========================================================================== */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.logo-text span {
  color: var(--primary);
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-main);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.btn-danger {
  background-color: var(--accent-rose-light);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose);
}

.btn-danger:hover {
  background-color: var(--accent-rose);
  color: white;
}

.btn-google {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 12px 20px;
  font-size: 1rem;
}

.btn-google:hover {
  background-color: var(--bg-subtle);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group .required {
  color: var(--accent-rose);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .col-6 {
  flex: 1;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 40px;
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ==========================================================================
   1. Authentication View
   ========================================================================== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.05) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
              var(--bg-app);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
  animation: fadeIn 0.3s ease-out;
}

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

.auth-header .brand-logo {
  margin-bottom: 16px;
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

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

.unified-account-banner {
  display: flex;
  gap: 12px;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 24px;
  color: var(--primary-text);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.unified-account-banner .banner-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.unified-account-banner strong {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.unified-account-banner p {
  color: var(--text-secondary);
  margin: 0;
}

/* Auth Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background-color: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.auth-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.auth-tab-btn:hover {
  color: var(--text-main);
}

.auth-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-tab-panel {
  display: none;
}

.auth-tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

/* Phone OTP specific */
.otp-instruction {
  text-align: center;
  margin-bottom: 18px;
}

.otp-instruction p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.otp-pill {
  display: inline-block;
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.otp-box {
  letter-spacing: 0.5em;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 12px;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

/* Google Tab specific */
.google-auth-box {
  text-align: center;
  padding: 12px 8px;
}

.google-logo-big {
  margin-bottom: 14px;
}

.google-auth-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.google-user-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 20px;
  text-align: left;
}

.google-user-preview .avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.google-user-preview .user-meta strong {
  display: block;
  font-size: 0.9rem;
}

.google-user-preview .user-meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-footer-note {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   2. Main Layout (Header, Navigation)
   ========================================================================== */
.main-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.workspace-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background-color: var(--bg-subtle);
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-sizing: border-box;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-emerald);
  flex-shrink: 0;
}

.header-center {
  flex: 1;
  max-width: 440px;
  margin: 0 20px;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
}

.search-bar svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 38px;
  font-size: 0.84rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  transition: var(--transition);
  box-sizing: border-box;
}

.search-bar input:focus {
  background-color: var(--bg-card);
  border-color: var(--border-focus);
}

.search-bar.mini input {
  padding: 0 12px 0 32px;
  font-size: 0.8125rem;
  width: 200px;
  height: 32px;
}

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

.header-right .btn {
  height: 36px;
  padding: 0 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-sizing: border-box;
  white-space: nowrap;
}

/* ==========================================================================
   Top Right Profile Toggle & Dropdown Menu
   ========================================================================== */
.profile-toggle-container {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px 0 3px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  box-sizing: border-box;
  cursor: pointer;
}

.profile-toggle-btn:hover,
.profile-toggle-btn[aria-expanded="true"] {
  background-color: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.user-brief {
  text-align: left;
  line-height: 1.15;
}

.user-brief-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

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

.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.profile-toggle-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* Dropdown Menu styling */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 270px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: none;
  z-index: 1000;
  padding: 12px;
  animation: slideDown 0.2s ease-out;
}

.profile-dropdown.open {
  display: block;
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 10px 4px;
}

.avatar-large {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.dropdown-user-info {
  line-height: 1.3;
  overflow: hidden;
}

.dropdown-user-info strong {
  display: block;
  font-size: 0.9375rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-info span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unified-tag {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 6px;
  background: var(--accent-emerald-light);
  color: var(--accent-emerald) !important;
  border-radius: var(--radius-full);
  font-size: 0.68rem !important;
  font-weight: 700;
}

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

.dropdown-menu-list {
  list-style: none;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  transition: var(--transition);
}

.dropdown-item svg {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--bg-subtle);
}

.dropdown-item:hover svg {
  color: var(--primary);
}

.dropdown-item.highlight {
  color: var(--primary);
  font-weight: 600;
}

.dropdown-item.highlight svg {
  color: var(--primary);
}

.dropdown-footer {
  margin-top: 4px;
}

.logout-btn {
  color: var(--accent-rose);
}

.logout-btn svg {
  color: var(--accent-rose);
}

.logout-btn:hover {
  background-color: var(--accent-rose-light);
}

/* ==========================================================================
   2A. Home Dashboard View
   ========================================================================== */
.main-content-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 24px;
}

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.welcome-text h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.welcome-text p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.quick-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.stat-card.highlight {
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(to right, var(--bg-card), var(--primary-light));
}

.stat-card .stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-card.highlight .stat-num {
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Content Sections */
.content-section {
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-icon.pending-icon {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
}

.section-icon.project-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.section-title-wrapper h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-pills {
  display: flex;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 4px;
}

.filter-pill {
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.filter-pill:hover {
  color: var(--text-main);
}

.filter-pill.active {
  background-color: var(--primary);
  color: white;
}

/* Pending Tasks List (Home Screen) */
.pending-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pending-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.pending-task-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.task-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}

.task-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-item-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
}

.task-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
}

.project-tag {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.task-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Priority Badges */
.badge-priority {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-priority.urgent {
  background-color: var(--accent-rose-light);
  color: var(--accent-rose);
}

.badge-priority.high {
  background-color: var(--accent-amber-light);
  color: var(--accent-amber);
}

.badge-priority.medium {
  background-color: var(--accent-cyan-light);
  color: var(--accent-cyan);
}

.badge-priority.low {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
}

.task-due-date {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-due-date.overdue {
  color: var(--accent-rose);
  font-weight: 700;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.empty-state h4 {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.84rem;
}

/* Project Groups Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.4);
}

.card-top {
  margin-bottom: 14px;
}

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

.group-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--primary-light);
  color: var(--primary);
}

.project-id-tag {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-muted);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.project-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.project-card-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Card Progress */
.card-progress-box {
  margin-bottom: 18px;
}

.card-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #8b5cf6 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .stack-item {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  border: 2px solid var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: -8px;
}

.avatar-stack .stack-item:first-child {
  margin-left: 0;
}

.avatar-stack .stack-more {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.card-open-link {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   2B. Project Detail Panel View
   ========================================================================== */
.project-detail-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
}

.project-detail-header {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px 0 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

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

.back-btn {
  padding-left: 0;
  font-weight: 600;
}

.breadcrumb-separator {
  color: var(--text-muted);
}

.project-group-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-main-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: nowrap;
  gap: 20px;
}

.meta-left {
  flex: 1 1 auto;
  min-width: 0;
}

.meta-left h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  word-break: break-word;
}

.meta-left p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 12px;
  max-width: 720px;
  line-height: 1.55;
  word-break: break-word;
}

.desc-toggle-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
  vertical-align: baseline;
  transition: color 0.15s ease;
}

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

.project-dates-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.timeline-date-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-deadline {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.meta-right .btn,
.detail-dynamic-actions .btn {
  height: 36px;
  padding: 0 14px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.meta-right .btn-primary {
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.meta-right .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.meta-right .btn-secondary {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.meta-right .btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
}

/* Project Header Settings Gear Menu */
.btn-header-settings {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
  border-radius: var(--radius-md);
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--text-secondary);
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-header-settings:hover,
.btn-header-settings.active {
  color: var(--primary);
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

.project-settings-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.project-settings-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 6px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: dropdownFadeIn 0.12s ease-out;
}

.project-settings-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.project-settings-menu-item svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.project-settings-menu-item:hover {
  background-color: var(--bg-subtle);
  color: var(--primary);
}

.project-settings-menu-item:hover svg {
  color: var(--primary);
}

.project-settings-menu-item.danger {
  color: var(--accent-rose);
}

.project-settings-menu-item.danger svg {
  color: var(--accent-rose);
}

.project-settings-menu-item.danger:hover {
  background-color: rgba(244, 63, 94, 0.1);
  color: var(--accent-rose);
}

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

/* Project Tabs Navigation */
.project-tabs-nav {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--border-color);
}

.project-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.project-tab-btn:hover {
  color: var(--text-main);
}

.project-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-badge {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.project-tab-btn.active .tab-badge {
  background: var(--primary-light);
  color: var(--primary);
}

.tab-badge.has-unseen {
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.4);
}

[data-theme="dark"] .tab-badge.has-unseen {
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.5);
}

.project-tab-content {
  display: none;
}

.project-tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

/* ==========================================================================
   Overview Tab Content
   ========================================================================== */
.overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.content-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.content-card .card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
}

.header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content-card .card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.content-card .card-body {
  padding: 22px;
}

.overview-lead-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.progress-section {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.overview-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.metric-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.metric-box.pending .metric-value { color: var(--accent-amber); }
.metric-box.completed .metric-value { color: var(--accent-emerald); }
.metric-box.members .metric-value { color: var(--primary); }

/* Activity Feed - Optimized for Right Sidebar */
.activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.35;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
}

.activity-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.activity-item-icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-item-content {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.activity-item-content strong {
  color: var(--text-main);
  font-weight: 500;
}

.activity-time {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Team Roster List - Structured 2-Tier Alignment */
.team-roster-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  min-height: 52px;
  transition: background-color 0.15s ease;
}

.team-member-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.team-member-row:first-child {
  padding-top: 2px;
}

.member-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.member-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 2px solid var(--bg-card);
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.member-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.member-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.member-name-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.member-email-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.member-meta-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.member-role-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.member-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.member-role-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1.3;
}

.member-role-badge.role-owner {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  border-color: rgba(79, 70, 229, 0.22);
}

.member-role-badge[style*="cursor: pointer"]:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* Credential Rows */
.credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.84rem;
}

.credential-row:last-of-type {
  border-bottom: none;
}

.credential-row code {
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--primary);
}

.copy-mini-btn {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.copy-mini-btn:hover {
  background: var(--primary-light);
}

/* ==========================================================================
   Tasks Tab Content (Kanban Board)
   ========================================================================== */
.tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: flex-start;
}

.kanban-column {
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 480px;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.status-indicator.pending { background-color: var(--accent-amber); }
.status-indicator.in_progress { background-color: var(--accent-cyan); }
.status-indicator.completed { background-color: var(--accent-emerald); }

.column-count {
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kanban-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.35;
}

.kanban-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.card-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-assignee-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

.card-assignee-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-status-select {
  padding: 2px 6px;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  width: auto;
}

.card-status-select:disabled,
.card-status-locked,
.status-select-locked {
  cursor: not-allowed !important;
  opacity: 0.75;
  background-color: var(--bg-subtle) !important;
  border-style: dashed;
}


/* ==========================================================================
   Chats Tab Content
   ========================================================================== */
.chat-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
}

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

.chat-title-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-hashtag {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.chat-title-info strong {
  display: block;
  font-size: 0.9375rem;
}

.chat-members-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.chat-message-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 80%;
}

.chat-message-item.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message-item.chat-message-system {
  width: 100%;
  max-width: 100%;
  align-self: center;
  justify-content: center;
  margin: 10px 0;
}

.chat-system-bubble {
  background: var(--bg-subtle, #f1f5f9);
  color: var(--text-secondary, #64748b);
  border: 1px dashed var(--border-color, #cbd5e1);
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.chat-system-time {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.chat-body {
  display: flex;
  flex-direction: column;
}

.chat-message-item.own .chat-body {
  align-items: flex-end;
}

.chat-sender-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.chat-sender-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.chat-bubble {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-message-item.own .chat-bubble {
  background-color: var(--primary);
  color: white;
}

.chat-composer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.composer-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.composer-input-container input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-full);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  padding: 0;
}

/* Chat Mention Autocomplete Popup */
.chat-mention-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: min(350px, 100%);
  max-height: 290px;
  overflow-y: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.2), 0 6px 14px -2px rgba(0, 0, 0, 0.08);
  z-index: 100;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: slideUpFade 0.15s ease-out;
}

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

.mention-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 5px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3px;
}

.mention-popup-header .shortcut-hint {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: none;
  opacity: 0.75;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  user-select: none;
}

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

[data-theme="dark"] .mention-item:hover,
[data-theme="dark"] .mention-item.active {
  background-color: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}

.mention-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.mention-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.mention-avatar-all {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.28);
}

.mention-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mention-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

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

.mention-item.active .mention-name {
  color: inherit;
}

.mention-pill-all {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.mention-pill-role {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.mention-pill-you {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.mention-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mention-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Chat bubble mention highlight pill */
.chat-mention-pill {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  padding: 1px 6px;
  margin: 0 1px;
  border-radius: 4px;
  background-color: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
}

[data-theme="dark"] .chat-mention-pill {
  background-color: rgba(129, 140, 248, 0.25);
  color: #a5b4fc;
}

.chat-mention-pill.chat-mention-all {
  background-color: rgba(239, 68, 68, 0.18);
  color: #dc2626;
  font-weight: 700;
}

[data-theme="dark"] .chat-mention-pill.chat-mention-all {
  background-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.chat-message-item.own .chat-mention-pill {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.chat-message-item.own .chat-mention-pill.chat-mention-all {
  background-color: rgba(255, 255, 255, 0.35);
  color: #fef08a;
}

/* ==========================================================================
   3. Modals & Dialogs
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-dialog.modal-lg {
  max-width: 640px;
}

.modal-dialog.modal-md {
  max-width: 560px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background-color: var(--bg-card);
  z-index: 10;
}

.task-detail-modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 18px 24px !important;
  flex-shrink: 0 !important;
  background-color: var(--bg-card) !important;
  z-index: 10 !important;
}

.task-detail-header-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.task-detail-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-detail-header-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  letter-spacing: -0.015em;
  word-break: break-word;
}

.task-detail-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close-btn {
  font-size: 1.25rem;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.modal-body {
  padding: 20px 24px;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  flex-shrink: 0;
  z-index: 10;
}

/* ==========================================================================
   Project Create & Edit Modals - High Performance, Modern SaaS Design
   ========================================================================== */

.modal-dialog.modal-project-form {
  max-width: 680px;
  width: 95%;
  max-height: 88vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 0 1px var(--border-color);
  background: var(--bg-card);
}

.modal-project-form .modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-with-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-title-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(139, 92, 246, 0.14) 100%);
  border: 1px solid rgba(79, 70, 229, 0.22);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.1);
}

.modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-title-row h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.modal-title-group .modal-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.modal-project-form .modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.modal-project-form .modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-project-form .modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-project-form .modal-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 9999px;
}
.modal-project-form .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Form Group Cards inside Project Form */
.project-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-form-card:focus-within {
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.05);
}

.project-form-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2px;
}

.project-form-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-form-card-title .card-title-icon {
  font-size: 1rem;
}

.project-form-governance-card {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.035) 0%, rgba(79, 70, 229, 0.005) 100%);
  border: 1px solid rgba(79, 70, 229, 0.22);
}

.governance-shield-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.governance-rule-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.governance-rule-box:hover {
  border-color: rgba(79, 70, 229, 0.35);
}

.governance-rule-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.governance-rule-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.governance-rule-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.governance-rule-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.governance-rule-subtitle {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin: 0;
}

.project-select-modern {
  width: 100%;
  padding: 9px 36px 9px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-select-modern:hover {
  border-color: rgba(79, 70, 229, 0.4);
}

.project-select-modern:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.special-members-dropdown-box {
  background: var(--bg-app);
  border: 1px dashed rgba(79, 70, 229, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-top: 4px;
}

.special-members-dropdown-box label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.special-members-dropdown-box .field-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.timeline-locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.modal-project-form .modal-footer {
  padding: 16px 24px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-save-project {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
}

.btn-save-project:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

/* ==========================================================================
   Permission Dialogs (Task Assignment & Rankings Visibility)
   Modern Card-Based SaaS UI
   ========================================================================== */

.modal-dialog.modal-permission-dialog {
  max-width: 580px;
  width: 95%;
  max-height: 88vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 0 1px var(--border-color);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-permission-dialog .modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-permission-dialog .modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-permission-dialog .modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-permission-dialog .modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-permission-dialog .modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}
.modal-permission-dialog .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.modal-permission-dialog .modal-footer {
  padding: 16px 24px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Policy Section Header */
.policy-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.policy-section-label-text {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.policy-badge-count {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-secondary);
}

/* Interactive Policy Cards Stack */
.policy-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.policy-card-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  outline: none;
}

.policy-card-option:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: var(--bg-subtle);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.policy-card-option:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.policy-card-option.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 14px rgba(79, 70, 229, 0.1);
}

.policy-card-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.policy-card-option:hover .policy-card-icon-wrap {
  transform: scale(1.05);
}

.policy-card-icon-wrap.admin-only {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14) 0%, rgba(124, 58, 237, 0.18) 100%);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.policy-card-icon-wrap.admin-self {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(37, 99, 235, 0.18) 100%);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.policy-card-icon-wrap.specific-members {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(217, 119, 6, 0.18) 100%);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.policy-card-icon-wrap.anyone {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(5, 150, 105, 0.18) 100%);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.policy-card-info {
  flex: 1;
  min-width: 0;
}

.policy-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.policy-card-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.policy-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9999px;
  line-height: 1.2;
}

.policy-pill.strict {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.22);
}

.policy-pill.controlled {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.policy-pill.delegated {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.policy-pill.open {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.policy-pill.restricted {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.policy-card-desc {
  margin: 0;
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.38;
}

.policy-card-radio {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.policy-radio-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.policy-card-option.selected .policy-radio-circle {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.policy-card-option.selected .policy-radio-circle::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
}

/* Dynamic Policy Notice Box */
.modern-policy-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.07) 0%, rgba(99, 102, 241, 0.03) 100%);
  border: 1px solid rgba(79, 70, 229, 0.2);
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-main);
  margin-top: 14px;
}

.notice-icon-pill {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.modern-policy-notice strong {
  color: var(--primary);
  font-weight: 700;
}

/* Special Members Container inside Modal */
.assign-policy-members-box {
  margin-top: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  animation: fadeInDown 0.25s ease forwards;
}

.assign-policy-members-box label.box-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.assign-policy-members-box p.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.assign-policy-members-box .special-assigners-select-list {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 6px;
}

.assign-policy-members-box .special-assigners-select-list::-webkit-scrollbar {
  width: 5px;
}
.assign-policy-members-box .special-assigners-select-list::-webkit-scrollbar-track {
  background: transparent;
}
.assign-policy-members-box .special-assigners-select-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}

/* Save button */
.btn-save-policy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
}

.btn-save-policy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

/* Dark Mode Overrides */
body.dark .policy-card-option {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.09);
}

body.dark .policy-card-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.6);
}

body.dark .policy-card-option.selected {
  background: rgba(79, 70, 229, 0.12);
  border-color: #818cf8;
}

body.dark .modern-policy-notice {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.3);
}

body.dark .assign-policy-members-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark .assign-policy-members-box .special-assigners-select-list {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Invite Modal Dialog & Tabs - Modern SaaS Redesign */
.modal-dialog.modal-invite-dialog {
  max-width: 650px;
}

#modal-invite-member .modal-body {
  padding: 20px 24px;
}

.invite-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background-color: var(--bg-subtle, #f1f5f9);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.invite-tab-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.invite-tab-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.invite-tab-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .invite-tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.invite-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--primary);
  border-color: rgba(79, 70, 229, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(79, 70, 229, 0.1);
}

[data-theme="dark"] .invite-tab-btn.active {
  background-color: var(--bg-card);
  color: #818cf8;
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.invite-tab-btn.active svg {
  transform: scale(1.08);
}

.invite-tab-panel {
  display: none;
}

.invite-tab-panel.active {
  display: block;
  animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-desc-text {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* Past Collaborators List - SaaS Card Optimized */
.past-collaborators-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.past-collaborators-list::-webkit-scrollbar {
  width: 5px;
}
.past-collaborators-list::-webkit-scrollbar-track {
  background: transparent;
}
.past-collaborators-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 9999px;
}

.collaborator-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  min-width: 0;
  gap: 12px;
  transition: all 0.18s ease;
}

.collaborator-item:hover {
  background-color: var(--bg-card);
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.collaborator-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.collaborator-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.84rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 5px rgba(79, 70, 229, 0.2);
  border: 2px solid var(--bg-card);
}

.collaborator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.collaborator-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.collaborator-info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 2px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collaborator-info span {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Share Link Box */
.copy-input-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.copy-input-box input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
}

.security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Code Cards Row */
.code-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.code-display-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  transition: all 0.2s ease;
}

.code-display-card:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.code-display-card.highlight {
  border-color: rgba(79, 70, 229, 0.35);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(99, 102, 241, 0.1) 100%);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.08);
}

.code-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.code-display-card.highlight .code-label {
  color: var(--primary);
}

.code-val {
  display: block;
  font-size: 1.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}

.code-display-card.highlight .code-val {
  color: var(--primary);
}

/* Profile Modal Details */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.avatar-huge {
  width: 92px;
  height: 92px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 2.1rem;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-huge:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.profile-hero-info {
  flex: 1;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.profile-name-row h4 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.badge-success {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-requested {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.32);
  padding: 3px 10px;
  border-radius: var(--radius-full, 999px);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
}

body.dark .badge-requested {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
}

.btn-withdraw-invite {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--danger, #ef4444);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-full, 999px);
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-withdraw-invite:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #dc2626;
  transform: translateY(-1px);
}

body.dark .btn-withdraw-invite {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

body.dark .btn-withdraw-invite:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.team-invited-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #d97706;
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full, 999px);
  margin-right: auto;
  letter-spacing: 0.1px;
}

.invited-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

body.dark .team-invited-status-pill {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
}

.linked-identities-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.linked-identities-box h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.identity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  margin-top: 8px;
}

.identity-item:last-child {
  border-bottom: none;
}

.identity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-right: 12px;
}

.identity-details {
  flex: 1;
}

.identity-details strong {
  display: block;
  font-size: 0.84rem;
}

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

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.status-pill.connected {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
}

/* Settings Modal */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
  border-bottom: none;
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-color);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

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

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

/* Settings Danger Zone & Account Deletion */
.settings-danger-zone {
  margin-top: 18px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

[data-theme="dark"] .settings-danger-zone {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
}

.settings-danger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.danger-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.delete-account-warning-card {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  margin-bottom: 14px;
}

[data-theme="dark"] .delete-account-warning-card {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--text-main);
  color: var(--bg-card);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: auto;
  animation: slideInUp 0.3s ease-out;
  transition: opacity 0.3s ease;
}

.toast.toast-success {
  background-color: var(--accent-emerald);
  color: white;
}

.toast.toast-error {
  background-color: var(--accent-rose);
  color: white;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

.my-tasks-info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 0.8125rem;
  color: var(--primary-text);
}

.my-tasks-info-banner svg {
  color: var(--primary);
  flex-shrink: 0;
}

.badge-policy {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.task-policy-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.task-policy-banner svg {
  flex-shrink: 0;
}

.task-policy-banner.open {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.04) 100%);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.task-policy-banner.restricted {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.04) 100%);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

body.dark .task-policy-banner.open {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

body.dark .task-policy-banner.restricted {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.special-assigners-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  background: var(--bg-subtle);
  padding: 10px;
  border-radius: var(--radius-md);
}

.assigner-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  cursor: pointer;
}

.assigner-checkbox-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.badge-special-assigner {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--accent-amber-light, rgba(245, 158, 11, 0.12));
  color: var(--accent-amber, #d97706);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.25;
}

.badge-special-assigner.badge-inviter-tag {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.badge-creator-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.28);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.25;
}

.btn-toggle-assigner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1.3;
}

.btn-toggle-assigner:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-toggle-assigner.active {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .btn-toggle-assigner.active {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
}

.btn-toggle-assigner.btn-toggle-inviter.active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .btn-toggle-assigner.btn-toggle-inviter.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.45);
}

.btn-toggle-assigner .btn-toggle-icon-remove {
  display: none;
}

.btn-toggle-assigner.active:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

.btn-toggle-assigner.active:hover .btn-toggle-icon-normal {
  display: none;
}

.btn-toggle-assigner.active:hover .btn-toggle-icon-remove {
  display: inline;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .kanban-board {
    grid-template-columns: 1fr;
  }
  .quick-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .header-center {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 10px 16px;
  }
  .user-brief {
    display: none;
  }
  .quick-stats-row {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .invite-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .code-cards-row {
    grid-template-columns: 1fr;
  }
  .project-main-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .meta-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .invite-tabs {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   NOTIFICATION SYSTEM STYLES
   ========================================================================== */
.notif-bell-container {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-bell-btn {
  position: relative;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  transition: all 0.2s ease;
  box-sizing: border-box;
  flex-shrink: 0;
}

.notif-bell-btn:hover {
  background: var(--surface-hover, #f8fafc);
  color: var(--text-primary, #0f172a);
  border-color: var(--border-hover, #cbd5e1);
}

.notif-bell-btn.has-unread {
  color: var(--primary-color, #4f46e5);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--surface-card, #ffffff);
  animation: notif-pulse 2s infinite;
}

@keyframes notif-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Notification Overlay & Drawer */
.notif-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.notif-drawer.open ~ .notif-overlay,
.notif-overlay.open {
  opacity: 1;
  visibility: visible;
}

.notif-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--surface-card, #ffffff);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-drawer.open {
  transform: translateX(0);
}

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

.notif-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.notif-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-mark-all-btn {
  background: transparent;
  border: none;
  color: var(--primary-color, #4f46e5);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.notif-mark-all-btn:hover {
  background: var(--primary-light, #eef2ff);
}

.notif-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.notif-close-btn:hover {
  background: var(--surface-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md, 8px);
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.notif-item:hover {
  background: var(--surface-hover, #f8fafc);
  border-color: var(--border-hover, #cbd5e1);
  transform: translateY(-1px);
}

.notif-item.unread {
  background: var(--surface-unread, #f0f4ff);
  border-color: #c7d2fe;
}

.notif-type-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-message {
  font-size: 0.86rem;
  color: var(--text-primary, #0f172a);
  margin: 0 0 4px 0;
  line-height: 1.4;
  word-break: break-word;
}

.notif-item.unread .notif-message {
  font-weight: 600;
}

.notif-meta {
  font-size: 0.74rem;
  color: var(--text-secondary, #64748b);
  display: block;
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-color, #4f46e5);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Mention Notifications Highlight - Light Mode */
.notif-item.notif-mention {
  border-left: 4px solid var(--primary, #4f46e5);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, var(--surface-card, #ffffff) 100%);
  border-color: #c7d2fe;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.06);
}

.notif-item.notif-mention:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, var(--surface-hover, #f8fafc) 100%);
  border-color: #a5b4fc;
}

.notif-item.notif-mention.unread {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(238, 242, 255, 0.95) 100%);
  border-color: #818cf8;
}

.notif-item.notif-mention.notif-mention-all {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--surface-card, #ffffff) 100%);
  border-color: #fde68a;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.06);
}

.notif-item.notif-mention.notif-mention-all:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, var(--surface-hover, #f8fafc) 100%);
  border-color: #fcd34d;
}

.notif-item.notif-mention.notif-mention-all.unread {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(254, 243, 199, 0.95) 100%);
  border-color: #f59e0b;
}

/* ==========================================================================
   Dark Theme Notification Drawer & Mention Highlight Enhancements
   ========================================================================== */
[data-theme="dark"] .notif-drawer {
  background: #111827;
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.65);
  border-left: 1px solid var(--border-color, #24304f);
}

[data-theme="dark"] .notif-drawer-header {
  background: #131b2e;
  border-bottom: 1px solid var(--border-color, #24304f);
}

[data-theme="dark"] .notif-drawer-title {
  color: var(--text-main, #f8fafc);
}

[data-theme="dark"] .notif-list {
  background: #0b0f19;
}

[data-theme="dark"] .notif-item {
  background: #131b2e;
  border-color: #1e293b;
}

[data-theme="dark"] .notif-item:hover {
  background: #1a233a;
  border-color: #334155;
}

[data-theme="dark"] .notif-item.unread {
  background: #172036;
  border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .notif-item .notif-message {
  color: #e2e8f0;
}

[data-theme="dark"] .notif-item.unread .notif-message {
  color: #ffffff;
}

[data-theme="dark"] .notif-item .notif-meta {
  color: #94a3b8;
}

/* Mention Notifications Highlight - Dark Theme */
[data-theme="dark"] .notif-item.notif-mention {
  border-left: 4px solid #818cf8;
  border-color: rgba(129, 140, 248, 0.4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(20, 27, 45, 0.98) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .notif-item.notif-mention:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(26, 36, 60, 0.98) 100%);
  border-color: rgba(129, 140, 248, 0.65);
}

[data-theme="dark"] .notif-item.notif-mention.unread {
  border-left: 4px solid #a5b4fc;
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.32) 0%, rgba(27, 36, 64, 0.98) 100%);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.28);
}

[data-theme="dark"] .notif-item.notif-mention .notif-message {
  color: #f8fafc !important;
  font-weight: 500;
}

[data-theme="dark"] .notif-item.notif-mention.unread .notif-message {
  color: #ffffff !important;
  font-weight: 600;
}

[data-theme="dark"] .notif-item.notif-mention .notif-meta {
  color: #a5b4fc !important;
  opacity: 0.95;
}

/* @all Broadcast Mention Highlight - Dark Theme */
[data-theme="dark"] .notif-item.notif-mention.notif-mention-all {
  border-left: 4px solid #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(25, 23, 36, 0.98) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .notif-item.notif-mention.notif-mention-all:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(32, 28, 44, 0.98) 100%);
  border-color: rgba(245, 158, 11, 0.7);
}

[data-theme="dark"] .notif-item.notif-mention.notif-mention-all.unread {
  border-left: 4px solid #fbbf24;
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.32) 0%, rgba(38, 30, 36, 0.98) 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.28);
}

[data-theme="dark"] .notif-item.notif-mention.notif-mention-all .notif-message {
  color: #fffbeb !important;
  font-weight: 500;
}

[data-theme="dark"] .notif-item.notif-mention.notif-mention-all.unread .notif-message {
  color: #ffffff !important;
  font-weight: 600;
}

[data-theme="dark"] .notif-item.notif-mention.notif-mention-all .notif-meta {
  color: #fde68a !important;
  opacity: 0.95;
}

.notif-mention-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full, 9999px);
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.notif-mention-icon.all {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
  font-size: 0.92rem;
}

[data-theme="dark"] .notif-mention-icon {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

[data-theme="dark"] .notif-mention-icon.all {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
  color: #1c1917;
}

.notif-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.notif-mention-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .notif-mention-badge {
  background: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.45);
}

.notif-mention-badge.all {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .notif-mention-badge.all {
  background: rgba(245, 158, 11, 0.28);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.notif-mention .notif-dot {
  background: #6366f1;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.7);
}

.notif-mention.notif-mention-all .notif-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.notif-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary, #64748b);
}

.notif-empty p {
  font-weight: 600;
  font-size: 1rem;
  margin: 12px 0 6px;
  color: var(--text-primary, #0f172a);
}

.notif-empty small {
  font-size: 0.8rem;
  line-height: 1.4;
  display: block;
}

.notif-permission-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-hover, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.78rem;
  color: var(--text-secondary, #475569);
  transition: all 0.2s ease;
}

.notif-permission-banner .banner-text {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.notif-permission-banner .enable-notif-btn {
  background: var(--primary-color, #4f46e5);
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}

.notif-permission-banner .enable-notif-btn:hover {
  background: var(--primary-hover, #4338ca);
  transform: translateY(-1px);
}

.notif-permission-banner.granted {
  background: #f0fdf4;
  border-bottom-color: #bbf7d0;
  color: #166534;
}

.notif-permission-banner.denied {
  background: #fef2f2;
  border-bottom-color: #fecaca;
  color: #991b1b;
}

[data-theme="dark"] .notif-close-btn {
  color: var(--text-muted, #94a3b8);
}

[data-theme="dark"] .notif-close-btn:hover {
  background: var(--bg-card-hover, #1c2640);
  color: var(--text-main, #f8fafc);
}

[data-theme="dark"] .notif-mark-all-btn {
  color: #818cf8;
}

[data-theme="dark"] .notif-mark-all-btn:hover {
  background: rgba(99, 102, 241, 0.18);
}

[data-theme="dark"] .notif-permission-banner {
  background: #151d30;
  border-bottom-color: var(--border-color, #24304f);
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .notif-permission-banner.granted {
  background: rgba(16, 185, 129, 0.12);
  border-bottom-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

[data-theme="dark"] .notif-permission-banner.denied {
  background: rgba(239, 68, 68, 0.12);
  border-bottom-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

[data-theme="dark"] .notif-empty {
  color: var(--text-muted, #64748b);
}

[data-theme="dark"] .notif-empty p {
  color: var(--text-main, #f8fafc);
}

/* ==========================================================================
   FIREBASE BACKEND STATUS & SETUP STYLES
   ========================================================================== */
.firebase-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  margin-bottom: 20px;
}

.firebase-status-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.firebase-status-text strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text-primary, #0f172a);
}

.firebase-status-text p {
  font-size: 0.76rem;
  color: var(--text-secondary, #64748b);
  margin: 2px 0 0;
}

.badge-backend-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--surface-card, #ffffff);
  color: var(--text-primary, #0f172a);
  transition: all 0.2s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

.badge-backend-status:hover {
  background: var(--surface-hover, #f8fafc);
  border-color: var(--border-hover, #cbd5e1);
}

.badge-backend-status.live {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.badge-backend-status.demo {
  background: #fffbeb;
  border-color: #fef08a;
  color: #854d0e;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.live {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.status-dot.demo {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.status-dot.reconnecting {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.workspace-pill.offline {
  border-color: rgba(239, 68, 68, 0.4);
  background-color: rgba(239, 68, 68, 0.07);
}

.setup-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-color, #4f46e5);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-details strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary, #0f172a);
  margin-bottom: 4px;
}

.step-details p {
  font-size: 0.8rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.4;
  margin: 0;
}

/* ==========================================================================
   Team Tab & Member Management
   ========================================================================== */
.team-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.team-tab-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.team-tab-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
}

.team-tab-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.team-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  transition: var(--transition);
}

.team-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.team-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-main);
  width: 200px;
}

.team-search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.team-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.team-member-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.team-member-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.team-member-card.team-member-card-invited {
  border: 1.5px dashed rgba(245, 158, 11, 0.45);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.03), transparent 60%), var(--bg-card);
}

.team-member-card.team-member-card-invited:hover {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.08);
}

body.dark .team-member-card.team-member-card-invited {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), transparent 60%), var(--bg-card);
}

.team-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.team-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.team-card-avatar.avatar-creator {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.team-card-identity {
  flex: 1;
  min-width: 0;
}

.team-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.team-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-you-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.team-card-email {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.team-card-presence-row {
  display: flex;
  align-items: center;
  margin-top: 5px;
}

.team-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.team-badge-role {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.team-badge-creator {
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.team-badge-special {
  background-color: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.team-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 16px;
  text-align: center;
}

.team-card-metric-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-card-metric-col .metric-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.team-card-metric-col .metric-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.team-card-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.badge-creator-protected {
  font-size: 0.72rem;
  font-weight: 700;
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-current-user-tag,
.badge-member-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 4px 8px;
  border-radius: var(--radius-full);
}

.btn-remove-member {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 5px 11px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.team-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.team-empty-state svg {
  margin-bottom: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}

.team-empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.team-empty-state p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Custom Role Editing in Team Tab */
.team-role-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.team-badge-role.role-empty {
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.8;
}

.btn-role-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--primary-light);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.btn-role-edit:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-role-edit svg {
  stroke-width: 2.2;
}

.edit-role-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.edit-role-preview-meta strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.edit-role-preview-meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================================= */
/* OWNER PROJECT CONTROLS, BROADCAST & MEMBER EXIT STYLES   */
/* ========================================================= */
.detail-dynamic-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-broadcast {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-broadcast:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-danger-outline {
  background-color: transparent;
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose);
}

.btn-danger-outline:hover {
  background-color: var(--accent-rose);
  color: #ffffff;
}

.danger-zone-card {
  border: 1px solid #fecdd3 !important;
  margin-top: 20px;
}

.danger-zone-card .card-header.danger-header {
  border-bottom: 1px solid #fecdd3;
  background-color: #fff1f2;
}

.member-exit-card {
  border: 1px solid var(--border-color);
  margin-top: 20px;
}

.owner-actions-flex {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.owner-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.owner-action-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 3px;
}

.owner-action-info p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.owner-action-divider {
  height: 1px;
  background-color: var(--border-color);
  width: 100%;
}

.btn-leave-member {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-rose);
  background-color: var(--accent-rose-light);
  border: 1px solid var(--accent-rose);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-leave-member:hover {
  background-color: var(--accent-rose);
  color: #ffffff;
}

/* ========================================================= */
/* TASK DETAILS, SUBTASKS CHECKLIST & COMMENTS STYLES        */
/* ========================================================= */
.task-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  background-color: var(--bg-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.task-detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-detail-meta-item .meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.task-detail-meta-item .meta-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
}

.section-subheading {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.task-detail-desc-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

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

/* Subtasks */
.subtasks-progress-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.subtask-progress-track {
  height: 6px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}

.subtask-progress-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.task-subtasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.subtask-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.subtask-item:hover {
  border-color: #cbd5e1;
  background-color: var(--bg-subtle);
}

.subtask-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.subtask-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--primary);
}

.subtask-title {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.35;
  transition: var(--transition);
}

.subtask-title.completed {
  text-decoration: line-through;
  color: var(--text-muted);
  opacity: 0.75;
}

.btn-delete-subtask {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.85rem;
  border-radius: 4px;
  opacity: 0.6;
  transition: var(--transition);
}

.btn-delete-subtask:hover {
  opacity: 1;
  color: var(--accent-rose);
  background-color: var(--accent-rose-light);
}

.subtask-add-form {
  display: flex;
  gap: 8px;
}

.subtask-add-form input {
  flex: 1;
  font-size: 0.84rem;
}

/* Comments */
.task-comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.task-comment-empty {
  text-align: center;
  padding: 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

.task-comment-card {
  display: flex;
  gap: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

.task-comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent-indigo));
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-comment-content {
  flex: 1;
}

.task-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.task-comment-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.task-comment-time {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.task-comment-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
}

.comment-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-assignee-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.task-comment-locked-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background-color: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  color: #92400e;
  font-size: 0.84rem;
  line-height: 1.4;
}

.task-comment-locked-alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Badges on Kanban Card */
.task-card-indicators {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.badge-subtasks {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-subtasks.completed {
  background-color: var(--accent-emerald-light);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.badge-comments {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-open-task-detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--primary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-open-task-detail:hover {
  text-decoration: underline;
  background-color: var(--primary-light);
}

/* ==========================================================================
   MEMBER CONTACT DETAILS MODAL STYLES
   ========================================================================== */
.member-contact-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  margin-bottom: 18px;
}

.member-contact-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.member-contact-avatar {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full, 999px);
  background: linear-gradient(135deg, var(--primary, #4f46e5) 0%, #8b5cf6 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.member-contact-avatar.avatar-creator {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.member-contact-avatar-wrap .crown-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.member-contact-title-area {
  flex: 1;
  min-width: 0;
}

.member-contact-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.member-contact-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0;
  line-height: 1.2;
}

.member-contact-role-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.member-contact-details-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.member-contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  transition: all 0.2s ease;
}

.member-contact-item:hover {
  border-color: var(--border-hover, #cbd5e1);
  background: var(--surface-hover, #f8fafc);
}

.contact-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-subtle, #f1f5f9);
  color: var(--primary, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-item-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.contact-item-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  word-break: break-all;
}

.contact-item-value.italic {
  font-style: italic;
  font-weight: 400;
}

.contact-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-contact-action {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--surface-card, #ffffff);
  color: var(--text-secondary, #475569);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-contact-action:hover {
  background: var(--primary-light, #e0e7ff);
  color: var(--primary, #4f46e5);
  border-color: var(--primary, #4f46e5);
  transform: translateY(-1px);
}

.member-contact-tasks-wrap {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.member-contact-tasks-wrap h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.member-contact-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.member-contact-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.member-contact-task-row:hover {
  background: #f1f5f9;
  border-color: var(--border-hover, #cbd5e1);
}

.member-contact-task-row.completed .task-row-title {
  text-decoration: line-through;
  color: var(--text-muted, #94a3b8);
}

.task-row-status {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
}

.task-row-status.completed {
  color: #16a34a;
  font-weight: 700;
}

.task-row-title {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-priority {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.task-row-priority.urgent { background: #fee2e2; color: #dc2626; }
.task-row-priority.high { background: #ffedd5; color: #ea580c; }
.task-row-priority.medium { background: #fef9c3; color: #ca8a04; }
.task-row-priority.low { background: #f0fdf4; color: #16a34a; }

/* Clickable profile styling in team cards */
.team-card-top.clickable-profile {
  cursor: pointer;
  padding: 6px;
  margin: -6px -6px 10px -6px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.team-card-top.clickable-profile:hover {
  background: var(--surface-hover, #f8fafc);
}

.btn-view-contact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
  transition: all 0.15s ease;
  margin-right: auto;
}

.btn-view-contact:hover {
  background: var(--primary-light, #e0e7ff);
  color: var(--primary, #4f46e5);
  border-color: var(--primary, #4f46e5);
}

/* Self-Assignment Controls */
.btn-assign-self {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light, rgba(79, 70, 229, 0.08));
  color: var(--primary, #4f46e5);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm, 6px);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-assign-self:hover {
  background: var(--primary, #4f46e5);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(79, 70, 229, 0.25);
}

.btn-assign-self:active {
  transform: translateY(0);
}

.badge-assigned-self {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.task-detail-reassign-select {
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface-card, #ffffff);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
}

/* Email Invitation Notice Card */
.invite-email-notice-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.07) 0%, rgba(99, 102, 241, 0.03) 100%);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 16px;
}

[data-theme="dark"] .invite-email-notice-card {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.25);
}

.invite-email-notice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary, #4f46e5);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
}

[data-theme="dark"] .invite-email-notice-header {
  color: #a5b4fc;
}

.invite-email-notice-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notice-point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.83rem;
  line-height: 1.45;
}

.notice-point-icon {
  font-size: 1.05rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.notice-point strong {
  display: inline;
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

[data-theme="dark"] .notice-point strong {
  color: #ffffff;
}

.notice-point span {
  display: inline;
  color: var(--text-secondary, #475569);
  margin-left: 4px;
}

[data-theme="dark"] .notice-point span {
  color: #cbd5e1;
}

/* ==========================================================================
   TEAM MEMBER RANKINGS / LEADERBOARD (Options 1, 2, 4)
   ========================================================================== */

.leaderboard-card {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.leaderboard-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.leaderboard-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.leaderboard-filter-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.leaderboard-filter-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .leaderboard-filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.leaderboard-filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.btn-rankings-visibility {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-rankings-visibility:hover {
  background: var(--bg-card-hover, rgba(99, 102, 241, 0.08));
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-rankings-visibility strong {
  color: var(--primary);
}

.vis-gear {
  font-size: 0.78rem;
  opacity: 0.7;
}

.btn-rankings-visibility:hover .vis-gear {
  opacity: 1;
}

.badge-rankings-visibility {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 20px 20px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 10px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  position: relative;
}

.leaderboard-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* Rank Podium Accents */
.leaderboard-item.rank-1 {
  border-left: 5px solid #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-card) 35%);
}

.leaderboard-item.rank-2 {
  border-left: 5px solid #94a3b8;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0%, var(--bg-card) 35%);
}

.leaderboard-item.rank-3 {
  border-left: 5px solid #b45309;
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.08) 0%, var(--bg-card) 35%);
}

.leaderboard-rank-badge {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.leaderboard-rank-badge.rank-other {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: 50%;
  border: 1px solid var(--border-color);
}

.leaderboard-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  border: 2px solid var(--border-color);
  overflow: hidden;
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-info {
  flex: 1;
  min-width: 0;
}

.leaderboard-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.leaderboard-user-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-role-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.leaderboard-metrics-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.leaderboard-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.leaderboard-metric-pill strong {
  color: var(--text-main);
}

.leaderboard-progress-container {
  width: 100%;
  height: 5px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.leaderboard-progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, #818cf8 100%);
  transition: width 0.4s ease;
}

.leaderboard-item.rank-1 .leaderboard-progress-bar {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.leaderboard-score-column {
  text-align: right;
  flex-shrink: 0;
  min-width: 90px;
}

.leaderboard-score-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.leaderboard-item.rank-1 .leaderboard-score-num {
  color: #f59e0b;
}

.leaderboard-score-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.leaderboard-empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   MEMBER TASK COMPLETION DONUT CHART
   ========================================================================== */

.member-completion-chart-card {
  margin-top: 24px;
}

.donut-chart-flex {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 32px;
  flex-wrap: wrap;
  padding: 8px 4px;
}

.donut-graphic-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 210px;
}

.donut-svg-box {
  position: relative;
  width: 200px;
  height: 200px;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  border-radius: 50%;
  overflow: visible;
}

.donut-slice {
  fill: none;
  stroke-linecap: round;
  transition: stroke-width 0.22s ease, opacity 0.22s ease, filter 0.22s ease;
  cursor: pointer;
}

.donut-slice:hover {
  stroke-width: 32 !important;
  opacity: 1 !important;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.donut-slice-empty {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 24;
  stroke-dasharray: 4 4;
}

.donut-center-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center-number {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.donut-center-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}

.donut-center-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 600;
}

.donut-legend-col {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.donut-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  cursor: pointer;
}

.donut-member-item:hover {
  background: var(--bg-card);
  border-color: var(--primary, #4f46e5);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.donut-member-item.active-highlight {
  border-color: var(--primary, #4f46e5);
  background: var(--primary-light, rgba(79, 70, 229, 0.08));
}

.donut-member-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.donut-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg-card);
}

.donut-member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-light, rgba(79, 70, 229, 0.12));
  color: var(--primary, #4f46e5);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.donut-member-name-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.donut-member-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-member-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-member-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.donut-member-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.donut-member-share-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.donut-member-track {
  width: 100%;
  height: 5px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.donut-member-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.35s ease;
}

.donut-empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ==========================================================================
   MEMBER TASK COMPLETION DONUT MODAL
   ========================================================================== */

.member-donut-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.member-donut-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light, rgba(79, 70, 229, 0.12));
  color: var(--primary, #4f46e5);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.member-donut-info h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.member-donut-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.member-donut-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.member-donut-stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 8px);
  padding: 10px;
  text-align: center;
}

.member-donut-stat-box.completed {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.06);
}

.member-donut-stat-box.in-progress {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.06);
}

.member-donut-stat-box.pending {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.06);
}

.member-donut-stat-val {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.member-donut-stat-val.completed { color: #10b981; }
.member-donut-stat-val.in-progress { color: #3b82f6; }
.member-donut-stat-val.pending { color: var(--text-muted); }

.member-donut-stat-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.member-donut-chart-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  padding: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.member-donut-legend-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 180px;
}

.member-donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.82rem;
}

.member-donut-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
}

.member-donut-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.member-donut-task-item:hover {
  background: var(--bg-card);
  border-color: var(--primary, #4f46e5);
}

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

/* ==========================================================================
   AVATAR IMAGE & PRESET GALLERY STYLES
   ========================================================================== */

.avatar-badge img,
.avatar-large img,
.avatar-huge img,
.card-assignee-avatar img,
.member-avatar img,
.donut-member-avatar img,
.member-donut-avatar img,
.chat-avatar img,
.task-comment-avatar img,
.activity-item-avatar img,
.stack-item img,
.team-card-avatar img,
.member-contact-avatar img,
.leaderboard-avatar img,
#task-detail-assignee-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

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

.avatar-camera-btn {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary, #4f46e5);
  color: #fff;
  border: 2.5px solid var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
  z-index: 2;
}

.avatar-camera-btn:hover {
  transform: scale(1.15);
  background: var(--primary-hover, #4338ca);
}

.profile-avatar-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  flex-wrap: wrap;
}

.preset-avatars-box {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 8px);
}

.preset-avatars-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.preset-avatars-header h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.preset-avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

@media (max-width: 480px) {
  .preset-avatar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.preset-avatar-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
}

.preset-avatar-btn:hover {
  transform: scale(1.15);
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.preset-avatar-btn.active {
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
  background: var(--primary-light, rgba(79, 70, 229, 0.1));
  transform: scale(1.08);
}

/* ==========================================================================
   SET PROFILE PHOTO MODAL STYLES
   ========================================================================== */
#modal-set-photo {
  z-index: 1050;
}

.set-photo-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
}

.set-photo-upload-card {
  padding: 18px 16px;
  border: 2px dashed var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  text-align: center;
  background: var(--bg-card, #ffffff);
  transition: all 0.2s ease;
}

.set-photo-upload-card:hover {
  border-color: var(--primary, #4f46e5);
  background: var(--bg-surface, #f8fafc);
}

/* =========================================================
   TASK DELETION & SCORE IMPACT STYLES
   ========================================================= */
.btn-delete-task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: transparent;
  color: var(--accent-rose, #ef4444);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 6px 14px;
  border-radius: var(--radius-md, 8px);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-task:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #dc2626;
  transform: translateY(-1px);
}

.btn-delete-task-disabled {
  opacity: 0.65;
  border-color: var(--border-color, #e2e8f0) !important;
  color: var(--text-muted, #94a3b8) !important;
  background-color: var(--bg-subtle, #f8fafc) !important;
  cursor: not-allowed !important;
  pointer-events: auto;
}

.btn-delete-task-disabled:hover {
  background-color: var(--bg-subtle, #f8fafc) !important;
  border-color: var(--border-color, #e2e8f0) !important;
  color: var(--text-muted, #94a3b8) !important;
  transform: none !important;
}

.btn-card-delete-task {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--accent-rose, #ef4444);
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-card-delete-task:hover {
  color: #dc2626;
  background-color: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
}

.btn-card-delete-locked {
  background: transparent !important;
  border: 1px dashed var(--border-color, #cbd5e1) !important;
  color: var(--text-muted, #94a3b8) !important;
  opacity: 0.55;
  cursor: pointer;
  padding: 2px 5px !important;
}

.btn-card-delete-locked:hover {
  opacity: 0.85;
  color: var(--text-main, #334155) !important;
}

body.dark .btn-card-delete-task {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

body.dark .btn-card-delete-task:hover {
  background-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

body.dark .btn-delete-task {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

body.dark .btn-delete-task:hover {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

body.dark .btn-delete-task-disabled {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text-muted, #64748b) !important;
}

body.dark .delete-task-score-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

body.dark .delete-task-score-warning strong {
  color: #fbbf24 !important;
}

.badge-reassign-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  background: var(--bg-subtle, #f8fafc);
  padding: 3px 8px;
  border-radius: var(--radius-sm, 6px);
  border: 1px dashed var(--border-color, #e2e8f0);
}

body.dark .badge-reassign-locked {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ========================================================= */
/* COMPACT & MODERN TASK DETAIL MODAL REDESIGN               */
/* ========================================================= */
.task-detail-meta-card {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 14px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .task-detail-meta-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.meta-card-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.meta-section-status {
  border-right: 1px solid var(--border-color, #e2e8f0);
  padding-right: 14px;
}

@media (max-width: 640px) {
  .meta-section-status {
    border-right: none;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    padding-right: 0;
    padding-bottom: 10px;
  }
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.meta-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
}

.task-status-select {
  height: 32px !important;
  padding: 3px 10px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm, 6px) !important;
  background-color: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  color: var(--text-main, #0f172a) !important;
  cursor: pointer;
  width: auto;
  min-width: 140px;
  transition: all 0.2s ease;
}

.meta-dates-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--text-main);
  background: var(--bg-subtle, #f8fafc);
  padding: 3px 8px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-color, #e2e8f0);
}

.meta-date-chip .chip-label {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.meta-date-chip .chip-value {
  font-weight: 600;
}

.meta-date-chip.completed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.28);
  color: #10b981;
}

.task-creator-pill {
  font-size: 0.73rem;
  color: var(--text-muted);
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-full, 999px);
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-creator-pill .creator-label {
  opacity: 0.85;
}

.task-creator-pill .creator-name {
  font-weight: 600;
  color: var(--text-main);
}

.meta-assignee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-subtle, #f8fafc);
  padding: 5px 10px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-color, #e2e8f0);
  min-height: 38px;
  box-sizing: border-box;
}

.meta-assignee-row .card-assignee {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.meta-assignee-row .card-assignee-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.meta-assignee-row .card-assignee-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 125px;
}

.meta-assignee-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.meta-assignee-actions .task-detail-reassign-select {
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  background-color: var(--bg-card, #ffffff);
  color: var(--text-main, #0f172a);
  max-width: 140px;
  height: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meta-assignee-actions .task-detail-reassign-select:hover {
  border-color: var(--primary, #4f46e5);
}

/* Dedicated Created By Row */
.meta-creator-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle, #f8fafc);
  padding: 5px 10px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-color, #e2e8f0);
  min-height: 38px;
  box-sizing: border-box;
}

.meta-creator-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.meta-creator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-creator-details {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.meta-creator-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.meta-creator-role {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary, #4f46e5);
  border: 1px solid rgba(99, 102, 241, 0.2);
  white-space: nowrap;
}

.task-desc-container {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.task-desc-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.task-detail-desc-text {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-main);
  margin: 0;
}

.task-subtasks-section,
.task-comments-section {
  margin-bottom: 14px;
}

.subtask-empty-hint {
  padding: 8px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  background: var(--bg-subtle, #f8fafc);
  border-radius: var(--radius-sm, 6px);
  border: 1px dashed var(--border-color, #e2e8f0);
  margin-bottom: 8px;
}

.task-comment-empty {
  padding: 8px 12px !important;
  font-size: 0.78rem !important;
  border-radius: var(--radius-sm, 6px) !important;
}

.subtask-add-form input {
  height: 32px !important;
  font-size: 0.82rem !important;
  padding: 4px 10px !important;
}

.subtask-add-form button {
  height: 32px !important;
  padding: 0 12px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

/* Dark mode overrides */
body.dark .task-detail-meta-card,
body.dark .task-desc-container {
  background: var(--bg-card, #1e293b);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark .meta-section-status {
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark .meta-date-chip,
body.dark .task-creator-pill,
body.dark .meta-assignee-row,
body.dark .meta-creator-row,
body.dark .subtask-empty-hint {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
}

body.dark .meta-creator-avatar {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

body.dark .meta-creator-role {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.35);
}

body.dark .meta-assignee-actions .task-detail-reassign-select {
  background-color: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
}

body.dark .meta-date-chip.completed {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* ========================================================= */
/* TWO-WAY APPROVAL: JOIN REQUESTS & PENDING INVITATIONS     */
/* ========================================================= */
.pending-requests-section,
.pending-invitations-section {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pending-requests-section {
  border-left: 4px solid var(--primary, #4f46e5);
}

.pending-invitations-section {
  border-left: 4px solid #f59e0b;
}

.pending-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pending-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pending-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary, #4f46e5);
  border: 1px solid rgba(79, 70, 229, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pending-badge.waiting {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.25);
}

.pending-requests-list,
.pending-invitations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pending-request-card,
.pending-invite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  flex-wrap: wrap;
}

.pending-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pending-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary, #4f46e5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.pending-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pending-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pending-user-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.pending-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Dashboard Invitations Banner */
.dashboard-invitations-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.07), rgba(99, 102, 241, 0.03));
  border: 1px solid rgba(79, 70, 229, 0.25);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.dashboard-invitations-banner .banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary, #4f46e5);
}

.dashboard-invitations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-invitation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  flex-wrap: wrap;
}

.dashboard-invitation-card .inv-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.dashboard-invitation-card .inv-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Notification item interactive action buttons */
.notif-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* Dark mode overrides */
body.dark .pending-requests-section,
body.dark .pending-invitations-section,
body.dark .dashboard-invitation-card {
  background: var(--bg-card, #1e293b);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark .pending-request-card,
body.dark .pending-invite-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
}

body.dark .dashboard-invitations-banner {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.35);
}

/* ==========================================================================
   REAL-TIME ONLINE PRESENCE & ACTIVITY STYLES
   ========================================================================== */
.member-avatar-wrap,
.chat-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.presence-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg-card, #ffffff);
  box-sizing: content-box;
  z-index: 2;
  transition: all 0.2s ease;
}

.presence-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
  animation: presence-pulse 2.2s infinite ease-in-out;
}

.presence-dot.away {
  background-color: #f59e0b;
}

.presence-dot.offline {
  background-color: #94a3b8;
}

@keyframes presence-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Presence Pill Badge in Member Rows */
.presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.presence-pill.online {
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.presence-pill.away {
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.presence-pill.offline {
  background-color: rgba(148, 163, 184, 0.12);
  color: #64748b;
}

.presence-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.presence-pill.online .presence-pill-dot {
  background-color: #10b981;
}

.presence-pill.away .presence-pill-dot {
  background-color: #f59e0b;
}

.presence-pill.offline .presence-pill-dot {
  background-color: #94a3b8;
}

/* Chat Header Live Online Counter Badge */
.chat-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-full, 9999px);
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 8px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.chat-online-pill .presence-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  animation: presence-pulse 2.2s infinite ease-in-out;
}

/* Dark mode overrides */
body.dark .presence-dot {
  border-color: var(--bg-card, #1e293b);
}

body.dark .presence-pill.online {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

body.dark .presence-pill.away {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

body.dark .presence-pill.offline {
  background-color: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

body.dark .chat-online-pill {
  background-color: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

/* High contrast button styling for dark mode */
body.dark .btn-secondary,
[data-theme="dark"] .btn-secondary,
body.dark .btn-outline,
[data-theme="dark"] .btn-outline {
  color: #f8fafc !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

body.dark .btn-secondary:hover,
[data-theme="dark"] .btn-secondary:hover,
body.dark .btn-outline:hover,
[data-theme="dark"] .btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

body.dark #modal-profile .btn,
[data-theme="dark"] #modal-profile .btn {
  color: #f8fafc !important;
}

body.dark #modal-profile .btn svg,
[data-theme="dark"] #modal-profile .btn svg {
  stroke: currentColor !important;
}
