#calendar table {
  table-layout: fixed;
  width: 100%;
}
.timesheet-cell {
  min-width: 20px;
  min-height: 20px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.first-column {
  width: 18em; /* Adjust as needed */
  min-width: 20em;
  font-weight: bold;
}
.allocation-row, .project-row {
  border-bottom: 1px solid #dee2e6;
}
.cell-filled {
  background-color: #e0f0ff;
  font-weight: bold;
}
.header-cell {
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
#calendar .bg-light.text-muted {
  background-color: #f8f9fa !important;
  color: #adb5bd !important;
}
.timesheet-cell {
  cursor: pointer;
  background-color: white;
  border: 1px solid #dee2e6;
}
#calendar .weekend-day.weekend-row,
#calendar .national-holiday {
  cursor: not-allowed;
}
.cell-filled {
  background-color: #e0f0ff !important;
  color: #000 !important;
}

/* Capacity warning styles */
.capacity-warning {
  background-color: #fff3cd !important;
  border-left: 4px solid #ffc107 !important;
}

.capacity-warning.cell-filled {
  background-color: #ffeaa7 !important;
}

.weekend-day,
.weekend-trace-marker,
.national-holiday,
.before-project,
.after-project {
  background-color: #f8f9fa !important;
  color: #888 !important;
  cursor: not-allowed;
}
.blocked-day {
  background-color: #ffcccc !important; /* Light red for blocked days */
  opacity: 0.7; /* Slight transparency */
}
.blocked-tag {
  color: #d9534f; /* Bootstrap's danger red */
  font-weight: bold;
  font-size: 0.85em;
}
.today-header {
  background-color: #e9f5ff !important;
  border-bottom: 2px solid #0d6efd !important;
}
.today-cell {
  position: relative;
  background: none !important;
}
.today-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: orange;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}
.today-cell > * {
  position: relative;
  z-index: 1;
}

/* Add to your CSS (e.g., application.scss) */
.col-lg-2-5 {
  flex: 0 0 auto;
  width: 13.5%;
}

.col-lg-10-5 {
    flex: 0 0 auto;
    width: 86.5%;
}

.weekend-trace {
  opacity: 0.2;
  pointer-events: none;
  min-width: 8px;
  max-width: 8px;
  width: 8px;
}

/* Enhanced Button Groups */
.btn-group .dropdown-toggle {
  border-radius: 0.375rem !important;
}

.btn-group .dropdown-menu {
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-group .dropdown-item {
  transition: all 0.2s ease;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
}

.btn-group .dropdown-item:hover {
  background-color: #f8f9fa;
}

.btn-group .dropdown-item.active {
  background-color: #0d6efd;
  color: white;
}

/* Enhanced dropdown styling */
.dropdown-menu {
  min-width: 200px;
  padding: 0.5rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: #212529;
}

.dropdown-item.active {
  background-color: #0d6efd;
  color: white;
}

/* Yearly Overview Styles */
.yearly-overview-card {
  transition: all 0.3s ease;
  cursor: default;
}

.monthly-grid {
  min-height: 140px;
}

.mini-calendar {
  font-size: 0.8em;
}

.calendar-day {
  border-radius: 2px;
  border: 1px solid transparent; /* Invisible border for consistent spacing */
  transition: all 0.3s ease;
  cursor: default;
  position: relative;
}

.calendar-day:hover {
  background-color: rgba(0, 123, 255, 0.05) !important;
}

/* Calendar day allocation indicators */
.calendar-day.allocation-high {
  background-color: rgba(25, 135, 84, 0.8) !important; /* Green - 75-100% */
  border: 1px solid rgba(25, 135, 84, 0.9);
  color: white !important;
}

.calendar-day.allocation-medium {
  background-color: rgba(255, 193, 7, 0.7) !important; /* Yellow - 50-75% */
  border: 1px solid rgba(255, 193, 7, 0.8);
  color: #000 !important;
}

.calendar-day.allocation-low {
  background-color: rgba(255, 133, 27, 0.7) !important; /* Orange - 25-50% */
  border: 1px solid rgba(255, 133, 27, 0.8);
  color: white !important;
}

.calendar-day.allocation-critical {
  background-color: rgba(220, 53, 69, 0.8) !important; /* Red - 0-25% */
  border: 1px solid rgba(220, 53, 69, 0.9);
  color: white !important;
}

/* National holidays in mini-calendar */
.calendar-day.national-holiday {
  background-color: rgba(108, 117, 125, 0.3) !important; /* Light gray background */
  border: 1px solid rgba(108, 117, 125, 0.6) !important;
  color: #495057 !important;
  font-weight: 500 !important;
  position: relative;
}

/* Today with allocation indicators */
.calendar-day.bg-primary.allocation-high,
.calendar-day.bg-primary.allocation-medium,
.calendar-day.bg-primary.allocation-low,
.calendar-day.bg-primary.allocation-critical {
  border: 1px solid #fff;
  box-shadow: 0 0 0 2px #0d6efd;
}

/* Stats styling with tooltips */
.stat-item {
  padding: 2px;
  cursor: help;
  transition: transform 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-1px);
}

.stat-number {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  transition: all 0.3s ease;
}

/* Yearly overview cards */
.yearly-overview-card {
  transition: all 0.3s ease;
  cursor: default;
  border-radius: 8px;
}

.weekday-header {
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Loading animations */
.yearly-overview-card {
  opacity: 1;
}

/* Stagger the animation for each card */
.col-lg-3:nth-child(1) .yearly-overview-card { animation-delay: 0.1s; }
.col-lg-3:nth-child(2) .yearly-overview-card { animation-delay: 0.2s; }
.col-lg-3:nth-child(3) .yearly-overview-card { animation-delay: 0.3s; }
.col-lg-3:nth-child(4) .yearly-overview-card { animation-delay: 0.4s; }
.col-lg-3:nth-child(5) .yearly-overview-card { animation-delay: 0.5s; }
.col-lg-3:nth-child(6) .yearly-overview-card { animation-delay: 0.6s; }
.col-lg-3:nth-child(7) .yearly-overview-card { animation-delay: 0.7s; }
.col-lg-3:nth-child(8) .yearly-overview-card { animation-delay: 0.8s; }
.col-lg-3:nth-child(9) .yearly-overview-card { animation-delay: 0.9s; }
.col-lg-3:nth-child(10) .yearly-overview-card { animation-delay: 1.0s; }
.col-lg-3:nth-child(11) .yearly-overview-card { animation-delay: 1.1s; }
.col-lg-3:nth-child(12) .yearly-overview-card { animation-delay: 1.2s; }


@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .monthly-grid {
    min-height: 120px;
  }
  
  .mini-calendar {
    font-size: 0.7em;
  }
  
  .calendar-day {
    min-height: 18px;
  }
  
  .project-indicator {
    width: 3px;
    height: 3px;
  }
  
  .yearly-overview-card {
    margin-bottom: 15px;
  }
}

/* Enhanced stats styling */
.stat-item {
  transition: transform 0.2s ease;
}

.stat-number {
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Responsive improvements */
@media (max-width: 576px) {
  .yearly-overview-card {
    margin-bottom: 20px;
  }
  
  .stat-number {
    font-size: 0.8em !important;
  }
  
  .stat-label {
    font-size: 0.6em !important;
  }
}

/* Today highlight in yearly view */
.yearly-overview-card .bg-primary {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

/* Better spacing for button groups */
.btn-group + .btn-group {
  margin-left: 0.5rem;
}

/* Responsive improvements */
@media (max-width: 991.98px) {
  #allocationControls {
    margin-top: 1rem;
  }
  
  #allocationControls .btn-group {
    margin-bottom: 0.5rem;
  }
}

/* Loading states */
.btn-group .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Focus states for accessibility */
.dropdown-item:focus {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
  background-color: #e9ecef;
}

.btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Hide reserved allocations when filter is active */
body.hide-reserved-allocations .allocation[data-status="reserved"],
body.hide-reserved-allocations .allocation-block[data-status="reserved"],
body.hide-reserved-allocations a.allocation[data-status="reserved"],
body.hide-reserved-allocations a.allocation-block[data-status="reserved"],
body.hide-reserved-allocations .allocation.allocation-block[data-status="reserved"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Update hour display when hiding reserved allocations */
body.hide-reserved-allocations .allocation-hours-display .total-hours-normal {
  display: none !important;
}

body.hide-reserved-allocations .allocation-hours-display .total-hours-filtered {
  display: inline !important;
}

/* Show/hide overbooked warnings based on reserved visibility */
/* This section is now handled in allocation_overbooked.css */

/* Hide warning icon when only overbooked due to reserved allocations */
/* This section is now handled in allocation_overbooked.css */

/* Apply red background only when overbooked with non-reserved allocations */
/* This section is now handled in allocation_overbooked.css */

/* Remove background styling from reserved days in yearly view */
.hide-reserved-allocations .calendar-day[data-purely-reserved="true"].allocation-high,
.hide-reserved-allocations .calendar-day[data-purely-reserved="true"].allocation-medium,
.hide-reserved-allocations .calendar-day[data-purely-reserved="true"].allocation-low,
.hide-reserved-allocations .calendar-day[data-purely-reserved="true"].allocation-critical {
  background-color: transparent !important;
  border: none !important;
  color: inherit !important;
}