/* ============================================
   SCHEDULER & CONTACTS STYLES
   ============================================ */

/* ========== SCHEDULER CONTAINER ========== */
.scheduler-container {
  padding: 0;
  max-width: 100%;
}

/* ========== SCHEDULER HERO BANNER ========== */
.scheduler-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  min-height: 90px;
}

.scheduler-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
  pointer-events: none;
  border-radius: 16px;
}

.scheduler-hero-banner .hero-circle {
  position: absolute;
  bottom: -350px;
  left: -160px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.05);
  pointer-events: none;
}

.scheduler-hero-banner .hero-circle-2 {
  position: absolute;
  top: -460px;
  left: -300px;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.05);
  pointer-events: none;
}

.scheduler-hero-banner .hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: white;
  position: relative;
  z-index: 1;
}

.scheduler-hero-banner .hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.scheduler-hero-banner .hero-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

.scheduler-hero-banner .hero-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.scheduler-hero-banner .hero-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.scheduler-hero-banner .hero-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.scheduler-hero-banner .hero-today-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
}

.scheduler-hero-banner .hero-today-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}


/* ========== APPRENTICE BAR (Fixed at bottom) ========== */
.apprentice-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  z-index: 100;
  border-top: 1px solid #e5e7eb;
}

/* Add padding to scheduler container so content doesn't hide behind fixed bar */
.scheduler-container {
  padding-bottom: 70px;
}

.apprentice-bar-label {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.875rem;
  white-space: nowrap;
}

.apprentice-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.apprentice-tag {
  padding: 0.5rem 1rem;
  background: rgba(0, 125, 217, 0.08);
  color: #007dd9;
  border: 1.5px solid #007dd9;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: grab;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.apprentice-tag:hover {
  transform: translateY(-2px);
  background: rgba(0, 125, 217, 0.15);
}

.apprentice-tag:active {
  cursor: grabbing;
}

.apprentice-tag-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 125, 217, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  position: relative;
  color: #007dd9;
}

/* Fully scheduled apprentice tag */
.apprentice-tag.fully-scheduled {
  /* Keep original blue */
}

.apprentice-tag .fully-scheduled-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  color: white;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.apprentice-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: auto;
  white-space: nowrap;
}

/* ========== DAY CELL APPRENTICE TILE ========== */
.apprentice-day-tile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0, 125, 217, 0.08);
  color: #007dd9;
  border: 1.5px solid #007dd9;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apprentice-tile-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.apprentice-tile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.apprentice-tile-remove {
  width: 16px;
  height: 16px;
  border: none;
  background: rgba(0, 125, 217, 0.15);
  color: #007dd9;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  opacity: 0;
  margin-left: auto;
}

.apprentice-day-tile:hover .apprentice-tile-remove {
  opacity: 1;
}

.apprentice-tile-remove:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(1.1);
}

/* Timeline view - narrower positioning */
.apprentice-day-tile-timeline {
  position: absolute;
  top: 4px;
  left: 55px;
  right: 4px;
  z-index: 12;
}

/* Employee Apprentice Indicator (under name) */
.employee-apprentice-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #007dd9;
  margin-top: 2px;
}

.apprentice-week-label {
  opacity: 0.8;
}

.employee-apprentice-indicator .apprentice-remove-btn {
  width: 14px;
  height: 14px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 50%;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0;
}

.employee-cell:hover .employee-apprentice-indicator .apprentice-remove-btn {
  opacity: 1;
}

.employee-apprentice-indicator .apprentice-remove-btn:hover {
  background: #ef4444;
  color: white;
}

/* ========== SCHEDULER LAYOUT ========== */
.scheduler-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

/* ========== SIDEBAR ========== */
.scheduler-sidebar {
  width: 280px;
  min-width: 280px;
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

.scheduler-sidebar h3 {
  font-size: 1rem;
  color: #111827;
  margin-bottom: 0.75rem;
}

/* Vertical Tabs */
.sidebar-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 1rem;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
}

.sidebar-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-size: 0.85rem;
  color: #6b7280;
}

.sidebar-tab:hover {
  background: rgba(255,255,255,0.7);
  color: #374151;
}

.sidebar-tab.active {
  background: white;
  color: #2563eb;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.sidebar-tab .tab-icon {
  font-size: 1rem;
}

.sidebar-tab .tab-label {
  flex: 1;
}

.sidebar-empty {
  padding: 1rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  font-style: italic;
}

.priority-item.scheduled {
  background: #dbeafe;
  border-color: #3b82f6;
  border-style: solid;
}

.priority-item.scheduled:hover {
  background: #bfdbfe;
}

.sidebar-search {
  margin-bottom: 1rem;
}

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

.priority-item {
  padding: 0.75rem;
  background: #fef3c7;
  border: 2px dashed #f59e0b;
  border-radius: 6px;
  cursor: grab;
  transition: all 0.2s;
}

.priority-item:hover {
  background: #fde68a;
}

.priority-item:active {
  cursor: grabbing;
}

.priority-item.urgent {
  background: #fef2f2;
  border-color: #ef4444;
}

.priority-item.urgent .priority-name {
  color: #991b1b;
}

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

.priority-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-weight: 600;
}

.priority-badge.urgent {
  background: #ef4444;
  color: white;
}

.priority-badge.high {
  background: #f59e0b;
  color: white;
}

.priority-id {
  font-size: 0.625rem;
  color: #6b7280;
}

.priority-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #92400e;
  margin-bottom: 0.25rem;
}

.priority-client {
  font-size: 0.75rem;
  color: #78350f;
}

/* ========== CALENDAR ========== */
.calendar-container {
  flex: 1;
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow-x: auto;
  min-width: 0;
}

.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.zoom-controls {
  display: flex;
  gap: 0.5rem;
}

.zoom-btn {
  padding: 0.375rem 0.75rem;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.zoom-btn:hover {
  background: #e5e7eb;
}

.zoom-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.weekend-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.weekend-toggle:hover {
  background: #e5e7eb;
}

.weekend-toggle.active {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

/* ========== CALENDAR GRID ========== */
.calendar-grid {
  min-width: 900px;
}

.calendar-header {
  display: grid;
  grid-template-columns: 180px repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.calendar-header.show-weekend {
  grid-template-columns: 180px repeat(7, 1fr);
}

.calendar-header-cell {
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
}

.calendar-header-cell.today {
  background: #dbeafe;
  color: #1e40af;
  border-radius: 8px;
}

.calendar-header-cell.today .day-name,
.calendar-header-cell.today .day-date {
  color: #1e40af;
}

.day-name {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.day-date {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.125rem;
}

/* ========== EMPLOYEE ROW ========== */
.employee-row {
  display: grid;
  grid-template-columns: 180px repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.employee-row.show-weekend {
  grid-template-columns: 180px repeat(7, 1fr);
}

.employee-cell {
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 60px;
}

.employee-cell.has-apprentice {
  /* No special background - just subtle indicator */
}

.employee-cell.fully-scheduled {
  /* No special background - checkmark is enough */
}

.fully-scheduled-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #22c55e;
  color: white;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.employee-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  position: relative;
}

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

.employee-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #111827;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.employee-apprentice {
  font-size: 0.625rem;
  color: #007dd9;
  font-weight: 500;
  margin-top: 0.125rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.employee-apprentice-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.apprentice-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0095f2 0%, #007dd9 100%);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: default;
}

.apprentice-remove-btn {
  background: transparent;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0 0.25rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.apprentice-remove-btn:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 3px;
}

/* ========== DAY CELL ========== */
.day-cell {
  min-height: 100px;
  background: white;
  border: 2px dashed #e5e7eb;
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.day-cell:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.day-cell.has-assignment {
  border: 2px solid #e5e7eb;
  border-style: solid;
  cursor: default;
}

.day-cell.has-assignment:hover {
  background: white;
}

.day-cell.frozen {
  background: #f3f4f6;
  border-color: #d1d5db;
  cursor: not-allowed;
  opacity: 0.6;
}

.day-cell.frozen:hover {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.frozen-icon {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  font-size: 1rem;
}

.empty-cell-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #9ca3af;
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s;
  text-align: center;
}

.day-cell:hover .empty-cell-hint {
  opacity: 1;
}

.day-cell.has-assignment .empty-cell-hint,
.day-cell.frozen .empty-cell-hint {
  display: none;
}

/* ========== ASSIGNMENT CARD ========== */
.assignment-card {
  padding: 0.625rem;
  padding-left: 2rem;
  background: #f0fdf4;
  border-left: 3px solid #10b981;
  border-radius: 4px;
  cursor: move;
  transition: all 0.2s;
  position: relative;
}

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

/* Color variations for multiple assignments */
.assignment-card.assignment-color-1 {
  background: #ccfbf1; /* Teal light */
  border-left-color: #14b8a6;
}

.assignment-card.assignment-color-2 {
  background: #cffafe; /* Cyan light */
  border-left-color: #06b6d4;
}

.assignment-card.assignment-color-3 {
  background: #dbeafe; /* Blue light */
  border-left-color: #3b82f6;
}

/* Swap target indicator */
.assignment-card.swap-target {
  outline: 2px dashed #8b5cf6;
  outline-offset: 2px;
  background: #f5f3ff;
  transform: scale(1.02);
}

/* Conflict indicator */
.assignment-card.has-conflict {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.conflict-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.75rem;
  z-index: 5;
}

.assignment-card:hover .remove-btn {
  opacity: 1;
}

.assignment-number {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 18px;
  height: 18px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
}

.assignment-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #111827;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assignment-time {
  font-size: 0.75rem;
  color: #6b7280;
}

.assignment-card.service-call {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.assignment-card.service-call .assignment-number {
  background: #ef4444;
}

.remove-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.remove-btn:hover {
  background: #dc2626;
}

.add-assignment-btn {
  padding: 0.5rem;
  background: white;
  border: 1px dashed #d1d5db;
  border-radius: 4px;
  color: #6b7280;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-weight: 500;
}

.add-assignment-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}

/* ========== DRAG AND DROP ========== */
.drag-over {
  background: #eff6ff !important;
  border-color: #3b82f6 !important;
}

.employee-row.drag-over {
  background: linear-gradient(90deg, #dbeafe 0%, transparent 100%) !important;
  box-shadow: inset 3px 0 0 #3b82f6, inset -3px 0 0 #3b82f6;
}

/* ========== ZOOM LEVELS ========== */
/* ========== ZOOM LEVELS ========== */

/* COMPACT: Hide times, smaller cells for more users on screen */
.calendar-grid.zoom-compact .employee-cell {
  min-height: 50px;
  padding: 0.5rem;
}

.calendar-grid.zoom-compact .employee-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.65rem;
}

.calendar-grid.zoom-compact .employee-name {
  font-size: 0.75rem;
}

.calendar-grid.zoom-compact .employee-apprentice {
  font-size: 0.65rem;
}

.calendar-grid.zoom-compact .day-cell {
  min-height: 50px;
  font-size: 0.7rem;
  padding: 0.25rem;
  gap: 0.25rem;
}

.calendar-grid.zoom-compact .assignment-card {
  padding: 0.25rem 0.25rem 0.25rem 1.5rem;
}

.calendar-grid.zoom-compact .assignment-name {
  font-size: 0.7rem;
}

.calendar-grid.zoom-compact .assignment-time {
  display: none; /* Hide times in compact view */
}

.calendar-grid.zoom-compact .assignment-number {
  font-size: 0.7rem;
}

/* NORMAL: Default balanced view (no special styles needed) */

/* DETAILED: Large cells with hourly timeline view */
.calendar-grid.zoom-detailed .employee-cell {
  min-height: 80px;
  padding: 1rem;
  position: relative;
}

.calendar-grid.zoom-detailed .employee-avatar {
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
}

.calendar-grid.zoom-detailed .employee-name {
  font-size: 1rem;
}

/* Expand button for 24h view */
.employee-expand-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 1.5px solid #d1d5db;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0.7;
}

.employee-expand-btn:hover {
  opacity: 1;
  border-color: #6366f1;
  background: #eef2ff;
}

.employee-expand-btn.expanded {
  background: #312e81;
  border-color: #4f46e5;
  opacity: 1;
}

/* Expanded row - taller cells for 24h */
.employee-row.expanded-hours .day-cell-timeline {
  min-height: 900px;
}

.calendar-grid.zoom-detailed .employee-apprentice {
  font-size: 0.875rem;
}

.calendar-grid.zoom-detailed .day-cell {
  min-height: 700px; /* 14 hours * 50px per hour */
  padding: 0;
}

/* Timeline View Styles */
.day-cell-timeline {
  position: relative;
  overflow: visible;
}

.timeline-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
}

.timeline-hour {
  flex: 1;
  position: relative;
  border-bottom: 1px dotted #e5e7eb;
}

.timeline-hour:last-child {
  border-bottom: none;
}

.timeline-hour-label {
  position: absolute;
  left: 4px;
  top: 2px;
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 500;
  background: white;
  padding: 0 4px;
  z-index: 1;
}

.timeline-hour-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #e5e7eb;
}

.timeline-assignments {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.assignment-timeline {
  position: absolute;
  right: 4px;
  left: 70px; /* Space for hour labels on the left */
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-left: 4px solid #047857;
  z-index: 1; /* Base z-index */
  border-radius: 6px;
  padding: 0;
  cursor: default; /* Changed from move - only drag handle moves */
  pointer-events: all;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: none; /* Disable transition during drag */
  color: white;
  overflow: visible; /* Changed from hidden to show resize handles */
  user-select: none;
}

.assignment-timeline.service-call {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-left-color: #b91c1c;
}

/* Color variations for multiple assignments on same day */
.assignment-timeline.assignment-color-1 {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); /* Teal */
  border-left-color: #0f766e;
}

.assignment-timeline.assignment-color-2 {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); /* Cyan */
  border-left-color: #0e7490;
}

.assignment-timeline.assignment-color-3 {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); /* Lighter green */
  border-left-color: #15803d;
}

.assignment-timeline:hover {
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  z-index: 10; /* Bring to front on hover */
}

.assignment-timeline-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none; /* Allow clicks through to resize handles */
}

.assignment-timeline-content > * {
  pointer-events: auto; /* Re-enable clicks on content children */
}

.assignment-timeline-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.assignment-drag-handle {
  cursor: grab;
  font-size: 0.75rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.6);
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.2s;
  user-select: none;
}

.assignment-drag-handle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}

.assignment-drag-handle:active {
  cursor: grabbing;
}

.assignment-timeline-time {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.9;
  flex: 1;
}

.assignment-timeline-name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.assignment-timeline-end {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.8;
  margin-top: auto;
}

.assignment-timeline .remove-btn {
  position: relative; /* Changed from absolute */
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  transition: all 0.2s;
  flex-shrink: 0;
}

.assignment-timeline:hover .remove-btn {
  opacity: 1;
}

.assignment-timeline .remove-btn:hover {
  background: rgba(0,0,0,0.5);
}

.add-assignment-btn-timeline {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #3b82f6;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.add-assignment-btn-timeline:hover {
  background: #2563eb;
}

/* Resize handles */
.resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 16px; /* Larger click area */
  cursor: ns-resize;
  z-index: 15;
  opacity: 0.6; /* Slightly visible by default */
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resize-handle-top {
  top: -8px !important; /* Positioned at top of card */
  bottom: auto !important;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 100%);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.resize-handle-bottom {
  top: auto !important;
  bottom: -8px !important; /* Positioned at bottom of card */
  background: linear-gradient(0deg, rgba(0,0,0,0.3) 0%, transparent 100%);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.assignment-timeline:hover .resize-handle {
  opacity: 1;
}

.resize-handle::before {
  content: '═'; /* Double line character for better visibility */
  color: white;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  line-height: 1;
}

/* ========== CONTACTS TREE ========== */
.contacts-tree {
  width: 100%;
}

.contacts-tree-header {
  margin-bottom: 1rem;
}

.contacts-tree-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tree-category {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.tree-category-header {
  padding: 1rem;
  background: #f9fafb;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.tree-category-header:hover {
  background: #f3f4f6;
}

.category-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-icon {
  font-size: 1.25rem;
}

.category-label {
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
}

.category-count {
  font-size: 0.875rem;
  color: #6b7280;
}

.category-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-arrow {
  font-size: 0.75rem;
  color: #6b7280;
  transition: transform 0.2s;
}

.tree-category.expanded .category-arrow {
  transform: rotate(90deg);
}

.tree-category-body {
  padding: 0 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ========== SUBCATEGORIES ========== */
.tree-subcategory {
  border-left: 3px solid #e5e7eb;
  padding-left: 1rem;
}

.subcategory-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-weight: 500;
  color: #374151;
}

.subcategory-icon {
  font-size: 1rem;
}

.subcategory-label {
  font-size: 0.875rem;
}

.subcategory-count {
  font-size: 0.75rem;
  color: #9ca3af;
}

.subcategory-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ========== CONTACT CARD ========== */
.contact-card-tree {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: all 0.2s;
}

.contact-card-tree:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-color: #d1d5db;
}

.contact-card-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.contact-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
}

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

.contact-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #111827;
  margin-bottom: 0.125rem;
}

.contact-company {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.contact-details {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: #9ca3af;
  flex-wrap: wrap;
}

.contact-card-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-badges {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-right: 0.5rem;
}

.contact-badge {
  padding: 0.125rem 0.5rem;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 12px;
  font-size: 0.625rem;
  font-weight: 500;
  white-space: nowrap;
}

.contact-actions {
  display: flex;
  gap: 0.25rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.btn-icon:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* ========== BADGE MANAGEMENT ========== */
.badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  min-height: 3rem;
}

.badge-item {
  padding: 0.375rem 0.75rem;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.badge-remove {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  background: #1e40af;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.badge-remove:hover {
  background: #1e3a8a;
}

.empty-badges {
  color: #9ca3af;
  font-size: 0.875rem;
  font-style: italic;
}

.badge-input-group {
  display: flex;
  gap: 0.5rem;
}

.badge-input-group .form-input {
  flex: 1;
}

/* Custom Badge Dropdown */
.custom-badge-dropdown {
  position: relative;
  flex: 1;
}

.badge-dropdown-menu {
  position: fixed;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  max-height: 280px;
  overflow-y: auto;
  z-index: 10500;
  min-width: 200px;
}

.badge-dropdown-item {
  padding: 0.625rem 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s;
  font-size: 0.875rem;
  color: #374151;
}

.badge-dropdown-item:hover {
  background: #f3f4f6;
}

.badge-dropdown-item:active {
  background: #e5e7eb;
}

.badge-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.badge-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.badge-input {
  padding-right: 2rem;
  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: 1.25rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  font-style: italic;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 1024px) {
  .scheduler-layout {
    flex-direction: column;
  }
  
  .scheduler-sidebar {
    width: 100%;
    max-height: 300px;
  }
  
  .calendar-container {
    overflow-x: auto;
  }
  
  .apprentice-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .apprentice-hint {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .calendar-grid {
    min-width: 600px;
  }
  
  .employee-row,
  .calendar-header {
    grid-template-columns: 120px repeat(5, 1fr);
  }
  
  .employee-cell {
    padding: 0.5rem;
  }
  
  .employee-name {
    font-size: 0.75rem;
  }
  
  .day-cell {
    min-height: 80px;
    padding: 0.375rem;
  }
}
