/* ===== Dashboard Specific Styles ===== */

/* Main Section Spacing */
.analytics-section {
  margin-bottom: 4rem;
  /* Main section spacing */
}

/* Chart Containers */
.chart-container {
  margin-bottom: 3rem;
  /* Spacing between charts */
}

/* Panel Spacing */
.panel {
  margin-bottom: 3rem;
  /* Spacing between panels */
}

/* Two Column Layout */

.two-column-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  /* Increased gap between columns */
  align-items: start;
}

.charts-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.info-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Chart Containers */
.chart-container {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chart-container h3.section-title {
  font-size: 1.1rem;
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text);
  font-weight: 600;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

/* Funnel Chart Specific */
#funnelChart {
  min-height: 250px;
  margin-bottom: 3rem;
  /* Spacing below funnel */
  position: relative;
}

.funnel-stages {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  width: 100%;
}

.funnel-stage {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.funnel-stage:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.funnel-stage strong {
  color: var(--color-text);
  font-weight: 500;
}

.funnel-stage span {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Top Cities Chart */
#topCitiesChart {
  min-height: 100px;
  margin-bottom: 3rem;
  /* Spacing below top cities */
  position: left;
}

.top-cities-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  width: 100%;
}

.city-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.city-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.city-name {
  color: var(--color-text);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: var(--space-sm);
}

.city-count {
  background: var(--color-success-light);
  color: var(--color-success-dark);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chart-container {
    padding: var(--space-sm);
  }

  #funnelChart,
  #topCitiesChart {
    min-height: 100px;
  }

  .funnel-stage,
  .city-item {
    padding: var(--space-xxs) var(--space-xs);
    font-size: 0.9rem;
  }
}

/* Empty state styling */
.empty-state {
  color: var(--color-text-light);
  font-style: italic;
  text-align: center;
  padding: var(--space-md) 0;
  font-size: 0.9rem;
}

/* Header Styles */
.app-header {
  background: var(--color-bg-light);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
}

.app-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Main Content Layout */
.dashboard-main {
  padding: var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
}

/* Filter Section */
.filter-section {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light);
}

.filter-group input,
.filter-group select {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: var(--color-bg);
  transition: all 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.action-buttons-left,
.action-buttons-right {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* KPI Grid */
.kpi-section {
  margin-bottom: var(--space-lg);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.kpi-tile {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.kpi-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.kpi-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.kpi-icon {
  font-size: 1.25rem;
  opacity: 0.7;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  line-height: 1;
}

.kpi-change {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
}

.kpi-change.positive {
  color: var(--color-success);
}

.kpi-change.negative {
  color: var(--color-danger);
}

.kpi-change.neutral {
  color: var(--color-text-light);
}

.kpi-sparkline {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 80px;
  height: 40px;
  opacity: 0.6;
}

/* Analytics Section */
.analytics-section {
  margin-bottom: 4rem;
}

.two-column-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

/* Chart Containers */
.chart-container {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.chart-container:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chart-wrapper {
  position: relative;
  height: 300px;
}

.chart-wrapper canvas {
  max-width: 100%;
}

/* Enhanced Top Cities list under the chart */
.top-cities-list {
  margin-top: var(--space-sm);
  display: grid;
  gap: 8px;
}

.city-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.city-item .city-name {
  font-weight: 600;
  color: var(--color-text);
}

.city-item .city-count {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-light);
}

/* Enhanced Funnel stage labels under the chart */
.funnel-stages {
  margin-top: var(--space-sm);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.funnel-stage {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.funnel-stage strong {
  color: var(--color-text);
}

.funnel-stage span {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-light);
}

/* Panels */
.panel {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.panel:last-child {
  margin-bottom: 0;
}

.alert-count,
.followup-count {
  background: var(--color-danger);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.followup-count {
  background: var(--color-warning);
}

.alerts-container,
.followups-container {
  max-height: 400px;
  overflow-y: auto;
}

.alert-item,
.followup-item {
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border-left: 4px solid transparent;
  background: var(--color-bg);
}

.alert-item:last-child,
.followup-item:last-child {
  margin-bottom: 0;
}

.alert-item.high {
  border-left-color: var(--color-danger);
  background: rgba(239, 68, 68, 0.05);
}

.alert-item.medium {
  border-left-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.05);
}

.alert-item.low {
  border-left-color: var(--color-info);
  background: rgba(59, 130, 246, 0.05);
}

.followup-item {
  border-left-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.05);
}

.alert-header,
.followup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-xs);
}

.alert-title,
.followup-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0;
}

.alert-time,
.followup-time {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.alert-message,
.followup-message {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: var(--space-lg);
  color: var(--color-text-light);
  font-style: italic;
}

/* Table Section */
.table-section {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-md);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.table-actions {
  display: flex;
  gap: var(--space-sm);
}

#table-search {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  min-width: 250px;
}

.table-responsive {
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--color-bg);
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

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

/* Recent Leads table styling */
.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.leads-table thead th {
  background: var(--color-bg);
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.leads-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.leads-table tbody tr:hover {
  background: var(--color-bg);
}

.leads-table .text-center {
  text-align: center;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: var(--color-bg);
}

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-new {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

.status-contacted {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.status-qualified {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.status-proposal {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.status-negotiation {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.status-won {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.status-lost {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

/* Priority Badges */
.priority-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.priority-hot {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.priority-warm {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.priority-cold {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: var(--space-xs);
}

.btn-icon {
  padding: 0.5rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text-light);
}

.btn-icon:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-icon.assign:hover {
  color: var(--color-primary);
}

.btn-icon.schedule:hover {
  color: var(--color-warning);
}

.btn-icon.view:hover {
  color: var(--color-info);
}

/* Pagination */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

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

/* Alerts Panel */
.alerts-panel {
  margin-top: 4rem;
  /* Space above alerts */
}

/* Recent Leads Section */
#recent-leads-widget {
  margin-top: 4rem;
  /* Space above recent leads */
  margin-bottom: 2rem;
  /* Space below recent leads */
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1001;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

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

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

.modal-title {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

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

.modal-body {
  padding: var(--space-md);
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 400px;
}

.toast {
  background: var(--color-bg-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: toastSlideIn 0.3s ease-out;
  border-left: 4px solid var(--color-primary);
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.error {
  border-left-color: var(--color-danger);
}

.toast.warning {
  border-left-color: var(--color-warning);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

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

/* Skeleton Loader */
.skeleton-row td {
  padding: 0.75rem 1rem;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.5rem 0.75rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .two-column-layout {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-main {
    padding: var(--space-md);
  }

  .header-container {
    padding: var(--space-sm);
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .action-buttons-left,
  .action-buttons-right {
    justify-content: stretch;
  }

  .action-buttons-left .btn,
  .action-buttons-right .btn {
    flex: 1;
    min-width: 0;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .table-actions {
    justify-content: stretch;
  }

  #table-search {
    min-width: 0;
    flex: 1;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .filters-collapsible {
    display: none;
  }

  .filters-collapsible.active {
    display: grid;
  }

  .toast-container {
    right: var(--space-sm);
    left: var(--space-sm);
    max-width: none;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-value {
    font-size: 1.75rem;
  }

  .pagination-controls {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .data-table {
    font-size: 0.75rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem 0.75rem;
  }
}

/* Print Styles */
@media print {

  .app-header,
  .filter-section,
  .action-row,
  .table-actions,
  .pagination-controls {
    display: none;
  }

  .dashboard-main {
    padding: 0;
  }

  .kpi-tile,
  .chart-container,
  .panel,
  .table-section {
    box-shadow: none;
    border: 1px solid var(--color-border);
    break-inside: avoid;
  }
}

/* ===== Sidebar Styles ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background: var(--color-bg-light);
  border-right: 1px solid var(--color-border);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-primary);
  color: white;
}

.sidebar-logo {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-logo {
  display: none;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.875rem var(--space-md);
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.nav-link.active {
  background: rgba(79, 70, 229, 0.1);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
}

.nav-link i {
  width: 20px;
  margin-right: var(--space-sm);
  font-size: 1rem;
  text-align: center;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
}

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

.sidebar.collapsed .user-details {
  display: none;
}

/* Main Wrapper */
.main-wrapper {
  margin-left: 250px;
  transition: margin-left 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-wrapper.sidebar-collapsed {
  margin-left: 60px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 250px;
  }

  .sidebar.collapsed {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .mobile-toggle {
    display: inline-flex !important;
  }

  .sidebar-header {
    justify-content: center;
  }

  .sidebar.collapsed .sidebar-toggle {
    display: none;
  }
}

/* Ensure content doesn't get hidden behind sidebar */
@media (min-width: 769px) {
  .sidebar.collapsed~.main-wrapper {
    margin-left: 60px;
  }
}

/* Assigned Users Section */
.assigned-users-section {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
}

.assigned-users-section .section-header {
  margin-bottom: var(--space-sm);
}

.assigned-users-section .section-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.users-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-sm);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-meta .user-name {
  font-weight: 600;
  color: var(--color-text);
}

.user-meta .user-sub {
  font-size: 0.8rem;
  color: var(--color-text-light);
}