/* Operational status is consistent across every view and independent of accents. */
.workload-available, .coverage-full {
  --status-color: var(--success, #159568);
  --status-ink: var(--success-text, #096544);
  --status-bg: var(--success-soft, #e7f7ef);
  --status-border: var(--success-border, #b8e4cc);
  --status-wash: #f5fbf8;
}
.workload-busy, .coverage-partial {
  --status-color: var(--warning, #e3ac20);
  --status-ink: var(--warning-text, #765400);
  --status-bg: var(--warning-soft, #fff8dc);
  --status-border: var(--warning-border, #f2dfa0);
  --status-wash: #fffdf4;
}
.workload-full {
  --status-color: var(--caution, #ed832a);
  --status-ink: var(--caution-text, #994410);
  --status-bg: var(--caution-soft, #fff0e2);
  --status-border: var(--caution-border, #f5cba6);
  --status-wash: #fff8f2;
}
.workload-over, .coverage-low {
  --status-color: var(--danger, #e34c64);
  --status-ink: var(--danger-text, #a52640);
  --status-bg: var(--danger-soft, #fff0f2);
  --status-border: var(--danger-border, #f4bec9);
  --status-wash: #fff7f8;
}
.workload-unavailable, .coverage-none {
  --status-color: #7d8799;
  --status-ink: var(--muted, #556174);
  --status-bg: var(--surface-muted, #eef2f6);
  --status-border: var(--line-strong, #c9d2de);
  --status-wash: var(--surface-subtle, #f8fafc);
}
.coverage-low, .coverage-partial, .coverage-full, .coverage-none {
  --coverage-color: var(--status-ink); --coverage-tint: var(--status-bg);
}
.status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
  border: 1px solid var(--status-border); border-radius: 999px;
  background: var(--status-bg); color: var(--status-ink); font-size: 11px;
  font-weight: 650; line-height: 1.4; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: inset 0 1px 0 #ffffff80;
}
.status-badge > i, .status-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--status-color); flex: 0 0 6px; }
.status-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 14px 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.status-legend > strong { color: var(--ink); font-size: 11px; font-weight: 650; }
.status-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.status-surface { background: var(--status-wash); border-color: var(--status-border); }
.status-meter { background: var(--status-bg); overflow: hidden; border-radius: 999px; min-height: 5px; }
.status-meter > i { display: block; background: var(--status-color); height: 100%; border-radius: inherit; }
.status-text { color: var(--status-ink); font-weight: 700; }
.status-ink { color: var(--status-ink); }

/* Booked work is always green; the surrounding week keeps its coverage signal. */
.assignment:not(.compact-assignment), .gantt-bar.employee-booking-bar {
  background: var(--success-soft);
  color: var(--success-text);
  border-color: var(--success-border);
  border-left: 3px solid var(--success);
}
.assignment:not(.compact-assignment):hover,
.gantt-bar.employee-booking-bar:hover {
  background: var(--success-soft);
  border-color: var(--success);
}
.employee-project-assignment > i { background: var(--success); }
.gantt-bar.employee-booking-bar { border-right-color: var(--success); }
.gantt-bar.employee-booking-bar.continues-after { border-right-color: var(--success); }
.gantt-bar.employee-booking-bar:hover,
.gantt-bar.employee-booking-bar[aria-expanded=true] {
  box-shadow: none;
  outline: 2px solid var(--success);
  outline-offset: 0;
}
.gantt-member-week { background: var(--success-soft); color: var(--success-text); }
.gantt-member-week:hover { background: var(--success-soft); outline-color: var(--success); }
.compact-team .compact-assignment { box-shadow: 0 0 0 2px var(--success-border); }
.compact-team .compact-assignment:hover { box-shadow: 0 0 0 2px var(--success); }

/* A fine coloured edge keeps dense planning readable, also in collapsed rows. */
.project-week.status-surface { background: var(--status-wash); box-shadow: inset 0 3px 0 var(--status-color); }
.project-week.status-surface .cell-summary, .employee-cell-summary { flex-wrap: wrap; gap: 6px; }
.project-week .status-badge { font-size: 10px; padding: 3px 6px; }
.project-week .cell-progress.status-meter > i, .employee-bar.status-meter > i { background: var(--status-color); }
.project-week.status-surface .open-hours, .project-week.status-surface .covered { color: var(--status-ink); }

.project-week.drag-over { outline: 3px solid var(--accent-focus); outline-offset: -3px; }
.role-slot.status-surface { background: var(--surface); border: 1px solid var(--status-border); border-left: 3px solid var(--status-color); }
.role-slot.status-surface .role-slot-status { color: var(--status-ink); font-weight: 700; }
.role-slot.status-surface:hover:not(:disabled) { background: var(--status-bg); border-color: var(--status-color); }
.role-slot.status-surface.drag-over { outline: 3px solid var(--accent-focus); outline-offset: 1px; }

/* A person's availability is visible in tables, picker cards and previews. */
.employee-drag-card.status-surface { background: var(--status-wash); border-color: var(--status-border); border-left: 3px solid var(--status-color); }
.employee-drag-card.status-surface:hover { background: var(--status-bg); border-color: var(--status-color); box-shadow: var(--shadow-sm); }
.employee-drag-card.status-surface.selected { outline: 2px solid var(--accent-focus); outline-offset: 2px; }

.employee-drag-card .employee-card-bottom { color: var(--ink); }
.employees-table tr > td:first-child { box-shadow: inset 3px 0 0 var(--status-color, transparent); }
.employees-table td .status-badge { margin: 5px 0; }
.employees-table .employee-bar { height: 6px; margin-top: 6px; min-width: 100px; }
.employees-table .table-hours { color: var(--ink); }
.employee-preview-weeks > button.status-surface { border-left: 3px solid var(--status-color); background: var(--status-wash); }
.employee-preview-totals.status-surface { border-radius: var(--radius-md, 12px); padding: 12px; }

.metric-card.status-surface { background: var(--status-wash); border-color: var(--status-border); box-shadow: inset 0 3px 0 var(--status-color), var(--surface-shadow); }
.metric-card.status-surface .metric-value, .metric-card.status-surface .metric-label svg { color: var(--status-ink); }
.metric-card.status-surface .metric-label svg { background: var(--status-bg); }
.metric-card.status-surface .metric-dot { background: var(--status-color); box-shadow: 0 0 0 5px var(--status-bg); }
.metric-card.status-surface .mini-progress i { background: var(--status-color); }
.metric-card .metric-value > .status-badge { color: var(--status-ink); font-size: 11px; }
.mobile-workload-status { display: none; }

/* Keep operational week colours visible beneath project bars and in role rows. */
.project-gantt .gantt-project-group > .gantt-row { height: 104px; }
.gantt-week-status { position: absolute; top: 63px; height: 22px; padding: 0 2px; border: 1px solid var(--status-border); border-top: 3px solid var(--status-color); border-radius: 5px; color: var(--status-ink); background: var(--status-bg); font-size: 9px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: clip; }
.gantt-week-status:hover { outline: 2px solid var(--status-color); outline-offset: -2px; }
.gantt-role-week.status-surface { background: var(--status-bg); border-color: var(--status-border); border-left: 3px solid var(--status-color); color: var(--status-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.gantt-role-week.status-surface > small { font-size: 9px; font-weight: 650; }
.gantt-role-week.status-surface:hover { background: var(--status-bg); outline: 2px solid var(--status-color); }
.week-load.status-surface { background: var(--status-bg); color: var(--status-ink); border: 1px solid var(--status-border); border-top: 3px solid var(--status-color); border-radius: 5px; font-size: 10px; line-height: 14px; font-weight: 650; }
.week-load.status-surface:hover { outline: 2px solid var(--status-color); background: var(--status-bg); }
.team-week.status-surface, .team-week-table tr.status-surface { background: var(--status-wash); }
.team-week-status.status-surface > td, .team-week-status.status-surface > th { background: var(--status-wash); }
.team-week-status.status-surface > th:first-child { box-shadow: inset 3px 0 0 var(--status-color); }
.team-totals > .status-surface, .coverage-totals > .status-surface, .gantt-role-demand.status-surface { background: var(--status-wash); border-color: var(--status-border); }
.team-totals > .status-surface strong, .coverage-totals > .status-surface strong { color: var(--status-ink); }

/* Capacity charts show planned and free hours with coverage labels. */

.chart-week .chart-open.status-badge { font-size: 10px; white-space: normal; justify-content: center; min-height: 33px; margin-top: 8px; }
.chart-week .chart-open.status-badge.coverage-low { color: var(--status-ink); }
.capacity-table .status-badge { font-size: 10px; }
.capacity-layout .status-legend { padding-top: 0; }

@media (max-width: 760px) {
  .status-legend { gap: 6px 12px; padding: 10px 14px; font-size: 10px; }
  .status-legend > strong { flex-basis: 100%; }
  .status-badge { font-size: 10px; }

  .mobile-workload-status { display: flex; align-items: flex-start; flex-direction: column; gap: 4px; padding-top: 8px; font-size: 10px; }
  .mobile-workload-status .status-badge { margin: 0; font-size: 10px; }
}
