/* Trail Projects - Shared styles for public browser and admin */

:root {
  --tcr-accent: #059669;
  --tcr-accent-hover: #047857;
  --tcr-border: #e5e7eb;
  --tcr-shadow: 0 6px 20px rgba(0,0,0,.06);
  --tcr-radius: 12px;
  --tcr-gap: 14px;
}

/* Admin notice on public page */
.tcr-admin-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--tcr-radius);
  color: #92400e;
  font-size: 14px;
  font-weight: 500;
}

.tcr-admin-notice a {
  color: #059669;
  font-weight: 700;
  text-decoration: none;
}

.tcr-admin-notice a:hover {
  text-decoration: underline;
}

/* ============================================================================
   PUBLIC PROJECT BROWSER
   ============================================================================ */

.tcr-projects {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tcr-projects-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f9fafb;
  border-radius: var(--tcr-radius);
  border: 1px solid var(--tcr-border);
}

.tcr-projects-filters select {
  padding: 10px 14px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.tcr-projects-filters select:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

#tcr-proj-apply {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--tcr-accent) 0%, var(--tcr-accent-hover) 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(5,150,105,.25);
}

#tcr-proj-apply:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5,150,105,.35);
}

/* Project Cards Grid */
.tcr-projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.tcr-project-card {
  border: 1px solid var(--tcr-border);
  border-radius: var(--tcr-radius);
  box-shadow: var(--tcr-shadow);
  background: #fff;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.tcr-project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

.tcr-project-cover {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #f3f4f6;
}

.tcr-project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.tcr-project-card:hover .tcr-project-cover img {
  transform: scale(1.05);
}

.tcr-project-header {
  padding: 16px;
  border-bottom: 1px solid var(--tcr-border);
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
}

.tcr-project-title {
  font-weight: 700;
  font-size: 18px;
  color: #1f2937;
  letter-spacing: -0.3px;
  margin: 0 0 6px 0;
}

.tcr-project-trail {
  font-size: 14px;
  color: #059669;
  font-weight: 600;
}

.tcr-project-manager {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}

.tcr-project-body {
  padding: 16px;
}

.tcr-project-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.tcr-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
}

.tcr-stat-icon {
  font-size: 16px;
}

.tcr-stat-label {
  color: #6b7280;
}

/* Progress bar */
.tcr-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.tcr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tcr-accent) 0%, #10b981 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.tcr-progress-text {
  font-size: 13px;
  color: #6b7280;
  text-align: right;
}

/* Status badges */
.tcr-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tcr-status-planning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.tcr-status-active {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.tcr-status-completed {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.tcr-status-cancelled {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Card footer actions */
.tcr-project-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--tcr-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.tcr-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tcr-btn-primary {
  background: var(--tcr-accent);
  color: #fff;
  border: none;
}

.tcr-btn-primary:hover {
  background: var(--tcr-accent-hover);
  transform: translateY(-1px);
}

.tcr-btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid var(--tcr-border);
}

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

.tcr-btn-danger {
  background: #fff;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.tcr-btn-danger:hover {
  background: #fef2f2;
}

.tcr-btn-admin {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(245,158,11,.3);
}

.tcr-btn-admin:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245,158,11,.4);
  color: #fff;
  text-decoration: none;
}

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

/* ============================================================================
   PROJECT DETAIL VIEW
   ============================================================================ */

.tcr-project-detail {
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: var(--tcr-radius);
  padding: 24px;
}

.tcr-project-detail[hidden] {
  display: none !important;
}

.tcr-projects-list[hidden] {
  display: none !important;
}

.tcr-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-detail-back {
  font-size: 14px;
  color: var(--tcr-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  cursor: pointer;
}

.tcr-detail-back:hover {
  text-decoration: underline;
}

.tcr-detail-section {
  margin-bottom: 24px;
}

.tcr-detail-section h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #374151;
  margin: 0 0 12px 0;
}

.tcr-detail-description {
  color: #374151;
  line-height: 1.6;
}

/* Overview tab enhancements */
.tcr-overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tcr-status-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid var(--tcr-border);
}

.tcr-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tcr-status-item label {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.tcr-quick-select {
  padding: 8px 12px;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.tcr-quick-select:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

.tcr-progress-section {
  margin: 20px 0;
}

.tcr-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tcr-progress-header span {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
}

.tcr-progress-header small {
  font-size: 12px;
  color: #6b7280;
}

/* ============================================================================
   CALENDAR VIEW
   ============================================================================ */

.tcr-calendar-container {
  margin-bottom: 20px;
}

.tcr-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.tcr-calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tcr-calendar-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  min-width: 180px;
  text-align: center;
}

.tcr-calendar-views {
  display: flex;
  gap: 4px;
}

/* Month View */
.tcr-cal-month {
  border: 1px solid var(--tcr-border);
  border-radius: 10px;
  overflow: hidden;
}

.tcr-cal-dow-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f3f4f6;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-cal-dow-header > div {
  padding: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
}

.tcr-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.tcr-cal-cell {
  min-height: 80px;
  padding: 8px;
  border-right: 1px solid var(--tcr-border);
  border-bottom: 1px solid var(--tcr-border);
  cursor: pointer;
  transition: background .15s;
}

.tcr-cal-cell:nth-child(7n) {
  border-right: none;
}

.tcr-cal-cell:hover {
  background: #f9fafb;
}

.tcr-cal-cell.tcr-cal-empty {
  background: #fafafa;
  cursor: default;
}

.tcr-cal-cell.tcr-cal-today {
  background: #ecfdf5;
}

.tcr-cal-cell.tcr-cal-today:hover {
  background: #d1fae5;
}

.tcr-cal-cell.tcr-cal-has-event {
  background: #eff6ff;
}

.tcr-cal-cell.tcr-cal-has-event:hover {
  background: #dbeafe;
}

.tcr-cal-cell.tcr-cal-today.tcr-cal-has-event {
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
}

/* Completed work dates */
.tcr-cal-cell.tcr-cal-has-completed {
  background: #ecfdf5;
}

.tcr-cal-cell.tcr-cal-has-completed:hover {
  background: #d1fae5;
}

.tcr-cal-cell.tcr-cal-has-event.tcr-cal-has-completed {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
}

.tcr-cal-cell.tcr-cal-has-event.tcr-cal-has-completed:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #d1fae5 100%);
}

.tcr-cal-day-info.tcr-cal-scheduled {
  border-left: 2px solid #3b82f6;
  padding-left: 6px;
  margin-bottom: 4px;
}

.tcr-cal-day-info.tcr-cal-completed {
  border-left: 2px solid #10b981;
  padding-left: 6px;
}

.tcr-cal-completed-hours {
  color: #059669;
  font-weight: 600;
}

.tcr-cal-day-info.tcr-cal-completed .tcr-cal-hours {
  color: #10b981;
}

.tcr-cal-tasks {
  font-size: 11px;
  color: #6b7280;
}

.tcr-cal-day-num {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  margin-bottom: 4px;
}

.tcr-cal-today .tcr-cal-day-num {
  background: var(--tcr-accent);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tcr-cal-day-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tcr-cal-hours {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
}

.tcr-cal-workers {
  font-size: 11px;
  color: #6b7280;
}

.tcr-cal-workers small {
  font-size: 10px;
}

/* Week View */
.tcr-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--tcr-border);
  border-radius: 10px;
  overflow: hidden;
}

.tcr-cal-week-day {
  border-right: 1px solid var(--tcr-border);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.tcr-cal-week-day:last-child {
  border-right: none;
}

.tcr-cal-week-header {
  padding: 10px;
  background: #f3f4f6;
  border-bottom: 1px solid var(--tcr-border);
  cursor: pointer;
  text-align: center;
}

.tcr-cal-week-header:hover {
  background: #e5e7eb;
}

.tcr-cal-week-dayname {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: #374151;
  text-transform: uppercase;
}

.tcr-cal-week-date {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

.tcr-cal-week-day.tcr-cal-today .tcr-cal-week-header {
  background: #ecfdf5;
}

.tcr-cal-week-day.tcr-cal-today .tcr-cal-week-date {
  color: var(--tcr-accent);
  font-weight: 600;
}

.tcr-cal-week-content {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tcr-cal-week-event {
  background: #dbeafe;
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: background .15s;
}

.tcr-cal-week-event:hover {
  background: #bfdbfe;
}

.tcr-cal-event-time {
  font-size: 12px;
  font-weight: 600;
  color: #1e40af;
}

.tcr-cal-event-workers {
  font-size: 11px;
  color: #3b82f6;
  margin-top: 2px;
}

.tcr-cal-event-notes {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
}

.tcr-cal-event-task {
  font-size: 12px;
  font-weight: 500;
  color: #065f46;
  margin-top: 2px;
}

/* Completed event styling in week view */
.tcr-cal-week-event.tcr-cal-event-completed {
  background: #d1fae5;
  border-left: 3px solid #10b981;
}

.tcr-cal-week-event.tcr-cal-event-completed:hover {
  background: #a7f3d0;
}

.tcr-cal-week-event.tcr-cal-event-completed .tcr-cal-event-time {
  color: #065f46;
}

.tcr-cal-week-event.tcr-cal-event-completed .tcr-cal-event-workers {
  color: #059669;
}

/* Week day with completed work */
.tcr-cal-week-day.tcr-cal-has-completed .tcr-cal-week-header {
  border-bottom: 2px solid #10b981;
}

.tcr-cal-week-empty {
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
  padding: 20px 8px;
}

/* Date Detail Panel */
.tcr-date-detail-panel {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 10px;
  overflow: hidden;
}

.tcr-date-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-date-detail-header h4 {
  margin: 0;
  font-size: 16px;
  color: #1f2937;
}

#date-detail-content {
  padding: 16px;
}

.tcr-date-card.tcr-highlighted {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Completed work section in detail panel */
.tcr-completed-work-section {
  margin-bottom: 16px;
}

.tcr-completed-work-section h5,
.tcr-scheduled-work-section h5 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #374151;
}

.tcr-completed-card {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-left: 3px solid #10b981;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.tcr-completed-task {
  font-weight: 600;
  color: #065f46;
  margin-bottom: 4px;
}

.tcr-completed-info {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.tcr-completed-hours {
  color: #059669;
  font-weight: 500;
}

.tcr-completed-workers {
  color: #6b7280;
}

.tcr-scheduled-work-section {
  margin-bottom: 8px;
}

/* Add Date Form */
.tcr-add-date-form {
  margin-top: 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 10px;
}

.tcr-add-date-form h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #1f2937;
}

.tcr-form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tcr-form-row .tcr-field {
  flex: 1;
  min-width: 120px;
}

.tcr-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Responsive calendar */
@media (max-width: 768px) {
  .tcr-calendar-header {
    flex-direction: column;
    align-items: stretch;
  }

  .tcr-calendar-nav {
    justify-content: center;
  }

  .tcr-calendar-views {
    justify-content: center;
  }

  .tcr-cal-cell {
    min-height: 60px;
    padding: 4px;
  }

  .tcr-cal-day-num {
    font-size: 12px;
  }

  .tcr-cal-day-info {
    display: none;
  }

  .tcr-cal-cell.tcr-cal-has-event::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    margin-top: 4px;
  }

  .tcr-cal-week {
    grid-template-columns: 1fr;
  }

  .tcr-cal-week-day {
    border-right: none;
    border-bottom: 1px solid var(--tcr-border);
    min-height: auto;
  }

  .tcr-cal-week-day:last-child {
    border-bottom: none;
  }

  .tcr-cal-week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .tcr-form-row {
    flex-direction: column;
  }
}

/* Calendar legend */
.tcr-calendar-legend {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.tcr-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}

.tcr-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Calendar event project name in week view */
.tcr-cal-event-project {
  font-weight: 600;
  font-size: 12px;
  color: #1e40af;
  margin-bottom: 2px;
}

.tcr-cal-event-trail {
  font-size: 10px;
  color: #6b7280;
  margin-top: 2px;
}

.tcr-cal-projects {
  font-size: 10px;
  color: #6b7280;
}

/* Calendar detail panel for standalone calendar */
.tcr-cal-detail-project {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-cal-detail-project:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.tcr-cal-detail-project-header {
  margin-bottom: 12px;
}

.tcr-cal-detail-project-header h5 {
  margin: 0 0 4px 0;
  font-size: 15px;
  color: #1f2937;
}

.tcr-cal-detail-trail {
  font-size: 12px;
  color: #6b7280;
}

.tcr-cal-detail-slot {
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.tcr-cal-detail-slot:last-child {
  margin-bottom: 0;
}

.tcr-cal-detail-slot.tcr-highlighted {
  border-color: #3b82f6;
  background: #eff6ff;
}

.tcr-cal-detail-time {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 4px;
}

.tcr-cal-detail-notes {
  font-size: 13px;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 8px;
}

.tcr-cal-detail-workers {
  font-size: 13px;
}

.tcr-cal-detail-workers strong {
  color: #374151;
  margin-right: 8px;
}

/* Work dates list with signup buttons */
.tcr-dates-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tcr-date-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: #f9fafb;
  border-radius: 10px;
  border: 2px solid var(--tcr-border);
  transition: all 0.2s ease;
}

.tcr-date-item:hover {
  border-color: var(--tcr-accent);
  background: #fff;
}

.tcr-date-item.signed-up {
  border-color: var(--tcr-accent);
  background: #ecfdf5;
}

.tcr-date-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.tcr-date-day {
  font-weight: 700;
  color: #1f2937;
  font-size: 15px;
}

.tcr-date-time {
  color: #6b7280;
  font-size: 14px;
}

.tcr-date-task {
  color: var(--tcr-accent);
  font-weight: 600;
  font-size: 13px;
  padding: 2px 8px;
  background: #ecfdf5;
  border-radius: 4px;
}

.tcr-date-notes {
  color: #6b7280;
  font-size: 13px;
  font-style: italic;
  flex-basis: 100%;
}

.tcr-date-signup {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.tcr-date-volunteer-count {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
}

/* Small button variant */
.tcr-btn-sm {
  padding: 6px 14px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
}

@media (max-width: 600px) {
  .tcr-date-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .tcr-date-signup {
    justify-content: space-between;
  }
}

/* Date cards with worker assignments */
.tcr-date-card {
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 10px;
  overflow: hidden;
}

.tcr-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-date-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tcr-date-workers {
  padding: 12px 16px;
}

.tcr-date-workers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tcr-date-workers-header strong {
  font-size: 13px;
  color: #374151;
}

.tcr-assign-worker-select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
}

.tcr-assign-worker-select:focus {
  outline: none;
  border-color: var(--tcr-accent);
}

.tcr-assigned-workers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tcr-assigned-worker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 20px;
  font-size: 13px;
  color: #047857;
}

.tcr-remove-worker-from-date {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: #fecaca;
  color: #dc2626;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.tcr-remove-worker-from-date:hover {
  background: #fca5a5;
}

.tcr-no-workers-assigned {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
}

.tcr-warning {
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
  font-size: 14px;
}

/* Volunteers list */
.tcr-volunteers-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tcr-volunteers-section {
  margin-bottom: 12px;
}

.tcr-volunteers-header {
  font-weight: 600;
  font-size: 13px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.tcr-volunteers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tcr-date-volunteers {
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 8px;
}

.tcr-date-volunteers-label {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 8px;
}

.tcr-volunteer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 999px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.tcr-volunteer:hover {
  border-color: var(--tcr-accent);
  background: #ecfdf5;
}

.tcr-volunteer-status {
  font-size: 12px;
}

/* Progress log */
.tcr-progress-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tcr-progress-entry {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 4px solid var(--tcr-accent);
}

.tcr-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #6b7280;
}

.tcr-progress-notes {
  color: #374151;
  line-height: 1.5;
}

/* Photo gallery by phase */
.tcr-photos-section {
  margin-bottom: 24px;
}

.tcr-photos-phase {
  margin-bottom: 16px;
}

.tcr-photos-phase h5 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--tcr-border);
}

.tcr-photos-phase.before h5 { border-color: #fbbf24; }
.tcr-photos-phase.during h5 { border-color: var(--tcr-accent); }
.tcr-photos-phase.after h5 { border-color: #3b82f6; }

.tcr-photos-summary {
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 16px;
  color: #374151;
  font-size: 14px;
}

.tcr-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.tcr-photo-task-label {
  font-size: 11px;
  color: #6b7280;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Photo Lightbox */
.tcr-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
}

.tcr-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tcr-lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  cursor: pointer;
}

.tcr-lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tcr-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  z-index: 1;
}

.tcr-lightbox-close:hover {
  color: #f3f4f6;
}

#tcr-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.tcr-lightbox-info {
  margin-top: 16px;
  text-align: center;
  color: white;
}

.tcr-lightbox-task {
  font-size: 14px;
  color: #d1d5db;
  margin: 0 0 4px 0;
}

.tcr-lightbox-caption {
  font-size: 16px;
  color: white;
  margin: 0 0 12px 0;
}

.tcr-lightbox-info .tcr-btn {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
  color: white;
}

.tcr-lightbox-info .tcr-btn:hover {
  background: rgba(255,255,255,0.3);
}

.tcr-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--tcr-border);
  cursor: pointer;
  transition: transform .2s ease;
}

.tcr-photo-thumb:hover {
  transform: scale(1.02);
}

.tcr-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcr-photo-from-report {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.tcr-photo-gps {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(5,150,105,.9);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: help;
}

/* Photo card with caption */
.tcr-photo-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  overflow: hidden;
}

.tcr-photo-thumb-img {
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
}

.tcr-photo-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.tcr-photo-thumb-img:hover img {
  transform: scale(1.05);
}

.tcr-photo-caption-area {
  padding: 8px;
  border-top: 1px solid var(--tcr-border);
  background: #f9fafb;
}

.tcr-photo-caption-text {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: #374151;
  line-height: 1.4;
  word-break: break-word;
}

.tcr-photo-caption-empty {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}

.tcr-photo-phase-select {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
}

.tcr-photo-phase-select label {
  color: #6b7280;
}

.tcr-photo-phase-select select {
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.tcr-photo-phase-select select:focus {
  outline: none;
  border-color: var(--tcr-accent);
}

.tcr-photo-actions {
  display: flex;
  gap: 8px;
}

.tcr-btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--tcr-accent);
  cursor: pointer;
  text-decoration: underline;
}

.tcr-btn-link:hover {
  color: #047857;
}

.tcr-btn-danger-link {
  color: #dc2626;
}

.tcr-btn-danger-link:hover {
  color: #b91c1c;
}

/* Photos map section */
.tcr-photos-map-section {
  margin: 20px 0;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
}

.tcr-photos-map-section h5 {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: #1f2937;
}

.tcr-photos-map {
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--tcr-border);
}

.tcr-map-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.tcr-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #374151;
}

.tcr-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* Map marker and popup styles */
.tcr-photo-marker {
  background: none !important;
  border: none !important;
}

.tcr-map-popup {
  text-align: center;
  min-width: 120px;
}

.tcr-map-popup img {
  display: block;
  margin: 0 auto;
}

/* Photo upload preview */
.tcr-photo-upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.tcr-upload-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--tcr-border);
}

.tcr-upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcr-upload-preview-item .tcr-upload-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 10px;
  padding: 3px;
  text-align: center;
}

.tcr-upload-preview-item.uploading {
  border-color: #f59e0b;
  animation: pulse 1s infinite;
}

.tcr-upload-preview-item.uploaded {
  border-color: var(--tcr-accent);
}

.tcr-upload-preview-item.uploaded .tcr-upload-status {
  background: rgba(5,150,105,.9);
}

.tcr-upload-preview-item.failed {
  border-color: #dc2626;
}

.tcr-upload-preview-item.failed .tcr-upload-status {
  background: rgba(220,38,38,.9);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Link report form */
.tcr-link-report-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-link-report-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tcr-link-report-form label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.tcr-link-report-form .tcr-select {
  flex: 1;
  min-width: 250px;
  max-width: 500px;
  padding: 10px 14px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.tcr-link-report-form .tcr-select:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

/* Linked reports */
.tcr-linked-reports {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tcr-linked-report {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid var(--tcr-border);
}

.tcr-linked-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.tcr-linked-report-title {
  font-weight: 600;
  color: #1f2937;
}

.tcr-linked-report-meta {
  font-size: 13px;
  color: #6b7280;
}

.tcr-linked-report-summary {
  font-size: 14px;
  color: #374151;
  margin-top: 8px;
  font-style: italic;
}

.tcr-linked-report-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Worker management */
.tcr-add-worker-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-add-worker-section label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.tcr-add-worker-section .tcr-input {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
  padding: 10px 14px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  font-size: 14px;
}

.tcr-add-worker-section .tcr-input:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

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

.tcr-workers-table th,
.tcr-workers-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-workers-table th {
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
}

.tcr-workers-table tr:hover {
  background: #f9fafb;
}

.tcr-select-sm {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
}

.tcr-btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* ============================================================================
   ADMIN INTERFACE
   ============================================================================ */

.tcr-project-admin {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tcr-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tcr-admin-header h2 {
  margin: 0;
  font-size: 24px;
  color: #1f2937;
}

.tcr-admin-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.tcr-admin-filters select {
  padding: 10px 14px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

/* Admin project list */
.tcr-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tcr-admin-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: var(--tcr-radius);
  transition: box-shadow .2s ease;
}

.tcr-admin-item:hover {
  box-shadow: var(--tcr-shadow);
}

.tcr-admin-item-main {
  flex: 1;
}

.tcr-admin-item-title {
  font-weight: 700;
  font-size: 16px;
  color: #1f2937;
  margin-bottom: 4px;
}

.tcr-admin-item-meta {
  font-size: 13px;
  color: #6b7280;
}

.tcr-admin-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #6b7280;
  flex-shrink: 0;
}

.tcr-stat-link {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.tcr-stat-link:hover {
  background: #f3f4f6;
  color: var(--tcr-accent);
}

.tcr-admin-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Modal */
.tcr-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.tcr-modal[hidden] {
  display: none;
}

.tcr-modal-content {
  background: #fff;
  border-radius: var(--tcr-radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}

.tcr-modal-large {
  max-width: 900px;
}

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

.tcr-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1f2937;
}

.tcr-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.tcr-modal-close:hover {
  color: #1f2937;
}

/* Form styles */
#tcr-project-form {
  padding: 20px;
}

.tcr-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tcr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.tcr-field label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.tcr-field input,
.tcr-field select,
.tcr-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.tcr-field input:focus,
.tcr-field select:focus,
.tcr-field textarea:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

.tcr-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--tcr-border);
}

/* Detail modal content */
#tcr-detail-content {
  padding: 20px;
}

.tcr-detail-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-detail-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tcr-detail-tab:hover {
  color: #374151;
}

.tcr-detail-tab.active {
  color: var(--tcr-accent);
  border-bottom-color: var(--tcr-accent);
}

.tcr-tab-panel[hidden] {
  display: none;
}

/* Admin-specific: Add date form */
.tcr-add-date-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tcr-add-date-form .tcr-field {
  flex: 1;
}

/* Admin: Progress form */
.tcr-progress-form {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tcr-progress-form .tcr-form-grid {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Admin: Photo upload */
.tcr-photo-upload {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tcr-photo-upload-dropzone {
  border: 2px dashed var(--tcr-border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
}

.tcr-photo-upload-dropzone:hover {
  border-color: var(--tcr-accent);
  background: rgba(5,150,105,.05);
}

.tcr-photo-upload-dropzone.dragover {
  border-color: var(--tcr-accent);
  background: rgba(5,150,105,.1);
}

.tcr-phase-selector {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.tcr-phase-btn {
  padding: 8px 16px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}

.tcr-phase-btn:hover {
  background: #f3f4f6;
}

.tcr-phase-btn.active {
  background: var(--tcr-accent);
  color: #fff;
  border-color: var(--tcr-accent);
}

/* Admin: Link report modal */
.tcr-report-picker {
  max-height: 400px;
  overflow-y: auto;
}

.tcr-report-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s ease;
}

.tcr-report-option:hover {
  background: #f9fafb;
  border-color: var(--tcr-accent);
}

.tcr-report-option.selected {
  background: rgba(5,150,105,.1);
  border-color: var(--tcr-accent);
}

.tcr-report-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--tcr-accent);
}

/* Photo picker from reports */
.tcr-photo-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.tcr-photo-picker-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--tcr-border);
  cursor: pointer;
  transition: all .15s ease;
}

.tcr-photo-picker-item:hover {
  border-color: var(--tcr-accent);
}

.tcr-photo-picker-item.selected {
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 2px rgba(5,150,105,.3);
}

.tcr-photo-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcr-photo-picker-item .check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: var(--tcr-accent);
  color: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.tcr-photo-picker-item.selected .check {
  display: flex;
}

/* Empty state */
.tcr-empty {
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
}

.tcr-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* Loading state */
.tcr-loading {
  text-align: center;
  padding: 24px;
  color: #6b7280;
}

/* Error state */
.tcr-error {
  padding: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  margin-bottom: 16px;
}

/* Success message */
.tcr-success {
  padding: 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  margin-bottom: 16px;
}

/* ============================================================================
   FILE ATTACHMENTS
   ============================================================================ */

.tcr-file-upload-section {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 20px;
}

.tcr-file-dropzone {
  border: 2px dashed var(--tcr-border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
}

.tcr-file-dropzone:hover,
.tcr-file-dropzone.dragover {
  border-color: var(--tcr-accent);
  background: rgba(5,150,105,.05);
}

.tcr-file-dropzone p {
  margin: 0;
  color: #6b7280;
}

.tcr-files-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tcr-file-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
}

.tcr-file-icon {
  font-size: 32px;
  flex-shrink: 0;
}

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

.tcr-file-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.tcr-file-desc {
  font-size: 14px;
  color: #374151;
  margin-bottom: 4px;
}

.tcr-file-meta {
  font-size: 12px;
  color: #6b7280;
}

.tcr-file-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================================
   SPREADSHEETS
   ============================================================================ */

.tcr-sheets-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.tcr-sheets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.tcr-sheet-item {
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  overflow: hidden;
}

.tcr-sheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
}

.tcr-sheet-icon {
  font-size: 24px;
}

.tcr-sheet-title {
  font-weight: 600;
  color: #1f2937;
  flex: 1;
}

.tcr-sheet-type {
  font-size: 12px;
  padding: 4px 10px;
  background: #e5e7eb;
  border-radius: 20px;
  color: #374151;
  text-transform: capitalize;
}

.tcr-sheet-meta {
  font-size: 13px;
  color: #6b7280;
}

.tcr-sheet-actions {
  display: flex;
  gap: 8px;
}

/* Sheet Form */
.tcr-sheet-form {
  padding: 20px;
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  margin-top: 16px;
}

.tcr-sheet-form h4 {
  margin: 0 0 16px 0;
  color: #1f2937;
}

.tcr-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Spreadsheet Editor */
.tcr-sheet-editor {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  overflow: hidden;
}

.tcr-sheet-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-sheet-editor-header h4 {
  margin: 0;
  color: #1f2937;
}

.tcr-sheet-editor-actions {
  display: flex;
  gap: 8px;
}

.tcr-spreadsheet-container {
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

.tcr-spreadsheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tcr-spreadsheet thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.tcr-spreadsheet th {
  background: #e5e7eb;
  padding: 10px 12px;
  font-weight: 600;
  color: #374151;
  text-align: left;
  border: 1px solid #d1d5db;
  white-space: nowrap;
}

.tcr-spreadsheet td {
  padding: 0;
  border: 1px solid #e5e7eb;
}

.tcr-row-number {
  width: 50px;
  min-width: 50px;
  text-align: center !important;
  background: #f3f4f6 !important;
  color: #6b7280;
  font-weight: 500;
}

.tcr-row-actions {
  width: 60px;
  min-width: 60px;
  text-align: center !important;
}

.tcr-row-actions .tcr-btn {
  padding: 4px 8px;
  font-size: 14px;
}

.tcr-cell-input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  min-width: 120px;
}

.tcr-cell-input:focus {
  outline: none;
  background: #fffbeb;
  box-shadow: inset 0 0 0 2px var(--tcr-accent);
}

/* ============================================================================
   TIMELINE
   ============================================================================ */

.tcr-timeline {
  position: relative;
  padding-left: 40px;
}

.tcr-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--tcr-accent), #d1d5db);
}

.tcr-timeline-entry {
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-timeline-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.tcr-timeline-marker {
  position: absolute;
  left: -40px;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tcr-timeline-dot {
  width: 12px;
  height: 12px;
  background: var(--tcr-accent);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--tcr-accent);
  z-index: 1;
}

.tcr-timeline-line {
  width: 2px;
  flex: 1;
  background: transparent;
}

.tcr-timeline-content {
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--tcr-shadow);
}

.tcr-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.tcr-timeline-date {
  font-weight: 600;
  color: #1f2937;
  font-size: 15px;
}

.tcr-timeline-user {
  font-size: 13px;
  color: #6b7280;
}

.tcr-timeline-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 6px;
}

.tcr-timeline-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.tcr-timeline-stats span strong {
  color: var(--tcr-accent);
}

.tcr-timeline-notes {
  color: #374151;
  line-height: 1.6;
  font-size: 14px;
}

.tcr-timeline-notes:not(:empty) {
  margin-bottom: 12px;
}

.tcr-timeline-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.tcr-timeline-photos a {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--tcr-border);
  transition: transform .2s ease, box-shadow .2s ease;
}

.tcr-timeline-photos a:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.tcr-timeline-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcr-timeline-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.tcr-timeline-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
  text-decoration: none;
  color: #374151;
  font-size: 14px;
  transition: background .15s ease;
}

.tcr-timeline-file:hover {
  background: #f3f4f6;
  text-decoration: none;
}

.tcr-timeline-file-icon {
  font-size: 20px;
}

.tcr-timeline-file-name {
  flex: 1;
  font-weight: 500;
}

.tcr-empty-timeline {
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
  font-style: italic;
}

/* Worker hours in timeline */
.tcr-timeline-worker-hours {
  margin: 12px 0;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 13px;
}

.tcr-timeline-worker-hours strong {
  display: block;
  margin-bottom: 6px;
  color: #166534;
}

.tcr-timeline-worker-hours ul {
  margin: 0;
  padding-left: 20px;
  color: #374151;
}

.tcr-timeline-worker-hours li {
  margin: 4px 0;
}

/* Worker hours form section */
.tcr-worker-hours-section {
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.tcr-section-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
  font-size: 14px;
}

.tcr-worker-hours-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tcr-worker-hours-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tcr-worker-hours-row label {
  flex: 1;
  min-width: 120px;
  font-size: 14px;
  color: #374151;
}

.tcr-worker-hours-row input {
  width: 80px;
  padding: 8px 12px;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
  font-size: 14px;
  text-align: right;
}

.tcr-worker-hours-row input:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

.tcr-hours-label {
  font-size: 13px;
  color: #6b7280;
  min-width: 24px;
}

.tcr-total-hours {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--tcr-border);
  font-size: 15px;
  color: #1f2937;
}

.tcr-total-hours strong {
  color: #374151;
}

.tcr-total-hours span {
  font-weight: 600;
  color: var(--tcr-accent);
  font-size: 18px;
}

.tcr-empty-workers {
  color: #6b7280;
  font-style: italic;
  font-size: 14px;
  margin: 0;
}

/* Timeline summary header */
.tcr-timeline-summary {
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.tcr-timeline-summary h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #1f2937;
}

.tcr-timeline-totals {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tcr-timeline-totals span {
  font-size: 14px;
  color: #6b7280;
}

.tcr-timeline-totals strong {
  color: var(--tcr-accent);
  font-size: 16px;
}

.tcr-timeline-entries {
  position: relative;
}

/* Timeline photo styling */
.tcr-timeline-photo {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--tcr-border);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.tcr-timeline-photo:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.tcr-timeline-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcr-help-text {
  font-size: 13px;
  color: #6b7280;
  margin-top: 16px;
  font-style: italic;
}

/* Large progress bar for timeline */
.tcr-progress-bar-large {
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0;
}

.tcr-progress-bar-large .tcr-progress-fill {
  height: 100%;
}

/* ============================================================================
   PROGRESS ATTACHMENTS UPLOAD
   ============================================================================ */

.tcr-progress-upload-zone {
  margin-top: 16px;
}

.tcr-progress-upload-zone label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
}

.tcr-progress-dropzone {
  border: 2px dashed var(--tcr-border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: #fff;
}

.tcr-progress-dropzone:hover,
.tcr-progress-dropzone.dragover {
  border-color: var(--tcr-accent);
  background: rgba(5,150,105,.05);
}

.tcr-progress-dropzone p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.tcr-progress-dropzone small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
}

.tcr-attachments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.tcr-attachment-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  min-width: 180px;
  max-width: 280px;
}

.tcr-attachment-item.is-image {
  flex-direction: column;
  padding: 6px;
  min-width: 80px;
  max-width: 90px;
}

.tcr-attachment-item.is-image .tcr-attachment-preview {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.tcr-attachment-item.is-image .tcr-attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcr-attachment-item.is-image .tcr-attachment-name {
  font-size: 10px;
  margin-top: 4px;
  text-align: center;
  max-width: 80px;
}

.tcr-attachment-item .tcr-attachment-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.tcr-attachment-item .tcr-attachment-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tcr-attachment-item .tcr-attachment-name {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcr-attachment-item .tcr-attachment-size {
  font-size: 11px;
  color: #9ca3af;
}

.tcr-attachment-item .tcr-attachment-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  transition: transform .15s ease;
}

.tcr-attachment-item .tcr-attachment-remove:hover {
  transform: scale(1.1);
  background: #b91c1c;
}

.tcr-attachment-item.uploading {
  opacity: 0.6;
}

.tcr-attachment-item.uploading::after {
  content: 'Uploading...';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: var(--tcr-accent);
  font-weight: 600;
}

.tcr-attachment-item.uploaded .tcr-attachment-remove {
  background: var(--tcr-accent);
}

/* Upload status indicator */
.tcr-upload-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  color: #065f46;
  font-size: 13px;
}

.tcr-upload-status.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
  .tcr-projects-filters {
    flex-direction: column;
  }

  .tcr-projects-filters select,
  #tcr-proj-apply {
    width: 100%;
  }

  .tcr-projects-list {
    grid-template-columns: 1fr;
  }

  .tcr-form-grid {
    grid-template-columns: 1fr;
  }

  .tcr-admin-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .tcr-admin-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .tcr-modal-content {
    max-height: 95vh;
    margin: 10px;
  }

  .tcr-detail-tabs {
    overflow-x: auto;
  }

  .tcr-progress-form .tcr-form-grid {
    grid-template-columns: 1fr;
  }

  /* Timeline responsive */
  .tcr-timeline {
    padding-left: 30px;
  }

  .tcr-timeline::before {
    left: 10px;
  }

  .tcr-timeline-marker {
    left: -30px;
  }

  .tcr-timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  .tcr-timeline-stats {
    flex-direction: column;
    gap: 8px;
  }

  .tcr-timeline-photos a {
    width: 60px;
    height: 60px;
  }

  /* Attachment preview responsive */
  .tcr-attachments-preview {
    gap: 8px;
  }

  .tcr-attachment-item {
    min-width: 150px;
  }

  .tcr-attachment-item.is-image {
    min-width: 80px;
    max-width: 100px;
  }
}

/* ============================================================================
   OVERVIEW TAB - PHOTOS SECTION
   ============================================================================ */

.tcr-overview-photos {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tcr-overview-phase-group {
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  overflow: hidden;
}

.tcr-overview-phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-overview-phase-label {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

.tcr-overview-phase-count {
  font-size: 13px;
  color: #6b7280;
}

.tcr-overview-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px;
}

.tcr-overview-photo-item {
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.tcr-overview-photo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.tcr-overview-photo-img {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.tcr-overview-photo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.tcr-overview-photo-item:hover .tcr-overview-photo-img img {
  transform: scale(1.05);
}

.tcr-overview-photo-info {
  padding: 10px 12px;
  border-top: 1px solid var(--tcr-border);
  min-height: 40px;
}

.tcr-overview-photo-caption {
  margin: 0 0 6px 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
  word-break: break-word;
}

.tcr-overview-photo-gps {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 11px;
  color: #6b7280;
  font-family: monospace;
}

.tcr-gps-icon {
  font-size: 12px;
}

/* Mini topo map for individual photos */
.tcr-photo-location-map {
  width: 100%;
  height: 100px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--tcr-border);
  overflow: hidden;
}

.tcr-empty-note {
  color: #6b7280;
  font-style: italic;
  font-size: 14px;
  margin: 0;
}

/* ============================================================================
   COVER PHOTO
   ============================================================================ */

/* Cover photo in form */
.tcr-cover-photo-field {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.tcr-cover-preview {
  max-width: 200px;
  max-height: 200px;
  min-width: 100px;
  min-height: 80px;
  border: 2px dashed var(--tcr-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
}

.tcr-cover-preview img {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.tcr-cover-preview:has(img) {
  border-style: solid;
  width: auto;
  height: auto;
}

.tcr-cover-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tcr-cover-actions {
  display: flex;
  gap: 8px;
}

.tcr-cover-gps {
  font-size: 13px;
  color: #059669;
  font-family: monospace;
  padding: 6px 10px;
  background: #ecfdf5;
  border-radius: 6px;
  border: 1px solid #a7f3d0;
}

.tcr-cover-caption-input {
  padding: 8px 12px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  font-size: 14px;
  min-width: 250px;
}

.tcr-cover-caption-input:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

/* Cover photo in admin list */
.tcr-admin-item-cover {
  width: 240px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.tcr-admin-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Cover photo in overview - natural dimensions */
.tcr-overview-cover {
  margin: 0 0 20px 0;
  text-align: center;
}

.tcr-overview-cover img {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--tcr-border);
}

.tcr-overview-cover-caption {
  margin-top: 10px;
  font-size: 14px;
  color: #374151;
  font-style: italic;
}

.tcr-overview-cover-gps {
  margin-top: 6px;
  font-size: 12px;
  color: #059669;
  font-family: monospace;
}

/* Cover photo location section with map */
.tcr-cover-location-section {
  margin-top: 16px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.tcr-cover-location-map {
  width: 100%;
  height: 180px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--tcr-border);
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .tcr-overview-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .tcr-cover-photo-field {
    flex-direction: column;
    align-items: flex-start;
  }

  .tcr-cover-caption-input {
    min-width: 100%;
    width: 100%;
  }

  .tcr-admin-item-cover {
    width: 120px;
    height: 90px;
  }

  .tcr-overview-cover img {
    max-height: 250px;
  }
}

/* ============================================================================
   ARCHIVED PROJECTS VIEW
   ============================================================================ */

.tcr-header-actions {
  display: flex;
  gap: 12px;
}

.tcr-deleted-header {
  padding: 16px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tcr-deleted-header p {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
}

.tcr-deleted-item {
  border-left: 4px solid #9ca3af;
  background: #f9fafb;
}

.tcr-deleted-item:hover {
  background: #f3f4f6;
}

/* ============================================================================
   CALENDAR ENHANCEMENTS - Year view, selectors, open days
   ============================================================================ */

/* Calendar header with selectors */
.tcr-calendar-selectors {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tcr-select-sm {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.tcr-select-sm:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

/* Legend dot colors */
.tcr-legend-scheduled {
  background: #3b82f6;
}

.tcr-legend-open {
  background: #10b981;
  opacity: 0.4;
}

.tcr-legend-today {
  background: #f59e0b;
}

/* Open day styling */
.tcr-cal-cell.tcr-cal-open {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.tcr-cal-open-label {
  font-size: 11px;
  color: #059669;
  font-weight: 600;
}

.tcr-cal-week-day.tcr-cal-open {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.tcr-cal-week-open-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #d1fae5;
  color: #059669;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  margin-left: 8px;
}

/* Year View */
.tcr-cal-year {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .tcr-cal-year {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .tcr-cal-year {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .tcr-cal-year {
    grid-template-columns: 1fr;
  }
}

.tcr-cal-year-month {
  background: #fff;
  border: 1px solid var(--tcr-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.tcr-cal-year-month-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-bottom: 1px solid var(--tcr-border);
  cursor: pointer;
  transition: all .2s ease;
}

.tcr-cal-year-month-header:hover {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.tcr-cal-year-month-name {
  font-weight: 700;
  font-size: 16px;
  color: #1f2937;
}

/* Month stats detail panel */
.tcr-cal-year-month-stats-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--tcr-border);
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-month-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  background: #fff;
}

.tcr-month-stat:nth-child(5) {
  grid-column: span 2;
}

.tcr-stat-label {
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.tcr-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.tcr-stat-value.tcr-stat-completed {
  color: #059669;
}

.tcr-stat-value.tcr-stat-scheduled {
  color: #3b82f6;
}

.tcr-stat-value.tcr-stat-progress {
  color: #f59e0b;
}

.tcr-stat-value.tcr-stat-done {
  color: #10b981;
}

/* Mini calendar in year view */
.tcr-cal-year-month-mini {
  padding: 8px;
}

.tcr-cal-year-month-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
}

.tcr-cal-year-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  padding: 4px 0;
  margin-bottom: 4px;
}

.tcr-cal-year-dow span {
  font-size: 9px;
  font-weight: 600;
  color: #9ca3af;
}

.tcr-cal-year-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.tcr-cal-year-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  font-size: 10px;
  color: #4b5563;
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s ease;
}

.tcr-cal-year-day:hover {
  background: #f3f4f6;
}

.tcr-cal-year-day.tcr-cal-year-empty {
  visibility: hidden;
}

.tcr-cal-year-day.tcr-cal-today {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.tcr-cal-year-day.tcr-cal-has-event {
  background: #3b82f6;
  color: #fff;
  font-weight: 600;
}

.tcr-cal-year-day.tcr-cal-has-event:hover {
  background: #2563eb;
}

.tcr-cal-year-day.tcr-cal-open {
  background: #d1fae5;
  color: #059669;
}

.tcr-cal-year-day.tcr-cal-open:hover {
  background: #a7f3d0;
}

.tcr-cal-year-day.tcr-cal-has-completed {
  background: #10b981;
  color: #fff;
  font-weight: 600;
}

.tcr-cal-year-day.tcr-cal-has-completed:hover {
  background: #059669;
}

.tcr-cal-year-day.tcr-cal-has-event.tcr-cal-has-completed {
  background: linear-gradient(135deg, #3b82f6 50%, #10b981 50%);
}

/* Date actions panel for adding work */
.tcr-date-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--tcr-border);
}

.tcr-add-work-form {
  background: #f9fafb;
  border: 1px solid var(--tcr-border);
  border-radius: 10px;
  padding: 16px;
}

.tcr-add-work-form h5 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #1f2937;
}

.tcr-add-work-form .tcr-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tcr-add-work-form .tcr-form-row label {
  min-width: 80px;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}

.tcr-add-work-form .tcr-select,
.tcr-add-work-form .tcr-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
  font-size: 13px;
}

.tcr-add-work-form .tcr-select:focus,
.tcr-add-work-form .tcr-input:focus {
  outline: none;
  border-color: var(--tcr-accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

.tcr-add-work-form #add-work-btn {
  margin-top: 12px;
  width: 100%;
}

.tcr-note {
  font-size: 13px;
  color: #6b7280;
}

.tcr-note a {
  color: var(--tcr-accent);
  font-weight: 600;
}

/* Responsive calendar header */
@media (max-width: 900px) {
  .tcr-calendar-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .tcr-calendar-nav {
    order: 1;
    flex: 1 1 100%;
    justify-content: center;
  }

  .tcr-calendar-selectors {
    order: 2;
  }

  .tcr-calendar-views {
    order: 3;
  }
}

@media (max-width: 600px) {
  .tcr-calendar-selectors {
    flex: 1 1 100%;
    justify-content: center;
  }

  .tcr-calendar-views {
    flex: 1 1 100%;
    justify-content: center;
  }

  .tcr-add-work-form .tcr-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tcr-add-work-form .tcr-form-row label {
    min-width: auto;
    margin-bottom: 4px;
  }
}

/* Calendar slot actions */
.tcr-cal-slot-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--tcr-border);
}

.tcr-cal-slot-actions .tcr-btn {
  font-size: 12px;
  padding: 4px 10px;
}

.tcr-btn-danger {
  background: #dc2626;
  color: white;
  border: none;
}

.tcr-btn-danger:hover {
  background: #b91c1c;
}

/* Worker checkboxes in modal */
.tcr-worker-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  margin: 12px 0;
}

.tcr-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.tcr-checkbox-label:hover {
  background: #f0fdf4;
}

.tcr-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--tcr-accent);
}

.tcr-worker-role {
  color: #6b7280;
  font-size: 13px;
}

/* Modal body */
.tcr-modal-body {
  padding: 20px;
}

.tcr-modal-body p {
  margin: 0 0 12px 0;
}

.tcr-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--tcr-border);
}

/* Calendar modal specific */
#tcr-cal-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#tcr-cal-modal .tcr-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* ============================================================================
   TASKS TAB STYLES
   ============================================================================ */

.tcr-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tcr-task-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.tcr-task-item:hover {
  border-color: var(--tcr-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tcr-task-drag-handle {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #9ca3af;
  cursor: grab;
  font-size: 18px;
}

.tcr-task-drag-handle:hover {
  color: #6b7280;
}

.tcr-task-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #f3f4f6;
}

.tcr-task-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.tcr-task-thumb:hover img {
  transform: scale(1.1);
}

.tcr-task-photo-count {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.tcr-task-main {
  flex: 1;
  min-width: 0;
}

.tcr-task-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tcr-task-title {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
}

.tcr-task-status {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tcr-task-blocked {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.tcr-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #6b7280;
}

.tcr-task-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tcr-task-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.tcr-task-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.tcr-task-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

/* Task Edit Modal */
.tcr-modal-large {
  max-width: 800px !important;
}

.tcr-form-row-inline {
  display: flex;
  gap: 20px;
}

.tcr-form-row-inline > div {
  flex: 1;
}

.tcr-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.tcr-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.tcr-checkbox-label:hover {
  background: #f1f5f9;
}

.tcr-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.tcr-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
}

.tcr-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcr-photo-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

.tcr-photo-thumb:hover .tcr-photo-delete {
  display: block;
}

.tcr-notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tcr-note-item {
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.tcr-note-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #6b7280;
}

.tcr-note-meta strong {
  color: #1f2937;
}

.tcr-note-text {
  color: #374151;
  font-size: 14px;
  white-space: pre-wrap;
}

.tcr-schedule-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tcr-schedule-list li {
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
}

.tcr-schedule-list li em {
  color: #6b7280;
  margin-left: 8px;
}

.tcr-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--tcr-border);
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
}

/* Calendar task display styles */
.tcr-cal-event-task {
  font-weight: 600;
  color: #1e3a5f;
  font-size: 14px;
  line-height: 1.3;
}

.tcr-cal-event-project-sub {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

.tcr-cal-detail-task {
  background: #e0f2fe;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #0369a1;
}

/* Medium modal size for task update */
.tcr-modal-medium {
  max-width: 550px;
}

/* Photo upload zone */
.tcr-photo-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.tcr-photo-upload-zone:hover,
.tcr-photo-upload-zone.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.tcr-photo-upload-zone p {
  margin: 0;
  color: #64748b;
}

/* Task update header */
.tcr-task-update-header {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
}

.tcr-task-progress-info {
  color: #64748b;
  font-size: 14px;
}

/* Edit Task Modal Improvements */
#task-edit-modal .tcr-modal-body {
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px;
}

#task-edit-modal .tcr-form-row {
  margin-bottom: 16px;
}

#task-edit-modal .tcr-form-row label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
  font-size: 14px;
}

#task-edit-modal .tcr-input,
#task-edit-modal .tcr-select,
#task-edit-modal .tcr-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#task-edit-modal .tcr-input:focus,
#task-edit-modal .tcr-select:focus,
#task-edit-modal .tcr-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

#task-edit-modal .tcr-form-row-inline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

#task-edit-modal .tcr-form-row-inline > div {
  min-width: 0;
}

#task-edit-modal h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

#task-edit-modal hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}

/* Task sections */
.tcr-task-workers-section,
.tcr-task-photos-section,
.tcr-task-notes-section,
.tcr-task-schedule-section {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
}

/* Photo upload in task modal */
.tcr-task-photo-upload {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.tcr-task-photo-upload select {
  width: 120px;
}

.tcr-task-photo-upload input[type="file"] {
  flex: 1;
}

/* Task sort order field */
.tcr-task-order-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.tcr-task-order-field label {
  font-size: 13px;
  color: #6b7280;
  margin: 0 !important;
}

.tcr-task-order-field input {
  width: 70px;
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #task-edit-modal .tcr-form-row-inline {
    grid-template-columns: 1fr;
  }

  #task-edit-modal .tcr-modal-body {
    padding: 16px;
  }
}

/* Task order controls */
.tcr-task-order-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px;
  min-width: 70px;
}

.tcr-task-order-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.2;
}

.tcr-task-move-btn {
  width: 28px;
  height: 20px;
  padding: 0;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  color: #6b7280;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tcr-task-move-btn:hover:not(.disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
}

.tcr-task-move-btn:active:not(.disabled) {
  background: #e5e7eb;
}

.tcr-task-move-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Update task item layout to accommodate order controls */
.tcr-task-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: box-shadow 0.2s;
}

.tcr-task-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tcr-task-main {
  flex: 1;
  min-width: 0;
}

.tcr-task-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

@media (max-width: 600px) {
  .tcr-task-item {
    flex-wrap: wrap;
  }

  .tcr-task-order-controls {
    flex-direction: row;
    min-width: auto;
    width: 100%;
    justify-content: center;
    padding: 4px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 8px;
  }

  .tcr-task-actions {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================
   Worker Hours Input Grid
   ============================================ */

.tcr-worker-hours-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.tcr-worker-hours-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.tcr-worker-hours-row .tcr-worker-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.tcr-worker-hours-row .tcr-worker-hours-input {
  width: 80px;
  padding: 6px 10px;
  text-align: right;
}

.tcr-worker-hours-row .tcr-worker-hours-label {
  font-size: 13px;
  color: #6b7280;
  min-width: 25px;
}

.tcr-worker-hours-total {
  margin-top: 8px;
  padding: 8px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #065f46;
  text-align: right;
}

/* ============================================
   Log Activity Modal Styles
   ============================================ */

#task-update-modal .tcr-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

#task-update-modal .tcr-modal-body {
  padding: 20px;
}

#task-update-modal .tcr-task-update-header {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

#task-update-modal .tcr-task-update-header h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
}

#task-update-modal .tcr-form-row {
  margin-bottom: 16px;
}

#task-update-modal .tcr-form-row > label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: #374151;
  margin-bottom: 6px;
}

#task-update-modal .tcr-input,
#task-update-modal .tcr-select,
#task-update-modal .tcr-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#task-update-modal .tcr-input:focus,
#task-update-modal .tcr-select:focus,
#task-update-modal .tcr-textarea:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

#task-update-modal .tcr-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#task-update-modal .tcr-checkbox-label:hover {
  background: #dcfce7;
}

#task-update-modal .tcr-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #059669;
}

#task-update-modal .tcr-checkbox-label span {
  font-weight: 500;
  font-size: 14px;
  color: #166534;
}

#task-update-modal .tcr-photo-upload-zone {
  padding: 24px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

#task-update-modal .tcr-photo-upload-zone:hover {
  border-color: #059669;
  background: #f0fdf4;
}

#task-update-modal .tcr-photo-upload-zone.dragover {
  border-color: #059669;
  background: #dcfce7;
}

#task-update-modal .tcr-photo-upload-zone p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

#task-update-modal .tcr-modal-footer {
  padding: 16px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#task-update-modal #save-update-btn {
  min-width: 120px;
}

#task-update-modal #save-update-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ============================================
   Activity Timeline Styles
   ============================================ */

.tcr-activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.tcr-activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
  position: relative;
  transition: background-color 0.2s;
}

.tcr-activity-item:hover {
  background: #f1f5f9;
}

.tcr-activity-date {
  flex-shrink: 0;
  width: 90px;
  text-align: center;
  padding-top: 2px;
}

.tcr-activity-day {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}

.tcr-activity-time {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.tcr-activity-content {
  flex: 1;
  min-width: 0;
}

.tcr-activity-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.tcr-activity-user {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
}

.tcr-activity-hours {
  background: #dcfce7;
  color: #166534;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.tcr-activity-status-change {
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tcr-activity-worker-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tcr-activity-worker-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  font-size: 12px;
  color: #166534;
}

.tcr-activity-description {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 4px;
}

.tcr-activity-photo {
  margin-top: 8px;
  max-width: 120px;
  max-height: 80px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}

.tcr-activity-photo:hover {
  transform: scale(1.05);
}

.tcr-activity-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
}

.tcr-activity-item:hover .tcr-activity-delete {
  opacity: 1;
}

.tcr-activity-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Responsive adjustments for activity timeline */
@media (max-width: 600px) {
  .tcr-activity-item {
    flex-direction: column;
    gap: 8px;
  }

  .tcr-activity-date {
    width: auto;
    text-align: left;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }

  .tcr-activity-time {
    margin-top: 0;
  }

  .tcr-activity-delete {
    opacity: 1;
  }
}

/* ============================================================================
   INTERACTIVE PROJECT MAP
   ============================================================================ */

.tcr-map-section {
  margin-bottom: 24px;
}

.tcr-project-map {
  width: 100%;
  height: 350px;
  border-radius: var(--tcr-radius);
  border: 1px solid var(--tcr-border);
  background: #f3f4f6;
  overflow: hidden;
}

/* Cover-style map at top of detail view */
.tcr-project-map-cover {
  width: 100%;
  height: 400px;
  border-radius: var(--tcr-radius);
  margin-bottom: 20px;
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
  overflow: hidden;
  box-shadow: var(--tcr-shadow);
}

.tcr-map-error,
.tcr-map-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
  font-size: 14px;
}

/* Task markers on the map */
.tcr-task-marker {
  background: transparent;
  border: none;
}

.tcr-task-marker-inner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.tcr-task-marker-inner:hover {
  transform: scale(1.1);
}

/* Map popup styles */
.tcr-marker-popup {
  min-width: 180px;
}

.tcr-marker-thumb {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.tcr-marker-info {
  margin-bottom: 8px;
}

.tcr-marker-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.tcr-marker-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.tcr-marker-link {
  display: block;
  color: var(--tcr-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.tcr-marker-link:hover {
  text-decoration: underline;
}

/* Task highlight animation */
.tcr-task-highlight {
  animation: tcr-highlight-pulse 0.5s ease-in-out 2;
}

@keyframes tcr-highlight-pulse {
  0%, 100% { background-color: inherit; }
  50% { background-color: #fef3c7; }
}

/* Leaflet popup overrides for consistency */
.tcr-project-map .leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tcr-project-map .leaflet-popup-content {
  margin: 12px;
}

.tcr-project-map .leaflet-popup-tip {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Project Navigation in Header */
.tcr-modal-header-with-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tcr-modal-header-with-nav h3 {
  flex: 1;
  margin: 0;
  text-align: center;
  min-width: 0;
}

.tcr-title-prefix {
  font-weight: 400;
  color: #6b7280;
  font-size: 0.85em;
}

.tcr-header-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  max-width: 200px;
}

.tcr-header-nav-btn:hover:not(:disabled) {
  background: var(--tcr-accent);
  border-color: var(--tcr-accent);
  color: white;
}

.tcr-header-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tcr-nav-arrow {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.tcr-nav-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Stacked nav buttons (arrow on top, text below) */
.tcr-header-nav-btn.tcr-nav-stacked {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
}

.tcr-nav-stacked .tcr-nav-arrow {
  font-size: 24px;
}

.tcr-nav-label-small {
  font-size: 10px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tcr-header-nav-btn.tcr-nav-stacked:hover:not(:disabled) .tcr-nav-label-small {
  color: white;
}

/* Task Photos Grid (Overview) */
.tcr-task-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.tcr-task-photo-card {
  background: white;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.tcr-task-photo-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.tcr-task-photo-placeholder {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-size: 32px;
}

.tcr-task-photo-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tcr-task-photo-title {
  font-weight: 500;
  font-size: 14px;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcr-task-photo-count {
  font-size: 12px;
  color: #6b7280;
}

/* Task Carousel Styles */
.tcr-task-carousel {
  margin-top: 10px;
}

.tcr-carousel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
}

.tcr-carousel-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--tcr-border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 40%;
}

.tcr-carousel-btn:hover:not(:disabled) {
  background: var(--tcr-accent);
  border-color: var(--tcr-accent);
  color: white;
}

.tcr-carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tcr-carousel-btn-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.tcr-carousel-counter {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  flex-shrink: 0;
}

.tcr-carousel-card {
  background: white;
  border: 1px solid var(--tcr-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tcr-carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--tcr-border);
}

/* Combined header with nav + title in one row */
.tcr-carousel-header-combined {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--tcr-border);
}

.tcr-carousel-header-combined .tcr-carousel-btn {
  flex-shrink: 0;
  padding: 12px 16px;
  max-width: none;
}

.tcr-carousel-header-combined .tcr-nav-arrow {
  font-size: 24px;
}

.tcr-carousel-header-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.tcr-carousel-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}

.tcr-carousel-header-combined .tcr-carousel-title {
  margin: 0;
  font-size: 18px;
}

.tcr-carousel-header-combined .tcr-carousel-counter {
  font-size: 12px;
  color: #9ca3af;
}

.tcr-carousel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.tcr-task-id {
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  margin-left: 8px;
}

.tcr-carousel-status {
  font-size: 13px;
  padding: 6px 14px;
}

.tcr-carousel-header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tcr-task-order-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: help;
}

.tcr-carousel-blocked {
  padding: 12px 24px;
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
  color: #dc2626;
  font-size: 14px;
}

.tcr-carousel-content {
  display: flex;
  gap: 24px;
  padding: 24px;
}

.tcr-carousel-photos {
  flex-shrink: 0;
  width: 200px;
}

.tcr-carousel-photo-main {
  width: 200px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tcr-carousel-photo-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.tcr-carousel-photo-main:hover img {
  transform: scale(1.05);
}

.tcr-carousel-photo-more {
  margin: 8px 0 0;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

.tcr-carousel-details {
  flex: 1;
  min-width: 0;
}

.tcr-carousel-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.tcr-carousel-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
}

.tcr-carousel-stat .tcr-stat-icon {
  font-size: 18px;
}

.tcr-carousel-stat .tcr-stat-value {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.tcr-carousel-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tcr-carousel-progress-bar {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.tcr-carousel-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.tcr-carousel-progress-text {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  flex-shrink: 0;
}

.tcr-carousel-desc {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

.tcr-carousel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--tcr-border);
}

.tcr-carousel-order-btns {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.tcr-carousel-order-btns .tcr-task-move-btn {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  width: auto !important;
  height: auto !important;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  background: white;
  border: 1px solid var(--tcr-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #6b7280;
  white-space: nowrap;
}

.tcr-carousel-order-btns .tcr-task-move-btn .tcr-move-icon,
.tcr-carousel-order-btns .tcr-task-move-btn .tcr-move-label {
  display: inline !important;
}

.tcr-carousel-order-btns .tcr-move-icon {
  font-size: 14px;
  line-height: 1;
}

.tcr-carousel-order-btns .tcr-move-label {
  font-size: 11px;
  font-weight: 500;
}

.tcr-carousel-order-btns .tcr-task-move-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #9ca3af;
  color: #374151;
}

.tcr-carousel-order-btns .tcr-task-move-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Create Task Tab */
.tcr-create-task-panel {
  max-width: 600px;
  padding: 20px;
}

.tcr-create-task-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tcr-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tcr-form-group label {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.tcr-form-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .tcr-form-row {
    grid-template-columns: 1fr;
  }
}

/* Enhanced Tasks Tab */
.tcr-task-carousel-enhanced {
  max-width: none;
}

.tcr-carousel-card-enhanced {
  padding: 20px;
}

.tcr-task-media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

@media (max-width: 768px) {
  .tcr-task-media-row {
    grid-template-columns: 1fr;
  }
}

.tcr-task-photo-large {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  min-height: 250px;
}

.tcr-task-photo-large img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.tcr-task-photo-large img:hover {
  transform: scale(1.02);
}

.tcr-task-photo-count-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}

/* Task Photo Gallery */
.tcr-task-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.tcr-task-gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  aspect-ratio: 1;
}

.tcr-task-gallery-item.tcr-task-gallery-main {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

.tcr-task-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.tcr-task-gallery-item img:hover {
  transform: scale(1.05);
}

.tcr-photo-phase-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
}

.tcr-phase-before {
  background: #f59e0b;
}

.tcr-phase-during {
  background: #3b82f6;
}

.tcr-phase-after {
  background: #10b981;
}

.tcr-photo-download-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.7);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tcr-photo-download-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  color: white;
}

/* Always visible on touch devices */
@media (hover: none) {
  .tcr-photo-download-btn {
    opacity: 1;
  }
}

.tcr-task-map-container {
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  min-height: 250px;
}

.tcr-task-map {
  width: 100%;
  height: 250px;
}

.tcr-task-map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px;
  color: #9ca3af;
  font-size: 14px;
}

.tcr-task-map-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 10px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.tcr-map-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.tcr-map-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.tcr-map-toggle:hover {
  color: #1f2937;
}
.tcr-project-org { color: #059669; font-size: 13px; font-weight: 500; margin: 2px 0; }
