/* Shared desktop workspace, based on the approved V3.1 visual design. */
body.app-shell {
  --primary: #087f8c;
  --primary-hover: #066774;
  --page: #f4f6f8;
  --ink: #203039;
  --muted: #586873;
  --line: #dde4e8;
  --control-height: 32px;
  --control-radius: 4px;
  --focus-ring: 0 0 0 3px rgb(8 127 140 / 18%);
  --shell-nav-width: 190px;
  display: grid;
  grid-template: 44px minmax(0, 1fr) 32px / var(--shell-nav-width) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  background: var(--page);
  font-size: 14px;
}
.shell-toolbar { grid-area: 1 / 1 / 2 / 3; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px 0 0; background: #28363b; color: #f4f7f8; z-index: 120; }
.shell-brand { flex: 0 0 var(--shell-nav-width); display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.shell-brand-mark { color: #35c4c4; font-size: 25px; font-weight: 750; }
.shell-icon { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.shell-icon-button { width: 32px; height: 32px; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; border: 0; border-radius: 4px; color: #eef4f5; background: transparent; cursor: pointer; }
.shell-icon-button:hover { background: #3c5057; }
.shell-page-title { min-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; border-left: 1px solid #536269; padding-left: 12px; }
.shell-toolbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
body.app-shell .shell-toolbar .button { min-height: 30px; padding: 0 10px; border-color: #6d858d; color: #fff; background: transparent; white-space: nowrap; font-size: 12px; }
body.app-shell .shell-toolbar .button-primary { border-color: #087f8c; background: #087f8c; }
.shell-user-menu { position: relative; flex-shrink: 0; margin-left: 4px; font-size: 12px; }
.shell-user-menu summary { padding: 6px 8px; cursor: pointer; }
.shell-user-panel { position: absolute; right: 0; top: 100%; width: 150px; padding: 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: white; box-shadow: 0 8px 24px #0002; }
.shell-user-panel a { display: block; padding: 8px 10px; }
.shell-user-panel a:hover { background: #edf6f6; }
.app-sidebar { grid-area: 2 / 1; min-height: 0; overflow-y: auto; overflow-x: hidden; background: #28363b; color: #e5edef; scrollbar-width: thin; }
.shell-nav-group { padding: 10px 0; border-bottom: 1px solid #46585f; }
.shell-nav-group p { margin: 0 16px 5px; color: #becdd2; font-size: 12px; }
.shell-nav-link { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 6px 16px; border-left: 3px solid transparent; font-size: 13px; white-space: nowrap; }
.shell-nav-link:hover { background: #354950; }
.shell-nav-link.is-active { background: #20535e; border-left-color: #36c5ca; color: #fff; font-weight: 600; }
body.app-shell.shell-collapsed { --shell-nav-width: 56px; }
.shell-collapsed .shell-brand { justify-content: center; padding: 0; }
.shell-collapsed .shell-brand > span:last-child, .shell-collapsed .shell-nav-group p, .shell-collapsed .shell-nav-link span { display: none; }
.shell-collapsed .shell-nav-link { padding-left: 16px; }
body.app-shell .container.main-content {
  grid-area: 2 / 2;
  width: 100%; max-width: none; min-width: 0; min-height: 0;
  margin: 0; padding: 12px 16px 20px;
  overflow: auto; scrollbar-gutter: stable;
}
.app-statusbar { grid-area: 3 / 1 / 4 / 3; display: flex; gap: 16px; align-items: center; padding: 0 12px; min-width: 0; background: #28363b; color: #e9f0f2; border-top: 1px solid #495c63; font-size: 12px; z-index: 90; }
.shell-status-brand { width: calc(var(--shell-nav-width) - 12px); flex-shrink: 0; font-size: 11px; color: #c2cfd3; overflow: hidden; white-space: nowrap; }
.shell-status-content { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
body.app-shell .app-statusbar .pagination { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; }
body.app-shell .app-statusbar .pagination-summary { color: inherit; font-size: 12px; }
body.app-shell .app-statusbar .page-button { min-width: 24px; height: 24px; min-height: 24px; padding: 0 6px; background: transparent; border-color: #536b74; color: white; border-radius: 3px; }
body.app-shell .app-statusbar .page-button.active { background: var(--primary); border-color: var(--primary); }
body.app-shell .app-statusbar .page-button.disabled { color: #9aafb6; opacity: 1; }
.shell-skip { position: fixed; left: 12px; top: -60px; z-index: 300; padding: 8px 16px; background: white; color: #075f69; }
.shell-skip:focus { top: 4px; }
body.app-shell .shell-accessible-heading { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.app-shell .shell-empty-heading { display: none; }
body.app-shell .shell-integrated-heading { margin: 0 0 10px; padding: 0; min-height: 0; }
body.app-shell .shell-integrated-heading p { margin: 0; font-size: 12px; color: var(--muted); }
/* Consistent controls and working surfaces; specialized editors retain their structure. */
body.app-shell .main-content h1 { font-size: 18px; line-height: 1.4; }
body.app-shell .main-content h2 { font-size: 15px; line-height: 1.4; }
body.app-shell .main-content h3 { font-size: 14px; }
body.app-shell .card { border-color: var(--line); border-radius: 6px; box-shadow: none; }
body.app-shell .button { border-color: #c4cfd5; color: #344b55; background: #fff; border-radius: 4px; font-size: 13px; font-weight: 500; box-shadow: none; }
body.app-shell .button:hover { border-color: var(--primary); color: #066774; background: #eef7f7; }
body.app-shell .button-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
body.app-shell .button-primary:hover { background: var(--primary-hover); color: #fff; }
body.app-shell .button-danger { color: #b42318; border-color: #e4b0ab; background: #fff; }
body.app-shell .button-danger:hover { color: #912018; border-color: #b42318; background: #fff1f0; }
body.app-shell .button:disabled { background: #e8edef; border-color: #cbd5da; color: #64747d; }
body.app-shell input:not([type=checkbox]):not([type=radio]), body.app-shell select, body.app-shell textarea { border-color: #c4cfd5; border-radius: 4px; font-size: 13px; font-weight: 400; }
body.app-shell input:focus, body.app-shell select:focus, body.app-shell textarea:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
body.app-shell label { color: #526570; font-weight: 500; }
body.app-shell .multi-dropdown summary { border-color: #c4cfd5; border-radius: 4px; }
body.app-shell :is(.table-header,.section-heading) { min-height: 36px; }
body.app-shell .table-header { padding: 8px 12px; }
body.app-shell .table-header p { margin-top: 2px; font-size: 12px; }
body.app-shell .table-wrap { max-width: 100%; }
body.app-shell :is(th,td) { height: 40px; padding: 7px 10px; font-size: 13px; }
body.app-shell th { color: #405660; background: #eef3f5; font-weight: 600; }
body.app-shell td { color: #344b55; }
body.app-shell tbody tr:hover { background: #f0f7f7; }
body.app-shell :is(.task-name,.project-name) { font-weight: 500; }
body.app-shell :is(.action-link,.text-button:not(.danger),.requirement-name-link,.requirement-actions a) { color: #087481; }
body.app-shell :is(.status,.priority,.requirement-priority,.requirement-status) { border-radius: 4px; font-weight: 500; }
body.app-shell :is(.search-card,.requirement-filter-card) { padding: 10px 12px; margin-bottom: 12px; }
body.app-shell :is(.page-heading,.module-page-heading,.project-page-heading,.process-page-header,.requirement-detail-heading) { gap: 10px; margin-bottom: 12px; }
body.app-shell :is(.form-card,.report-section) { padding: 16px; }
body.app-shell .form-grid { gap: 12px 16px; }
body.app-shell .project-overview-grid { gap: 10px 20px; }
body.app-shell .project-overview-grid > span { display: flex; align-items: baseline; gap: 12px; min-height: 32px; padding: 6px 0; background: none; border: 0; font-size: 13px; }
body.app-shell .project-overview-grid em { flex: 0 0 92px; margin: 0; color: #586873; font-size: 12px; }
body.app-shell .project-detail-sections { gap: 12px; }
body.app-shell :is(.project-detail-tabs,.dashboard-tabs,.process-stage-tabs,.module-view-tabs) { border-radius: 0; background: transparent; box-shadow: none; }
body.app-shell :is(.project-detail-tabs button,.dashboard-tabs a,.process-stage-tab,.module-view-tabs a) { border-radius: 0; box-shadow: none; padding: 8px 12px; font-size: 13px; }
body.app-shell :is(.project-detail-tabs button[aria-selected=true],.dashboard-tabs a.active,.process-stage-tab.is-active,.module-view-tabs a.active) { color: #087481; border-bottom: 2px solid var(--primary); background: #eef7f7; }
body.app-shell :is(.summary-card,.requirement-summary-card,.dashboard-metrics article,.dashboard-command-metrics article) { min-height: 80px; padding: 12px; border-radius: 6px; box-shadow: none; }
body.app-shell :is(.summary-value,.requirement-summary-card strong,.dashboard-metrics strong,.dashboard-command-metrics strong) { font-size: 24px; }
body.app-shell :is(.dashboard-metrics article::before,.dashboard-command-metrics article::before) { display: none; }
body.app-shell .dashboard-command-metrics small { font-size: 12px; color: var(--muted); }
body.app-shell .dashboard-heading { grid-template-columns: 1fr; }
body.app-shell .dashboard-filters { flex-wrap: wrap; }
body.app-shell .dashboard-page { gap: 12px; }
body.app-shell .detail-design-topbar { padding: 0 0 8px; }
body.app-shell :is(.shell-toolbar,.app-sidebar,.app-statusbar) :focus-visible { outline: 2px solid #75e2e6; outline-offset: -2px; }
body.app-shell .main-content:focus { outline: none; }
@media (max-width: 1100px) {
  body.app-shell { --shell-nav-width: 164px; }
  .shell-brand { font-size: 13px; }
  body.app-shell .project-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  body.app-shell { grid-template: auto minmax(0,1fr) auto / minmax(0,1fr); --shell-nav-width: 190px; }
  .shell-toolbar { grid-area: 1 / 1; flex-wrap: wrap; min-height: 44px; gap: 4px; padding: 5px 8px; }
  .shell-brand { flex-basis: auto; padding: 0 4px; }
  .shell-brand > span:last-child, .shell-home { display: none; }
  .shell-page-title { flex: 1; }
  .shell-toolbar-actions { order: 5; flex-basis: 100%; flex-wrap: wrap; }
  .shell-toolbar-actions:empty { display: none; }
  body.app-shell .container.main-content { grid-area: 2 / 1; padding: 10px; }
  .app-sidebar { grid-area: 2 / 1; width: 190px; z-index: 110; box-shadow: 8px 0 20px #0002; }
  body.app-shell.shell-collapsed { --shell-nav-width: 190px; }
  .shell-collapsed .app-sidebar { display: none; }
  .app-statusbar { grid-area: 3 / 1; min-height: 32px; padding: 4px 8px; }
  .shell-status-brand { display: none; }
  body.app-shell .app-statusbar .pagination { flex-wrap: wrap; gap: 4px; }
  body.app-shell .project-overview-grid { grid-template-columns: 1fr; }
  body.app-shell .page-heading .button { width: auto; }
}
@media print {
  body.app-shell { display: block; height: auto; overflow: visible; }
  .shell-toolbar,.app-sidebar,.app-statusbar,.shell-skip { display: none; }
  body.app-shell .container.main-content { overflow: visible; padding: 0; }
  body.app-shell .shell-accessible-heading { position: static; width: auto; height: auto; margin: 0 0 12px; clip-path: none; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  body.app-shell *, body.app-shell *::before, body.app-shell *::after { transition: none !important; animation: none !important; }
}
body.app-shell .shell-status-content { display: flex; align-items: center; gap: 16px; }
body.app-shell .app-statusbar .pagination { flex: 1; }
body.app-shell .shell-task-summary { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; margin: 0; }
body.app-shell .shell-task-summary::before { content: '可见任务'; color: #c2cfd3; }
body.app-shell .shell-task-summary .summary-card { display: flex; align-items: center; gap: 4px; min-height: 0; padding: 0; border: 0; background: transparent; }
body.app-shell .shell-task-summary .summary-label, body.app-shell .shell-task-summary .summary-value { margin: 0; color: #edf3f5; font-size: 12px; font-weight: 400; line-height: 1.4; }
body.app-shell .shell-task-summary :is(.summary-caption,.summary-dot) { display: none; }
body.app-shell .shell-page-size { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; color: #e9f0f2; font-size: 12px; }
body.app-shell .shell-page-size select { width: 68px; min-height: 24px; height: 24px; padding: 0 4px; background: #28363b; border-color: #69818a; color: #fff; font-size: 12px; }
body.app-shell .project-module-page { gap: 12px; }
body.app-shell .project-list-card .table-header, body.app-shell .project-detail-card .table-header { padding: 8px 12px; }
body.app-shell .project-list-card .table-header h2::before, body.app-shell .project-detail-card .table-header h2::before, body.app-shell .project-overview-card .section-heading h2::before { display: none; }
body.app-shell .project-list-table { min-width: 940px; table-layout: auto; }
body.app-shell .project-list-table :is(col,th,td) { width: auto; min-width: 0; max-width: none; }
body.app-shell .project-list-table td:nth-child(2) { min-width: 180px; white-space: normal; }
body.app-shell .project-list-table :is(th,td):nth-child(6) { text-align: right; font-variant-numeric: tabular-nums; }
body.app-shell .project-list-card td, body.app-shell .project-list-card th { height: 40px; padding: 7px 10px; }
body.app-shell .list-filter-card { padding: 10px 12px; margin-bottom: 12px; }
body.app-shell .list-filter-bar :is(input,select,.multi-dropdown summary) { min-height: 32px; }
@media (max-width: 760px) {
  body.app-shell .shell-status-content { flex-wrap: wrap; gap: 4px 12px; max-height: 88px; overflow: auto; }
  body.app-shell .shell-task-summary { gap: 8px; flex-wrap: wrap; }
}
.shell-page-title .shell-page-heading { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.app-shell .main-content .table-card .table-header { padding: 8px 12px; }
body.app-shell .main-content .table-card .table-header h2::before { display: none; }
body.app-shell .plans-list-table :is(th,td) { height: 40px; padding: 7px 10px; }
body.app-shell .plans-list-table :is(th,td):first-child { width: 160px; min-width: 160px; }
body.app-shell .plans-list-table :is(th,td):nth-child(2) { width: 220px; min-width: 220px; }
body.app-shell .main-content > .table-card > .table-wrap { max-height: calc(100dvh - 242px); overflow: auto; }
body.app-shell .main-content > .table-card > .table-wrap th { position: sticky; top: 0; z-index: 2; }
@media (max-width: 760px) {
  body.app-shell .main-content > .table-card > .table-wrap { max-height: none; }
}
@media print {
  body.app-shell .main-content > .table-card > .table-wrap { max-height: none; overflow: visible; }
}
body.app-shell .project-scope-bar { margin-bottom: 10px; padding: 4px 10px; border-radius: 4px; gap: 8px; font-size: 12px; }
body.app-shell .project-scope-bar a { padding: 3px 8px; color: #087481; }
body.app-shell .project-scope-bar a[aria-current=true] { background: #edf7f7; border-color: #87bec4; }
body.app-shell .plan-view-bar { margin-bottom: 10px; min-height: 32px; }
body.app-shell .plan-view-switcher { padding: 2px; border-radius: 4px; }
body.app-shell .plan-view-switcher a { min-height: 30px; padding: 5px 12px; font-size: 13px; }
body.app-shell .plan-view-switcher a[aria-current=page] { color: #087481; background: #edf7f7; box-shadow: none; }
body.app-shell .row-more-actions summary { min-height: 32px; }
body.app-shell :is(.research-list-page,.research-form-page,.research-detail-page) { gap: 12px; }
body.app-shell .research-module-tabs { padding: 2px; border-radius: 4px; }
body.app-shell .research-module-tab { padding: 7px 12px; border-radius: 3px; font-size: 13px; }
body.app-shell .research-module-tab.is-active { background: #087f8c; color: white; box-shadow: none; }
body.app-shell .research-search-panel { padding: 10px 12px; }
@media print {
  body.app-shell .shell-toolbar { display: block; background: white; color: black; padding: 0 0 12px; }
  body.app-shell .shell-toolbar > :not(.shell-page-title) { display: none; }
  body.app-shell .shell-page-title { border: 0; padding: 0; }
}
