/* Shared page order: title and KPIs, search and period, then the work itself. */
.workspace-heading.page-heading {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(500px, 1.2fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  padding: 12px 24px;
  border: 1px solid #ffffffd9;
  border-radius: var(--radius-xl);
  background: radial-gradient(ellipse at 100% 0%, #ffffff00, #ffffffb3 65%), linear-gradient(115deg, var(--accent-soft), #ffffffd9 58%, var(--purple-soft));
  box-shadow: var(--shadow-sm);
}
.workspace-heading .page-title { min-width: 0; }
.workspace-heading h1 { margin: 4px 0 0; font-size: 31px; line-height: 1.3; letter-spacing: -1.3px; }
.workspace-heading .page-title > p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; max-width: 420px; }
.workspace-heading .eyebrow { font-size: 9px; letter-spacing: 1.4px; color: var(--accent-text); font-weight: 800; }
.workspace-heading .page-kpis { min-width: 0; }
.workspace-heading .kpi-scope { margin: 0 0 6px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.workspace-heading .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.workspace-heading .metric-card { padding: 11px 12px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.workspace-heading .metric-card.status-surface { box-shadow: inset 0 2px 0 var(--status-color); }
.workspace-heading .metric-label { font-size: 10px; line-height: 1.4; gap: 4px; white-space: nowrap; }
.workspace-heading .metric-label svg { width: 14px; height: 14px; padding: 0; border-radius: 0; background: none; flex-shrink: 0; }
.workspace-heading .metric-value { margin: 7px 0 0; font-size: 25px; line-height: 1.2; letter-spacing: -.8px; gap: 4px; flex-wrap: nowrap; font-variant-numeric: tabular-nums; }
.workspace-heading .metric-value > span { font-size: 11px; letter-spacing: 0; }

.page-tools { padding: 16px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.page-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.page-toolbar > .search-field { flex: 1 1 210px; min-width: 180px; background: var(--surface-subtle); }
.page-toolbar .search-field input { padding: 9px 0; font-size: 12px; }
.page-period { min-width: 0; }
.page-tools .week-navigation, .page-tools .gantt-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-tools .heading-actions { flex: 0 1 auto; margin-left: auto; width: auto; gap: 8px; }
.page-tools .button { min-height: 38px; padding: 9px 12px; font-size: 11px; }
.page-tools .nav-arrow-group .icon-button { width: 30px; height: 34px; }
.page-tools .date-picker, .page-tools .gantt-month-picker { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.page-tools .date-picker input, .page-tools .gantt-month-picker input { min-width: 0; border: 0; background: transparent; font-size: 12px; padding: 7px 0; }
.page-tools select { min-width: 0; max-width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; }
.page-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.page-tools .planning-switches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0; }
.page-tools .planning-view-switch, .page-tools .planning-group-switch, .page-tools .segmented-control { width: auto; margin: 0; padding: 4px; border-radius: var(--radius-md); }
.page-tools .planning-view-switch button, .page-tools .planning-group-switch button, .page-tools .segmented-control button { min-height: 32px; padding: 7px 10px; font-size: 11px; border-radius: var(--radius-sm); }
.page-tools .planning-group-label { font-size: 10px; }
.page-tools .gantt-range-controls { flex-wrap: wrap; gap: 8px; }
.page-tools .gantt-coverage-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0; margin: 0; background: none; border: 0; }
.page-tools .gantt-coverage-controls > .coverage-field, .page-tools .coverage-range > label { flex-direction: row; align-items: center; gap: 6px; }
.page-tools .coverage-field > label, .page-tools .gantt-staff-control > label { font-size: 10px; }
.page-tools .gantt-staff-control { flex-wrap: wrap; gap: 6px; margin-left: auto; }
.toolbar-scope { color: var(--muted); font-size: 11px; line-height: 1.5; }
.page-filters > .toolbar-scope { margin-left: auto; }
.workspace-page .page-body > :first-child { margin-top: 0; }
.results-summary { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.workspace-page .gantt-heading { padding: 16px 20px; align-items: center; gap: 12px; }
.workspace-page .gantt-heading h2 { font-size: 16px; margin: 0; }
.workspace-page .gantt-heading p { margin: 5px 0 0; }
.workspace-page .project-gantt > .coverage-scope { padding: 0 20px; margin: 0 0 12px; }

/* Project rows follow the employee overview, with coverage for the whole project. */
.project-table-panel { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); }
.projects-table th, .projects-table td { padding: 16px 18px; vertical-align: middle; }
.projects-table th:first-child, .projects-table td:first-child { padding-left: 23px; }
.table-column-note { display: block; margin-top: 3px; font-size: 10px; font-weight: 400; }
.project-list-name { display: flex; align-items: center; gap: 9px; max-width: 100%; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; font-size: 13px; line-height: 1.5; white-space: normal; }
.project-list-name strong { font-weight: 650; overflow-wrap: anywhere; }
.project-list-name .project-color { flex: 0 0 7px; }
.project-list-name:hover strong { text-decoration: underline; }
.project-row-location { display: flex; align-items: center; gap: 5px; margin: 6px 0 0 16px; color: var(--muted); font-size: 11px; white-space: normal; }
.project-row-location svg { flex-shrink: 0; }
.project-row-dates { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 11px; }
.project-row-dates + .badge { display: inline-flex; margin-top: 8px; font-size: 10px; padding: 4px 7px; }
.project-row-roles { max-width: 320px; gap: 6px; }
.project-row-roles > span { white-space: normal; overflow-wrap: anywhere; }
.project-row-coverage { min-width: 100px; }
.project-coverage-meter { width: 112px; max-width: 100%; height: 5px; margin-top: 9px; border-radius: 6px; overflow: hidden; }
.project-coverage-meter > i { display: block; height: 100%; border-radius: inherit; }
.projects-table .table-actions .button { padding: 7px 9px; font-size: 11px; }
.project-table-hint { display: none; margin: 0; padding: 10px 18px; color: var(--muted); font-size: 11px; }

/* Both management tables use the same row height and vertical spacing. */
.workspace-page { --management-row-height: 96px; }
:is(.employees-table, .projects-table) > thead > tr { height: 56px; }
:is(.employees-table, .projects-table) > tbody > tr { height: var(--management-row-height); }
:is(.employees-table, .projects-table) > :is(thead, tbody) > tr > :is(th, td) { padding-block: 8px; vertical-align: middle; }

/* Column positions depend on the viewport, never on the selected week's data. */
:is(.employees-table, .projects-table, .capacity-table) { table-layout: fixed; width: 100%; }
:is(.employees-table, .projects-table, .capacity-table) > tbody > tr > td { white-space: normal; overflow-wrap: anywhere; }
:is(.employees-table, .projects-table, .capacity-table) .status-badge { max-width: 100%; white-space: normal; }
:is(.employees-table, .projects-table, .capacity-table) .status-badge > i { flex-shrink: 0; }

.employees-table, .projects-table { min-width: 1120px; }
.employees-table th:nth-child(1) { width: 20%; }
.employees-table th:nth-child(2) { width: 19%; }
.employees-table th:nth-child(3) { width: 10%; }
.employees-table th:nth-child(4) { width: 16%; }
.employees-table th:nth-child(5) { width: 12%; }
.employees-table th:nth-child(6) { width: 23%; }
.employees-table .person-link { max-width: 100%; text-align: left; white-space: normal; }
.employees-table .person-link .avatar { flex-shrink: 0; }
.employees-table .table-actions { flex-wrap: wrap; }
.employees-table .table-actions .button { white-space: nowrap; }
.projects-table th:nth-child(1) { width: 24%; }
.projects-table th:nth-child(2) { width: 17%; }
.projects-table th:nth-child(3) { width: 27%; }
.projects-table th:nth-child(4) { width: 13%; }
.projects-table th:nth-child(5) { width: 19%; }

.capacity-table { min-width: 1000px; }
.capacity-table th:nth-child(1) { width: 25%; }
.capacity-table th:nth-child(2) { width: 12%; }
.capacity-table th:nth-child(3) { width: 15%; }
.capacity-table th:nth-child(4) { width: 13%; }
.capacity-table th:nth-child(5) { width: 17%; }
.capacity-table th:nth-child(6) { width: 18%; }
.workspace-page .chart-y { flex: 0 0 56px; width: 56px; }

@media (max-width: 1200px) {
  .workspace-heading.page-heading { grid-template-columns: minmax(170px, .65fr) minmax(410px, 1.35fr); gap: 18px; padding: 8px 20px; }
  .workspace-heading .metric-card { padding: 10px; }
  .workspace-heading .metric-label svg { display: none; }
  .page-tools .heading-actions { flex-wrap: wrap; }
}
@media (max-width: 1000px) {
  .workspace-heading.page-heading { grid-template-columns: 1fr; gap: 12px; }
  .workspace-heading .page-title > p { max-width: none; }
  .workspace-heading .metric-label svg { display: block; }
  .page-tools .planning-group-label { display: none; }
  .project-table-hint { display: block; }
}
@media (max-width: 760px) {
  .workspace-page { --management-row-height: 112px; }
  .project-table-panel { border-radius: 15px; }
  .workspace-heading.page-heading { margin-bottom: 14px; padding: 18px 14px; border-radius: var(--radius-lg); }
  .workspace-heading h1 { font-size: 27px; }
  .workspace-heading .metrics { gap: 6px; }
  .workspace-heading .metric-card { padding: 10px; }
  .workspace-heading .metric-label { font-size: 10px; white-space: normal; }
  .workspace-heading .metric-label svg { display: none; }
  .workspace-heading .metric-value { font-size: 23px; }
  .page-tools { padding: 12px; border-radius: var(--radius-lg); }
  .page-toolbar > .search-field, .page-period { width: 100%; flex-basis: 100%; }
  .page-tools .heading-actions { margin-left: 0; }
  .page-tools .heading-actions .button { width: auto; min-height: 36px; padding: 8px 10px; font-size: 11px; }
  .page-tools .planning-view-switch, .page-tools .planning-group-switch { max-width: 100%; }
  .page-tools .planning-view-switch button { flex: 1; }
  .page-filters > .toolbar-scope { margin-left: 0; }
  .page-tools .gantt-staff-control { margin-left: 0; }
  .page-tools .coverage-field { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .workspace-heading .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-heading .metric-label svg { display: block; }
  .page-filters select { flex: 1 1 120px; }
}
