:root {
  --bg: #f5f7fa; --surface: #fff; --text: #172033; --muted: #667085;
  --line: #dfe3ea; --blue: #1769e0; --blue-soft: #eaf2ff;
  --red: #c7352c; --red-soft: #fff0ee; --amber: #ad6800; --amber-soft: #fff7e6;
  --green: #16845b; --green-soft: #eaf7f1; --shadow: 0 14px 36px rgba(24, 33, 48, .14);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; }
.app-header { min-height: 72px; padding: 0 28px; display: grid; grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr); align-items: center; gap: 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: #1769e0; color: #fff; font-weight: 700; font-size: 18px; }
.brand h1 { margin: 0; font-size: 18px; line-height: 1.35; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.primary-nav { align-self: stretch; display: flex; gap: 24px; }
.nav-item { border: 0; border-bottom: 2px solid transparent; padding: 0 2px; background: transparent; color: #475467; font-size: 14px; font-weight: 600; }
.nav-item.active { border-bottom-color: var(--blue); color: var(--blue); }
.primary, .secondary { min-height: 40px; border-radius: 6px; padding: 0 16px; font-size: 14px; font-weight: 600; }
.primary { justify-self: end; border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.primary:hover { background: #0f5bc7; }
.secondary { border: 1px solid #cfd5df; background: #fff; color: #344054; }
.compact { min-height: 34px; padding: 0 13px; font-size: 13px; }
main { width: min(1440px, 100%); margin: 0 auto; padding: 26px 28px 48px; }
.workspace { min-width: 0; }
.page-heading { min-height: 50px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.page-heading h2 { margin: 0; font-size: 21px; line-height: 1.35; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.metrics { margin: 18px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.metrics button { min-height: 86px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 5px; padding: 14px 20px; border: 0; border-right: 1px solid var(--line); background: transparent; text-align: left; }
.metrics button:last-child { border-right: 0; }
.metrics button:hover { background: #fafbfc; }
.metrics span { color: var(--muted); font-size: 13px; }
.metrics strong { font-size: 25px; line-height: 1; }
.metrics strong.danger { color: var(--red); }
.filter-bar { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; }
.search-field { flex: 1 1 360px; }
.filter-bar input[type="search"], .filter-bar select { width: 100%; height: 36px; border: 1px solid #cfd5df; border-radius: 6px; background: #fff; color: var(--text); font-size: 13px; }
.filter-bar input[type="search"] { padding: 0 12px; }
.filter-bar select { min-width: 120px; padding: 0 28px 0 10px; }
.check-control { display: flex; align-items: center; gap: 7px; padding: 0 6px; color: #475467; font-size: 13px; white-space: nowrap; }
.check-control input { width: 16px; height: 16px; accent-color: var(--blue); }
.result-count { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.task-table { border: 1px solid var(--line); border-radius: 0 0 8px 8px; overflow: hidden; background: var(--surface); }
.task-table-head, .task-row { display: grid; grid-template-columns: minmax(230px, 1.7fr) 100px 110px 110px 145px minmax(150px, 1fr) 76px; gap: 14px; align-items: center; }
.task-table-head { min-height: 42px; padding: 0 16px; background: #f8f9fb; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; }
.task-row { width: 100%; min-height: 76px; padding: 11px 16px; border: 0; border-bottom: 1px solid #edf0f4; background: #fff; color: var(--text); text-align: left; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #f8fbff; }
.task-id { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.task-company { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.task-model { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.status { width: fit-content; padding: 4px 8px; border-radius: 4px; background: var(--blue-soft); color: #175cb8; font-size: 12px; font-weight: 600; }
.status.pending { background: var(--amber-soft); color: var(--amber); }
.status.done { background: var(--green-soft); color: var(--green); }
.handler, .time-value, .due-value, .blocker { min-width: 0; font-size: 13px; }
.time-value strong { display: block; font-size: 14px; }
.time-value span, .due-value span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.time-value.overdue strong, .due-value.overdue, .blocker.overdue { color: var(--red); }
.blocker { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #475467; }
.row-action { justify-self: end; color: var(--blue); font-size: 13px; font-weight: 600; }
.empty { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 6px; color: #344054; font-size: 15px; }
.role-directory { margin: 18px 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.role-summary { min-height: 90px; padding: 16px; border-right: 1px solid var(--line); }
.role-summary:last-child { border-right: 0; }
.role-summary strong { display: block; font-size: 14px; }
.role-summary span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.people-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.people-table-head, .person-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(210px, 1.5fr) minmax(180px, 1fr) 150px 90px; gap: 16px; align-items: center; padding: 0 16px; }
.people-table-head { min-height: 42px; background: #f8f9fb; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; }
.person-row { min-height: 64px; border-bottom: 1px solid #edf0f4; font-size: 13px; }
.person-row:last-child { border-bottom: 0; }
.person-name strong { display: block; }
.person-name span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.role-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.role-tag { padding: 3px 7px; border-radius: 4px; background: #eef2f6; color: #344054; font-size: 11px; }
.link-button { justify-self: end; border: 0; background: transparent; color: var(--blue); font-size: 13px; font-weight: 600; }
.state-panel { min-height: 55vh; display: grid; place-items: center; align-content: center; text-align: center; }
.state-panel h2 { margin: 14px 0 6px; font-size: 18px; }.state-panel p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.spinner { width: 30px; height: 30px; border: 3px solid #dce6f5; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.state-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .38); }
.drawer-backdrop { z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; z-index: 21; width: min(560px, 100vw); height: 100vh; display: flex; flex-direction: column; background: #fff; box-shadow: var(--shadow); transform: translateX(105%); transition: transform .2s ease; }
.drawer.open { transform: translateX(0); }
.drawer-head { min-height: 86px; padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.drawer-kicker { margin: 0 0 4px; color: var(--muted); font-size: 12px; }.drawer-head h2 { margin: 0; font-size: 19px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 6px; background: #f2f4f7; color: #344054; font-size: 24px; line-height: 1; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px 32px; }
.progress-track { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 24px; }
.progress-step { position: relative; padding-top: 24px; color: var(--muted); text-align: center; font-size: 11px; }
.progress-step::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 2px; background: #e4e7ec; }
.progress-step:first-child::before { left: 50%; }.progress-step:last-child::before { right: 50%; }
.progress-step::after { content: ""; position: absolute; top: 3px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: #d0d5dd; }
.progress-step.done::before, .progress-step.done::after { background: var(--blue); }.progress-step.current { color: var(--text); font-weight: 700; }
.detail-alert { margin-bottom: 18px; padding: 12px 14px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: #744b00; font-size: 13px; }
.detail-alert.overdue { border-left-color: var(--red); background: var(--red-soft); color: #8f2822; }
.detail-grid { display: grid; grid-template-columns: 100px 1fr; gap: 10px 16px; margin: 0; font-size: 13px; }
.detail-grid dt { color: var(--muted); }.detail-grid dd { margin: 0; min-width: 0; word-break: break-word; }
.section-title { margin: 26px 0 12px; font-size: 15px; }
.timeline { border-left: 1px solid #d0d5dd; margin-left: 5px; padding-left: 18px; }
.detail-files { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }.file-link { padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--blue); text-decoration: none; background: #f8fbff; }.muted { color: var(--muted); font-size: 13px; }
.timeline-item { position: relative; padding: 0 0 18px; }.timeline-item::before { content: ""; position: absolute; left: -23px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.timeline-title { font-size: 13px; font-weight: 650; }.timeline-meta, .timeline-detail { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.drawer-actions { padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }.drawer-actions .primary { width: 100%; }
.modal-backdrop { z-index: 30; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(100%, 440px); padding: 22px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.modal h2 { margin: 0; font-size: 18px; }.modal-sub { margin: 6px 0 18px; color: var(--muted); font-size: 13px; }
.modal label { display: block; margin: 16px 0 7px; color: #344054; font-size: 13px; font-weight: 600; }
.modal select, .modal textarea { width: 100%; border: 1px solid #cfd5df; border-radius: 6px; background: #fff; color: var(--text); font-size: 13px; }
.modal select { height: 42px; padding: 0 10px; }.modal textarea { padding: 10px; resize: vertical; }
.role-options { display: grid; gap: 8px; }
.role-option { display: grid !important; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; margin: 0 !important; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; font-weight: 400 !important; }
.role-option input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--blue); }.role-option strong { display: block; font-size: 13px; }.role-option span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }.form-error { min-height: 18px; margin: 8px 0 0; color: var(--red); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 40; transform: translateX(-50%); max-width: calc(100vw - 40px); padding: 10px 14px; border-radius: 6px; background: #172033; color: #fff; font-size: 13px; box-shadow: var(--shadow); }
@media (max-width: 980px) {
  .app-header { grid-template-columns: 1fr auto; padding: 10px 18px 0; }.primary-nav { order: 3; grid-column: 1 / -1; height: 42px; justify-content: center; }
  main { padding: 20px 16px 40px; }.task-table-head { display: none; }.task-row { grid-template-columns: minmax(0, 1.8fr) 90px 90px 98px 70px; gap: 10px; }.task-row .due-value, .task-row .blocker { display: none; }
  .role-directory { grid-template-columns: repeat(2, 1fr); }.role-summary { border-bottom: 1px solid var(--line); }.people-table-head, .person-row { grid-template-columns: minmax(130px, 1fr) minmax(160px, 1.4fr) 80px; }.people-table-head span:nth-child(3), .people-table-head span:nth-child(4), .person-row > :nth-child(3), .person-row > :nth-child(4) { display: none; }
}
@media (max-width: 640px) {
  .app-header { min-height: 64px; gap: 10px; }.brand-mark { width: 32px; height: 32px; }.brand h1 { font-size: 17px; }.brand p { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.app-header .primary { min-height: 36px; padding: 0 11px; font-size: 12px; }
  main { padding: 16px 12px 32px; }.page-heading h2 { font-size: 19px; }.metrics { grid-template-columns: repeat(2, 1fr); }.metrics button { min-height: 70px; padding: 12px 15px; border-bottom: 1px solid var(--line); }.metrics button:nth-child(2) { border-right: 0; }.metrics button:nth-child(3), .metrics button:nth-child(4) { border-bottom: 0; }.metrics strong { font-size: 22px; }
  .filter-bar { flex-wrap: wrap; }.search-field { flex-basis: 100%; }.status-select { flex: 1; }.filter-bar select { min-width: 0; }.result-count { margin-left: 0; }
  .task-row { min-height: 104px; grid-template-columns: minmax(0, 1fr) 84px; grid-template-areas: "main status" "main time" "handler action"; align-items: start; padding: 13px 14px; }.task-main { grid-area: main; }.task-row .status { grid-area: status; justify-self: end; }.task-row .handler { grid-area: handler; color: var(--muted); }.task-row .time-value { grid-area: time; justify-self: end; text-align: right; }.task-row .row-action { grid-area: action; }
  .role-directory { grid-template-columns: 1fr; }.role-summary { min-height: 70px; border-right: 0; }.people-table-head { display: none; }.person-row { grid-template-columns: 1fr auto; min-height: 78px; }.person-row .role-tags { grid-column: 1 / 2; }.person-row > :nth-child(3), .person-row > :nth-child(4) { display: none; }.person-row .link-button { grid-column: 2; grid-row: 1 / 3; }
  .drawer { width: 100vw; }.detail-grid { grid-template-columns: 88px 1fr; }.progress-step { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; }.drawer { transition: none; } }
