/* Beyond The Sale - CRM Styles */

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

:root {
  /* Light Theme (Emerald Prestige - Luxury Palette) */
  --primary-color: #2E8B57;     /* Rich Emerald */
  --secondary-color: #B8860B;   /* Dark Goldenrod */
  --accent-color: #A9A9A9;      /* Polished Silver */
  --text-dark: #0A1D1F;         /* Deep Forest */
  --text-light: #6b7280;        /* Muted Gray */
  --bg-light: #F0F8F0;          /* Mint Cream */
  --border-color: #d4d4d4;      /* Light Silver */
  --success-color: #2E8B57;     /* Rich Emerald */
  --warning-color: #B8860B;     /* Dark Goldenrod */
  --danger-color: #8B0000;      /* Deep Burgundy */
  --white: #ffffff;

  /* Additional variables for consistency */
  --bg-primary: #ffffff;
  --text-primary: #0A1D1F;
  --surface: #F0F8F0;
  --primary-600: #2E8B57;
  --secondary-500: #B8860B;
  --border-light: #d4d4d4;
  --error-500: #8B0000;
  --success-500: #2E8B57;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-lg: 0 10px 15px -3px rgba(10, 29, 31, 0.15);
  --hover-bg: rgba(46, 139, 87, 0.08);
}

/* Dark Theme (Emerald Prestige - Dark Mode) */
[data-theme="dark"] {
  --primary-color: #3CB371;      /* Medium Sea Green */
  --secondary-color: #DAA520;    /* Goldenrod */
  --accent-color: #C0C0C0;       /* Silver */
  --text-dark: #F0F8F0;          /* Mint Cream */
  --text-light: #A9A9A9;         /* Dark Gray */
  --bg-light: #0A1D1F;           /* Deep Forest */
  --border-color: #2E4A4F;       /* Dark Teal */
  --success-color: #3CB371;      /* Medium Sea Green */
  --warning-color: #DAA520;      /* Goldenrod */
  --danger-color: #DC143C;       /* Crimson */
  --white: #1B263B;              /* Charcoal Navy */

  /* Additional dark theme variables */
  --bg-primary: #1B263B;
  --text-primary: #F0F8F0;
  --surface: #0A1D1F;
  --primary-600: #3CB371;
  --secondary-500: #DAA520;
  --border-light: #2E4A4F;
  --error-500: #DC143C;
  --success-500: #3CB371;
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --hover-bg: rgba(60, 179, 113, 0.15);
}

/* Smooth transitions for theme changes */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  margin: 0;
  padding: 0;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  padding: 2rem;
}

.login-box {
  background: var(--white);
  padding: 3rem;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 100%;
}

.login-box h1 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.login-box p {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  min-height: 100vh;
  gap: 0;  /* No gap between sidebar and content */
}

.sidebar {
  width: 250px;
  background: var(--white);
  border-right: 1px solid var(--border-color);
  padding: 1rem 0;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: hidden;
  margin: 0;
  z-index: 100;
  /* Extend background slightly to cover any sub-pixel gaps */
  box-shadow: 1px 0 0 var(--white);
  display: flex;
  flex-direction: column;
}

/* Make the nav section scrollable if needed */
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  /* Hide scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar nav::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar .logo {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.sidebar .logo h2 {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.sidebar nav ul {
  list-style: none;
}

.sidebar nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-dark);
  text-decoration: none;
  transition: all 0.3s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--bg-light);
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
}

.sidebar .user-info {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.sidebar .user-info p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.sidebar .user-info .btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 1rem 1.5rem;
  min-width: 0;
  box-sizing: border-box;
  background: var(--white);
  min-height: 100vh;
}

.top-bar {
  background: var(--bg-light);
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  border: 1px solid var(--border-color);
}

.top-bar h1 {
  font-size: 1.75rem;
  color: var(--text-dark);
}

/* Cards */
.card {
  background: var(--card-bg, var(--bg-light));
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Clickable/interactive cards get lift effect */
.card.clickable:hover,
.card[onclick]:hover,
a.card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

/* Card header with border */
.card-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2,
.card-header h3 {
  margin: 0;
}

/* Card footer */
.card-footer {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Clickable Stat Cards (Filter Cards) */
.stat-card-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.stat-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card-clickable:active {
  transform: translateY(0);
}

.stat-card-clickable.active {
  border-left-width: 4px;
  border-left-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(46, 139, 87, 0.08), rgba(46, 139, 87, 0.02));
  box-shadow: 0 2px 8px rgba(46, 139, 87, 0.2);
}

.stat-card-clickable.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
  border-radius: 0 0 0.5rem 0;
}

[data-theme="dark"] .stat-card-clickable.active {
  background: linear-gradient(135deg, rgba(60, 179, 113, 0.15), rgba(60, 179, 113, 0.05));
  box-shadow: 0 2px 8px rgba(60, 179, 113, 0.3);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-size: 1rem;
  font-family: inherit;
  background: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

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

.btn-success {
  background: var(--success-color);
  color: var(--white);
}

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

.btn-secondary {
  background: var(--text-light);
  color: var(--white);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Table - Enhanced for better scannability */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--bg-light);
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  vertical-align: middle;
}

/* Table row hover with subtle left border accent */
tbody tr {
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

tbody tr:hover {
  background: var(--bg-light);
  border-left-color: var(--primary-color);
}

/* Table row striping (optional - uncomment if desired)
tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}
*/

/* Make first column (usually name/title) stand out */
td:first-child {
  font-weight: 500;
}

/* Sortable column headers */
th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
}

th.sortable::after {
  content: '↕';
  margin-left: 0.5rem;
  opacity: 0.3;
  font-size: 0.625rem;
}

th.sortable.asc::after {
  content: '↑';
  opacity: 1;
}

th.sortable.desc::after {
  content: '↓';
  opacity: 1;
}

/* Modern Badge System */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* Status Badge Variants - Modern Color Palette */
.badge-success,
.badge.success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}

.badge-warning,
.badge.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border-color: #fcd34d;
}

.badge-danger,
.badge.danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-color: #fca5a5;
}

.badge-info,
.badge.info {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border-color: #93c5fd;
}

.badge-primary,
.badge.primary {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4338ca;
  border-color: #a5b4fc;
}

.badge-secondary,
.badge.secondary {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #374151;
  border-color: #d1d5db;
}

/* Status-Specific Badges */
.badge.draft,
.badge-draft {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #4b5563;
  border-color: #d1d5db;
}

.badge.scheduled,
.badge-scheduled {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border-color: #93c5fd;
}

.badge.published,
.badge-published {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}

.badge.archived,
.badge-archived {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  color: #831843;
  border-color: #f9a8d4;
}

.badge.active,
.badge-active {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}

.badge.inactive,
.badge-inactive {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #6b7280;
  border-color: #d1d5db;
}

.badge.pending,
.badge-pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border-color: #fcd34d;
}

.badge.completed,
.badge-completed {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}

.badge.cancelled,
.badge-cancelled,
.badge.canceled,
.badge-canceled {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-color: #fca5a5;
}

.badge.paid,
.badge-paid {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}

.badge.unpaid,
.badge-unpaid {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-color: #fca5a5;
}

.badge.overdue,
.badge-overdue {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-color: #fca5a5;
}

/* Dark Mode Support */
[data-theme="dark"] .badge-success,
[data-theme="dark"] .badge.success,
[data-theme="dark"] .badge.published,
[data-theme="dark"] .badge.completed,
[data-theme="dark"] .badge.active,
[data-theme="dark"] .badge.paid {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.3) 100%);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .badge-warning,
[data-theme="dark"] .badge.warning,
[data-theme="dark"] .badge.pending {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.3) 100%);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .badge-danger,
[data-theme="dark"] .badge.danger,
[data-theme="dark"] .badge.cancelled,
[data-theme="dark"] .badge.canceled,
[data-theme="dark"] .badge.unpaid,
[data-theme="dark"] .badge.overdue {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.3) 100%);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .badge-info,
[data-theme="dark"] .badge.info,
[data-theme="dark"] .badge.scheduled {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.3) 100%);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .badge-primary,
[data-theme="dark"] .badge.primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.3) 100%);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .badge-secondary,
[data-theme="dark"] .badge.secondary,
[data-theme="dark"] .badge.draft,
[data-theme="dark"] .badge.inactive,
[data-theme="dark"] .badge.archived {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.2) 0%, rgba(107, 114, 128, 0.3) 100%);
  color: #d1d5db;
  border-color: rgba(107, 114, 128, 0.4);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  padding: 2rem;
  border-radius: 0.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 1;
  /* Hide scrollbar but allow scrolling */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.modal-content::-webkit-scrollbar {
  display: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-close,
.modal-content .close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  position: absolute;
  right: 1rem;
  top: 1rem;
  line-height: 1;
  padding: 0.25rem;
  z-index: 10;
}

.modal-close:hover,
.modal-content .close:hover {
  color: var(--text-dark);
}

.modal-content {
  position: relative;
}

/* Messages */
.message {
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.message.success {
  background: #d1fae5;
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.message.error {
  background: #fee2e2;
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #1f2937;
  --text-primary: #f9fafb;
  --surface: #374151;
  --bg-light: #111827;
  --text-dark: #f9fafb;
  --text-light: #d1d5db;
  --border-color: #374151;
  --border-light: #374151;
  --white: #1f2937;
  --hover-bg: rgba(255, 255, 255, 0.05);
}

/* Responsive */
/* ========================================
   MOBILE RESPONSIVENESS (Tablets & Phones)
   ======================================== */

@media (max-width: 768px) {
  /* Dashboard Layout */
  .dashboard {
    flex-direction: column;
  }

  /* Sidebar: Hidden by default, slides in when opened */
  .sidebar {
    width: 280px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
  }

  /* Main Content: Full width on mobile */
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
  }

  /* Mobile Header with Hamburger Menu */
  .mobile-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
  }

  .hamburger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .hamburger-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
  }

  .hamburger-btn i {
    font-size: 1.5rem;
  }

  /* Backdrop overlay when sidebar is open */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  .sidebar-backdrop.active {
    display: block;
    opacity: 1;
  }

  /* Grid Layouts: Single column on mobile */
  .stats-grid,
  .grid,
  .card-grid {
    grid-template-columns: 1fr !important;
  }

  /* Tables: Horizontal scroll container */
  .table-container,
  table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px; /* Ensure table doesn't squish */
  }

  /* Reduce padding on mobile */
  .container {
    padding: 0.75rem;
  }

  /* Modal: Full screen on mobile */
  .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    height: 95vh !important;
    margin: 2.5vh auto !important;
  }

  /* Forms: Full width inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  select,
  textarea {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Buttons: Larger tap targets */
  button,
  .btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  /* Action Icon Buttons: Larger touch targets */
  .action-icon-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  /* Hide desktop-only elements */
  .desktop-only {
    display: none !important;
  }

  /* Page Headers: Smaller on mobile */
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  /* Card spacing */
  .card {
    margin-bottom: 1rem;
  }

  /* Flex containers: Stack on mobile */
  .flex-row {
    flex-direction: column;
  }

  /* AI Assistant: Smaller on mobile */
  .ai-assistant-panel {
    width: 95vw !important;
    max-width: 95vw !important;
  }
}

/* Theme Toggle Button */
.theme-toggle-container {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.theme-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-dark);
}

.theme-toggle-btn:hover {
  background: var(--hover-bg);
  transform: translateY(-1px);
}

.theme-toggle-btn:active {
  transform: translateY(0);
}

.theme-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover .theme-icon {
  transform: rotate(20deg);
}

.moon-icon {
  display: none;
}

/* Fix for charts in dark mode */
[data-theme="dark"] canvas {
  filter: brightness(0.9);
}

/* Fix for modals in dark mode */
[data-theme="dark"] .modal {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .modal-content {
  background: #1e293b;
  color: var(--text-primary);
}

/* Fix for tables in dark mode */
[data-theme="dark"] table {
  color: var(--text-primary);
}

[data-theme="dark"] tr:hover {
  background: var(--hover-bg);
}

/* Fix for inputs in dark mode */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #1e293b;
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] select option {
  background: #1e293b;
  color: var(--text-primary);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-light);
}

/* Fix for buttons in dark mode */
[data-theme="dark"] .btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary:hover {
  background: var(--hover-bg);
}

/* Fix for code blocks */
[data-theme="dark"] pre,
[data-theme="dark"] code {
  background: #0d1117;
  color: #c9d1d9;
}

/* ============================================
   PROVISIONAL EMAIL PROTECTION STYLES
   ============================================ */

/* Filter Buttons */
.btn-filter {
  background: var(--surface);
  color: var(--text-dark);
  border: 2px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

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

.btn-filter i {
  font-size: 1rem;
}

/* Dark mode filter buttons */
[data-theme="dark"] .btn-filter {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .btn-filter:hover {
  background: var(--hover-bg);
}

[data-theme="dark"] .btn-filter.active {
  background: var(--primary-color);
  color: white;
}

/* Provisional Email Badge in Table */
.provisional-email-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fff3cd;
  color: #856404;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #ffc107;
  white-space: nowrap;
}

.provisional-email-text {
  color: #999;
  font-size: 0.85em;
  font-family: monospace;
  margin-left: 0.5rem;
}

/* Dark mode provisional badge */
[data-theme="dark"] .provisional-email-badge {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border-color: #ffc107;
}

[data-theme="dark"] .provisional-email-text {
  color: #666;
}

/* Provisional Email Warning Banner */
[data-theme="dark"] #provisional-email-warning {
  background: rgba(255, 193, 7, 0.15) !important;
  border-color: #ffc107 !important;
}

[data-theme="dark"] #provisional-email-warning h4,
[data-theme="dark"] #provisional-email-warning p {
  color: #ffc107 !important;
}

[data-theme="dark"] #provisional-email-warning i {
  color: #ffc107 !important;
}


/* ============================================
   BULK SELECTION STYLES
   ============================================ */

/* Selected row highlighting */
.row-selected {
  background-color: rgba(59, 130, 246, 0.1) !important;
  border-left: 3px solid var(--primary-color) !important;
}

[data-theme="dark"] .row-selected {
  background-color: rgba(59, 130, 246, 0.15) !important;
}

/* Checkbox styling */
.contact-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

#select-all-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* Indeterminate checkbox state */
#select-all-checkbox:indeterminate {
  opacity: 0.7;
}

/* Bulk actions toolbar animation */
#bulk-actions-toolbar {
  animation: slideDown 0.3s ease-out;
}

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

/* Hover effect on rows with checkboxes */
tr:hover .contact-checkbox {
  transform: scale(1.1);
  transition: transform 0.2s;
}

/* Dark mode bulk actions toolbar */
[data-theme="dark"] #bulk-actions-toolbar {
  background: var(--primary-color);
}

/* ============================================
   COMMUNICATION STAT CARDS
   ============================================ */

.comm-stat-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.875rem;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.comm-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.comm-stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-size: 1.25rem;
}

.comm-stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.comm-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Dark mode support */
[data-theme="dark"] .comm-stat-card {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .comm-stat-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .comm-stat-value {
  color: var(--text-primary);
}

/* Preferred Communication Channels - Checkbox styling */
.checkbox-group label:has(.preferred-channel) {
  position: relative;
}

.checkbox-group label:has(.preferred-channel):hover {
  background: var(--hover-bg) !important;
  border-color: var(--primary-color) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkbox-group label:has(.preferred-channel:checked) {
  background: rgba(46, 139, 87, 0.1) !important;
  border-color: var(--primary-color) !important;
  font-weight: 500;
}

[data-theme="dark"] .checkbox-group label:has(.preferred-channel:checked) {
  background: rgba(60, 179, 113, 0.15) !important;
}

/* Hide mobile-only elements on desktop */
.mobile-header,
.hamburger-btn,
.sidebar-backdrop {
  display: none;
}

/* Ensure sidebar is always visible on desktop */
@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0) !important;
  }
}

/* ========================================
   SIDEBAR EXPANDABLE MENU (Accordion)
   ======================================== */

.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar nav li {
  margin: 0;
}

/* Menu Section Header (Clickable) */
.menu-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  border-top: 1px solid var(--border-color);
}

.menu-section-header:hover {
  background: var(--hover-bg);
  color: var(--primary-color);
}

.menu-section-header i.chevron {
  font-size: 0.875rem;
  transition: transform 0.3s ease;
}

.menu-section-header.collapsed i.chevron {
  transform: rotate(-90deg);
}

/* Menu Section Content (Collapsible) */
.menu-section-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease;
  opacity: 1;
}

.menu-section-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.menu-section-content li {
  margin: 0;
}

/* First section (no border-top) */
.menu-section-header:first-child {
  margin-top: 0;
  border-top: none;
}

/* Dark mode adjustments */
[data-theme="dark"] .menu-section-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================================
   TEAM PROFILE MODAL STYLES
   ============================================================ */

.profile-modal-content {
  max-width: 900px;
  max-height: 90vh;
  overflow: visible; /* Allow tooltips to escape */
  display: flex;
  flex-direction: column;
  background: #ffffff;
  opacity: 1;
}

[data-theme="dark"] .profile-modal-content {
  background: #1e293b;
}

.profile-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 2rem;
  border-bottom: 2px solid var(--border-color);
  background: var(--surface);
}

.profile-tab {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-tab:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.05);
}

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

.tab-content {
  display: none;
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

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

/* Profile Header Section */
.profile-header-section {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 2rem;
}

.profile-avatar-container {
  position: relative;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
}

.profile-avatar-container .btn-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  background: white;
  color: var(--primary-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--primary-color);
}

.profile-name-section h3 {
  margin: 0;
  font-size: 1.75rem;
  color: white;
}

.profile-name-section .text-light {
  color: rgba(255, 255, 255, 0.9);
  margin: 0.5rem 0;
}

.profile-section {
  background: var(--card-bg);
  border-radius: 8px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-field.full-width {
  grid-column: 1 / -1;
}

.profile-field label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-field p {
  margin: 0;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: 6px;
  color: var(--text);
}

.profile-field .editable-field {
  width: 100%;
}

.profile-section-divider {
  height: 1px;
  background: var(--border-color);
  margin: 2rem 0;
}

/* Permissions Grid */
.permissions-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.permission-category h5 {
  color: var(--primary-color);
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.permission-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.permission-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
  border-left: 3px solid var(--success-color);
}

.permission-item i {
  color: var(--success-color);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.permission-item strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.permission-item .text-light {
  font-size: 0.875rem;
  margin: 0;
}

/* Performance Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.metric-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.metric-card i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.metric-card h4 {
  font-size: 2rem;
  margin: 0.5rem 0;
  color: var(--text);
}

.metric-card p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
}

/* Time Off Section */
.timeoff-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.pto-balance-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.pto-balance-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.pto-balance-item i {
  font-size: 3rem;
  opacity: 0.9;
}

.pto-label {
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.9;
}

.pto-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.25rem 0 0 0;
}

.small-modal {
  max-width: 500px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .profile-modal-content {
    max-width: 95%;
    margin: 1rem;
  }

  .profile-tabs {
    overflow-x: auto;
    padding: 0 1rem;
  }

  .profile-tab {
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }

  .tab-content {
    padding: 1rem;
  }

  .profile-header-section {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

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

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

  .timeoff-header {
    flex-direction: column;
    gap: 1rem;
  }

  .pto-balance-card {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode */
[data-theme="dark"] .profile-header-section {
  background: linear-gradient(135deg, #4c51bf 0%, #6b46c1 100%);
}

[data-theme="dark"] .metric-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .metric-card:hover {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .permission-item {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .pto-balance-item {
  background: linear-gradient(135deg, #5568d3 0%, #6b47b5 100%);
}

/* ============================================================
   SIDEBAR COLLAPSE FUNCTIONALITY
   ============================================================ */

.sidebar {
  transition: width 0.3s ease;
  /* position: fixed is set above - do NOT override with relative */
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .logo h2,
.sidebar.collapsed .logo p,
.sidebar.collapsed .menu-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.collapsed .menu-section-header span {
  justify-content: center;
}

.sidebar.collapsed .menu-section-header .chevron {
  display: none;
}

.sidebar.collapsed nav li a {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar.collapsed nav li a i {
  margin-right: 0;
  font-size: 1.25rem;
}

/* Center menu section headers when collapsed */
.sidebar.collapsed .menu-section-header span {
  display: flex;
  justify-content: center;
  width: 100%;
}

.sidebar.collapsed .menu-section-header span i {
  margin-right: 0;
}

.sidebar.collapsed .user-info p strong,
.sidebar.collapsed .user-info #user-email {
  display: none;
}

.sidebar.collapsed .user-info button .menu-text {
  display: none;
}

.sidebar.collapsed .user-info button {
  padding: 0.5rem;
  width: auto !important;
  min-width: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar.collapsed .user-info button i {
  margin: 0;
  font-size: 1.25rem;
}

/* User info section alignment when collapsed */
.sidebar.collapsed .user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
}

.sidebar.collapsed .user-info .btn {
  margin-bottom: 0.5rem;
}

.sidebar.collapsed .theme-toggle-wrapper {
  padding: 0.5rem 0;
}

.sidebar.collapsed .theme-switch {
  transform: scale(0.7);
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: absolute;
  top: 1rem;
  right: -15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: 2px solid var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-toggle-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

.sidebar-toggle-btn i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

/* Main Content Adjustment */
.main-content {
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
  margin-left: 70px;
}

/* Menu Text Transitions */
.menu-text {
  transition: opacity 0.3s ease, width 0.3s ease;
  display: inline-block;
}

/* ============================================================
   THEME TOGGLE - SLIDER STYLE (REVERTED)
   ============================================================ */

.theme-toggle-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.25rem 0;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

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

.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

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

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

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

.theme-labels {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  pointer-events: none;
  z-index: 1;
}

.theme-labels i {
  font-size: 0.875rem;
  color: white;
}

.theme-labels i:first-child {
  opacity: 1;
}

.theme-labels i:last-child {
  opacity: 0.5;
}

.theme-switch input:checked ~ .theme-labels i:first-child {
  opacity: 0.5;
}

.theme-switch input:checked ~ .theme-labels i:last-child {
  opacity: 1;
}

/* ============================================================
   HIDE DEV MODE
   ============================================================ */

#dev-mode,
.dev-mode-toggle,
[id*="dev-mode"],
[class*="dev-mode"] {
  display: none !important;
}

/* Fix for menu section content - must be UL not DIV */
nav .menu-section-content {
  list-style: none;
  padding: 0;
  margin: 0;
}


/* ELEGANT STAT CARDS - Subtle, Rich, Professional */

.stat-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.stat-icon-large {
  font-size: 3rem;
  opacity: 0.12;
  line-height: 1;
  color: inherit;
}

.stat-icon-large i {
  display: block;
}

/* Primary Card - Elegant Neutral */
.stat-card-primary {
  background: #fafafa;
  border-left: 4px solid #6b7280;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card-primary .stat-info h3 {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-primary .stat-value {
  color: #1f2937;
  font-weight: 600;
}

.stat-card-primary .stat-icon-large {
  color: #6b7280;
}

/* Success Card - Rich Emerald Green */
.stat-card-success {
  background: #f0fdf4;
  border-left: 4px solid #2E8B57;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card-success .stat-info h3 {
  color: #2E8B57;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-success .stat-value {
  color: #1f2937;
  font-weight: 600;
}

.stat-card-success .stat-icon-large {
  color: #2E8B57;
}

/* Info Card - Elegant Blue-Gray */
.stat-card-info {
  background: #f8fafc;
  border-left: 4px solid #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card-info .stat-info h3 {
  color: #475569;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-info .stat-value {
  color: #1f2937;
  font-weight: 600;
}

.stat-card-info .stat-icon-large {
  color: #475569;
}

/* Warning Card - Rich Goldenrod */
.stat-card-warning {
  background: #fffbeb;
  border-left: 4px solid #B8860B;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card-warning .stat-info h3 {
  color: #B8860B;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-warning .stat-value {
  color: #1f2937;
  font-weight: 600;
}

.stat-card-warning .stat-icon-large {
  color: #B8860B;
}

/* Elegant hover effect */
.stat-card-primary:hover,
.stat-card-success:hover,
.stat-card-info:hover,
.stat-card-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ============================================
   ACTIVITY LOG STYLES
   ============================================ */

.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

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

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

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.activity-icon.booking {
  background: rgba(46, 139, 87, 0.1);
  color: var(--success-color);
}

.activity-icon.survey {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.activity-icon.dm {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.activity-icon.payment {
  background: rgba(184, 134, 11, 0.1);
  color: var(--warning-color);
}

.activity-icon.analytics {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-light);
}

.activity-icon.nps {
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
}

.activity-content {
  flex: 1;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.activity-title {
  font-weight: 600;
  color: var(--text-dark);
}

.activity-time {
  font-size: 0.875rem;
  color: var(--text-light);
  white-space: nowrap;
}

.activity-details {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.activity-metadata {
  margin-top: 0.75rem;
}

.activity-metadata summary {
  font-size: 0.875rem;
  color: var(--primary-color);
  cursor: pointer;
  user-select: none;
}

.activity-metadata pre {
  background: var(--bg-light);
  padding: 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  overflow-x: auto;
}

/* Dark mode support */
[data-theme="dark"] .activity-icon.booking {
  background: rgba(46, 139, 87, 0.2);
}

[data-theme="dark"] .activity-icon.survey {
  background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .activity-icon.dm {
  background: rgba(168, 85, 247, 0.2);
}

[data-theme="dark"] .activity-icon.payment {
  background: rgba(184, 134, 11, 0.2);
}

[data-theme="dark"] .activity-icon.analytics {
  background: rgba(107, 114, 128, 0.2);
}

[data-theme="dark"] .activity-icon.nps {
  background: rgba(234, 179, 8, 0.2);
}

/* ============================================
   CERTIFICATES - CLIENT SELECTOR STYLES
   ============================================ */

.client-item-rich {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.client-item-rich:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.client-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.client-info-detailed {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-item i {
  font-size: 1rem;
}

.client-stats {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-light);
  border-radius: 0.375rem;
  min-width: 60px;
}

.stat-label {
  font-size: 0.625rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.125rem;
}

.stat-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
}

.client-status {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.status-active {
  background: rgba(46, 139, 87, 0.1);
  color: var(--success-color);
}

.status-lead {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.status-inactive {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-light);
}

.status-prospect {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

/* Dark mode support */
[data-theme="dark"] .client-item-rich {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .client-item-rich:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
}

[data-theme="dark"] .stat-badge {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .status-active {
  background: rgba(46, 139, 87, 0.2);
}

[data-theme="dark"] .status-lead {
  background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .status-inactive {
  background: rgba(107, 114, 128, 0.2);
}

[data-theme="dark"] .status-prospect {
  background: rgba(168, 85, 247, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .client-item-rich {
    flex-direction: column;
    align-items: flex-start;
  }

  .client-stats {
    width: 100%;
    justify-content: space-around;
  }
}

/* ============================================
   CUSTOMER AVATARS - CARDS AND TABS
   ============================================ */

.avatar-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.avatar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.avatar-header {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.avatar-image-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}

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

.avatar-info {
  flex: 1;
}

.avatar-info h3 {
  margin: 0 0 0.25rem 0;
  color: var(--text-dark);
  font-size: 1.125rem;
}

.avatar-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-light);
}

.avatar-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.avatar-badges .badge {
  background: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.avatar-badges .badge.income {
  background: rgba(184, 134, 11, 0.1);
  color: var(--warning-color);
  border-color: var(--warning-color);
}

.avatar-stats {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.avatar-stats .stat-item {
  flex: 1;
  text-align: center;
}

.avatar-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.avatar-actions .btn {
  flex: 1;
}

/* Form grid layout - 2 columns for modal forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-grid .form-group {
  margin-bottom: 0;
}

/* Full width items in form-grid */
.form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

/* Form tabs container - horizontal layout, single line */
.form-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.125rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.form-tabs::-webkit-scrollbar {
  display: none;
}

/* Modal title styling */
#modal-title {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Provisional email warning - less alarming */
#provisional-email-warning {
  padding: 0.5rem 0.75rem !important;
  margin-bottom: 0.75rem !important;
  font-size: 0.875rem;
  width: fit-content;
  display: inline-block;
}

/* Tab buttons */
.tab-btn {
  padding: 0.4rem 0.6rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--text-dark);
  background: rgba(99, 102, 241, 0.05);
}

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

.tab-btn i {
  font-size: 1.125rem;
}

/* Tab content */
.tab-content {
  display: none;
}

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

/* ============================================
   ACTION ICON BUTTONS (Table Row Actions)
   ============================================ */
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-light);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.action-icon-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

.action-icon-btn:active {
  transform: translateY(0);
}

/* Specific icon colors on hover */
.action-icon-btn[title="Send Email"]:hover {
  background: #3b82f6;
}

.action-icon-btn[title="Call Prospect"]:hover {
  background: #10b981;
}

.action-icon-btn[title="View LinkedIn"]:hover {
  background: #0077b5;
}

.action-icon-btn[title="Schedule Meeting"]:hover {
  background: #8b5cf6;
}

.action-icon-btn[title="Mark as Qualified"]:hover {
  background: #10b981;
}

.action-icon-btn[title="Mark as High Priority"]:hover {
  background: #f59e0b;
}

.action-icon-btn[title="Edit"]:hover {
  background: #6366f1;
}

/* Active/priority state */
.action-icon-btn.active {
  color: #f59e0b;
}

.action-icon-btn.active:hover {
  background: #f59e0b;
  color: white;
}

/* ============================================
   LEAD SCORE BADGES
   ============================================ */
.lead-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Low Score: 0-39 - Neutral Gray */
.lead-score.low {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Medium Score: 40-69 - Warm Amber */
.lead-score.medium {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* High Score: 70+ - Rich Green */
.lead-score.high {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* Dark mode adjustments */
[data-theme="dark"] .lead-score.low {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  color: #94a3b8;
  border: 1px solid #475569;
}

[data-theme="dark"] .lead-score.medium {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
  color: #fde68a;
  border: 1px solid #b45309;
}

[data-theme="dark"] .lead-score.high {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  color: #6ee7b7;
  border: 1px solid #059669;
}

/* Dark mode support */
[data-theme="dark"] .avatar-card {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .avatar-card:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
}

[data-theme="dark"] .avatar-badges .badge {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .avatar-badges .badge.income {
  background: rgba(184, 134, 11, 0.2);
}

/* ============================================
   LEAD SCORING BADGES
   ============================================ */

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
}

.tier-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge.hot {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.tier-badge.warm {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.tier-badge.cold {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid #3b82f6;
}

.status-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.new {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.status-badge.contacted {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.status-badge.qualified {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-badge.enrolled {
  background: rgba(46, 139, 87, 0.1);
  color: var(--success-color);
}

.status-badge.lost {
  background: rgba(139, 0, 0, 0.1);
  color: var(--danger-color);
}

.quick-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  padding: 0.375rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
}

.action-btn.secondary {
  background: var(--text-light);
}

.action-btn.secondary:hover {
  background: var(--text-dark);
}

/* Dark mode */
[data-theme="dark"] .tier-badge.hot {
  background: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .tier-badge.warm {
  background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .tier-badge.cold {
  background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .status-badge.new {
  background: rgba(168, 85, 247, 0.2);
}

[data-theme="dark"] .status-badge.contacted {
  background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .status-badge.qualified {
  background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .status-badge.enrolled {
  background: rgba(46, 139, 87, 0.2);
}

[data-theme="dark"] .status-badge.lost {
  background: rgba(139, 0, 0, 0.2);
}

/* ============================================
   UNIFIED ELEGANT TOOLBAR
   ============================================ */

.table-controls-unified {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(to bottom, #fafafa, #f5f5f5);
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table-controls-unified .view-modes {
  display: flex;
  gap: 0.25rem;
  padding-right: 1rem;
  border-right: 1px solid #e5e7eb;
}

.table-controls-unified .view-mode-btn {
  padding: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.table-controls-unified .view-mode-btn:hover {
  background: white;
  border-color: #d1d5db;
  color: #374151;
}

.table-controls-unified .view-mode-btn.active {
  background: white;
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.1);
}

.table-controls-unified .view-mode-btn i {
  font-size: 1.125rem;
}

.table-controls-unified .search-section {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.table-controls-unified .search-section input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background: white;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.table-controls-unified .search-section input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.table-controls-unified .search-section i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
}

.table-controls-unified .toolbar-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.table-controls-unified .toolbar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.table-controls-unified .toolbar-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-controls-unified .toolbar-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.table-controls-unified .toolbar-btn i {
  font-size: 1rem;
}

/* Dark mode support */
[data-theme="dark"] .table-controls-unified {
  background: linear-gradient(to bottom, #1f2937, #111827);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .table-controls-unified .view-modes {
  border-right-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .table-controls-unified .view-mode-btn {
  color: #9ca3af;
}

[data-theme="dark"] .table-controls-unified .view-mode-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

[data-theme="dark"] .table-controls-unified .view-mode-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary-color);
}

[data-theme="dark"] .table-controls-unified .search-section input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: white;
}

[data-theme="dark"] .table-controls-unified .toolbar-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

[data-theme="dark"] .table-controls-unified .toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Responsive */
@media (max-width: 1024px) {
  .table-controls-unified {
    flex-wrap: wrap;
  }

  .table-controls-unified .search-section {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    margin-top: 0.75rem;
  }

  .table-controls-unified .toolbar-actions {
    margin-left: 0;
  }
}

/* Bulk Actions Section - INSIDE the unified toolbar */
.bulk-actions-section {
  display: none;
  align-items: center;
  gap: 1rem;
  flex: 1;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), #1e6b45) !important;
  color: white !important;
  border-radius: 0.375rem;
  animation: slideIn 0.3s ease-out;
  order: -1;
  width: 100%;
}

/* LIGHT MODE - Bulk Actions Section (ensure visibility) */
.bulk-actions-section,
:root .bulk-actions-section,
[data-theme="light"] .bulk-actions-section {
  background: linear-gradient(135deg, #2E8B57, #1e6b45) !important;
  color: #ffffff !important;
}

/* LIGHT MODE - Selection count text must be white */
.bulk-actions-section #selection-count,
:root .bulk-actions-section #selection-count,
[data-theme="light"] .bulk-actions-section #selection-count {
  color: #ffffff !important;
}

/* When bulk actions are active, transform the toolbar */
.table-controls-unified.bulk-active {
  background: linear-gradient(to bottom, #e3f2fd, #f5f5f5);
  border-color: var(--primary-color);
}

/* DARK MODE - Bulk Active Toolbar */
[data-theme="dark"] .table-controls-unified.bulk-active {
  background: linear-gradient(to bottom, #1a2838, #0f1419) !important;
  border-color: var(--primary-color) !important;
}

/* DARK MODE - Bulk Actions Section */
[data-theme="dark"] .bulk-actions-section {
  background: linear-gradient(135deg, #3CB371, #2E8B57) !important;
  color: #ffffff !important;
}

.table-controls-unified.bulk-active .bulk-actions-section {
  display: flex !important;
}

.bulk-actions-section #selection-count {
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff !important;
}

.bulk-action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

/* LIGHT MODE - Bulk Action Buttons */
.bulk-actions-section .toolbar-btn {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  transition: all 0.2s ease;
  font-weight: 500;
}

.bulk-actions-section .toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  transform: translateY(-1px);
}

/* Bulk Action Button Icons - ensure visibility */
.bulk-actions-section .toolbar-btn i {
  color: #ffffff !important;
}

.bulk-actions-section .toolbar-btn-danger {
  background: #dc3545 !important;
  border-color: #bd2130 !important;
  color: #ffffff !important;
}

.bulk-actions-section .toolbar-btn-danger:hover {
  background: #c82333 !important;
  border-color: #bd2130 !important;
}

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

/* Linked Task Badge for Sessions/Meetings */
.linked-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.2s;
}

.linked-task-badge:hover {
  background: #bfdbfe;
  color: #1e3a8a;
}

[data-theme="dark"] .linked-task-badge {
  background: #1e3a8a;
  color: #93c5fd;
}

[data-theme="dark"] .linked-task-badge:hover {
  background: #1e40af;
  color: #bfdbfe;
}

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

/* ============================================
   KANBAN VIEW STYLES
   ============================================ */

/* Kanban Board Container */
.kanban-board {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0;
  min-height: 500px;
}

/* Kanban Column */
.kanban-column {
  flex: 0 0 320px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

[data-theme="dark"] .kanban-column {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

/* Kanban Column Header */
.kanban-column-header {
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: white;
}

.kanban-column-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: white;
}

.kanban-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
}

/* Kanban Cards Container - NO SCROLLBAR */
.kanban-cards {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  /* Remove scrollbar while keeping scroll functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.kanban-cards::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Kanban Card */
.kanban-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: grab;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .kanban-card {
  background: var(--surface);
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.kanban-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

[data-theme="dark"] .kanban-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg);
}

/* Kanban Card Content */
.kanban-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.kanban-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* Kanban Card Meta & Tags - WITH DARK MODE SUPPORT */
.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.kanban-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--primary-color);
  color: white;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

/* Light Mode Tags */
[data-theme="light"] .kanban-tag {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Tags */
[data-theme="dark"] .kanban-tag {
  background: linear-gradient(135deg, rgba(60, 179, 113, 0.3), rgba(218, 165, 32, 0.3));
  color: var(--text-dark);
  border-color: var(--primary-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.kanban-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   PHOSPHOR ICONS - ELEGANT STYLING
   ============================================ */

/* Global Phosphor Icon Enhancement */
.ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

/* Icon sizing improvements */
.ph-sm {
  font-size: 1rem;
}

.ph-md {
  font-size: 1.25rem;
}

.ph-lg {
  font-size: 1.5rem;
}

.ph-xl {
  font-size: 2rem;
}

/* Icons in buttons */
.btn .ph,
.toolbar-btn .ph,
.view-mode-btn .ph {
  margin-right: 0.375rem;
  font-size: 1.125rem;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

/* Icon-only buttons (no margin) */
.btn .ph:only-child,
.toolbar-btn .ph:only-child,
.view-mode-btn .ph:only-child {
  margin-right: 0;
}

/* Hover effects for icons */
.btn:hover .ph,
.toolbar-btn:hover .ph,
.view-mode-btn:hover .ph {
  transform: scale(1.1);
}

/* Active state for view mode buttons */
.view-mode-btn.active .ph {
  transform: scale(1.15);
  font-weight: 700;
}

/* Icons in sidebar */
.sidebar nav a .ph,
.menu-section-header .ph {
  font-size: 1.25rem;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.sidebar nav a:hover .ph {
  transform: translateX(3px);
}

/* Icons in cards and stats */
.stat-card .ph,
.card h2 .ph {
  font-size: 1.5rem;
  opacity: 0.9;
  transition: all 0.2s ease;
}

.stat-card:hover .ph {
  transform: scale(1.1);
  opacity: 1;
}

/* Kanban card icons */
.kanban-card .ph {
  font-size: 1rem;
  margin-right: 0.25rem;
  opacity: 0.8;
}

/* Tag icons */
.kanban-tag .ph,
.badge .ph {
  font-size: 0.875rem;
  margin-right: 0.25rem;
}

/* Chevron icons */
.ph-caret-down,
.ph-caret-up,
.ph-caret-left,
.ph-caret-right {
  transition: transform 0.3s ease;
}

/* Rotating chevrons for dropdowns */
.menu-section-header.active .ph-caret-down,
.dropdown.active .ph-caret-down {
  transform: rotate(180deg);
}

/* Status icons with colors */
.ph-check-circle {
  color: var(--success-color);
}

.ph-warning-circle,
.ph-warning {
  color: var(--warning-color);
}

.ph-x-circle,
.ph-warning-octagon {
  color: var(--danger-color);
}

/* Icon animations */
@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.ph-spinner,
.ph-circle-notch {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   LIST VIEW STYLES - ELEGANT DARK/LIGHT DESIGN
   ============================================ */

/* List View Container */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* View Container & List Container Backgrounds */
.view-container,
.list-container {
  background: var(--bg-light);
}

/* Disclosure Triangles / Summary Markers - Dark Mode */
[data-theme="dark"] summary::-webkit-details-marker,
[data-theme="dark"] details summary::-webkit-details-marker {
  color: #E8F0E8 !important;
  background: transparent !important;
}

[data-theme="dark"] summary::marker,
[data-theme="dark"] details summary::marker {
  color: #E8F0E8 !important;
}

/* ===== LIGHT MODE - Professional & Clean ===== */

/* List Item - Light Mode */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.5rem;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.list-item:hover {
  background: #F0F8F4;
  border-color: #3CB371;
  box-shadow: 0 4px 12px rgba(46, 139, 87, 0.12);
  transform: translateX(3px);
}

/* List Item Main (Left Side) */
.list-item-main {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0A1D1F;
  margin-bottom: 0.375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.list-item-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* List Item Meta (Right Side) */
.list-item-meta {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}

/* List Tags - Light Mode */
.list-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: #F0F8F0;
  color: #2E8B57;
  border: 1px solid #D1E8D9;
  transition: all 0.2s ease;
}

.list-tag:hover {
  background: #2E8B57;
  color: #ffffff;
  border-color: #2E8B57;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(46, 139, 87, 0.2);
}

/* List Item Actions - Light Mode */
.list-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.list-item:hover .list-item-actions {
  opacity: 1;
}

/* ===== DARK MODE - Sophisticated & Easy on Eyes ===== */

[data-theme="dark"] .list-item {
  background: #242F3E !important;
  border-color: #3A4A5A !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .list-item:hover {
  background: #2D3A4A !important;
  border-color: #3CB371 !important;
  box-shadow: 0 4px 12px rgba(60, 179, 113, 0.15) !important;
  transform: translateX(3px);
}

[data-theme="dark"] .list-item-title {
  color: #E8F0E8;
}

[data-theme="dark"] .list-item-subtitle {
  color: #A0ADB8;
}

[data-theme="dark"] .list-tag {
  background: rgba(60, 179, 113, 0.18);
  color: #7FD4A8;
  border-color: rgba(60, 179, 113, 0.3);
}

[data-theme="dark"] .list-tag:hover {
  background: #3CB371;
  color: #0A1D1F;
  border-color: #3CB371;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(60, 179, 113, 0.3);
}

/* Empty State */
.list-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
  font-size: 1rem;
}

[data-theme="dark"] .list-empty {
  color: #A0ADB8;
}

/* Responsive List View */
@media (max-width: 768px) {
  .list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  .list-item-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .list-item-actions {
    opacity: 1;
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================
   GRID VIEW STYLES - ELEGANT DARK/LIGHT DESIGN
   ============================================ */

/* Grid Item - Light Mode */
.grid-item {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.grid-item:hover {
  border-color: #3CB371;
  box-shadow: 0 4px 12px rgba(46, 139, 87, 0.12);
  transform: translateY(-2px);
}

/* Dark Mode Grid Item */
[data-theme="dark"] .grid-item {
  background: #242F3E !important;
  border-color: #3A4A5A !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .grid-item:hover {
  background: #2D3A4A !important;
  border-color: #3CB371 !important;
  box-shadow: 0 4px 12px rgba(60, 179, 113, 0.15) !important;
  transform: translateY(-2px);
}

.grid-item-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0A1D1F;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .grid-item-title {
  color: #E8F0E8;
}

.grid-item-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

[data-theme="dark"] .grid-item-subtitle {
  color: #A0ADB8;
}

/* ============================================
   MARKETING AI PAGE STYLES
   ============================================ */

/* Alert Styles */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  color: #92400e;
}

[data-theme="dark"] .alert-warning {
  background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
  border-color: #92400e;
  color: #fef3c7;
}

/* Selector Display (clickable area) */
.selector-display {
  padding: 0.75rem 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.selector-display:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Selector Modal */
.selector-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.selector-modal.active {
  display: flex;
}

.selector-modal-content {
  background: #ffffff;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow: visible; /* Allow tooltips to escape */
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

/* Dark mode variant for all selector modals */
[data-theme="dark"] .selector-modal-content {
  background: #1e293b;
}

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

.selector-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  padding: 0;
  transition: color 0.2s ease;
}

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

.selector-modal-search {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.selector-modal-search i {
  color: var(--text-light);
}

.selector-modal-search input {
  flex: 1;
  border: none;
  background: none;
  font-size: 1rem;
  outline: none;
  color: var(--text-color);
}

/* Selector Options */
.selector-options,
.avatar-options {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.modal-list-item,
.avatar-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-list-item:hover,
.avatar-list-item:hover {
  background: var(--surface-light);
}

.modal-list-item.hidden,
.avatar-list-item.hidden {
  display: none;
}

.modal-list-item-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 1.5rem;
}

.modal-list-item-content {
  flex: 1;
}

.modal-list-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.modal-list-item-description {
  font-size: 0.875rem;
  color: var(--text-light);
}

.avatar-list-image {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-list-content {
  flex: 1;
}

.avatar-list-name {
  font-weight: 600;
}

.avatar-list-meta {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Modal Empty State */
.modal-empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.modal-empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.modal-empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Selector Option (for content type) */
.selector-option {
  padding: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.selector-option:hover {
  background: var(--surface-light);
  border-color: var(--primary-color);
}

.option-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.option-description {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Content Views */
.content-view {
  display: none;
}

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

/* View Buttons */
.view-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-light);
}

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

.view-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Kanban Board */
.kanban-column {
  background: var(--surface-light);
  border-radius: 0.5rem;
  padding: 1rem;
  min-height: 300px;
  transition: all 0.2s ease;
}

.kanban-column.drag-over {
  background: rgba(99, 102, 241, 0.1);
  border: 2px dashed var(--primary-color);
}

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

.kanban-column-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.kanban-count {
  background: var(--primary-color);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kanban-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kanban-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(3deg);
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kanban-card-id {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-light);
}

.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Status Badges */
.table-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.table-status-badge.draft {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.table-status-badge.scheduled {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.table-status-badge.published {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.table-status-badge.archived {
  background: rgba(156, 163, 175, 0.1);
  color: #9ca3af;
}

.status-badge-large {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: 0.25rem;
}

.table-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s ease;
}

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

.record-id-cell {
  font-family: monospace;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* AI Suggestions Dropdown */
.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  max-height: 200px;
  overflow-y: auto;
  opacity: 1;
}

.suggestions-dropdown.visible {
  display: block;
}

.suggestions-dropdown.loading {
  padding: 1rem;
  text-align: center;
  color: var(--text-light);
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.suggestion-item:hover {
  background: var(--surface-light);
}

.suggestion-item i {
  color: var(--primary-color);
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: var(--surface-light);
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-color);
}

/* Content Cards (Grid View) */
.content-card-item {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.content-card-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

.card-media {
  height: 150px;
  background: var(--surface-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-media-placeholder {
  font-size: 3rem;
  color: var(--text-light);
}

.card-content {
  padding: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.card-record-id {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-light);
}

.card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: 0.875rem;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* List View Item (Marketing AI) */
.list-item-record-id {
  font-family: monospace;
  font-size: 0.875rem;
  color: var(--text-light);
  min-width: 80px;
}

/* Dark Mode Adjustments for Marketing AI */
[data-theme="dark"] .selector-display {
  background: var(--surface-dark);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .kanban-column {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .kanban-card {
  background: var(--surface-dark);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .content-card-item {
  background: var(--surface-dark);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .suggestions-dropdown {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}

/* =====================================================
   ENHANCED DATA DISPLAY UTILITIES
   Improved spacing, scannability, and visual hierarchy
   ===================================================== */

/* Data List - Clean vertical list of items */
.data-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.data-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--card-bg, var(--white));
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.data-list-item:hover {
  background: var(--bg-light);
  border-left-color: var(--primary-color);
}

/* Data Grid - Card-based grid layout */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.data-grid-item {
  background: var(--card-bg, var(--white));
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.2s ease;
}

.data-grid-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

/* Field Label/Value pairs */
.field-group {
  margin-bottom: 0.75rem;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.field-value {
  font-size: 0.875rem;
  color: var(--text-dark);
  font-weight: 500;
}

/* Inline field display */
.field-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-inline .field-label {
  margin-bottom: 0;
  min-width: 80px;
}

/* Status indicators */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-dot.active,
.status-dot.success {
  background: #10b981;
}

.status-dot.warning,
.status-dot.pending {
  background: #f59e0b;
}

.status-dot.error,
.status-dot.inactive {
  background: #ef4444;
}

.status-dot.info {
  background: #3b82f6;
}

/* Enhanced Toolbar */
.data-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--card-bg, var(--white));
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  min-width: 250px;
}

.toolbar-search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.toolbar-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.filter-chip .remove {
  cursor: pointer;
  opacity: 0.8;
}

.filter-chip .remove:hover {
  opacity: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1.5rem;
}

.pagination-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  background: var(--card-bg, var(--white));
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-dark);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-light);
  border-color: var(--primary-color);
}

.pagination-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* View Switcher */
.view-switcher {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-light);
  padding: 0.25rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
}

.view-btn {
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.view-btn:hover {
  color: var(--text-dark);
}

.view-btn.active {
  background: var(--card-bg, var(--white));
  color: var(--primary-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Responsive table wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

.table-responsive table {
  margin-bottom: 0;
}

.table-responsive table th:first-child,
.table-responsive table td:first-child {
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
}

/* ============================================
   Blog Engagement Analytics Section
   ============================================ */

/* Engagement badge */
.engagement-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg-light);
  color: var(--text-light);
}

.engagement-badge.has-engagement {
  background: linear-gradient(135deg, var(--primary-color), #3CB371);
  color: white;
}

/* Comment cards */
.comment-card {
  background: var(--surface, var(--bg-light));
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s ease;
}

.comment-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #3CB371);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
}

.author-name {
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-email {
  font-size: 0.8rem;
  color: var(--text-light);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-light);
}

.comment-post {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-light);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.comment-content {
  margin-top: 0.75rem;
  color: var(--text-dark);
  line-height: 1.6;
}

/* Contact link button */
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.contact-link:hover {
  opacity: 0.9;
}

/* CRM Contact Button in Comments */
.crm-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.crm-contact-btn.has-contact {
  background: var(--primary-color);
  color: white;
}

.crm-contact-btn.has-contact:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.crm-contact-btn.no-contact {
  background: #9ca3af;
  color: #f3f4f6;
  cursor: not-allowed;
  opacity: 0.7;
}

.crm-contact-btn.no-contact:hover {
  background: #9ca3af;
}

/* Comment post title clickable */
.comment-post {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.comment-post:hover {
  color: var(--primary-color);
}

.comment-post-title {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.comment-post:hover .comment-post-title {
  text-decoration-style: solid;
}

/* Contact stage badge */
.contact-stage-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: capitalize;
}

.contact-stage-badge.lead {
  background: #dbeafe;
  color: #1e40af;
}

.contact-stage-badge.prospect {
  background: #fef3c7;
  color: #92400e;
}

.contact-stage-badge.qualified {
  background: #d1fae5;
  color: #065f46;
}

.contact-stage-badge.customer {
  background: #dcfce7;
  color: #166534;
}

[data-theme="dark"] .contact-stage-badge.lead {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

[data-theme="dark"] .contact-stage-badge.prospect {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

[data-theme="dark"] .contact-stage-badge.qualified {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .contact-stage-badge.customer {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

/* Table action button styles in engagement context */
.table-action-btn {
  padding: 0.375rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-action-btn:hover {
  background: var(--hover-bg, rgba(46, 139, 87, 0.1));
  color: var(--primary-color);
}

a.table-action-btn {
  text-decoration: none;
}

/* ============================================
   Toggle Switch Styling
   ============================================ */

.toggle-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: #e5e7eb;
  border-radius: 9999px;
  position: relative;
  transition: background 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

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

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.2);
}

[data-theme="dark"] .toggle-slider {
  background: #374151;
}

[data-theme="dark"] .toggle-slider::before {
  background: #f3f4f6;
}

/* ============================================
   Publishing Platform Selector
   ============================================ */

.platform-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.platform-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
}

.platform-checkbox:hover {
  border-color: var(--primary-color);
  background: var(--hover-bg);
}

.platform-checkbox input[type="checkbox"] {
  display: none;
}

.platform-checkbox input[type="checkbox"]:checked + .platform-icon {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.3);
}

.platform-checkbox input[type="checkbox"]:checked ~ .platform-label .platform-name {
  color: var(--primary-color);
  font-weight: 600;
}

.platform-checkbox input[type="checkbox"]:checked ~ .platform-label::after {
  content: '\2713';
  position: absolute;
  right: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.platform-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.platform-icon i {
  font-size: 1rem;
}

.platform-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.platform-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: color 0.2s ease;
}

.platform-desc {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* Dark mode support */
[data-theme="dark"] .platform-checkbox {
  background: var(--bg-light);
  border-color: var(--border-color);
}

[data-theme="dark"] .platform-checkbox:hover {
  border-color: var(--primary-color);
}

[data-theme="dark"] .platform-name {
  color: var(--text-dark);
}

/* =====================================================
   TEAM PAGE STYLES
   Grid layout and card styling for team members
   ===================================================== */

/* Team Grid Layout */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

/* Team Member Card */
.team-member-card {
  background: var(--card-bg, var(--bg-light));
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.team-member-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Member Header with Avatar */
.team-member-card .member-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.team-member-card .member-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.team-member-card .member-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text-dark);
}

.team-member-card .member-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Member Details */
.team-member-card .member-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.team-member-card .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.team-member-card .detail-label {
  color: var(--text-light);
}

.team-member-card .detail-value {
  color: var(--text-dark);
  font-weight: 500;
}

/* Member Status Badge */
.team-member-card .member-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.team-member-card .member-status.active {
  background: var(--success-100, #dcfce7);
  color: var(--success-700, #15803d);
}

.team-member-card .member-status.inactive {
  background: var(--error-100, #fee2e2);
  color: var(--error-700, #b91c1c);
}

/* Member Actions */
.team-member-card .member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.team-member-card .member-actions .btn {
  flex: 1;
  min-width: fit-content;
  justify-content: center;
}

/* Team Table View */
#team-table-view {
  display: none;
  margin-top: 1rem;
}

#team-table-view table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg, var(--bg-light));
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

#team-table-view th,
#team-table-view td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

#team-table-view th {
  background: var(--surface-light);
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.875rem;
}

#team-table-view tr:hover {
  background: var(--surface-light);
}

#team-table-view tr:last-child td {
  border-bottom: none;
}

/* View Member Modal */
#view-member-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#view-member-modal.active {
  display: flex;
}

.view-modal-content {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  opacity: 1;
}

.view-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.view-modal-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.5rem;
}

.view-modal-info h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
}

.view-modal-info p {
  margin: 0;
  color: var(--text-light);
}

.view-modal-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.view-modal-row .label {
  color: var(--text-light);
  font-size: 0.875rem;
}

.view-modal-row .value {
  font-weight: 500;
  color: var(--text-dark);
}

.view-modal-bio {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface-light);
  border-radius: 0.5rem;
}

.view-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Dark mode adjustments for team page */
[data-theme="dark"] .team-member-card {
  background: var(--surface-dark);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .team-member-card:hover {
  border-color: var(--primary-color);
}

[data-theme="dark"] .team-member-card .member-header {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .team-member-card .member-actions {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .team-member-card .member-status.active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

[data-theme="dark"] .team-member-card .member-status.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

[data-theme="dark"] #team-table-view table {
  background: var(--surface-dark);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #team-table-view th {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] #team-table-view th,
[data-theme="dark"] #team-table-view td {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #team-table-view tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .view-modal-content {
  background: var(--bg-dark);
}

[data-theme="dark"] .view-modal-bio {
  background: rgba(255, 255, 255, 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .team-grid {
    grid-template-columns: 1fr;
  }

  .team-member-card .member-actions {
    flex-direction: column;
  }

  .team-member-card .member-actions .btn {
    width: 100%;
  }

  /* Kanban Board - Mobile Optimization */
  .kanban-board {
    gap: 1rem;
    padding: 0.5rem;
  }

  .kanban-column {
    flex: 0 0 280px; /* Narrower columns on mobile */
    min-width: 280px;
  }

  .kanban-column-header h3 {
    font-size: 0.9rem;
  }

  .kanban-card {
    padding: 0.75rem;
  }

  .kanban-card-title {
    font-size: 0.875rem;
  }

  .kanban-card-subtitle {
    font-size: 0.75rem;
  }

  .kanban-tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }
}

/* ============================================
   DRAG AND DROP STYLES
   ============================================ */

/* Kanban drag styles */
.draggable-meeting {
  cursor: grab;
  user-select: none;
}

.draggable-meeting:active {
  cursor: grabbing;
}

.draggable-meeting.dragging {
  opacity: 0.5;
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.kanban-drop-zone {
  position: relative;
}

.kanban-drop-zone.drop-target-available {
  background: rgba(46, 139, 87, 0.05) !important;
}

.kanban-drop-zone.drop-target-hover {
  background: rgba(46, 139, 87, 0.15) !important;
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

.kanban-drop-zone.drop-loading {
  opacity: 0.7;
  pointer-events: none;
}

.kanban-drop-zone.drop-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.kanban-empty-placeholder {
  opacity: 0.6;
  transition: opacity 0.2s;
}

.kanban-drop-zone.drop-target-hover .kanban-empty-placeholder {
  opacity: 1;
  border-color: var(--primary-color) !important;
  background: rgba(46, 139, 87, 0.1) !important;
}

/* Calendar drag styles */
.draggable-calendar-meeting {
  cursor: grab;
  user-select: none;
}

.draggable-calendar-meeting:active {
  cursor: grabbing;
}

.draggable-calendar-meeting.dragging {
  opacity: 0.5;
}

.calendar-drop-zone {
  position: relative;
}

.calendar-drop-zone.calendar-drop-target-available {
  background: rgba(46, 139, 87, 0.08) !important;
}

.calendar-drop-zone.calendar-drop-target-hover {
  background: rgba(46, 139, 87, 0.2) !important;
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

.calendar-drop-zone.drop-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Spinner animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Dark mode drag styles */
[data-theme="dark"] .kanban-drop-zone.drop-target-available {
  background: rgba(60, 179, 113, 0.1) !important;
}

[data-theme="dark"] .kanban-drop-zone.drop-target-hover {
  background: rgba(60, 179, 113, 0.2) !important;
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

[data-theme="dark"] .calendar-drop-zone.calendar-drop-target-available {
  background: rgba(60, 179, 113, 0.1) !important;
}

[data-theme="dark"] .calendar-drop-zone.calendar-drop-target-hover {
  background: rgba(60, 179, 113, 0.2) !important;
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

/* Hover hint for draggable items */
.draggable-meeting:hover,
.draggable-calendar-meeting:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Kanban card grab handle visibility */
.draggable-meeting .ph-dots-six-vertical {
  opacity: 0.4;
  transition: opacity 0.15s;
}

.draggable-meeting:hover .ph-dots-six-vertical {
  opacity: 1;
}

/* ============================================================ */
/* TOOLTIP SYSTEM - Knowledge Hub Integration */
/* ============================================================ */

/* Help Icon - OPTION 4: Hover-activated overlay (invisible by default) */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 10px;
  font-weight: bold;
  cursor: help;
  transition: transform 0.2s, background-color 0.2s, opacity 0.4s;
  transition-delay: 0s, 0s, 0s; /* No delay when disappearing */

  /* Absolute positioning to not disrupt layout */
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 999998; /* High z-index, just below tooltip content */

  /* Invisible by default - OPTION 4 */
  opacity: 0;
  pointer-events: none;
}

/* Show help icon ONLY on hover of parent wrapper OR table cell */
.tooltip-wrapper:hover .help-icon,
th:hover > .help-icon,
td:hover > .help-icon {
  opacity: 1;
  pointer-events: auto;
  /* Wait 2 seconds before showing help icon on hover */
  transition-delay: 0s, 0s, 2s;
}

.help-icon:hover {
  transform: scale(1.15);
  background: var(--secondary-color);
}

.help-icon::before {
  content: '?';
}

/* Placeholder/Ghost Tooltip - for elements without configured content */
.help-icon.tooltip-placeholder {
  background: #9ca3af;
  width: 14px;
  height: 14px;
  font-size: 9px;
}

.tooltip-wrapper:hover .help-icon.tooltip-placeholder,
th:hover > .help-icon.tooltip-placeholder,
td:hover > .help-icon.tooltip-placeholder {
  opacity: 0.5; /* Slightly more transparent for placeholders */
  transition-delay: 0s, 0s, 2s;
}

.help-icon.tooltip-placeholder:hover {
  opacity: 0.8 !important;
  background: #6b7280;
  transform: scale(1.1);
}

/* Tooltip Wrapper - Non-disruptive: inherits display type from wrapped element */
.tooltip-wrapper {
  position: relative;
  display: contents; /* Default: acts like it doesn't exist in layout */
}

/* For specific elements that need positioning context */
.tooltip-wrapper.has-position {
  display: inline-block;
}

/* Tooltip Content - positioned absolutely relative to wrapper */
.tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 999999; /* MAXIMUM z-index to ensure always on top layer */
  width: 280px;
  max-width: 90vw;
  background: var(--text-dark);
  color: white;
  padding: 16px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;

  /* Position below by default - overlapping with help icon to prevent gap */
  bottom: calc(100% - 4px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);

  /* Quick disappearance on unhover (0.4s with no delay) */
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
  transition-delay: 0s; /* No delay when hiding */

  /* Text wrapping for better formatting */
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;

  /* COMPLETELY hide all content including icons during delay - prevent flash */
  clip-path: inset(50%);

  /* NEVER uppercase - always normal case */
  text-transform: none !important;
}

/* Arrow pointing to the element */
.tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text-dark);
}

/* Hide the icons inside tooltip links */
.tooltip-link-sop i,
.tooltip-content i.ph {
  display: none !important;
}

/* GENERAL RULE: All tooltips in top-bar show at BOTTOM of element */
.top-bar .tooltip-wrapper .tooltip-content {
  bottom: auto;
  top: calc(100% + 4px);
  transform: translateX(-50%) translateY(-5px);
}

.top-bar .tooltip-wrapper:hover .tooltip-content {
  transform: translateX(-50%) translateY(0);
}

/* Arrow pointing up for bottom-positioned tooltips in top-bar */
.top-bar .tooltip-wrapper .tooltip-content::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--text-dark);
}

/* Show tooltip on hover of wrapper, table cell, or help icon */
.tooltip-wrapper:hover .tooltip-content,
.help-icon:hover + .tooltip-content,
th:hover > .tooltip-content,
td:hover > .tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  /* Remove clipping to reveal content */
  clip-path: none;
  /* Wait 2 seconds before showing tooltip on hover */
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease, clip-path 0s;
  transition-delay: 2s, 2s, 2s, 2s; /* clip-path also waits 2s before removing */
}

/* Tooltip Position Variants */

/* Right-positioned tooltip */
.tooltip-content.tooltip-right {
  bottom: auto;
  left: calc(100% - 4px);
  top: 50%;
  transform: translateY(-50%) translateX(-5px);
}

.tooltip-content.tooltip-right::after {
  top: 50%;
  left: -6px;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: var(--text-dark);
}

.tooltip-wrapper:hover .tooltip-content.tooltip-right,
.help-icon:hover + .tooltip-content.tooltip-right,
th:hover > .tooltip-content.tooltip-right,
td:hover > .tooltip-content.tooltip-right {
  transform: translateY(-50%) translateX(0);
}

/* Left-positioned tooltip */
.tooltip-content.tooltip-left {
  bottom: auto;
  right: calc(100% - 4px);
  left: auto;
  top: 50%;
  transform: translateY(-50%) translateX(5px);
}

.tooltip-content.tooltip-left::after {
  top: 50%;
  right: -6px;
  left: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-left-color: var(--text-dark);
}

.tooltip-wrapper:hover .tooltip-content.tooltip-left,
.help-icon:hover + .tooltip-content.tooltip-left,
th:hover > .tooltip-content.tooltip-left,
td:hover > .tooltip-content.tooltip-left {
  transform: translateY(-50%) translateX(0);
}

/* Top-positioned tooltip */
.tooltip-content.tooltip-top {
  bottom: calc(100% - 4px);
  top: auto;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
}

.tooltip-content.tooltip-top::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--text-dark);
  border-bottom-color: transparent;
}

.tooltip-wrapper:hover .tooltip-content.tooltip-top,
.help-icon:hover + .tooltip-content.tooltip-top,
th:hover > .tooltip-content.tooltip-top,
td:hover > .tooltip-content.tooltip-top {
  transform: translateX(-50%) translateY(0);
}

/* Bottom-positioned tooltip */
.tooltip-content.tooltip-bottom {
  top: calc(100% - 4px);
  bottom: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
}

.tooltip-content.tooltip-bottom::after {
  bottom: 100%;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--text-dark);
  border-top-color: transparent;
}

.tooltip-wrapper:hover .tooltip-content.tooltip-bottom,
.help-icon:hover + .tooltip-content.tooltip-bottom,
th:hover > .tooltip-content.tooltip-bottom,
td:hover > .tooltip-content.tooltip-bottom {
  transform: translateX(-50%) translateY(0);
}

/* Rich Tooltip Content Styling */
.tooltip-content h5 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.tooltip-content p {
  margin: 0 0 8px 0;
  color: rgba(255, 255, 255, 0.9);
}

.tooltip-content p:last-child {
  margin-bottom: 0;
}

.tooltip-content ul {
  margin: 0 0 8px 0;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.tooltip-content ul:last-child {
  margin-bottom: 0;
}

.tooltip-content li {
  margin-bottom: 4px;
}

.tooltip-content code {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'Monaco', 'Courier New', monospace;
  color: rgba(255, 255, 255, 0.95);
}

.tooltip-content strong {
  color: white;
  font-weight: 600;
}

.tooltip-content a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
}

.tooltip-content a:hover {
  color: var(--secondary-color);
}

/* Tooltip link to SOP */
.tooltip-link-sop {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.tooltip-link-sop:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.tooltip-link-sop i {
  margin-right: 4px;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .help-icon {
  background: var(--primary-color);
}

[data-theme="dark"] .help-icon:hover {
  background: var(--secondary-color);
}

[data-theme="dark"] .tooltip-content {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .tooltip-content::after {
  border-top-color: #1a1a1a;
}

[data-theme="dark"] .tooltip-content.tooltip-right::after {
  border-right-color: #1a1a1a;
  border-top-color: transparent;
}

[data-theme="dark"] .tooltip-content.tooltip-left::after {
  border-left-color: #1a1a1a;
  border-top-color: transparent;
}

[data-theme="dark"] .tooltip-content.tooltip-bottom::after {
  border-bottom-color: #1a1a1a;
  border-top-color: transparent;
}

/* Loading State for Dynamic Tooltips */
.tooltip-content.tooltip-loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
}

/* Mobile Responsive Tooltips */
@media (max-width: 768px) {
  .tooltip-content {
    width: 240px;
    font-size: 12px;
    padding: 10px 12px;
  }

  .help-icon {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }

  .help-icon.tooltip-placeholder {
    width: 12px;
    height: 12px;
    font-size: 8px;
  }

  /* On mobile, position tooltips to avoid viewport overflow */
  .tooltip-content.tooltip-right,
  .tooltip-content.tooltip-left {
    /* Revert to bottom position on mobile - with overlap */
    top: calc(100% - 4px);
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(-5px);
  }

  .tooltip-content.tooltip-right::after,
  .tooltip-content.tooltip-left::after {
    bottom: 100%;
    top: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-bottom-color: var(--text-dark);
    border-top-color: transparent;
    border-left-color: transparent;
    border-right-color: transparent;
  }

  .tooltip-wrapper:hover .tooltip-content.tooltip-right,
  .tooltip-wrapper:hover .tooltip-content.tooltip-left {
    transform: translateX(-50%) translateY(0);
  }

  [data-theme="dark"] .tooltip-content.tooltip-right::after,
  [data-theme="dark"] .tooltip-content.tooltip-left::after {
    border-bottom-color: #1a1a1a;
  }
}

/* Touch Device Support - Show on tap */
@media (hover: none) and (pointer: coarse) {
  .help-icon {
    cursor: pointer;
  }

  .tooltip-content {
    display: none;
  }

  .help-icon.tooltip-active + .tooltip-content {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Accessibility - Keyboard Focus Support */
.help-icon:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.help-icon:focus + .tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Animation for tooltip appearance */
@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.tooltip-wrapper:hover .tooltip-content {
  animation: tooltipFadeIn 0.25s ease;
}

/* ============================================================ */
/* MARKETING AI TOOLBAR BEAUTIFICATION */
/* ============================================================ */

/* Enhanced Library Toolbar */
.library-toolbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--card-bg, var(--white));
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

[data-theme="dark"] .library-toolbar {
  background: var(--bg-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Enhanced View Switcher */
.view-switcher {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-light);
  padding: 0.375rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .view-switcher {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.view-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.125rem;
  transition: all 0.2s ease;
  position: relative;
}

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

.view-btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* Enhanced Search Input */
#search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.9375rem;
  background: var(--bg-light);
  color: var(--text-dark);
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 256 256'%3E%3Cpath fill='%23999' d='M229.66 218.34l-50.07-50.06a88.11 88.11 0 1 0-11.31 11.31l50.06 50.07a8 8 0 0 0 11.32-11.32M40 112a72 72 0 1 1 72 72a72.08 72.08 0 0 1-72-72'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem center;
  background-size: 18px 18px;
}

[data-theme="dark"] #search-input {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 256 256'%3E%3Cpath fill='%23ccc' d='M229.66 218.34l-50.07-50.06a88.11 88.11 0 1 0-11.31 11.31l50.06 50.07a8 8 0 0 0 11.32-11.32M40 112a72 72 0 1 1 72 72a72.08 72.08 0 0 1-72-72'/%3E%3C/svg%3E");
}

#search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background-color: var(--white);
}

[data-theme="dark"] #search-input:focus {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Enhanced Filter Selects */
#filter-category,
#filter-status {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.9375rem;
  background: var(--bg-light);
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%23666' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 14px 14px;
  min-width: 150px;
}

[data-theme="dark"] #filter-category,
[data-theme="dark"] #filter-status {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%23ccc' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32'/%3E%3C/svg%3E");
}

#filter-category:hover,
#filter-status:hover {
  border-color: var(--primary-color);
  background-color: var(--white);
}

[data-theme="dark"] #filter-category:hover,
[data-theme="dark"] #filter-status:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

#filter-category:focus,
#filter-status:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Enhanced Action Buttons */
.library-toolbar .btn-sm {
  min-width: 42px;
  height: 42px;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.library-toolbar .btn-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.library-toolbar .btn-sm:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .library-toolbar .btn-sm {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .library-toolbar .btn-sm:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Elegant Toolbar Action Buttons */
.toolbar-action-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #495057 !important;
}

.toolbar-action-btn:hover {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.15) !important;
}

.toolbar-action-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Ripple effect on click */
.toolbar-action-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.toolbar-action-btn:active::after {
  width: 100px;
  height: 100px;
}

/* Dark mode elegant buttons */
[data-theme="dark"] .toolbar-action-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="dark"] .toolbar-action-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.08) 100%) !important;
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .library-toolbar {
    padding: 1rem;
    gap: 0.75rem;
  }

  #filter-category,
  #filter-status {
    min-width: 120px;
    font-size: 0.875rem;
  }

  .view-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .library-toolbar .btn-sm {
    min-width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}
}

/* ============================================ */
/* TOOLTIP Z-INDEX FIX - GLOBAL OVERRIDE */
/* ============================================ */

/* Prevent overflow clipping of tooltips in tab content and table containers */
.tab-content {
  overflow-y: visible !important;
}

.table-container,
.survey-table-container,
.data-table-container {
  overflow-y: visible !important;
}

/* Ensure tooltips always appear on top with maximum z-index */
.tooltip-content {
  z-index: 2147483647 !important; /* Maximum possible z-index value */
}

/* Ensure table cells with tooltips maintain relative positioning */
th[data-tooltip],
td[data-tooltip] {
  position: relative !important;
}

/* Force fixed positioning for tooltips to escape overflow containers */
.tooltip-wrapper .tooltip-content,
th .tooltip-content,
td .tooltip-content,
.help-icon + .tooltip-content {
  position: fixed !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
}
