:root {
    --teal: #25b8c4;
    --teal-dark: #087f8a;
    --ink: #18313a;
    --muted: #65737a;
    --line: #dbe3e6;
    --soft: #f4f7f8;
    --white: #fff;
    --shadow: 0 8px 28px rgba(24, 49, 58, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f8fafb; font-family: Inter, "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; }
main { max-width: 1800px; margin: 0 auto; padding: 28px; }
.title-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 20px; }
.title-row > div:first-child { text-align: left; }
h1, h2, p { margin-top: 0; }
.title-row h1 { margin-left: 0; margin-bottom: 6px; text-align: left; font-size: 30px; letter-spacing: -.6px; }
h2 { margin-bottom: 0; font-size: 18px; }
.eyebrow { margin-bottom: 5px; color: var(--teal-dark); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 700; }
.calculation-rule { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.report-actions { display: flex; gap: 8px; }
button { border: 0; border-radius: 6px; padding: 10px 14px; color: white; background: var(--teal-dark); cursor: pointer; }
button:hover { filter: brightness(.94); }
button.secondary { color: var(--ink); background: #e8edef; }
.filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.filters label:not(.checkbox-filter) { min-width: 165px; color: #4f6067; font-size: 12px; font-weight: 650; }
.filters select, .filters input[type="date"] { display: block; width: 100%; min-height: 38px; margin-top: 5px; border: 1px solid #cbd6da; border-radius: 5px; padding: 7px 9px; color: var(--ink); background: white; }
.checkbox-filter { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 5px; color: #31484f; background: #eaf8f9; font-size: 13px; font-weight: 650; }
.checkbox-filter input { width: 17px; height: 17px; accent-color: var(--teal-dark); }
.text-button { color: var(--teal-dark); background: transparent; padding-inline: 5px; }
.notice { margin-top: 16px; padding: 14px; border: 1px solid #cfe9ec; border-radius: 7px; background: #edf9fa; }
.notice.error { color: #8e2531; border-color: #efc4c9; background: #fff1f2; }
.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(135px, 1fr)); gap: 12px; margin: 18px 0; }
.summary-grid article { min-height: 95px; display: flex; flex-direction: column; justify-content: space-between; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.summary-grid article span { color: var(--muted); font-size: 12px; }
.summary-grid article strong { font-size: 24px; }
.summary-grid article.accent { color: white; border-color: var(--teal-dark); background: linear-gradient(135deg, var(--teal-dark), var(--teal)); }
.summary-grid article.accent span { color: white; }
.report-grid { display: grid; grid-template-columns: 315px minmax(0, 1fr); gap: 16px; align-items: start; }
.side-panels { display: grid; gap: 16px; }
.project-panel, .internal-panel, .chart-card, .matrix-card { border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { padding: 14px 14px 8px; border-bottom: 2px solid var(--teal); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.panel-heading > div, .project-row, .internal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.sort-button { width: 100%; height: auto; min-height: 0; display: inline-flex; align-items: center; justify-content: inherit; gap: 4px; overflow: hidden; margin: 0; padding: 0; border: 0; border-radius: 0; color: inherit; background: transparent; font: inherit; text-align: inherit; text-transform: inherit; letter-spacing: inherit; white-space: nowrap; }
.sort-button:hover { color: var(--teal-dark); background: transparent; filter: none; }
.sort-button span { flex: 0 0 auto; font-size: 9px; }
.panel-heading .sort-button:first-child { justify-content: flex-start; }
.panel-heading .sort-button:last-child { justify-content: flex-end; }
.project-list { max-height: 710px; overflow-y: auto; }
.internal-list { max-height: 420px; overflow-y: auto; }
.project-row, .internal-row { padding: 9px 13px; border-bottom: 1px solid #edf1f2; font-size: 13px; }
.project-row:nth-child(even), .internal-row:nth-child(even) { background: var(--soft); }
.project-row span:first-child, .internal-row span:first-child { overflow-wrap: anywhere; }
.project-total, .internal-total { font-weight: 750; border-top: 2px solid var(--teal); }
.main-report-panel { min-width: 0; display: grid; gap: 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.section-heading .eyebrow { margin-bottom: 3px; }
.legend, .hint { color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; background: var(--teal); }
.weekly-chart { min-height: 185px; display: flex; align-items: end; gap: 12px; padding: 22px 20px 15px; overflow-x: auto; background: linear-gradient(to top, transparent 24%, #eef2f3 25%, transparent 25%, transparent 49%, #eef2f3 50%, transparent 50%, transparent 74%, #eef2f3 75%, transparent 75%); }
.bar-group { min-width: 66px; height: 145px; display: grid; grid-template-rows: 1fr auto; align-items: end; text-align: center; }
.bar-track { height: 112px; display: flex; align-items: end; justify-content: center; }
.bar { width: 34px; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(var(--teal), var(--teal-dark)); position: relative; }
.bar strong { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); white-space: nowrap; color: var(--ink); font-size: 10px; }
.bar-group > span { margin-top: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.table-scroll { overflow: auto; max-height: 680px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; }
#utilisation-table .hierarchy-column { width: 260px; }
#utilisation-table .hours-column { width: 100px; }
#utilisation-table .utilisation-column { width: 105px; }
#utilisation-table .fee-column { width: 105px; }
#utilisation-table .rate-column { width: 120px; }
th, td { overflow: hidden; padding: 8px 9px; border-right: 1px solid #e5eaec; border-bottom: 1px solid #e5eaec; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
th:first-child, td:first-child { position: sticky; left: 0; z-index: 2; width: 260px; min-width: 260px; max-width: 260px; text-align: left; background: white; box-shadow: 1px 0 0 #d4dde0; }
thead th { position: sticky; top: 0; z-index: 3; color: #3e5158; background: #f6f8f9; }
thead tr:first-child th { top: 0; border-bottom-color: var(--teal); }
thead tr:nth-child(2) th { top: 34px; font-size: 10px; }
thead tr:nth-child(2) th { overflow: visible; padding-inline: 7px; text-overflow: clip; }
thead .sort-button { justify-content: flex-end; }
thead .hierarchy-heading .sort-button { justify-content: flex-start; }
thead th:first-child { z-index: 4; }
#utilisation-table .hierarchy-heading { overflow: hidden; width: 260px; min-width: 260px; max-width: 260px; padding-inline: 9px; text-overflow: ellipsis; }
tbody tr:nth-child(even) { background: #f2f4f5; }
tbody tr:hover { background: #e8f7f8; }
tbody tr:nth-child(even) > td:first-child { background: #f2f4f5; }
tbody tr:nth-child(odd) > td:first-child { background: white; }
tbody tr:hover > td:first-child { background: #e8f7f8; }
tfoot { font-weight: 750; background: white; }
tfoot td { position: sticky; bottom: 0; z-index: 3; border-top: 2px solid var(--teal); background: white; box-shadow: 0 -1px 0 #d4dde0; }
tfoot td:first-child { z-index: 5; background: white; box-shadow: 1px -1px 0 #d4dde0; }
.employee-cell { display: flex; align-items: center; gap: 7px; width: 240px; min-width: 0; }
.employee-cell strong, .employee-cell > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expand-button { width: 24px; min-width: 24px; height: 24px; min-height: 24px; flex: 0 0 24px; display: inline-grid; place-items: center; margin: 0; padding: 0; border: 1px solid #8da9b0; border-radius: 6px; color: var(--teal-dark); background: #f7fcfc; box-shadow: 0 1px 2px rgba(24, 49, 58, .08); font-size: 0; font-weight: 700; line-height: 1; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.expand-button::before { content: '+'; font-size: 15px; line-height: 1; }
.expand-button[aria-expanded="true"]::before { content: '−'; }
.expand-button:hover { border-color: var(--teal-dark); color: #065d65; background: #def4f5; box-shadow: 0 2px 5px rgba(8, 127, 138, .18); filter: none; transform: translateY(-1px); }
.expand-button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.hierarchy-project { background: #f7f9f9; font-weight: 600; }
.hierarchy-task { color: #40535a; background: white; }
.hierarchy-project > td:first-child { background: #f7f9f9; }
.hierarchy-task > td:first-child { background: white; }
.project-cell { padding-left: 18px; }
.task-cell { min-width: 230px; display: grid; grid-template-columns: minmax(95px, auto) 1fr; padding-left: 48px; }
.task-cell small { overflow: hidden; color: #7b888d; font-size: 9px; font-weight: 500; text-overflow: ellipsis; }
.hierarchy-project[hidden], .hierarchy-task[hidden] { display: none; }
.empty { padding: 28px; color: var(--muted); text-align: center; }

@media (max-width: 1050px) {
    .summary-grid { grid-template-columns: repeat(3, 1fr); }
    .report-grid { grid-template-columns: 1fr; }
    .project-list { max-height: 300px; }
}
@media (max-width: 700px) {
    .title-row { align-items: flex-start; flex-direction: column; }
    main { padding: 16px; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .filters > * { flex: 1 1 100%; }
}
@media print {
    .sidebar, .report-actions, .filters, .hint, .expand-button { display: none !important; }
    body { background: white; }
    main { max-width: none; padding: 8px; }
    .summary-grid { grid-template-columns: repeat(6, 1fr); }
    .report-grid { grid-template-columns: 260px 1fr; }
    .project-panel, .internal-panel, .chart-card, .matrix-card, .summary-grid article { box-shadow: none; }
    .table-scroll, .project-list { max-height: none; overflow: visible; }
}
