*{box-sizing:border-box} :root{--ink:#202920;--muted:#858b82;--line:#e9ebe5;--paper:#fff;--canvas:#f5f6f2;--green:#456b4d;--green-soft:#edf3eb;--serif:Georgia,'Times New Roman',serif}html{scroll-behavior:smooth}body{margin:0;background:var(--canvas);color:var(--ink);font-family:'DM Sans','Noto Sans SC',sans-serif;font-size:13px;-webkit-font-smoothing:antialiased}.app-shell{min-height:100vh}.sidebar{width:236px;position:fixed;inset:0 auto 0 0;background:#fbfcf9;border-right:1px solid #e8eae4;padding:28px 17px 18px;display:flex;flex-direction:column;z-index:3}.brand{display:flex;gap:11px;align-items:center;padding:0 12px;text-decoration:none;color:inherit}.brand-mark{width:35px;height:35px;border-radius:11px;background:#486c50;display:grid;place-items:center;color:#f9faf4}.brand-mark svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.brand strong{font-size:17px;letter-spacing:.06em;display:block}.brand small{display:block;color:#92978d;font-size:10px;letter-spacing:.05em;margin-top:2px}.side-label{font-size:10px;letter-spacing:.14em;color:#a0a59d;margin:48px 12px 12px}.main-nav{display:grid;gap:4px}.nav-item{height:42px;padding:0 12px;border-radius:7px;display:flex;align-items:center;gap:11px;color:#6f766d;text-decoration:none;font-size:12px;transition:.2s}.nav-item:hover{background:#f1f3ee;color:#334a36}.nav-item.active{background:#eaf0e7;color:#3e6547;font-weight:600}.nav-icon{font-size:16px;width:17px;text-align:center;color:#889087}.active .nav-icon{color:#4d7656}.nav-count{margin-left:auto;background:#f8e9e5;color:#b56751;border-radius:4px;padding:3px 6px;font-size:10px}.sidebar-bottom{margin-top:auto}.privacy-card{position:relative;display:flex;align-items:center;gap:10px;margin:0 4px 14px;padding:12px 10px;background:#f2f4ef;border-radius:8px}.privacy-icon{width:27px;height:27px;border-radius:7px;background:#e3eadf;color:#58735a;display:grid;place-items:center;font-size:15px}.privacy-card strong,.profile-copy strong{display:block;font-size:10px;font-weight:600}.privacy-card small,.profile-copy small{display:block;color:#92978d;font-size:9px;margin-top:3px}.status-dot{width:6px;height:6px;border-radius:50%;background:#72a77b;position:absolute;right:12px;top:13px}.profile-button{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:10px;padding:9px 7px;text-align:left;color:inherit}.avatar,.top-avatar{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#dfe8db;color:#46684c;font-size:12px;font-weight:600}.profile-copy{flex:1}.more{font-size:18px;color:#92978d;letter-spacing:2px}.main-content{margin-left:236px;min-height:100vh}.topbar{height:68px;border-bottom:1px solid #e7e9e3;background:rgba(250,251,248,.8);display:flex;align-items:center;justify-content:space-between;padding:0 48px;position:sticky;top:0;z-index:2;backdrop-filter:blur(12px)}.breadcrumb{display:flex;gap:11px;align-items:center;color:#92978d;font-size:11px}.crumb-slash{color:#c3c7be}.breadcrumb strong{font-weight:500;color:#485047}.topbar-actions{display:flex;align-items:center;gap:23px}.today-label{display:flex;align-items:center;gap:7px;color:#7c8379;font-size:11px}.calendar-icon{font-size:14px}.icon-button{position:relative;border:0;background:none;color:#70796e;font-size:17px}.icon-button i{position:absolute;width:4px;height:4px;border-radius:50%;background:#bf725a;right:0;top:2px}.top-avatar{width:28px;height:28px;font-size:11px}.content-wrap{max-width:1440px;margin:0 auto;padding:42px 48px 24px}.welcome-row{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:29px}.eyebrow{display:flex;align-items:center;gap:8px;color:#889083;letter-spacing:.14em;font-size:9px;margin-bottom:12px}.eyebrow-line{display:block;width:17px;height:1px;background:#7c9477}.welcome-row h1{font-family:'Noto Sans SC',sans-serif;font-size:24px;font-weight:500;letter-spacing:-.04em;margin:0}.wave{color:#91a888;font-size:17px;margin-left:3px}.welcome-copy{color:#949990;font-size:11px;margin:9px 0 0}.primary-button{border:0;background:#476b4d;color:#fff;border-radius:6px;height:39px;padding:0 16px;font-family:inherit;font-size:11px;font-weight:500;display:inline-flex;align-items:center;gap:8px;cursor:pointer;transition:background .2s,transform .2s}.primary-button:hover{background:#385b3e;transform:translateY(-1px)}.plus{font-size:17px;font-weight:300}.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.metric-card{height:155px;background:var(--paper);border:1px solid #eaebe6;border-radius:9px;padding:17px 17px 12px;position:relative;overflow:hidden}.green-card{background:#f3f6f0;border-color:#e7ede3}.metric-top{display:flex;align-items:center;justify-content:space-between}.metric-name{font-size:10px;color:#727a70}.metric-symbol{width:24px;height:24px;border-radius:6px;display:grid;place-items:center;font-size:14px}.green-symbol{background:#e4ecdf;color:#5a7c5d}.amber-symbol{background:#f5eee1;color:#ac8753}.rose-symbol{background:#f6e9e5;color:#b7745f}.blue-symbol{background:#e8edf2;color:#71899c}.metric-value{display:flex;align-items:baseline;gap:4px;margin-top:9px}.metric-value strong{font-family:var(--serif);font-size:34px;line-height:1;font-weight:400;letter-spacing:-.04em}.metric-value>span{font-size:14px;color:#858b82}.metric-value .unit{font-size:11px}.metric-foot{display:flex;align-items:center;gap:6px;margin-top:10px;color:#a0a49c;font-size:9px}.trend{font-size:9px;font-weight:600}.positive{color:#658b68}.neutral{color:#a36f5d}.metric-period{margin-left:auto;color:#92988f}.sparkline{position:absolute;width:43%;height:42px;right:12px;bottom:9px;opacity:.9}.sparkline svg{width:100%;height:100%;overflow:visible}.sparkline path:first-child{fill:none;stroke-width:1.6}.green-spark path:first-child{stroke:#85a17d}.amber-spark path:first-child{stroke:#c5a575}.spark-area{stroke:none!important;opacity:.11}.green-spark .spark-area{fill:#78966f}.amber-spark .spark-area{fill:#b99666}.mini-bars{position:absolute;right:18px;bottom:14px;height:39px;display:flex;align-items:end;gap:4px}.mini-bars i{display:block;width:5px;background:#efd9d2;border-radius:2px 2px 0 0}.mini-bars i:nth-last-child(-n+3){background:#d9a695}.doc-stack{position:absolute;bottom:13px;right:19px;display:flex;align-items:end}.doc-stack span{width:30px;height:29px;border:1px solid #e2e8ec;background:#f8fafb;border-radius:4px;color:#8ca0ad;font-size:7px;display:grid;place-items:center;margin-left:-7px}.doc-stack span:nth-child(2){height:35px;background:#f4f7f8}.doc-stack span:last-child{width:25px;height:25px;background:#edf2ed;border-color:#e3e9e2;color:#6e8a70;font-size:14px}.pending-dashboard{display:grid;grid-template-columns:minmax(0,1.06fr) minmax(0,1.4fr);gap:15px;margin-top:17px}.pending-dashboard[hidden]{display:none}.chart-panel{min-height:258px}.chart-heading{padding-bottom:12px}.chart-total{font-family:var(--serif);font-size:18px;color:#526c55}.chart-content{padding:0 20px 20px}.pie-layout{display:flex;align-items:center;gap:22px}.pie-chart{width:148px;height:148px;border-radius:50%;display:grid;place-items:center;flex:0 0 148px;position:relative}
.metric-card.pending-metric-toggle{width:100%;text-align:left;font:inherit;color:inherit;cursor:pointer;transition:background .18s,border-color .18s}
.metric-card.pending-metric-toggle:is(:hover,[aria-expanded="true"]){background:var(--yellow-wash);border-color:var(--yellow-border)}
.pending-metric-hint,.pending-metric-chevron{color:var(--blue);font-weight:650}
.pending-metric-chevron{font-size:13px;line-height:1}
.pending-metric-toggle[aria-expanded="true"] .pending-metric-chevron{transform:rotate(180deg)}
.metric-grid > #pending-dashboard{grid-column:1/-1;margin:0}
@media(prefers-reduced-motion:no-preference){
  .metric-grid > #pending-dashboard:not([hidden]){animation:pending-charts-reveal .2s ease-out both}
}
@keyframes pending-charts-reveal{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
.chart-notice{grid-column:1/-1;margin:0;padding:10px 14px;border-radius:7px;background:var(--blue-soft);color:var(--navy)}
.chart-notice[hidden],.empty-state[hidden]{display:none}
.chart-total{white-space:nowrap}

@media(max-width:420px){.chart-content.pie-layout{flex-direction:column;align-items:stretch}.pie-chart{align-self:center;flex:none}}
.chart-legend{display:grid;gap:8px;min-width:0;flex:1}.legend-item{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:7px;font-size:10px;color:#687267}.legend-item i{width:7px;height:7px;border-radius:2px}.legend-item span{overflow-wrap:anywhere}.legend-item strong,.bar-row strong{white-space:nowrap}.legend-item strong{font-weight:500;color:#506050}.legend-item strong small{color:#a1a79f;font-size:8px;margin-left:4px}.bar-chart{padding:1px 20px 21px;display:grid;gap:10px}.chart-legend,.bar-chart{margin:0;list-style:none}.chart-legend{padding:0}.bar-row{display:grid;grid-template-columns:minmax(65px,1fr) minmax(30px,2.1fr) auto;align-items:center;gap:9px}.bar-label{font-size:10px;color:#6b7469;overflow-wrap:anywhere}.bar-track{height:9px;background:#f0f2ed;border-radius:3px;overflow:hidden}.bar-track i{display:block;height:100%;border-radius:3px;background:#557a5b}.bar-row strong{font-size:10px;text-align:right;color:#637064;font-weight:600}.chart-empty{font-size:10px;color:#a0a79e;padding:28px 0}.lower-grid{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(240px,.86fr);gap:15px;margin-top:17px}.panel{background:#fff;border:1px solid #eaebe6;border-radius:9px}.records-panel{min-width:0}.panel-heading{padding:20px 20px 14px;display:flex;justify-content:space-between;align-items:flex-start}.panel-heading h2{font-size:15px;font-weight:600;margin:5px 0 3px;letter-spacing:-.02em}.panel-heading p{font-size:10px;color:#9a9f96;margin:0}.section-kicker{font-family:'DM Sans',sans-serif;font-size:8px;letter-spacing:.15em;color:#9ba196}.text-button{background:none;border:0;padding:5px 0;color:#66806a;font-family:inherit;font-size:10px;cursor:pointer}.text-button span{font-size:15px;margin-left:5px}.record-toolbar{display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid #eff0ec;gap:8px}.record-tabs{display:flex;gap:18px;align-items:center;overflow:auto}.record-tab{white-space:nowrap;border:0;background:none;padding:11px 0 10px;color:#969b93;font-family:inherit;font-size:10px;cursor:pointer;border-bottom:1px solid transparent}.record-tab.selected{color:#496e50;border-color:#587b5e;font-weight:600}.record-tab span{margin-left:4px;color:#a8ada5;font-size:9px}.search-box{display:flex;align-items:center;gap:5px;border:1px solid #eceee9;border-radius:5px;height:27px;padding:0 7px;color:#9da39a;flex:0 0 128px}.search-box>span{font-size:16px;line-height:1}.search-box input{width:100%;border:0;outline:0;background:transparent;font-family:inherit;font-size:9px;color:#3a4239}.search-box input::placeholder{color:#a9aea6}.records-table-wrap{min-height:280px}.records-table{width:100%;border-collapse:collapse;text-align:left}.records-table th{height:34px;background:#fbfcfa;color:#a2a69f;font-size:9px;font-weight:500;padding:0 12px}.records-table th:first-child,.records-table td:first-child{padding-left:20px}.records-table th:last-child,.records-table td:last-child{padding-right:17px}.records-table td{height:48px;padding:0 12px;border-bottom:1px solid #f0f1ed;color:#777f75;font-size:10px;white-space:nowrap}.records-table tbody tr:hover{background:#fcfdfb}.records-table tbody tr:last-child td{border-bottom:0}.record-title-cell{display:flex;align-items:center;gap:10px;max-width:290px}.record-type-icon{flex:0 0 27px;height:27px;border-radius:7px;display:grid;place-items:center;font-size:12px}.type-inspection{background:#f6e9e5;color:#b26f5e}.type-manual{background:#eaf0f3;color:#748d9d}.type-spec{background:#f4eee3;color:#aa8957}.type-quality{background:#eaf1e8;color:#668567}.type-returns{background:#f2ebef;color:#a27d91}.record-title-copy{overflow:hidden}.record-title-copy strong{font-size:10px;font-weight:500;color:#465046;display:block;overflow:hidden;text-overflow:ellipsis}.record-title-copy small{display:block;color:#a2a79f;font-size:9px;margin-top:3px;overflow:hidden;text-overflow:ellipsis}.type-pill{font-size:9px;color:#81877e}.status-pill{display:inline-flex;align-items:center;gap:5px;border-radius:4px;padding:4px 7px;font-size:9px}.status-pill:before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor}.status-wait{color:#a77c4c;background:#f7f1e7}.status-done{color:#608166;background:#edf3eb}.status-archived{color:#8c9289;background:#f1f2ef}.row-more{border:0;background:none;color:#a3a89f;font-size:15px;cursor:pointer}.table-footer{height:42px;border-top:1px solid #eff0ec;display:flex;align-items:center;justify-content:space-between;padding:0 19px;color:#a0a49c;font-size:9px}.pagination-button{border:0;background:none;color:#728671;font-family:inherit;font-size:9px;cursor:pointer}.pagination-button span{margin-left:4px}.empty-state{height:245px;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#9ca297;gap:6px}.empty-state>span{font-size:24px}.empty-state strong{font-size:11px;font-weight:500;color:#626b60}.empty-state small{font-size:9px}.right-column{display:grid;align-content:start;gap:15px}.quick-panel .panel-heading{padding:20px 18px 13px}.compact{align-items:center}.four-dots{font-size:20px;color:#b7bdb4}.quick-links{padding:0 9px 9px}.quick-link{width:100%;height:58px;display:flex;align-items:center;gap:10px;text-align:left;background:none;border:0;border-top:1px solid #f0f1ed;padding:0 9px;cursor:pointer;color:inherit}.quick-icon{width:29px;height:29px;border-radius:7px;display:grid;place-items:center;font-size:14px}.qi-red{background:#f7ece8;color:#b77a68}.qi-blue{background:#edf1f3;color:#78909f}.qi-green{background:#edf3ea;color:#6b896c}.quick-link>span:nth-child(2){flex:1}.quick-link strong{display:block;font-size:10px;font-weight:500;color:#4e574c}.quick-link small{display:block;font-size:9px;color:#a0a49d;margin-top:4px}.quick-arrow{font-size:13px;color:#a4aaa1;transition:transform .2s}.quick-link:hover .quick-arrow{transform:translate(2px,-2px);color:#57795b}.focus-card{min-height:180px;background:#425e47;border-radius:9px;overflow:hidden;position:relative;color:#fff;padding:20px}.focus-content{position:relative;z-index:1}.focus-label{font-size:9px;color:#d4dfd0;letter-spacing:.05em}.focus-label i{display:inline-block;width:5px;height:5px;background:#a8c69e;border-radius:50%;margin:0 5px 1px 0}.focus-content h3{font-size:18px;line-height:1.55;font-weight:500;letter-spacing:.015em;margin:13px 0 5px}.focus-content p{font-size:9px;color:#c1cec0;margin:0}.focus-content button{margin-top:15px;padding:0;background:none;border:0;color:#e0e8dc;font-family:inherit;font-size:9px;cursor:pointer}.focus-content button span{margin-left:5px}.focus-orbit{position:absolute;border:1px solid rgba(218,230,212,.12);border-radius:50%;width:220px;height:220px;right:-85px;top:4px}.orbit-two{width:165px;height:165px;right:-58px;top:31px;border-color:rgba(218,230,212,.16)}.focus-mark{position:absolute;right:22px;top:43px;color:rgba(224,235,217,.17);font-size:72px}.page-footer{display:flex;justify-content:space-between;color:#a4a89f;font-size:9px;padding:22px 2px 0}.page-footer span:last-child{display:flex;align-items:center;gap:6px}.page-footer i{width:5px;height:5px;border-radius:50%;background:#75a079}.record-dialog{width:min(470px,calc(100vw - 30px));border:1px solid #e7eae3;padding:0;border-radius:12px;box-shadow:0 24px 80px rgba(33,48,33,.19);color:var(--ink)}.record-dialog::backdrop{background:rgba(28,39,30,.36);backdrop-filter:blur(2px)}.record-dialog form{padding:25px}.dialog-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:21px}.dialog-head h2{font-size:19px;font-weight:600;margin:5px 0}.dialog-head p{font-size:11px;color:#91978d;margin:0}.dialog-close{border:0;background:#f3f4f1;border-radius:50%;width:28px;height:28px;font-size:20px;color:#7f867b;cursor:pointer;line-height:1}.field-label{display:block;font-size:10px;color:#5b6459;margin:0 0 14px}.field-label input,.field-label select,.field-label textarea{display:block;width:100%;height:38px;border:1px solid #e6e9e2;border-radius:6px;margin-top:7px;padding:0 10px;background:#fff;color:#3d473c;font-family:inherit;font-size:11px;outline:none}.field-label textarea{height:auto;padding:10px;resize:vertical}.field-label input:focus,.field-label select:focus,.field-label textarea:focus{border-color:#8da78b;box-shadow:0 0 0 3px #eef3eb}.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.optional{color:#a6aaa2;margin-left:5px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:21px}.secondary-button{height:38px;border:1px solid #e5e8e1;background:#fff;border-radius:6px;padding:0 16px;color:#747b71;font-family:inherit;font-size:11px;cursor:pointer}.toast{position:fixed;z-index:5;bottom:24px;left:50%;transform:translate(-50%,20px);background:#314b36;color:white;padding:10px 16px;border-radius:7px;font-size:11px;opacity:0;pointer-events:none;transition:.22s;box-shadow:0 6px 24px #233a2940}.toast.visible{opacity:1;transform:translate(-50%,0)}.panel-actions{display:flex;align-items:center;gap:12px}.panel-actions .text-button:disabled{opacity:.55;cursor:wait}.workbook-status{max-width:108px;min-width:88px;height:25px;border:1px solid transparent;border-radius:5px;padding:0 7px;font-family:inherit;font-size:9px;cursor:pointer;outline:none}.workbook-status:disabled{opacity:.6;cursor:wait}.workbook-status.status-wait{color:#a77c4c;background:#f7f1e7}.workbook-status.status-done{color:#608166;background:#edf3eb}.workbook-status:focus{border-color:#8da78b;box-shadow:0 0 0 2px #eef3eb}.record-toolbar[hidden]{display:none}
@media(max-width:1120px){.content-wrap{padding-left:30px;padding-right:30px}.topbar{padding:0 30px}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.lower-grid{grid-template-columns:minmax(0,1.55fr) minmax(225px,.8fr)}}
@media(max-width:820px){.sidebar{width:68px;padding:20px 9px 14px;align-items:center}.brand{padding:0}.brand>span:last-child,.side-label,.nav-item:not(.active),.nav-item .nav-count,.privacy-card,.profile-copy,.more{display:none}.main-nav{margin-top:43px;width:100%}.nav-item{justify-content:center;padding:0}.nav-item.active{width:46px;margin:auto}.nav-icon{font-size:18px}.profile-button{justify-content:center;padding:7px 0}.main-content{margin-left:68px}.pending-dashboard{grid-template-columns:1fr}.pie-layout{justify-content:flex-start}.lower-grid{grid-template-columns:1fr}.right-column{grid-template-columns:1fr 1fr}.topbar{padding:0 22px}.content-wrap{padding:32px 22px 20px}}
@media(max-width:580px){.topbar{height:57px;padding:0 16px}.topbar-actions{gap:14px}.today-label{font-size:0}.today-label .calendar-icon{font-size:15px}.content-wrap{padding:27px 14px 20px}.welcome-row{align-items:flex-start;gap:12px}.welcome-row h1{font-size:18px;max-width:240px;line-height:1.5}.welcome-copy{font-size:10px}.welcome-row .primary-button{height:35px;padding:0 11px;font-size:10px;white-space:nowrap}.metric-grid{gap:9px}.metric-card{height:139px;padding:14px 12px}.metric-value strong{font-size:30px}.metric-foot{gap:4px;font-size:8px}.sparkline{width:47%;right:8px;bottom:6px}.metric-period{display:none}.lower-grid{margin-top:10px}.right-column{grid-template-columns:1fr}.pie-layout{gap:14px}.pie-chart{width:122px;height:122px;flex-basis:122px}.record-toolbar{align-items:flex-start;flex-direction:column;padding-top:0;padding-bottom:9px}.record-tabs{width:100%;gap:14px}.search-box{flex-basis:auto;width:100%}.records-table-wrap #date-column-heading,.records-table-wrap .record-date{display:none}.records-table th,.records-table td{padding-left:8px;padding-right:8px}.records-table th:first-child,.records-table td:first-child{padding-left:12px}.record-title-cell{max-width:205px;gap:7px}.records-table td{height:54px}.records-table-wrap{min-height:280px}.focus-card{min-height:172px}.page-footer{font-size:8px}.record-dialog form{padding:20px}}

html{scrollbar-gutter:stable}
.sidebar > :not(.main-nav){flex-shrink:0}
.main-nav{min-height:0;overflow:auto;scrollbar-width:thin;padding:3px;margin-inline:-3px}
.sidebar-bottom{padding-top:12px}
[hidden]{display:none !important}
.overview-lower-grid > .right-column{grid-column:1 / -1}
.workshop-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}
.workshop-scope { min-width: 0; }
.workshop-scope + .workshop-scope {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.workshop-scope-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.workshop-scope-heading h3 { margin: 0; font-size: 12px; font-weight: 600; }
.workshop-scope .pie-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0 0;
}
.workshop-scope .pie-chart {
  justify-self: center;
  width: min(100%, 96px);
  height: auto;
  aspect-ratio: 1;
}
.workshop-scope .legend-item small { display: block; margin-left: 0; }
.workshop-scope .chart-empty { padding: 8px 0; }
.record-type-icon.type-inspection.status-done{background:#e7f0e5;color:#3e754a}
.record-type-icon.type-inspection.status-wait{background:#f6e8e3;color:#a94c3b}
.record-type-icon.type-manual,.record-type-icon.type-spec{width:30px;height:30px;flex:0 0 30px;border-radius:7px;font-weight:600}
.record-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}
.record-delete{border:1px solid transparent;border-radius:5px;padding:4px 6px;background:transparent;color:#a94c3b;font:inherit;cursor:pointer}
.record-delete:hover,.record-delete:focus-visible{border-color:#eaccc3;background:#f9edeb}
@media(min-width:581px){.overview-lower-grid > .right-column{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}}
.statistics-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}
.statistics-header h1{font-size:clamp(20px,3vw,30px);line-height:1.2;margin:0;color:var(--ink)}
.statistics-header .primary-button{flex:none;white-space:nowrap}
.ledger-header-actions{display:flex;flex:none;align-items:center;gap:8px}
.ledger-export-button{align-self:stretch;white-space:nowrap}
@media(max-width:500px){.statistics-header:has(.ledger-header-actions){flex-wrap:wrap}.ledger-header-actions{margin-inline-start:auto}.ledger-export-button{padding-inline:9px}}
.record-dialog.export-dialog{width:min(620px,calc(100% - 24px))}
.export-fieldset{min-inline-size:0;margin:0 0 12px;padding:8px 10px 10px;border:1px solid var(--line);border-radius:6px}
.export-fieldset legend{color:var(--blue);font-weight:700}
.export-hint,.export-error{margin:0 0 8px;font-size:11px;color:var(--muted)}
.export-error{color:var(--red)}
.export-dates .field-label{margin:0}
.export-selection-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:5px 12px;margin-bottom:6px;font-size:12px}
.export-record-list{max-height:180px;overflow:auto;border-block:1px solid var(--line)}
.export-record-choice,.export-field-list label{display:flex;align-items:baseline;gap:6px;overflow-wrap:anywhere}
.export-record-choice{padding:5px 0;border-bottom:1px solid var(--line)}
.export-record-choice:last-child{border-bottom:0}
.export-record-choice small{flex:none;font-variant-numeric:tabular-nums;color:var(--muted)}
.export-form-empty{margin:0;padding:10px 0;color:var(--muted)}
.export-field-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:4px 10px}
#export-form input[type="checkbox"]{flex:none;accent-color:var(--blue)}
#export-submit:disabled{opacity:.5;cursor:default}
.statistics-filters{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin-bottom:18px}
.statistics-filters .field-label{margin:0;min-width:0}
.statistics-filters .field-label input{margin:0;width:100%}
#records[data-search-only] .statistics-filters .records-month-field,
#records[data-search-only] #reset-records-filters{display:none}
/* Match the original right edge of the search field on desktop. */
#records[data-search-only] .field-label:has(#search-input){width:min(100%,294px)}
.statistics-filters .text-button,.statistics-table .text-button{font-size:12px}
.statistics-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 18px}
.statistics-metric{min-width:0;padding:16px;background:var(--paper);border:1px solid var(--line);border-radius:9px}
.statistics-metric dt{color:#657065}
.statistics-metric dd{margin:6px 0 0;color:var(--blue);font-size:clamp(18px,3vw,30px);font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.statistics-metric dd small{font-size:11px;font-weight:400;white-space:nowrap}
.reward-amount-metric,.reward-share-metric{height:210px}
.reward-share-metric{display:flex;flex-direction:column}
.reward-share-metric dd{display:flex;flex:1;flex-direction:column;align-items:center;gap:8px;min-height:0;margin-top:8px;font:inherit;color:inherit}
.reward-share-pie{flex:none;width:min(100%,96px);aspect-ratio:1;border-radius:50%}
.reward-share-metric .chart-legend{width:100%;min-width:0;min-height:0;align-content:start;gap:4px;overflow-y:auto}
.reward-share-metric .legend-item strong{white-space:normal;text-align:right;overflow-wrap:anywhere}
.reward-share-metric .legend-item strong small{display:inline-block}
.reward-share-empty{margin:4px 0;color:#657065;font-size:11px}
#records[data-section="manual"] #records-count-metric{align-self:start}
#manual-category-metric dd{margin-top:10px;font:inherit;color:inherit}
#manual-category-counts{display:grid;gap:6px;list-style:none;margin:0;padding:0}
#manual-category-counts li{display:flex;justify-content:space-between;gap:8px;color:#657065}
#manual-category-counts strong{color:var(--blue);white-space:nowrap;font-variant-numeric:tabular-nums}
#records[data-monthly-rate] .statistics-summary,.statistics-summary.sorting-summary{
  position:relative;
  grid-template-rows:repeat(2,1fr);
  row-gap:0;
}
/* Both rows match the original count card height. The chart spans both. */
#records[data-monthly-rate] #records-count-metric{visibility:hidden}
.statistics-metric.quality-trend-metric{position:absolute;inset:0 auto 0 0;width:50%;display:flex;flex-direction:column;padding:5px 7px 3px}
.quality-trend-metric dt{padding-inline:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quality-trend-metric .monthly-trend-heading{white-space:normal;overflow-wrap:anywhere}
.quality-trend-metric dd{position:relative;flex:1;min-height:0;margin:2px 0 0}
#quality-trend,.monthly-trend-canvas{position:absolute;inset:0;display:block;width:100%;height:100%}
.statistics-summary.sorting-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
/* Match the trend card, which spans both equal-height rows. */
.sorting-total-metric{height:200%;align-self:start}
.statistics-metric.sorting-trend-metric{inset:0 0 0 auto;width:calc((100% - 12px)/2)}
.quality-trend-metric .sorting-trend-legend{display:flex;flex:0 0 auto;justify-content:center;gap:10px;margin:2px 0 0;color:var(--muted);font-size:10px;line-height:1.4}
.pest-trend-metric .sorting-trend-legend{flex-wrap:wrap;gap:2px 10px}
.sorting-trend-legend span{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.sorting-trend-legend i{width:13px;border-top:2px solid var(--series-color)}
.sorting-trend-legend i.sorting-legend-dashed{border-top-style:dashed}
@media(min-width:581px){.statistics-summary.sorting-summary{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}.statistics-metric.sorting-trend-metric{width:calc((100% - 12px)*2/3)}}
@media(max-width:580px){.statistics-metric.sorting-trend-metric{width:calc((100% - 8px)/2)}}
.statistics-summary:is(.rework-summary,.pest-summary,.defect-summary){grid-template-columns:minmax(0,1fr) minmax(0,2fr)}
.statistics-metric:is(.rework-trend-metric,.pest-trend-metric,.defect-trend-metric){position:relative;inset:auto;width:auto;min-height:190px}
.statistics-metric.defect-trend-metric{min-height:214px;padding:8px 10px 6px}
.quality-trend-metric :is(.defect-chart-period,.chart-breakdown-scope){flex:none;padding-inline:4px;color:var(--muted);font-size:11px;font-weight:400}
.quality-trend-metric .rework-trend-legend{display:flex;flex:0 0 auto;flex-wrap:wrap;justify-content:center;gap:2px 10px;margin:4px 0 0;color:var(--muted);font-size:10px;line-height:1.4}
.rework-trend-legend button{display:inline-flex;align-items:center;gap:4px;padding:1px 2px;border:0;border-radius:3px;background:none;color:inherit;font:inherit;white-space:nowrap;cursor:pointer}
.rework-trend-legend button:hover{background:var(--blue-soft);color:var(--navy)}
.rework-trend-legend i{width:13px;border-top:2px solid var(--series-color)}
.rework-trend-legend i.rework-legend-dashed{border-top-style:dashed}
.quality-trend-metric .defect-trend-legend{max-height:54px;overflow:auto}
.defect-trend-legend button{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left}
.defect-trend-legend i{flex:none}
.quality-trend-metric .chart-breakdown-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:0 6px;white-space:normal}
.rework-chart-back{flex:none;padding:4px;white-space:nowrap;font-size:11px}
.quality-trend-metric .chart-breakdown-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:10px;margin-top:6px;color:inherit;font-size:12px;font-weight:400}
.chart-breakdown-table{width:100%;border-collapse:collapse}
.chart-breakdown-table :is(th,td){padding:3px 5px;border-bottom:1px solid var(--line)}
.chart-breakdown-table tbody th{font-weight:400}
.chart-breakdown-table :is(thead,tfoot){background:var(--blue-soft);color:var(--navy)}
.chart-breakdown-table :is(th,td):first-child{text-align:left}
.chart-breakdown-table :is(th,td):not(:first-child){text-align:right;overflow-wrap:normal}
.chart-breakdown-table tfoot :is(th,td){border-bottom:0;font-weight:650}
.chart-breakdown-label{display:flex;align-items:center;gap:5px;overflow-wrap:anywhere}
.chart-breakdown-label i{flex:0 0 7px;height:7px;border-radius:2px}
.chart-breakdown-visual{display:grid;place-items:center;align-self:stretch;min-width:0;border-inline-start:1px solid var(--line);padding:6px}
.chart-breakdown-pie{width:min(100%,180px);aspect-ratio:1;border-radius:50%;box-shadow:inset 0 0 0 1px var(--line)}
.chart-breakdown-empty{color:var(--muted);text-align:center}
/* Give the sorting drilldown room for all rows; keep the existing compact trend view. */
.statistics-summary.sorting-summary:has(.chart-breakdown-body){grid-template-rows:auto}
.sorting-summary:has(.chart-breakdown-body) .sorting-total-metric{height:auto;align-self:stretch}
.statistics-metric.sorting-trend-metric:has(.chart-breakdown-body){position:relative;inset:auto;width:auto}
@media(max-width:580px){
  .statistics-summary:is(.rework-summary,.pest-summary,.defect-summary,.sorting-summary:has(.chart-breakdown-body)){grid-template-columns:minmax(0,1fr)}
  .quality-trend-metric .chart-breakdown-body{gap:5px;font-size:11px}
  .chart-breakdown-table :is(th,td){padding:3px 2px}
  .chart-breakdown-label{gap:3px}
}
@media(max-width:360px){
  .quality-trend-metric .chart-breakdown-body{grid-template-columns:minmax(0,1fr)}
  .chart-breakdown-visual{border-inline-start:0;border-top:1px solid var(--line)}
  .chart-breakdown-pie{width:min(100%,110px)}
}
#quality-rate-preview,#returns-rate-preview,#sorting-ratio-preview{margin-left:5px;color:var(--blue);font-size:14px;font-weight:600}
#records[data-section="inspection"] .statistics-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
.statistics-metric.inspection-progress-metric{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto 1fr auto auto;align-content:start;column-gap:8px}
.inspection-progress-metric > dt:first-child{grid-column:1;grid-row:1}
.inspection-progress-metric > dd.inspection-progress-value:not(.inspection-pending-value){grid-column:1;grid-row:2}
.inspection-progress-metric .inspection-pending-value{grid-column:2;grid-row:1 / 3;margin:0}
.inspection-hidden-label{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
.inspection-progress-label{font-size:13px;font-weight:700;color:var(--blue)}
.inspection-metric-filter{padding:0;border:0;border-radius:4px;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.inspection-pending-value .inspection-metric-filter{width:100%;display:block}
.inspection-pending-value .inspection-progress-label{display:block;margin-bottom:6px}
.inspection-warning-metric:hover dt{text-decoration:underline;text-underline-offset:3px}
.inspection-pending-value .inspection-metric-filter:is(:hover,[aria-pressed="true"]){box-shadow:0 0 0 3px var(--yellow),0 0 0 4px var(--yellow-border)}
.inspection-progress-metric .inspection-rate-label{grid-column:1/-1;margin-top:9px;padding-top:8px;border-top:1px solid var(--line)}
.inspection-progress-metric .inspection-rate-value{grid-column:1/-1;display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 8px;margin-top:3px;font-size:clamp(18px,2.5vw,26px)}
.inspection-rate-value small{color:var(--muted)}
.inspection-warning-metric{position:relative}
.inspection-warning-filter::after{content:'';position:absolute;inset:0;border-radius:inherit}
.inspection-pending-value .inspection-metric-filter:is(:hover,[aria-pressed="true"]),
.inspection-warning-metric:has(.inspection-warning-filter:is(:hover,[aria-pressed="true"])){background:var(--yellow);border-color:var(--yellow-border)}
.inspection-warning-metric:has(.inspection-warning-filter:focus-visible){outline:2px solid var(--blue);outline-offset:2px}
.inspection-warning-metric .inspection-warning-hint{margin-top:6px;font-size:11px;font-weight:400;color:var(--muted)}
.inspection-filter-indicator{display:flex;align-items:center;gap:12px;margin:-5px 0 8px;color:var(--blue);font-size:12px}
.inspection-filter-indicator .text-button{text-decoration:underline;text-underline-offset:3px}
@media(max-width:580px){
  #records[data-section="inspection"] .statistics-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .inspection-category-metric{grid-column:1/-1}
  .inspection-progress-label{font-size:11px}
}
#records[data-section="followup"] .statistics-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
#followup-term-metric .bar-chart{grid-template-rows:repeat(2,30px)}
@media(max-width:580px){
  #records[data-section="followup"] .statistics-summary{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:360px){#records[data-section="inspection"] .statistics-summary{grid-template-columns:minmax(0,1fr)}}
.inspection-category-metric dd{margin-top:10px;font:inherit;color:inherit}
.inspection-category-metric .bar-chart {
  grid-template-rows: repeat(3, 30px);
  gap: 8px;
  padding: 0;
}
.inspection-category-metric .bar-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  gap: 4px 8px;
}
.inspection-category-metric .bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspection-category-metric .bar-track{grid-column:1 / -1;grid-row:2;height:5px}
.inspection-category-metric .chart-empty{padding:4px 0}
.statistics-table-wrap{overflow-x:auto;border-radius:9px}
.statistics-table{width:100%;min-width:550px;border-collapse:collapse;text-align:left}
.statistics-table th,.statistics-table td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:top}
.statistics-table th{background:#f8f9f6;color:#586357;font-weight:600;white-space:nowrap}
.statistics-table td{overflow-wrap:anywhere;min-width:64px}
.statistics-table tr:not(.statistics-month-row) td:first-child,.statistics-table td.inspection-deadline{white-space:nowrap}
.statistics-table td.statistics-month-cell{width:1%;vertical-align:middle;white-space:nowrap}
.statistics-table tr:last-child td{border-bottom:0}
#statistics:is([data-section="semi-defects"],[data-section="inner-machine-sampling"]) .statistics-table{min-width:1450px}
#statistics:is([data-section="semi-defects"],[data-section="inner-machine-sampling"]) .statistics-table thead th{text-align:center;vertical-align:middle}
#statistics:is([data-section="semi-defects"],[data-section="inner-machine-sampling"]) .statistics-table :is(th,td){padding-inline:8px}
#statistics[data-section="outer-sampling"] .statistics-table{min-width:740px}
.record-dialog.defect-ledger-dialog{width:min(620px,calc(100% - 24px))}
.ledger-count-fields{grid-column:1/-1;min-inline-size:0;margin:0 0 12px;padding:8px 10px 0;border:1px solid var(--line);border-radius:6px}
.ledger-count-fields legend{padding-inline:3px;color:var(--blue);font-weight:700}
.ledger-count-hint{margin:0 0 8px;color:var(--muted);font-size:11px}
.semi-packet-editor > .ledger-count-hint{margin:6px 0 0}
#statistics[data-section="semi-defects"] .semi-shared-cell{vertical-align:middle}
.semi-packet-editor{margin:0 0 8px;padding:7px 9px;border:1px solid var(--line);border-radius:6px}
.semi-packet-editor summary{color:var(--blue);font-weight:650;cursor:pointer}
.semi-packet-state{margin-inline-start:10px;color:var(--muted);font-weight:400}
.text-button.ledger-fill-zero{display:block;min-height:32px;margin:4px 0 7px;color:var(--blue);font-size:12px;font-weight:600;text-align:left;text-decoration:underline;text-underline-offset:2px}
.machine-number-entry{position:relative;display:block}
.machine-number-entry input{padding-inline-end:28px}
.machine-number-entry > span{position:absolute;inset:0 10px 0 auto;display:grid;place-items:center;color:var(--muted);pointer-events:none}
.defect-ledger-preview{margin:0 0 8px;color:var(--blue);font-weight:650}
.defect-ledger-error{margin:0 0 8px;color:var(--red);font-size:12px}
#records[data-section="inspection"] .statistics-table{table-layout:fixed;min-width:900px}
#records[data-section="inspection"] .statistics-table :is(th,td){padding-inline:10px}
#records[data-section="inspection"] .statistics-table th:first-child{width:91px}
#records[data-section="inspection"] #workshop-column-heading{width:88px}
#records[data-section="inspection"] #inspection-category-heading{width:84px}
#records[data-section="inspection"] #inspection-deadline-heading{width:91px}
#records[data-section="inspection"] #status-column-heading{width:98px}
#records[data-section="inspection"] #standard-record-columns th:last-child{width:96px}
#records[data-section="followup"] .statistics-table{table-layout:fixed;min-width:900px}
#records[data-section="followup"] .statistics-table :is(th,td){padding-inline:10px}
#followup-record-columns th:not(:nth-child(2),:nth-child(3)){width:92px}
#followup-record-columns th:nth-child(6),#followup-record-columns th:last-child{width:98px}
.followup-milestone-cell ol{margin:0;padding-inline-start:1.55em}
.followup-milestone-editor ol{list-style:none;margin:0;padding:0}
.followup-milestone-editor li + li{margin-top:8px}
.followup-milestone-cell li{white-space:pre-wrap}
.followup-milestone-cell li + li{margin-top:4px}
.followup-milestone-editor{min-inline-size:0;margin:10px 0 0;padding:8px 10px;border:1px solid var(--line);border-radius:6px}
.followup-milestone-editor legend{color:var(--blue);font-weight:700}
.followup-milestone-editor .followup-date-hint{margin-bottom:8px}
.followup-milestone-editor .field-label:last-child{margin-bottom:0}
#followup-term-field select{margin:0;width:100%}
.followup-term{display:inline-block;padding:2px 7px;border-radius:4px;background:var(--blue-soft);color:var(--navy);white-space:nowrap}
.followup-term-long{background:var(--yellow);color:var(--deep-navy)}
.followup-date-hint{color:var(--muted);margin:0;font-size:11px}
.workspace-scroll-text{display:block;min-width:0;overflow-x:auto;white-space:nowrap;scroll-behavior:auto;scrollbar-width:thin}
.workspace-scroll-text > span{display:inline-block;white-space:inherit}
.ledger-scroll-text{max-inline-size:17em}
.statistics-table .record-title-copy{display:block;min-width:0}
.inspection-issue-text{font-weight:650}
@media(prefers-reduced-motion:no-preference){
  .app-shell:not(.text-scroll-paused) .workspace-text-overflow:not(:hover):not(:focus){overflow-x:hidden}
  .app-shell:not(.text-scroll-paused) .workspace-text-overflow:not(:hover):not(:focus) > span{animation:workspace-text-pan var(--text-scroll-duration) ease-in-out infinite alternate}
}
@keyframes workspace-text-pan{0%,18%{transform:translateX(0)}82%,100%{transform:translateX(var(--text-scroll-shift))}}
.text-button[data-text-scroll-toggle]{padding-inline:6px;border-radius:5px;white-space:nowrap}
.text-button[data-text-scroll-toggle][aria-pressed="true"]{background:var(--blue-soft)}
/* Overview labels wrap instead of using the ledger text animation. */
#category-bars{grid-template-rows:none;grid-auto-rows:minmax(30px,auto)}
#category-bars .bar-label{white-space:normal;overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){[data-text-scroll-toggle]{display:none}}
.statistics-empty{margin:0;padding:32px 16px;text-align:center;color:#657065}
.statistics-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px}
.statistics-fields .field-label{min-width:0}
.pest-table-entries{display:grid;grid-auto-rows:24px;gap:4px;list-style:none;margin:0;padding:0}
.pest-table-entries li{display:flex;align-items:center;white-space:nowrap}
.pest-table-counts{font-variant-numeric:tabular-nums}
.pest-category-tag{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:4.7em;padding:2px 6px;border:1px solid var(--line);border-radius:5px;background:var(--paper);color:var(--navy);font-size:11px;font-weight:650;text-align:center}
.pest-category-tag::before{content:'';display:block;width:7px;height:7px;border-radius:2px;background:var(--pest-swatch,var(--chart-empty))}
.pest-category-1{--pest-swatch:var(--pest-color-1)}
.pest-category-2{--pest-swatch:var(--pest-color-2)}
.pest-category-3{--pest-swatch:var(--pest-color-3)}
.pest-category-4{--pest-swatch:var(--pest-color-4)}
.pest-category-5{--pest-swatch:var(--pest-color-5)}
.pest-fields{min-inline-size:0;margin:0 0 12px;padding:8px 10px 10px;border:1px solid var(--line);border-radius:6px}
.pest-fields legend{color:var(--blue);font-weight:700}
.pest-fields p,#pest-form-error{margin:0 0 8px;color:var(--muted);font-size:11px;overflow-wrap:anywhere}
#pest-legacy-entries{margin:8px 0 0}
#pest-form-error{color:var(--red)}
.monthly-rate-form-error{margin:0 0 8px;color:var(--red);font-size:11px;overflow-wrap:anywhere}
.field-label.pest-entry-row{display:grid;grid-template-columns:5.5em minmax(0,1fr);align-items:center;gap:10px;margin:0 0 8px}
.pest-entry-row input{min-width:0;margin:0}
.rework-legacy-note{grid-column:1/-1;margin:0 0 12px;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.statistics-table .rework-defect-cell{width:1%;padding-inline:7px}
.rework-defect-list{display:grid;gap:4px;margin:0;padding:0;list-style:none}
.rework-defect-head,.rework-defect-list li{display:grid;grid-template-columns:29px 44px 66px;align-items:center;column-gap:4px;padding:2px 4px;border:1px solid transparent;font-size:11px;line-height:16px;text-align:center}
.rework-defect-head{color:var(--muted)}
.rework-defect-list li{border-color:var(--line);border-radius:5px;background:var(--paper)}
.rework-packet-tag{border-radius:4px;background:var(--blue-soft);color:var(--navy);font-weight:650;white-space:nowrap}
.rework-defect-list strong{font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--navy)}
.rework-defect-fields{grid-column:1/-1;min-inline-size:0;margin:0 0 12px;padding:8px 10px 10px;border:1px solid var(--line);border-radius:6px}
.rework-defect-fields legend{color:var(--blue);font-weight:700}
.rework-defect-fields p{margin:0 0 8px;color:var(--muted);font-size:11px}
.rework-defect-fields .rework-defect-error{color:var(--red)}
.rework-defect-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:end;gap:6px;margin-bottom:8px}
.rework-defect-row .field-label{margin:0}
.rework-defect-row .field-label select,.rework-defect-row .field-label input{min-width:0;margin:0;padding-inline:6px}
.rework-defect-row .record-delete{min-height:36px;white-space:nowrap}
.rework-defect-row :is(select,input):disabled{opacity:.55}
@media(max-width:390px){.rework-defect-row{grid-template-columns:repeat(2,minmax(0,1fr))}.rework-defect-row .record-delete{justify-self:start}}
.sorting-category-tags{display:flex;flex-wrap:wrap;gap:5px}
.sorting-category-tag{display:inline-flex;align-items:baseline;gap:6px;padding:3px 7px;border:1px solid var(--line);border-radius:5px;background:var(--blue-soft);color:var(--navy);white-space:nowrap;font-size:11px}
.sorting-category-tag strong{font-variant-numeric:tabular-nums}
.sorting-category-zero{background:var(--blue-wash);color:var(--muted)}
.record-dialog{max-height:calc(100dvh - 24px);overflow:auto}
.spec-packet-fields{min-inline-size:0;margin:0 0 14px;padding:10px;border:1px solid var(--line);border-radius:6px}
.spec-packet-hint{margin:0 0 8px;color:#657065;font-size:12px;overflow-wrap:anywhere}
.spec-packet-input-row{display:grid;grid-template-columns:minmax(0,1.6fr) repeat(2,minmax(0,1fr));gap:6px}
.spec-packet-head{color:#586357;font-size:11px;margin-bottom:4px}
.spec-packet-input-row .field-label{min-width:0;margin:0 0 5px}
.spec-packet-input-row input{min-width:0;height:30px;margin:0;padding:0 5px}
#manual-form input[type="file"]{height:auto;min-height:38px;padding:7px 10px}
.attachment-status{margin:0;color:#657065;font-size:12px}
.attachment-status:empty{display:none}
.manual-view-button:disabled{opacity:.55;cursor:wait}
.nav-group{min-width:0}
.nav-group > summary{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:6px 10px 6px 12px;border:1px solid var(--line);border-radius:7px;background:var(--blue-wash);color:var(--navy);font-size:12px;font-weight:700;list-style:none;cursor:pointer}
.nav-group > summary::-webkit-details-marker{display:none}
.nav-group > summary::after{content:'';width:6px;height:6px;flex:none;border:solid var(--blue);border-width:0 1.5px 1.5px 0;transform:rotate(-45deg)}
.nav-group[open] > summary::after{transform:translateY(-2px) rotate(45deg)}
.nav-group > summary:hover,.nav-group:has(.nav-item.active) > summary{background:var(--blue-soft);border-color:var(--blue-border);color:var(--blue)}
.nav-group .nav-item{margin-top:3px;padding-inline-start:20px}
.nav-group .nav-icon{flex:none}
@media(max-height:780px) and (min-width:821px){.side-label{margin-top:24px}.nav-item{height:37px}}
@media(max-width:820px){
  .main-nav{margin-top:22px}
  .main-nav .nav-item{display:flex;flex-direction:column;justify-content:center;width:100%;min-height:46px;height:auto;gap:1px;margin:0;padding:4px 2px;font-size:9px;line-height:1.15;text-align:center;overflow-wrap:anywhere}
  .nav-group > summary{flex-direction:column;justify-content:center;gap:3px;min-height:44px;padding:5px 2px;font-size:10px;line-height:1.2;text-align:center;overflow-wrap:anywhere}
  .nav-group[open] > .nav-item{margin-top:3px}
}
.main-nav .nav-group:not([open]) > .nav-item{display:none}
@media(max-width:580px){
  .statistics-header{gap:10px}
  .statistics-header .primary-button{padding:0 9px;height:35px}
  .statistics-filters .field-label:last-of-type{flex:1 1 120px}
  #records[data-search-only] .statistics-filters{container-type:inline-size}
  /* Where the old clear button fit beside search, keep its 48px slot and 12px gap. */
  #records[data-search-only] .field-label:has(#search-input){flex:none;width:calc(100% - 60px)}
  @container (width < 180px) or (244px <= width < 304px){
    #records[data-search-only] .field-label:has(#search-input){width:100%}
  }
  .statistics-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .statistics-metric{padding:12px}
  .statistics-metric dt{font-size:11px}
}
@media(max-width:420px){.statistics-header h1{font-size:clamp(16px,4.5vw,20px)}}
@media(max-width:390px){.statistics-fields{grid-template-columns:1fr}}

/* White surfaces with a blue system color, amber notices, and red exceptions. */
:root{
  --ink:#17283d;--muted:#4f6279;--line:#dbe4ef;--paper:#fff;--canvas:#fff;
  --blue:#2456a1;--navy:#183352;--deep-navy:#122742;--blue-soft:#eaf2ff;
  --blue-wash:#f5f9ff;--blue-border:#b8cde8;--blue-hover:#1c4789;
  --yellow:#fff3cb;--yellow-border:#dec581;--amber-ink:#70500a;--yellow-wash:#fffaf0;
  --red:#a83143;--red-soft:#fff0f2;--red-border:#e7b0ba;
  --sidebar:var(--paper);--outline:#2a63b4;--input-border:#788da8;--warning-icon:#9a6914;
  --panel-shadow:0 2px 7px #18335212;
  --serif:system-ui,'Microsoft YaHei',sans-serif;
  --chart-ink:#41546d;--chart-grid:#dce6f2;--chart-empty:#e8eef7;
  /* Solid/dashed lines and a shared palette for trends, bars, pies, and their legends. */
  --chart-category-1:#2f63a7;--chart-category-2:#b54554;--chart-category-3:#a27719;
  --chart-category-4:#497d99;--chart-category-5:#873e60;--chart-category-6:#b85e2d;
  --chart-category-7:#315678;--chart-category-8:#a95374;--chart-category-9:#907836;--chart-category-10:#65599b;
  --chart-line:var(--chart-category-1);--chart-quality:var(--chart-category-1);--chart-returns:var(--chart-category-2);
  --chart-vegetable:var(--chart-category-1);--chart-bamboo:var(--chart-category-3);
  --rework-chart-1:var(--chart-category-1);--rework-chart-2:var(--chart-category-2);--rework-chart-3:var(--chart-category-3);
  --rework-chart-4:var(--chart-category-4);--rework-chart-5:var(--chart-category-5);--rework-chart-6:var(--chart-category-6);
  --rework-chart-7:var(--chart-category-7);
  --pest-color-1:var(--chart-category-1);--pest-color-2:var(--chart-category-2);--pest-color-3:var(--chart-category-3);
  --pest-color-4:var(--chart-category-4);--pest-color-5:var(--chart-category-5);
}
body{background:var(--canvas);font-family:system-ui,'Microsoft YaHei','PingFang SC',sans-serif}
.sidebar{color:var(--ink);border-color:var(--line);background:var(--sidebar)}
.brand-mark{background:var(--blue);color:var(--paper);box-shadow:none;border-radius:9px;flex-shrink:0}
.avatar,.top-avatar{background:var(--blue-soft);color:var(--blue);box-shadow:none}
.brand-copy{min-width:0}
.brand strong{color:var(--navy);font-weight:800;font-size:13px;line-height:1.35;letter-spacing:0}
.brand strong span{white-space:nowrap}
.brand small,.side-label,.profile-copy small,.privacy-card small{color:var(--muted)}
.side-label{font-weight:650}
.nav-item{color:var(--navy);border:1px solid transparent;font-weight:550}
.nav-item .nav-icon{color:var(--blue)}
.nav-item:hover{background:var(--blue-wash);color:var(--blue)}
.nav-item.active{background:var(--blue-soft);color:var(--blue);border-color:var(--blue-border);box-shadow:inset 3px 0 var(--blue);font-weight:750}
.nav-item.active .nav-icon{color:var(--blue)}
.nav-count{background:var(--red-soft);color:var(--red);min-width:18px;text-align:center}
.privacy-card{background:var(--blue-wash);border:1px solid var(--line)}
.privacy-card strong,.profile-copy strong,.profile-button .more{color:var(--navy)}
.privacy-icon{color:var(--blue);background:var(--blue-soft)}
.status-dot{background:var(--blue)}
.page-footer .save-status{margin-inline-start:auto;font-size:11px}
.page-footer .save-status i{background:var(--muted)}
.page-footer .save-status[data-state="saving"] i{background:var(--warning-icon)}
.page-footer .save-status[data-state="saved"] i{background:var(--blue)}
.page-footer .save-status[data-state="error"] i{background:var(--red)}
.page-footer .save-status[data-state="error"] #save-status-result{color:var(--red)}
.topbar{background:var(--paper);border-color:var(--line)}
.breadcrumb,.today-label,.calendar-icon,.icon-button{color:var(--muted)}
.breadcrumb strong{color:var(--navy);font-weight:700}
.icon-button i{background:var(--red)}
.top-avatar{border:1px solid var(--blue-border)}

.welcome-row{
  position:relative;isolation:isolate;overflow:hidden;min-height:140px;align-items:center;
  padding:22px clamp(16px,4vw,38px);border:1px solid var(--line);border-radius:15px;
  background:var(--paper);
  box-shadow:var(--panel-shadow);
}
.welcome-row::after{
  content:'';position:absolute;z-index:-1;inset:0 0 0 auto;width:31%;
  background:linear-gradient(134deg,var(--blue-wash) 62%,var(--blue-soft) 62% 81%,var(--yellow) 81% 94%,var(--red-soft) 94%);
  clip-path:polygon(46% 0,100% 0,100% 100%,0 100%);
}
.workspace-overview-card{display:grid;grid-template-columns:minmax(0,1fr);align-content:center;gap:14px}
.workspace-overview-card h1{margin:0;color:var(--navy);font-size:clamp(17px,2.3vw,23px);font-weight:750;line-height:1.25;letter-spacing:0}
.workspace-overview-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);gap:10px 22px;width:min(100%,540px);margin:0}
.workspace-overview-fields > div{min-width:0;padding-inline-start:12px;border-inline-start:2px solid var(--blue-border)}
.workspace-overview-fields > div + div{border-inline-start-color:var(--yellow-border)}
.workspace-overview-fields dt{color:var(--muted);font-size:12px}
.workspace-overview-fields dd{margin:4px 0 0;color:var(--navy);font-size:16px;font-weight:700;overflow-wrap:anywhere}
.workspace-overview-fields small{color:var(--muted);font-size:12px;font-weight:500}
#workspace-daily-completion[data-state="pending"]{color:var(--amber-ink)}
.workspace-login{min-height:100dvh;display:grid;place-items:center;padding:16px;background:var(--blue-wash)}
.workspace-login-card{width:min(100%,410px);padding:clamp(20px,6vw,34px)}
.workspace-login-card h1{margin:12px 0 3px;color:var(--navy);font-size:23px}
.workspace-login-subtitle{margin:0 0 22px;color:var(--muted)}
.workspace-login-card .primary-button{justify-content:center;width:100%}
.workspace-login-card .primary-button:disabled{opacity:.55;cursor:wait}
.workspace-login-note{margin:12px 0 0;color:var(--muted);font-size:12px;text-align:center}
.workspace-login-error{margin:0 0 12px;color:var(--red);font-size:12px}
.workspace-profile,.workspace-notifications{position:relative}
.workspace-profile{display:flex;align-items:center;gap:8px;padding:5px 3px 5px 8px;border-top:1px solid var(--line)}
.workspace-profile .avatar{flex-shrink:0}
.workspace-profile .profile-copy{flex:1;min-width:0;line-height:1.35}
.workspace-profile .profile-copy small{overflow-wrap:anywhere}
.workspace-icon-button{display:grid;place-items:center;width:38px;height:38px;flex:none;padding:0;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--navy);cursor:pointer}
.workspace-icon-button svg{width:20px;height:20px}
.workspace-icon-button:is(:hover,[aria-expanded="true"]){border-color:var(--blue-border);background:var(--blue-soft);color:var(--blue)}
.workspace-popup{position:absolute;z-index:4;border:1px solid var(--blue-border);border-radius:9px;background:var(--paper);box-shadow:0 6px 20px #12274226}
.workspace-profile-panel{inset:auto 0 calc(100% + 6px) auto;min-width:130px;padding:5px}
.workspace-logout{display:block;width:100%;padding:9px 11px;border:0;border-radius:5px;background:transparent;color:var(--red);font:inherit;font-weight:700;text-align:start;white-space:nowrap;cursor:pointer}
.workspace-logout:hover,.workspace-logout:focus-visible{background:var(--red-soft)}
.workspace-notifications-panel{inset:calc(100% + 6px) 0 auto auto;width:min(270px,calc(100vw - 148px));padding:12px}
.workspace-notifications-panel h2{margin:0;color:var(--navy);font-size:14px}
.workspace-notifications-panel p{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.55}
@media(max-width:820px){
  .brand > span.brand-copy{display:block;text-align:center}
  .brand strong span{display:inline-block;max-width:3em;white-space:normal;line-break:anywhere}
  .brand small{display:none}
  .workspace-profile{padding:4px 0 0}
  .workspace-profile .avatar{display:none}
  .workspace-profile-panel{inset:auto auto calc(100% + 6px) 0}
}
@media(max-width:400px){.topbar-actions .today-label{display:none}}
.workspace-daily{margin-block-start:12px;padding:14px clamp(12px,3vw,20px)}
.workspace-daily-header{display:flex;align-items:start;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin-bottom:12px}
.workspace-daily-header h2{margin:0;color:var(--navy);font-size:15px}
.workspace-daily-header p,.workspace-daily-header time{margin:4px 0 0;color:var(--muted);font-size:12px}
.workspace-daily-header time{white-space:nowrap;font-variant-numeric:tabular-nums}
.workspace-daily-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,216px),1fr));gap:8px}
.workspace-daily-group{min-width:0;padding:7px 9px;border:1px solid var(--line);border-radius:7px;background:var(--blue-wash)}
.workspace-daily-group h3{display:flex;justify-content:space-between;gap:6px;margin:0 0 4px;color:var(--navy);font-size:12px;overflow-wrap:anywhere}
.workspace-daily-group h3 span{white-space:nowrap;color:var(--muted);font-weight:500}
.workspace-daily-group ul{padding:0;margin:0;list-style:none}
.workspace-daily-group li{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px}
.workspace-daily-group li + li{border-top:1px solid var(--line)}
.daily-page-link{text-align:left;overflow-wrap:anywhere;font-size:12px}
.daily-page-state{border-radius:4px;padding:2px 5px;white-space:nowrap;font-size:11px}
.workspace-daily-inactive{margin-top:10px;color:var(--muted);font-size:12px}
.workspace-daily-inactive summary{cursor:pointer}
.workspace-daily-inactive .workspace-daily-grid{margin-top:8px}

.metric-card,.panel,.statistics-metric{background:var(--paper);border-color:var(--line);border-radius:11px;box-shadow:var(--panel-shadow)}
.metric-grid > .metric-card{border-block-start:3px solid var(--blue-border)}
.metric-grid > .metric-card:nth-child(2){border-block-start-color:var(--red-border)}
.metric-grid > .metric-card:nth-child(4){border-block-start-color:var(--yellow-border)}
.metric-grid > .metric-card.pending-metric-toggle{border-block-start-color:var(--red-border)}
.metric-name,.metric-value>span,.metric-foot,.metric-period{color:var(--muted)}
.metric-name{font-weight:750}
.metric-value strong{color:var(--navy);font-weight:750}
.green-symbol,.qi-green,.qi-blue,.trend.positive,.trend.neutral{background:var(--blue-soft);color:var(--blue)}
.blue-symbol{background:var(--yellow);color:var(--amber-ink)}
.amber-symbol,.rose-symbol,.qi-red{background:var(--red-soft);color:var(--red)}
.green-spark path:first-child{stroke:var(--chart-quality)}
.green-spark .spark-area{fill:var(--chart-quality)}
.amber-spark path:first-child{stroke:var(--chart-returns)}
.amber-spark .spark-area{fill:var(--chart-returns)}
.doc-stack span,.doc-stack span:nth-child(2),.doc-stack span:last-child{background:var(--blue-wash);border-color:var(--blue-border);color:var(--blue)}
.doc-stack span:last-child{background:var(--yellow)}
.panel-heading h2,.statistics-header h1,.dialog-head h2{font-weight:750}
.panel-heading p,.section-kicker,.page-footer,.chart-empty,.statistics-empty,.reward-share-empty,.optional,.spec-packet-hint,.attachment-status{color:var(--muted)}
.chart-total{color:var(--blue);font-weight:750}
.legend-item,.bar-label,.bar-row strong,.legend-item strong,.legend-item strong small{color:var(--muted)}
.bar-track{background:var(--blue-soft)}
.bar-track i{background:var(--bar-color,var(--chart-line))}
.pie-chart,.reward-share-pie{box-shadow:inset 0 0 0 1px var(--line)}
.quick-link{border-top-color:var(--line)}
.quick-link:hover{background:var(--blue-wash)}
.quick-link strong,.quick-arrow,.quick-link:hover .quick-arrow,.four-dots{color:var(--blue)}
.quick-link small{color:var(--muted)}
.focus-card{background:var(--blue-wash);color:var(--navy);border:1px solid var(--line);box-shadow:var(--panel-shadow)}
.focus-label,.focus-content button{color:var(--blue)}
.focus-label i{background:var(--warning-icon)}
.focus-content h3{font-weight:750}
.focus-content p{color:var(--muted)}
.focus-orbit{border-color:var(--line)}
.focus-mark{color:var(--blue-border);transform:rotate(12deg)}

.statistics-header h1{color:var(--navy)}
.statistics-header h1::after{content:'';display:block;width:1.4em;height:3px;margin-top:5px;border-radius:5px;background:linear-gradient(90deg,var(--blue) 60%,var(--yellow-border) 60% 82%,var(--red) 82%)}
.statistics-metric dt{color:var(--blue);font-weight:700}
.statistics-table th{background:var(--blue-soft);color:var(--navy);font-weight:700}
.statistics-table tbody tr:nth-child(even){background:var(--blue-wash)}
.statistics-table tbody tr:hover{background:var(--yellow-wash)}
.record-type-icon.type-manual,.record-type-icon.type-spec{background:var(--blue-soft);color:var(--blue)}
.text-button,.pagination-button{color:var(--blue);font-weight:650}
.text-button:hover,.pagination-button:hover{text-decoration:underline;text-underline-offset:3px}
.primary-button{border:1px solid var(--blue);background:var(--blue);color:var(--paper);box-shadow:none;font-weight:750}
.primary-button:hover{background:var(--blue-hover);color:var(--paper);transform:none}
.primary-button:active{background:var(--deep-navy);transform:none}
.secondary-button{background:var(--paper);color:var(--blue);border-color:var(--blue-border);font-weight:700}
.secondary-button:hover{background:var(--blue-soft)}
.record-delete{color:var(--red)}
.record-delete:hover,.record-delete:focus-visible{border-color:var(--red-border);background:var(--red-soft)}
.status-wait,.workbook-status.status-wait,.record-type-icon.type-inspection.status-wait{background:var(--red-soft);color:var(--red)}
.status-done,.workbook-status.status-done,.record-type-icon.type-inspection.status-done{background:var(--blue-soft);color:var(--blue)}
.status-archived{background:var(--blue-wash);color:var(--muted)}

.record-dialog{background:var(--paper);border-color:var(--blue-border);border-radius:13px;box-shadow:0 14px 38px #12274238}
.record-dialog::backdrop{background:#1227425c}
.dialog-close{color:var(--blue)}
.field-label,.spec-packet-head{color:var(--navy);font-weight:650}
.field-label input,.field-label select,.field-label textarea{background:var(--paper);border-color:var(--input-border);color:var(--ink)}
.field-label input:focus,.field-label select:focus,.field-label textarea:focus,.workbook-status:focus{border-color:var(--outline);box-shadow:0 0 0 2px var(--blue-soft)}
select:enabled,input:is([type="date"],[type="month"],[type="time"]):enabled:not([readonly]){cursor:pointer}
input:is([type="date"],[type="month"],[type="time"]):enabled:not([readonly])::-webkit-calendar-picker-indicator{cursor:pointer}
:where(a,button,summary,[tabindex]):focus-visible{outline:2px solid var(--outline);outline-offset:2px}
.toast{background:var(--navy);color:var(--paper);box-shadow:0 3px 12px #12274233}
.chart-hover-tooltip{position:fixed;z-index:8;pointer-events:none;width:max-content;max-width:min(240px,calc(100vw - 16px));padding:7px 9px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:7px;box-shadow:0 4px 14px #12274226;font-size:12px;line-height:1.45;overflow-wrap:anywhere}
.chart-hover-heading{display:flex;align-items:center;gap:6px;color:var(--navy)}
.chart-hover-heading i{flex:none;width:9px;height:9px;border-radius:2px;background:var(--hover-series-color,var(--chart-line))}
.chart-hover-detail{margin:2px 0 0 15px;color:var(--muted);font-variant-numeric:tabular-nums}
.sparkline:has(svg path){pointer-events:auto}
.sparkline svg path{pointer-events:visiblePainted}

@media(max-width:580px){
  .welcome-row{min-height:118px;padding:16px 12px}
  .workspace-overview-card h1{font-size:clamp(17px,4vw,20px)}
  .workspace-overview-fields{column-gap:10px}
  .workspace-overview-fields > div{padding-inline-start:8px}
  .welcome-row::after{opacity:.65}
  .metric-value strong{font-size:clamp(22px,6vw,30px)}
  .metric-foot{flex-wrap:wrap}
}
.statistics-summary.serious-rework-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
.serious-rework-summary > .statistics-metric{min-height:154px}
.serious-rework-count{border-top:3px solid var(--red-border)}
.serious-rework-share,.serious-rework-category{border-top:3px solid var(--blue-border)}
.serious-rework-share{container-type:inline-size}
.serious-rework-category .bar-chart{grid-template-rows:none;grid-auto-rows:minmax(30px,auto);max-height:106px;overflow:auto;scrollbar-gutter:stable}
.serious-rework-category .bar-label{white-space:normal;overflow-wrap:anywhere}
.serious-rework-share .serious-rework-share-body{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px 18px;margin-top:9px;font:inherit}
.serious-rework-pie{width:96px;aspect-ratio:1;border-radius:50%;box-shadow:inset 0 0 0 1px var(--line)}
.serious-rework-share .legend-item,.serious-rework-share .legend-item small{font-size:12px}
#statistics[data-section="serious-rework"] .statistics-table{min-width:1120px}
#statistics[data-section="serious-rework"] .statistics-table th{white-space:nowrap}
.serious-rework-text{width:17%;line-height:1.6}
.record-dialog.serious-rework-dialog{width:min(640px,calc(100% - 24px))}
#serious-rework-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px}
.serious-rework-wide{grid-column:1/-1}
@container (width < 250px){
  .serious-rework-share .serious-rework-share-body{grid-template-columns:minmax(0,1fr);justify-items:center}
  .serious-rework-share .chart-legend{width:100%}
}
@media(max-width:620px){
  .statistics-summary.serious-rework-summary{grid-template-columns:minmax(0,1fr)}
  .serious-rework-summary > .serious-rework-count{min-height:auto}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{transition-duration:0.01ms!important}
}
