/* Task Manager only: keep shared calendar and modal styles unchanged. */
.task-workspace { min-width: 0; font-size: 13px; letter-spacing: 0; }
.task-view-bar, .task-views, .task-section-heading, .task-detail-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-view-bar { justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.task-views { gap: 6px; }
.task-views span { margin-left: 5px; opacity: .75; font-variant-numeric: tabular-nums; }
.task-workspace .task-filters { align-items: end; margin: 16px 0; gap: 12px; }
.task-filters > div { min-width: 120px; }
.task-table { table-layout: fixed; width: 100%; }
.task-table th:nth-child(1) { width: 27%; }
.task-table th:nth-child(2) { width: 16%; }
.task-table th:nth-child(3) { width: 12%; }
.task-table th:nth-child(4) { width: 10%; }
.task-table th:nth-child(5) { width: 22%; }
.task-table th:nth-child(6) { width: 13%; }
.task-table th, .task-table td { padding: 14px 10px; vertical-align: top; overflow-wrap: anywhere; white-space: normal; }
.task-table .task-overdue td:first-child { border-left: 3px solid var(--red); }
.task-title-link { display: block; border: 0; background: none; padding: 0; text-align: left; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; overflow-wrap: anywhere; }
.task-title-link:hover { text-decoration: underline; color: var(--blue); }
.task-title-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.task-muted { color: var(--text2); font-size: 12px; overflow-wrap: anywhere; }
.task-late { color: var(--red); font-weight: 600; }
.task-workspace progress { display: block; width: 100%; max-width: 170px; height: 6px; margin: 7px 0; accent-color: var(--green); }
.task-detail { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; }
.task-main { grid-column: 1; grid-row: 1; min-width: 0; }
.task-properties { grid-column: 2; grid-row: 1; border-left: 1px solid var(--border); padding-left: 22px; overflow-wrap: anywhere; }
.task-properties .form-label:not(:first-child), .task-properties h3 { margin-top: 20px; }
.task-workspace h3 { font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 8px; letter-spacing: 0; }
.task-detail-header { justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.task-detail-header h2 { font-size: 21px; line-height: 1.35; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; letter-spacing: 0; }
.task-prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.task-description, .task-meta-editor { padding-bottom: 22px; }
.task-description h3:not(:first-child) { margin-top: 18px; }
.task-meta-editor textarea { min-height: 100px; }
.task-milestones, .task-conversation { border-top: 1px solid var(--border); padding: 18px 0; }
.task-section-heading { margin: 8px 0; }
.task-section-heading h3 { margin: 0; }
.task-section-heading .task-muted { margin-right: auto; }
/* One grid for every row, so assignee, due date and progress line up down the page:
   checkbox | name (+ guide, remark, file link) | assignee | due | progress | actions */
.task-milestone, .task-cols { display: grid; grid-template-columns: 18px minmax(0,1fr) 170px 132px 178px 70px; align-items: start; gap: 6px 12px; padding: 10px 12px; }
.task-milestone input[type=checkbox] { width: 16px; height: 16px; margin: 6px 0 0; }
.task-milestone-head { padding: 0 12px 6px; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; }
/* A milestone and its sub-items are one block. */
.task-group { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.task-ms-head { background: var(--surface2); }
.task-group .task-subitem, .task-group .task-adding, .task-group .task-add-line { border-top: 1px solid var(--border); }
.task-group > .task-adding:first-child { border-top: 0; }
.task-subitem .task-cell-name, .task-subitem .task-add-cell { padding-left: 22px; }
.task-row-late { box-shadow: inset 3px 0 0 var(--red); }
.task-cell-name { min-width: 0; }
.task-name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 28px; }
.task-ms-head .task-milestone-title { font-weight: 600; }
.task-milestone-title { overflow-wrap: anywhere; }
.task-workspace .task-title-btn { width: auto; height: auto; min-height: 0; background: none; border: 0; padding: 2px 4px; margin-left: -4px; border-radius: 4px; font: inherit; color: inherit; text-align: left; cursor: text; }
.task-workspace .task-title-btn:hover, .task-workspace .task-title-btn:focus-visible { background: var(--surface2); outline: 1px solid var(--border); }
.task-ms-head .task-title-btn:hover, .task-ms-head .task-title-btn:focus-visible { background: var(--surface); }
.task-workspace .task-chevron { width: 20px; height: 20px; min-height: 0; padding: 0; background: none; border: 0; color: var(--text2); font-size: 13px; line-height: 1; cursor: pointer; }
.task-cell-assignee, .task-cell-due, .task-cell-progress { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 28px; }
.task-avatar { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; background: var(--blue-bg); color: var(--blue); }
.task-avatar-none { background: var(--surface2); color: var(--text3); }
/* Date and assignee are changed in place. app.css makes inputs full width; these are not. */
.task-workspace .task-inline { width: auto; min-width: 0; max-width: 100%; height: 28px; padding: 2px 6px; font-size: 12px; }
.task-workspace select.task-inline { flex: 1 1 auto; }
.task-workspace input.task-inline.task-late { color: var(--red); }
.task-bar { flex: 1 1 auto; min-width: 30px; height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.task-ms-head .task-bar { background: var(--surface); }
.task-bar span { display: block; height: 100%; background: var(--green); }
.task-percent-cell { display: flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 13px; }
.task-percent-text { min-width: 40px; justify-content: flex-end; font-weight: 600; }
.task-workspace .task-percent { width: 58px; height: 28px; padding: 2px 6px; text-align: right; }
.task-row-notes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-top: 2px; }
.task-remark, .task-file, .task-guide-empty { font-size: 12px; line-height: 1.5; color: var(--text2); overflow-wrap: anywhere; min-width: 0; }
.task-row-notes .task-row-edit, .task-name-line .task-row-edit { flex: 1 1 100%; margin-top: 0; }
.task-workspace .task-link-btn { display: inline; width: auto; height: auto; min-height: 0; line-height: 1.5; background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
/* "+ Remark" and friends stay quiet until wanted, so empty rows do not shout. */
.task-workspace .task-add-note { color: var(--text3); text-decoration: none; }
.task-workspace .task-add-note:hover, .task-workspace .task-add-note:focus-visible { color: var(--blue); text-decoration: underline; }
.task-guide { margin-top: 4px; background: var(--amber-bg); border-radius: 6px; padding: 6px 9px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.task-guide .task-row-edit { margin-top: 0; }
.task-row-edit { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.task-workspace .task-row-edit input, .task-workspace .task-row-edit textarea { flex: 1 1 200px; min-width: 0; width: auto; }
.task-row-edit textarea { min-height: 60px; }
.task-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; min-height: 28px; }
.task-workspace .task-add-btn { width: 26px; height: 26px; min-height: 0; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text2); font-size: 16px; line-height: 1; cursor: pointer; }
.task-workspace .task-add-btn:hover, .task-workspace .task-add-btn:focus-visible { color: var(--blue); border-color: var(--blue); }
/* The row a new milestone or sub-item is typed into. */
.task-adding { background: var(--blue-bg); }
.task-add-cell { grid-column: 2 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.task-workspace .task-add-cell input { flex: 1 1 220px; min-width: 0; width: auto; height: 30px; }
.task-add-hint { font-size: 11px; }
.task-workspace .task-add-line { display: block; width: 100%; height: auto; min-height: 0; text-align: left; background: none; border: 0; padding: 8px 12px 8px 52px; color: var(--blue); font: inherit; font-size: 12px; cursor: pointer; }
.task-workspace .task-add-line:hover, .task-workspace .task-add-line:focus-visible { background: var(--surface2); }
.task-workspace .task-add-milestone { padding-left: 12px; border: 1px dashed var(--border); border-radius: 8px; }
/* What an admin wants before reading a row. */
.task-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 10px 0 12px; }
.task-tile { background: var(--surface2); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.task-tile-label { font-size: 11px; color: var(--text2); }
.task-tile-value { font-size: 20px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.task-tile-date { font-size: 15px; padding-top: 4px; }
.task-tile .task-bar { margin-top: 6px; background: var(--surface); }
.task-tile-late { background: var(--red-bg); }
.task-tile-late .task-tile-label, .task-tile-late .task-tile-value { color: var(--red); }
.task-item-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.task-drive { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.task-drive-label { font-weight: 600; overflow-wrap: anywhere; }
.task-finished { text-decoration: line-through; color: var(--text3); }
.task-action-menu { position: relative; }
.task-action-menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; font-size: 22px; }
.task-action-menu summary::-webkit-details-marker { display: none; }
.task-action-menu summary:hover { background: var(--surface2); }
.task-action-menu > div { position: absolute; right: 0; top: 32px; z-index: 10; width: 165px; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 6px; padding: 4px; box-shadow: 0 4px 16px #0002; }
.task-action-menu button { display: block; width: 100%; background: none; border: 0; padding: 9px; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.task-action-menu button:hover { background: var(--surface2); }
.task-action-menu button.task-late { color: var(--red); }
.task-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.task-reply { padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.task-reply .task-muted { margin-bottom: 6px; }
.task-reply-actions { justify-content: flex-end; margin-top: 10px; }
.task-conversation textarea { min-height: 100px; }
.task-activity { list-style: none; padding: 0; }
.task-activity li { padding: 12px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
/* Narrow: the columns fold under the name. name | menu, then assignee | due, then progress. */
@media (max-width: 1180px) {
  .task-milestone { grid-template-columns: 18px minmax(0,1fr) minmax(0,1fr) auto; }
  .task-milestone-head { display: none; }
  .task-cell-name { grid-column: 2 / 4; grid-row: 1; }
  .task-milestone > .task-item-actions { grid-column: 4; grid-row: 1; }
  .task-cell-assignee { grid-column: 2; grid-row: 2; }
  .task-cell-due { grid-column: 3; grid-row: 2; }
  .task-cell-progress { grid-column: 2 / -1; grid-row: 3; }
  .task-cell-progress:empty { display: none; }
}
@media (max-width: 900px) {
  .task-detail { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .task-properties { grid-column: 1; grid-row: 1; border-left: 0; padding: 0 0 18px; border-bottom: 1px solid var(--border); }
  .task-main { grid-row: 2; }
  .task-table thead { display: none; }
  .task-table, .task-table tbody, .task-table tr, .task-table td { display: block; width: auto; }
  .task-table tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .task-table td { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 4px 10px; border: 0; padding: 5px 8px; }
  .task-table td::before { content: attr(data-label); color: var(--text2); font-size: 12px; grid-column: 1; grid-row: 1 / span 5; }
  .task-table td > * { grid-column: 2; min-width: 0; }
  .task-table .badge { justify-self: start; }
}
@media (max-width: 540px) {
  .task-workspace .task-filters > div { min-width: 0 !important; width: 100%; flex: auto !important; }
  .task-views .btn { white-space: normal; }
  .task-milestone { gap: 6px 8px; padding: 10px 8px; }
  .task-subitem .task-cell-name, .task-subitem .task-add-cell { padding-left: 10px; }
  .task-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .task-workspace .task-add-line { padding-left: 34px; }
}
