:root {
  color-scheme: light;
  --canvas: #f5f7f9;
  --paper: #fff;
  --ink: #152634;
  --muted: #536575;
  --line: #dce4ea;
  --blue: #18597b;
  --blue-deep: #104760;
  --side: #182b39;
  --side-muted: #c0d0da;
  --side-active: #2b4658;
  --orange: #8b4809;
  --green: #27644c;
  --red: #9d2f2d;
  --radius: 12px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 1rem; line-height: 1.55; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, input, select, textarea { -webkit-tap-highlight-color: #d5e9f2; }
:focus-visible { outline: 2px solid #257aab; outline-offset: 3px; }
::selection { color: #112936; background: #bbdce9; }
h1, h2, p, dl { margin: 0; }
h1 { font-size: 2rem; font-weight: 680; line-height: 1.25; letter-spacing: -.025em; }
h2 { font-size: 1.125rem; line-height: 1.35; font-weight: 670; }
small { font-size: .8rem; }
[hidden] { display: none !important; }
.skip { position: fixed; inset: 1rem auto auto 1rem; transform: translateY(-160%); background: white; padding: .55rem 1rem; z-index: 3; }
.skip:focus { transform: translateY(0); }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 12.65rem minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 2.25rem; padding: 1.4rem .85rem 1.1rem; background: var(--side); color: #eff5f8; }
.brand { display: flex; gap: .7rem; align-items: center; margin: .15rem .3rem .15rem .45rem; font-weight: 690; font-size: 1rem; white-space: nowrap; }
.brand, .brand:hover { color: inherit; text-decoration: none; }
.brand-mark { display: inline-block; position: relative; width: 1.75rem; height: 1.75rem; background: #9bcbdb; color: #204459; border-radius: 6px; flex: 0 0 auto; }
.brand-mark::before, .brand-mark::after { position: absolute; content: ""; width: .69rem; height: .69rem; border: 1.5px solid currentColor; border-radius: 2px; }
.brand-mark::before { top: .35rem; left: .33rem; }
.brand-mark::after { right: .34rem; bottom: .34rem; background: #9bcbdb; }
.sidebar nav { display: grid; gap: .35rem; }
.nav-link { display: flex; align-items: center; gap: .8rem; padding: .65rem .75rem; min-height: 2.75rem; color: var(--side-muted); text-decoration: none; font-size: .94rem; border-radius: 7px; }
.nav-link:hover, .nav-active { background: var(--side-active); color: #fff; }
.nav-active { font-weight: 650; }
.icon { position: relative; width: .96rem; height: .98rem; display: inline-block; flex: none; }
.icon-grid { border: 1.5px solid currentColor; border-radius: 2px; }
.icon-grid::before, .icon-grid::after, .icon-sheet::after, .icon-users::after { content: ""; position: absolute; }
.icon-grid::before { inset: 0 50%; border-left: 1px solid currentColor; }
.icon-grid::after { inset: 50% 0; border-top: 1px solid currentColor; }
.icon-sheet { border: 1.5px solid currentColor; border-radius: 2px; width: .8rem; margin-inline: .08rem; }
.icon-sheet::after { top: .24rem; inset-inline: .125rem; height: .28rem; border-block: 1px solid currentColor; }
.icon-users::before { content: ""; position: absolute; top: 0; left: .27rem; width: .4rem; height: .4rem; border: 1.25px solid currentColor; border-radius: 50%; }
.icon-users::after { inset: .54rem .03rem 0; border: 1.25px solid currentColor; border-radius: 6px 6px 2px 2px; }
.sidebar-user { margin-top: auto; display: flex; gap: .55rem; align-items: center; border-top: 1px solid #3d5361; padding: 1.1rem .15rem 0; }
.avatar { color: #dfedf3; background: #395565; border-radius: 7px; padding: .36rem .55rem; font-size: .9rem; flex-shrink: 0; }
.user-name { min-width: 0; flex: 1; }
.user-name b, .user-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-name b { font-size: .875rem; }
.user-name small { color: var(--side-muted); }
.signout { color: var(--side-muted); background: none; padding: .38rem .18rem; border: 0; font-size: .85rem; }
.signout:hover { color: white; }
.workspace { min-width: 0; }
.topbar { min-height: 3.75rem; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: flex-end; gap: .85rem; padding: .45rem clamp(1rem, 3vw, 2.55rem); font-size: .87rem; color: var(--muted); }
.demo-tag { color: #5b4a2b; background: #f6efe0; border: 1px solid #e6d9ba; border-radius: 5px; padding: .15rem .5rem; font-size: .8rem; white-space: nowrap; }
.content { max-width: 92rem; margin-inline: auto; padding: 1.95rem clamp(1rem, 3vw, 2.55rem) 3rem; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.3rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.55rem; padding: .45rem .85rem; border: 1px solid; border-radius: 7px; font-size: .9rem; font-weight: 620; text-decoration: none; white-space: nowrap; transition: background 140ms ease; }
.primary { background: var(--blue); color: white; border-color: var(--blue); }
.primary:hover { background: var(--blue-deep); color: white; }
.secondary { background: var(--paper); color: var(--ink); border-color: #cbd7e0; }
.secondary:hover { background: #eaf1f6; color: var(--ink); }
.button:disabled { opacity: .55; cursor: default; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 0; }
.summary > div { padding: 0 clamp(.6rem, 2vw, 1.5rem); }
.summary > div + div { border-left: 1px solid var(--line); }
.summary dt { font-size: .87rem; color: var(--muted); }
.summary dd { font-size: 1.8rem; font-weight: 675; margin: .08rem 0 0; line-height: 1.35; }
.summary-attention dd { color: var(--orange); }

.attention-section { margin: 1.45rem 0 0; }
.attention-section h2 { margin-bottom: .62rem; }
.attention-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); background: #fff9ef; border: 1px solid #eddfc8; border-radius: var(--radius); padding: 0; margin: 0; }
.attention-list li + li { border-left: 1px solid #eddfc8; }
.attention-list a { display: grid; align-content: start; gap: .25rem; height: 100%; padding: .75rem .9rem; color: var(--ink); text-decoration: none; }
.attention-list a:hover { background: #fff3e1; }
.attention-title { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.attention-title strong { font-size: .93rem; }
.attention-issue { color: #6b4c2d; font-size: .83rem; overflow-wrap: anywhere; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 1.4rem 0 .65rem; }
.section-head a { font-size: .88rem; }
.section { margin-top: 1.75rem; }
.filter { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.filter input[type=search] { width: min(14.5rem, 100%); }
.filter input, .filter select { padding-block: .4rem; }
.report-filter { align-items: end; margin-bottom: 1rem; }
.report-filter a { align-self: end; padding: .48rem .25rem; font-size: .88rem; }
.table-scroll { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: .9rem; }
.project-table { min-width: 46rem; }
.stage-table { min-width: 44rem; }
.report-table { min-width: 52rem; }
.employee-table { min-width: 47rem; }
th, td { padding: .78rem clamp(.65rem, 1.4vw, 1.1rem); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #edf2f6; color: #405361; font-weight: 640; font-size: .85rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f7fafc; }
td small { display: block; margin-top: .2rem; color: var(--muted); line-height: 1.42; }
.row-name { font-weight: 675; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.row-name:hover { color: var(--blue); text-decoration: underline; }
.wide-cell { width: 33%; min-width: 11rem; }
.separator { margin-inline: .35rem; }
.nowrap, .numeric { white-space: nowrap; }
.numeric { text-align: right; }
.dim, .metadata { color: var(--muted); }
.metadata { margin-top: .25rem; font-size: .93rem; overflow-wrap: anywhere; }
.status { display: inline-flex; width: max-content; align-items: center; padding: .15rem .45rem; border-radius: 5px; font-weight: 640; font-size: .79rem; line-height: 1.5; }
.status-active { color: #2d576d; background: #eaf1f7; }
.status-late { color: var(--red); background: #fdebe8; }
.status-risk { color: var(--orange); background: #faeed8; }
.status-done { color: var(--green); background: #e3f2e9; }
.fresh { color: var(--green); }
.progress-cell { min-width: 11rem; width: 23%; }
.progress { display: grid; gap: .34rem; }
.progress-values { display: flex; justify-content: space-between; gap: .35rem; font-size: .83rem; white-space: nowrap; }
.progress-percent { color: var(--muted); }
progress { width: 100%; height: .33rem; border: 0; border-radius: 999px; background: #e6edf3; appearance: none; color: var(--blue); }
progress::-webkit-progress-bar { background: #e6edf3; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
.stage-issue, .report-notes { min-width: 8.5rem; max-width: 18rem; overflow-wrap: anywhere; }
.blocker { color: var(--orange); display: block; }
.note-text { white-space: pre-wrap; }
.edit-link + a, a + .edit-link { margin-left: .4rem; }
.empty { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: var(--paper); }
.pagination { margin-top: 1rem; display: flex; align-items: center; gap: .9rem; justify-content: flex-end; font-size: .9rem; }
.crumb { margin-bottom: .8rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .85rem; color: var(--muted); }
.project-summary { display: grid; grid-template-columns: .7fr .9fr 1.5fr; gap: 1rem; align-items: start; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); max-width: 48rem; }
.label { display: block; color: var(--muted); font-size: .86rem; margin-bottom: .3rem; }

.form-panel { display: grid; gap: .95rem; max-width: 45rem; padding: clamp(1rem, 3vw, 1.65rem); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
label { display: grid; gap: .3rem; font-size: .91rem; font-weight: 630; }
input:not([type=hidden], [type=checkbox], [type=radio]), select, textarea { min-width: 0; min-height: 2.6rem; border: 1px solid #c9d5df; border-radius: 7px; padding: .47rem .65rem; background: var(--paper); font-size: .94rem; font-weight: 400; }
input[type=file] { width: 100%; }
input::placeholder, textarea::placeholder { color: #5e6f7d; opacity: 1; }
select { text-overflow: ellipsis; padding-right: 1.3rem; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); margin: 0; width: 1.05rem; height: 1.05rem; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.project-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.quantities { grid-template-columns: repeat(4, minmax(0, 1fr)); }
fieldset { min-width: 0; margin: 0; padding: .75rem 0 0; border: 0; border-top: 1px solid var(--line); }
legend { font-size: .95rem; font-weight: 680; padding: 0 .45rem 0 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .45rem; }
.route { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.hint { font-size: .83rem; color: var(--muted); margin-top: .45rem; max-width: 66ch; overflow-wrap: anywhere; }
.form-panel > .hint { margin-top: -.5rem; }
.notice { font-size: .93rem; border: 1px solid #c6e1d2; border-radius: 8px; padding: .7rem .85rem; margin-bottom: .85rem; background: #ebf7f0; color: #225942; max-width: 45rem; }
.notice-error { color: #842925; border-color: #f2cbc5; background: #fff1ed; }
.choice { display: flex; align-items: center; gap: .5rem; min-height: 2.1rem; font-weight: 500; }
.scope-list { max-height: 13rem; overflow: auto; }
.scope-grid { margin-top: .75rem; }

.logged-out { min-height: 100dvh; display: grid; place-content: center; justify-items: start; padding: 1rem; }
.login-panel { width: min(25rem, calc(100vw - 2rem)); padding: clamp(1.15rem, 5vw, 2rem); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.login-mark { margin-bottom: .8rem; }
.login-panel h1 { font-size: 1.55rem; margin-bottom: 1.25rem; }
.login-form { display: grid; gap: .92rem; }
.login-demo { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: .9rem; font-size: .84rem; }
.login-demo p { font-weight: 650; }
.login-demo span { color: var(--muted); font-weight: 400; margin-left: .35rem; }
.login-demo > div { display: flex; flex-wrap: wrap; gap: .15rem .85rem; margin-top: .35rem; }
.login-demo button { min-height: 2rem; padding: 0; border: 0; background: none; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 870px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-flow: row wrap; align-items: center; gap: .35rem .8rem; padding: .6rem .9rem; }
  .brand { margin: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; order: 2; width: 100%; }
  .nav-link { gap: .5rem; padding: .42rem .6rem; font-size: .88rem; min-height: 2.35rem; }
  .sidebar-user { margin: 0 0 0 auto; padding: 0; border: 0; }
  .sidebar-user .avatar { display: none; }
  .user-name { max-width: 5.5rem; }
  .user-name small { display: none; }
  .topbar { min-height: 2.7rem; }
  .content { padding-top: 1.2rem; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.65rem; }
  .page-heading, .section-head { align-items: flex-start; }
  .section-head { flex-direction: column; }
  .attention-list { grid-template-columns: 1fr; }
  .attention-list li + li { border-left: 0; border-top: 1px solid #eddfc8; }
  .summary { padding-block: .75rem; }
  .summary dt { font-size: .79rem; }
  .summary dd { font-size: 1.45rem; }
  .filter input[type=search] { width: min(10.25rem, 100%); }
  .quantities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-fields, .route { grid-template-columns: 1fr; }
  .project-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-summary > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 370px) {
  .page-heading { flex-wrap: wrap; }
  .scope-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.route-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: .55rem; margin: .65rem 0; }
.workshop-list { margin: 0; padding-left: 1.25rem; }
@media (max-width: 420px) {
  .route-item { grid-template-columns: 1fr auto; }
  .route-item > :first-child { grid-column: 1 / -1; }
}
@media (min-width: 601px) {
  .section-head .filter { flex: none; flex-wrap: nowrap; }
  .section-head .filter input[type=search] { width: 14.5rem; }
}
