:root { --task-checked-background: #e8f5e9; font-family: system-ui, sans-serif; color: #17202a; background: #f5f7fa; }
body { margin: 0; } main { max-width: 1900px; margin: auto; padding: 20px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.header-actions, .toolbar, .toolbar-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.header-actions form, .toolbar form { margin: 0; }
.toolbar { justify-content: space-between; background: white; border: 1px solid #d4dce5; padding: 12px; margin: 14px 0; }
.toolbar[hidden] { display: none; }
.toolbar label { display: flex; align-items: center; gap: 6px; }
.toolbar-group { flex-wrap: nowrap; }
.evo-upload { margin-left: auto !important; }
.evo-upload input[type=file] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.file-button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; box-sizing: border-box; border-radius: 5px; padding: 9px 12px; font: inherit; line-height: 1; cursor: pointer; }
.link-button { min-height: auto; padding: 0; color: #165ea8; background: transparent; text-decoration: underline; font-size: .82rem; }
.file-button { background: #596576; color: white; }
.file-button.disabled { opacity: .5; cursor: wait; }
.file-button:focus-within, #evo-file:focus + .file-button { outline: 2px solid #165ea8; outline-offset: 2px; }
details { background: white; border: 1px solid #d4dce5; padding: 10px; margin-bottom: 12px; }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(440px, calc(100% - 40px)); background: white; border: 1px solid #d4dce5; border-radius: 8px; }
.login-card form, .login-card label { display: grid; gap: 7px; }
.login-card form { gap: 14px; margin-top: 20px; }
.login-card .error { color: #ad2929; background: #ffe0e0; padding: 8px; }
.login-card input, select { padding: 7px; }
h1 { margin: 0; font-size: 1.6rem; } h2 { font-size: 1rem; margin: 0 0 8px; }
button { background: #165ea8; color: white; border: 0; }
button:disabled { opacity: .5; cursor: wait; }
#reload[hidden] { display: none; }
button.secondary { background: #596576; }
#warnings p { background: #ffe0e0; border: 1px solid #e7a5a5; padding: 8px; margin: 6px 0; }
.controls { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
#message { min-height: 1.4em; margin: 8px 0; color: #6b7280; }
#message.error { color: #ad2929; }
#message.saved { color: #16803c; }
#evo-upload-status.saved { color: #16803c; }
#evo-upload-status.error { color: #ad2929; }
#add-task-message { color: #ad2929; }
#settings-panel { background: white; border: 1px solid #d4dce5; padding: 16px; margin: 14px 0; }
#settings-message { min-height: 1.4em; color: #ad2929; }
#settings-fields { display: grid; gap: 14px; }
#settings-fields fieldset { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; border: 1px solid #d4dce5; padding: 14px; }
#settings-fields legend { font-weight: 650; padding: 0 5px; }
.setting-field { display: grid; gap: 5px; font-size: .92rem; }
.setting-field input { min-width: 0; padding: 7px; box-sizing: border-box; }
.setting-field small { color: #596576; line-height: 1.25; }
.fixed-task { display: flex; gap: 8px; align-items: end; grid-column: 1 / -1; }
.field-error { color: #ad2929; font-size: .85rem; }
tr.just-added { outline: 3px solid #16803c; outline-offset: -3px; }
.table-wrap { overflow-x: auto; border: 1px solid #d4dce5; background: white; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 7px 8px; border-bottom: 1px solid #e3e7ec; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #eaf0f6; white-space: nowrap; }
td:nth-child(2) { min-width: 240px; max-width: 480px; }
td:nth-child(n+4) { text-align: right; }
td:nth-child(n+7) { text-align: center; }
#tasks > tr[data-task-id] > td:first-child { text-align: center; }
#tasks > tr > td:nth-child(2) { min-width: 0; max-width: none; }
#tasks > tr > td:nth-child(3) { min-width: 240px; max-width: 480px; }
#tasks > tr > td:nth-child(4) { text-align: left; }
#tasks > tr > td:nth-child(7) { text-align: right; }
td input[type=number] { width: 85px; padding: 5px; box-sizing: border-box; }
tr.over-estimate { background: #fff0bf; }
tr.task-checked { background: var(--task-checked-background); }
.task-review-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
tr.empty-billable { outline: 2px solid #ad2929; outline-offset: -2px; }
tr.evo-details td { background: #f6f8fa; }
table.evo-breakdown { width: auto; min-width: 620px; margin: 4px 0; }
table.evo-breakdown th { position: static; }
table.evo-breakdown .total td { font-weight: 600; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 16px; }
.totals > div { background: white; padding: 14px; border: 1px solid #d4dce5; border-radius: 5px; }
.totals p { line-height: 1.6; margin: 0; }
.legend { color: #596576; font-size: .85rem; }
.document-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.document-card { border: 1px solid #ccd4da; border-radius: 8px; padding: 1rem; background: #fff; }
.document-card label { display: grid; gap: .25rem; margin: .5rem 0; }
.document-card input { width: 100%; box-sizing: border-box; }
.document-card ul { padding-left: 1.2rem; }
.document-card textarea { width: 100%; min-height: 7rem; box-sizing: border-box; }
.document-links { display: flex; flex-wrap: wrap; gap: .6rem; margin: .7rem 0; }
.document-card .error { color: #a21c1c; }
@media (max-width: 760px) { .toolbar { justify-content: flex-start; } .toolbar-group { flex: 0 0 auto; } .evo-upload { margin-left: 0 !important; } }
.date-picker { position: relative; display: inline-grid; gap: 4px; min-width: 0; max-width: 100%; }
.date-picker input.picker-control { padding: 8px 25px 8px 8px; }
.picker-chevron { position: absolute; right: 9px; top: 7px; pointer-events: none; }
.date-picker input[hidden] { display: none; }
.picker-control { width: 100%; box-sizing: border-box; }
.picker-control[aria-invalid=true] { border: 2px solid #b42318; }
.date-error { color: #b42318; white-space: normal; }
.date-error:empty { display: none; }
.picker-popup { position: fixed; z-index: 100; width: 292px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; box-sizing: border-box; padding: 12px; border: 1px solid #b7c4d3; border-radius: 8px; background: white; box-shadow: 0 6px 24px #17202a30; }
.picker-header, .picker-footer { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.picker-header { margin-bottom: 8px; }
.picker-header button, .picker-days button { padding: 6px; }
.picker-months, .picker-days { display: grid; gap: 4px; text-align: center; }
.picker-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.picker-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.picker-popup button { color: #17202a; background: #eef2f6; }
.picker-popup button.selected { background: #165ea8; color: white; }
.picker-popup button.today { outline: 2px solid #165ea8; outline-offset: -2px; }
.picker-footer { margin-top: 8px; }
@media (max-width: 760px) {
  main { padding: 12px; } header, .toolbar-group { flex-wrap: wrap; }
  .toolbar-group { flex: 1 1 100%; min-width: 0; }
  .toolbar label, .toolbar select { max-width: 100%; min-width: 0; }
  .document-cards, .totals { grid-template-columns: minmax(0, 1fr); }
  .document-card, .totals > div, .setting-field { min-width: 0; overflow-wrap: anywhere; }
}

.unavailable-status { margin-top: 4px; font-size: .82rem; color: #596576; }
.unavailable-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.unavailable-actions button { max-width: 100%; }
.history-row { border: 1px solid #d7dee8; border-radius: 8px; padding: 18px; margin: 16px 0; overflow-wrap: anywhere; }
.history-row h3 { margin-top: 0; }
.history-row label { display: block; margin: 16px 0 10px; }
.history-row textarea { display: block; box-sizing: border-box; width: 100%; margin-top: 6px; resize: vertical; font: inherit; }
@media (max-width: 760px) {
  tr[data-unavailable-task-id] { display: flex; flex-wrap: wrap; width: calc(100vw - 44px); }
  tr[data-unavailable-task-id] .unavailable-description { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  tr[data-unavailable-task-id] td:last-child { flex-basis: 100%; box-sizing: border-box; }
}

.project-templates > p { margin-top: 0; max-width: 78ch; }
.template-row { display: grid; gap: .5rem; padding: 1rem 0; border-top: 1px solid var(--line, #ddd); }
.template-row > span, .template-row > small { font-size: .9rem; }
.template-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
