/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* App Footer */
.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

@media (min-width: 768px) {
  /* Offset footer content by sidebar width on desktop */
  .app-footer {
    padding-left: calc(16px + 4rem);
  }
}

.app-footer .left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-footer img.netcore-logo {
  height: 36px;
  width: auto;
  display: block;
}

.app-footer .right {
  color: #6b7280; /* gray-500 */
  font-size: 12px;
}

/* Sidebar Styles */
.sidebar {
  width: 4rem; /* 64px */
  z-index: 50;
  transition: transform 0.3s ease;
}

/* Sidebar tooltips */
.sidebar .sidebar-tooltip {
  position: absolute;
  left: 4.5rem; /* slightly right of the sidebar */
  top: 50%;
  transform: translateY(-50%);
  background: rgba(17, 24, 39, 0.95); /* gray-900 */
  color: #fff;
  font-size: 0.75rem; /* text-xs */
  line-height: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem; /* rounded-md */
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sidebar .sidebar-tooltip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent rgba(17, 24, 39, 0.95) transparent transparent;
}

.sidebar .group:hover .sidebar-tooltip {
  opacity: 1;
}

/* Sidebar beta (or other) badge on nav items */
.sidebar .sidebar-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1px 4px;
  border-radius: 3px;
  background: #f59e0b; /* amber-500 */
  color: #000;
  line-height: 1.2;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
}

/* Main Content Offset */
.main-offset {
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

@media (min-width: 768px) {
  .main-offset {
    margin-left: 4rem; /* 64px */
  }
}

/* Multi-select styling */
select[multiple] {
  background-image: none !important;
  padding-right: 2.5rem;
}

select[multiple]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select[multiple] option {
  padding: 0.5rem;
  cursor: pointer;
}

select[multiple] option:checked {
  background-color: #3b82f6;
  color: white;
}

select[multiple] option:hover {
  background-color: #f3f4f6;
}

select[multiple] option:checked:hover {
  background-color: #2563eb;
}

/* Ensure main content adjusts properly */
main {
  transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
  main {
    margin-left: 0 !important;
  }
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  backdrop-filter: blur(8px);
}

/* Card Hover Effects */
.card-hover {
  transition: all 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background-color: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

.btn-primary:hover {
  background-color: #4338ca;
  border-color: #4338ca;
}

.btn-ghost {
  background-color: transparent;
  color: #6b7280;
  border-color: #d1d5db;
}

.btn-ghost:hover {
  background-color: #f9fafb;
  color: #374151;
}

/* Input Styles */
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Filter Bar Elements - Compact and Fixed Size */
.filter-bar-input,
.filter-bar-select,
.filter-bar-button {
  min-height: 32px !important;
  height: 32px !important;
  max-height: 32px !important;
  padding: 0.375rem 0.625rem !important;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.8125rem !important;
  line-height: 1.25 !important;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.filter-bar-input {
  padding: 0.375rem 0.625rem !important;
}

.filter-bar-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  padding-right: 2rem !important;
  cursor: pointer;
}

.filter-bar-button {
  padding: 0.375rem 0.75rem !important;
  white-space: nowrap;
  gap: 0.375rem;
  cursor: pointer;
  font-weight: 500;
}

.filter-bar-button svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.filter-bar-button span {
  line-height: 1.25;
  display: inline-block;
}

.filter-bar-input:focus,
.filter-bar-select:focus,
.filter-bar-button:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Chip Styles */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.chip-green {
  background-color: #dcfce7;
  color: #166534;
}

.chip-amber {
  background-color: #fef3c7;
  color: #92400e;
}

.chip-gray {
  background-color: #f3f4f6;
  color: #374151;
}

.chip-red {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Toast Styles */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
  padding: 1rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 500;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background-color: #10b981;
}

.toast.error {
  background-color: #ef4444;
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

/* Table Styles */
.table-container {
  overflow-x: auto;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container th {
  background-color: #f9fafb;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.table-container td {
  padding: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.table-container tr:hover {
  background-color: #f9fafb;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: block;
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* Responsive Grid */
.responsive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .responsive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .responsive-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 300px;
}

@media (min-width: 768px) {
  .chart-container {
    height: 400px;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Focus States */
.focus-visible:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Gauge Animation */
.gauge-progress {
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-linecap: round;
  filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

/* Enhanced Card Hover Effects */
.card-hover {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Button Styles */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

/* Table Enhancements */
.table-container table {
  border-spacing: 0;
}

.table-container th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f9fafb;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table-container tr:nth-child(even) {
  background-color: #f8fafc;
}

.table-container tr:hover {
  background-color: #f1f5f9;
  transition: all 0.2s ease;
}

/* Modern Table Styling */
table {
  border-collapse: collapse;
}

tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: #f8fafc;
}

tbody td {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Projects page table polish */
#tableContainer.projects-table-wrap {
  border-top: 1px solid #e5e7eb;
}

#projectsTable.projects-table {
  border-collapse: separate;
  border-spacing: 0;
}

#projectsTable thead th {
  position: sticky;
  top: 0;
  z-index: 12;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
  white-space: nowrap;
}

#projectsTable tbody td {
  vertical-align: middle;
  border-bottom: 1px solid #eef2f7;
}

#projectsTable tbody tr:hover td {
  background-color: #f9fafb;
}

#projectsTable .editable-account-name {
  max-width: 220px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Filter Bar Enhancements */
.filter-bar {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.filter-bar select {
  transition: all 0.2s ease;
}

.filter-bar select:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Chart Container Enhancements */
.chart-container {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 0.75rem;
  overflow: hidden;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* Metric Card Enhancements */
.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth Transitions */
* {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Enhanced Focus States */
.focus-visible:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Custom Scrollbar for Tables */
.table-container::-webkit-scrollbar {
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #cbd5e1, #94a3b8);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #94a3b8, #64748b);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .card-hover:hover {
    transform: none;
  }
  
  .table-container tr:hover {
    transform: none;
  }
}

/* Dashboard Card Scrollable Tables - Fixed height matching Project Status card */
.dashboard-table-card {
  display: flex;
  flex-direction: column;
  height: 280px;
  overflow: hidden;
}

.dashboard-table-card .table-content-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.dashboard-table-card .table-content-wrapper::-webkit-scrollbar {
  width: 6px;
}

.dashboard-table-card .table-content-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.dashboard-table-card .table-content-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.dashboard-table-card .table-content-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sticky table headers for scrollable cards */
.dashboard-table-card table thead {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.dashboard-table-card table thead th {
  background: white;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* Professional Dashboard Enhancements */
.dashboard-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.dashboard-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.metric-value {
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 2.25rem;
  color: #111827;
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.metric-description {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* Status Indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-right: 0.25rem;
}

.status-dot.green {
  background-color: #10b981;
}

.status-dot.yellow {
  background-color: #f59e0b;
}

.status-dot.gray {
  background-color: #6b7280;
}

/* Chart Container Enhancements */
.chart-container {
  position: relative;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.chart-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 1.5rem;
}

.chart-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

/* Brand Colors */
.bg-brand-600 {
  background-color: #2563eb;
}

.hover\:bg-brand-700:hover {
  background-color: #1d4ed8;
}

.focus\:ring-brand-500:focus {
  --tw-ring-color: #3b82f6;
}

.focus\:border-brand-500:focus {
  border-color: #3b82f6;
}

/* Task Status Select Dropdown - Fixed Width */
.task-status-select {
  min-width: 150px;
  width: 150px;
}

/* Print Styles */
@media print {
  .card-hover {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }
  
  .btn {
    display: none;
  }
}

/* Auth Check - Hide content until authenticated */
body.auth-checking aside,
body.auth-checking main,
body.auth-checking .mobile-menu-toggle {
  display: none !important;
}

body.auth-checking aside.show,
body.auth-checking main.show,
body.auth-checking .mobile-menu-toggle.show {
  display: flex !important;
}

/* Loading spinner for auth check */
.auth-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-loading.hidden {
  display: none;
}

.auth-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Prevent flashing when navUsers hidden class is removed */
.sidebar #navUsers,
.sidebar #navUsers *,
.sidebar #navUsers.hidden,
.sidebar #navUsers.hidden * {
  transition: none !important;
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -o-transition: none !important;
  animation: none !important;
  -webkit-animation: none !important;
}

/* Advanced Filter Side Pane */
.filter-pane {
  max-width: 28rem; /* 448px */
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.filter-pane.open {
  transform: translateX(0);
}

.filter-pane-header {
  position: relative;
  backdrop-filter: blur(8px);
}

.filter-pane-footer {
  position: relative;
  backdrop-filter: blur(8px);
}

#filterPaneOverlay.show {
  display: block;
  opacity: 1;
}

#filterPaneOverlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Modern Filter Rule Cards */
.filter-rule {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(to bottom, #ffffff, #fafafa);
  border-radius: 0.75rem;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.filter-rule::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.filter-rule:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.filter-rule:hover::before {
  opacity: 1;
}

.filter-rule .filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-rule .filter-label::before {
  content: '';
  width: 4px;
  height: 4px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-radius: 50%;
}

.filter-rule-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-rule .filter-field-select,
.filter-rule .filter-operator-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
  height: 2.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-rule .filter-field-select:hover,
.filter-rule .filter-operator-select:hover {
  border-color: #a855f7;
}

.filter-rule .filter-field-select:focus,
.filter-rule .filter-operator-select:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.filter-rule .filter-value-input,
.filter-rule .filter-value-select:not([multiple]) {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
  height: 2.75rem;
  transition: all 0.2s ease;
}

.filter-rule .filter-value-input:hover,
.filter-rule .filter-value-select:not([multiple]):hover {
  border-color: #a855f7;
}

.filter-rule .filter-value-input:focus,
.filter-rule .filter-value-select:not([multiple]):focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.filter-rule .filter-value-container {
  width: 100%;
  display: flex;
  align-items: center;
}

.filter-rule .filter-value-container:empty {
  min-height: 2.75rem;
  border: 1.5px dashed #e5e7eb;
  border-radius: 0.5rem;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-rule .filter-value-container:empty::after {
  content: 'Select value...';
  color: #9ca3af;
  font-size: 0.875rem;
}

.filter-rule .filter-value-select[multiple] {
  min-height: 120px;
  padding: 0.75rem;
  width: 100%;
  flex: 1 1 0;
  min-width: 0;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  background: white;
  transition: all 0.2s ease;
}

.filter-rule .filter-value-select[multiple]:hover {
  border-color: #a855f7;
}

.filter-rule .filter-value-select[multiple]:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.filter-rule .filter-remove-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #9ca3af;
  background: #f3f4f6;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.filter-rule .filter-remove-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: scale(1.05);
}

.filter-rule .filter-remove-btn:active {
  transform: scale(0.95);
}

/* Filter Add Buttons */
.filter-add-btn {
  position: relative;
  overflow: hidden;
}

.filter-add-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.1), transparent);
  transition: left 0.5s ease;
}

.filter-add-btn:hover::before {
  left: 100%;
}

/* Scrollbar for filter pane */
.filter-pane > div:first-of-type + div::-webkit-scrollbar {
  width: 6px;
}

.filter-pane > div:first-of-type + div::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.filter-pane > div:first-of-type + div::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a855f7, #ec4899);
  border-radius: 3px;
}

.filter-pane > div:first-of-type + div::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9333ea, #db2777);
}

/* Filter Groups */
.filter-group {
  padding: 1rem;
  background: linear-gradient(to bottom, #f8fafc, #ffffff);
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.filter-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  opacity: 0.6;
}

.filter-group:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid #e2e8f0;
}

.filter-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group-label::before {
  content: '';
  width: 4px;
  height: 4px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-radius: 50%;
}

.filter-group-logic {
  padding: 0.375rem 0.75rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: white;
  color: #4f46e5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-group-logic:hover {
  border-color: #a855f7;
  background: #f3f4f6;
}

.filter-group-logic:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.filter-group-remove-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #9ca3af;
  background: #f3f4f6;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.filter-group-remove-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: scale(1.05);
}

.filter-group-remove-btn:active {
  transform: scale(0.95);
}

.filter-group-rules {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.filter-group-add-rule-btn {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: white;
  border: 1.5px dashed #cbd5e1;
  border-radius: 0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.filter-group-add-rule-btn:hover {
  border-color: #a855f7;
  background: #faf5ff;
  color: #7c3aed;
}

.filter-group-add-rule-btn:active {
  transform: scale(0.98);
}

/* Filter rules inside groups have slightly different styling */
.filter-group .filter-rule {
  background: white;
  border: 1.5px solid #e5e7eb;
  margin: 0;
}

.filter-group .filter-rule:hover {
  border-color: #cbd5e1;
}

@media (max-width: 640px) {
  .filter-pane {
    width: 100%;
    max-width: 100%;
  }
}

/* Freeze Column and Row Styles */
#tableContainer.freeze-enabled {
  position: relative;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  overflow-x: auto;
}

/* Freeze header row (all header cells stick to top) */
#tableContainer.freeze-enabled thead th {
  position: sticky;
  top: 0;
  background-color: #f9fafb !important;
  z-index: 20;
}

/* Freeze first column (header and data cells stick to left) */
#tableContainer.freeze-enabled .freeze-column-header,
#tableContainer.freeze-enabled .freeze-column {
  position: sticky;
  left: 0;
  z-index: 21;
  background-color: #f9fafb;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

/* First column header cell - frozen at both top AND left (corner) */
#tableContainer.freeze-enabled thead .freeze-column-header {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 30;
  background-color: #f9fafb;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* First column data cells - frozen at left only */
#tableContainer.freeze-enabled tbody .freeze-column {
  background-color: white;
  z-index: 10;
}

/* Hover effect for frozen column */
#tableContainer.freeze-enabled tbody tr:hover .freeze-column {
  background-color: #f8fafc;
}

#freezeToggleBtn.active {
  background-color: #eef2ff;
  color: #4f46e5;
  border-color: #4f46e5;
}

#freezeToggleBtn.active svg {
  color: #4f46e5;
}

/* Collapsible sub-products in project overview */
.subproduct-header {
  user-select: none;
}

.subproduct-chevron {
  flex-shrink: 0;
}

/* What's New Page Styles */
#updatesContainer .bg-white,
#manualContainer .bg-white {
  animation: fadeInUp 0.3s ease-out;
}

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

/* Prose styles for user manual */
.prose ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.prose ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.prose li {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

/* Image placeholder styles for user manual */
.manual-image-placeholder {
  width: 100%;
  max-width: 800px;
  height: 400px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  color: #6b7280;
  font-size: 0.875rem;
  text-align: center;
  padding: 2rem;
}

/* Code block styles */
code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
}

/* Enhanced manual section styling */
#manualContainer .bg-white {
  position: relative;
  transition: all 0.3s ease;
}

#manualContainer .bg-white:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#manualContainer .bg-white h3 {
  color: #111827;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
}

#manualContainer .bg-white h4 {
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  padding-left: 0.5rem;
  border-left: 4px solid #4f46e5;
}

#manualContainer .bg-white h5 {
  color: #374151;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Step numbering enhancement */
#manualContainer ol {
  counter-reset: step-counter;
  padding-left: 0;
}

#manualContainer ol li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 2rem;
  padding-bottom: 0.5rem;
  line-height: 1.6;
}

#manualContainer ol li::marker {
  font-weight: 700;
  color: #4f46e5;
  font-size: 1.1em;
}

/* Better list styling */
#manualContainer ul {
  padding-left: 1.5rem;
}

#manualContainer ul li {
  padding-bottom: 0.25rem;
  line-height: 1.6;
}

/* Enhanced callout boxes */
#manualContainer .bg-blue-50,
#manualContainer .bg-yellow-50,
#manualContainer .bg-green-50,
#manualContainer .bg-red-50 {
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Better spacing for sections */
#manualContainer .bg-white > div {
  margin-bottom: 1rem;
}

/* Improved code blocks */
#manualContainer code {
  background-color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-family: 'Courier New', 'Monaco', monospace;
  font-size: 0.875em;
  border: 1px solid #e5e7eb;
}

/* Better gray boxes */
#manualContainer .bg-gray-50 {
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin: 1rem 0;
  border: 1px solid #e5e7eb;
}

/* Improved image placeholder styling */
#manualContainer .bg-blue-50 p {
  margin: 0;
  line-height: 1.5;
}

/* Better visual hierarchy */
#manualContainer .bg-white p {
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

/* Enhanced nested lists */
#manualContainer ul ul,
#manualContainer ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Better spacing for nested content */
#manualContainer .ml-4,
#manualContainer .ml-6 {
  margin-top: 0.5rem;
}

/* Bell Icon with Rings Animation */
.bell-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  pointer-events: none;
}

.bell-rings .ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.group:hover .bell-rings .ring {
  opacity: 1;
  animation: ring-pulse 2s ease-out infinite;
}

.bell-rings .ring-1 {
  animation-delay: 0s;
}

.bell-rings .ring-2 {
  animation-delay: 0.4s;
}

.bell-rings .ring-3 {
  animation-delay: 0.8s;
}

@keyframes ring-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.4;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

/* AI Copilot report – email-ready display and copy */
.copilot-report-container table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0 1em;
  font-size: 0.875rem;
}
.copilot-report-container th,
.copilot-report-container td {
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  text-align: left;
}
.copilot-report-container th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
}
.copilot-report-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25em 0 0.5em;
  color: #111827;
}
.copilot-report-container h3:first-child {
  margin-top: 0;
}
.copilot-report-container ul {
  margin: 0.5em 0 1em;
  padding-left: 1.5em;
}
.copilot-report-container li {
  margin: 0.25em 0;
}
.copilot-report-container p {
  margin: 0.5em 0;
}