/* QC workspace layout and report workflow. Kept separate from legacy page styles. */
body.qc-authenticated main{max-width:1440px;display:grid;grid-template-columns:220px minmax(0,1fr);gap:0 20px;align-items:start}
body.qc-authenticated #message{grid-column:1/-1}
body.qc-authenticated #workspaceNav{grid-column:1;grid-row:2/span 12;display:flex;flex-direction:column;position:sticky;top:94px;gap:8px;padding:14px;background:#fff;border:1px solid #d8e2e8;border-radius:14px;box-shadow:0 4px 18px #16364a0c;max-height:calc(100dvh - 108px);overflow-y:auto;overflow-x:hidden}
body.qc-authenticated #workspaceNav button{width:100%;text-align:left;margin:0;min-height:44px}
body.qc-authenticated #workspaceNav #navCustomize{flex:none;margin-top:2px;border:1px solid #c7d6de;background:#f4f8fa;text-align:center}
header{position:sticky;top:0;z-index:30}.header-actions{gap:8px}.header-actions .header-utility{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:38px;margin:0;padding:6px 10px;border:1px solid #7895a4;background:#e9f4f5;color:#12314a;font-size:13px;font-weight:700;white-space:nowrap}.header-actions .header-utility[hidden]{display:none!important}.header-actions .badge{padding:2px 7px;background:#b7312e;color:#fff}
.mobile-menu-button,.mobile-nav-heading,.mobile-nav-backdrop{display:none}
.qc-menu-group{display:block;flex:none;width:100%;border-bottom:1px solid #e2eaf0;padding:4px 0 10px}.qc-menu-group:last-of-type{border-bottom:0}.qc-menu-group-label{display:block;padding:6px 10px;color:#647c8e;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.qc-menu-items{display:flex;flex-direction:column;gap:5px;width:100%}
body.qc-authenticated #workspaceNav.arranging .qc-menu-items button[draggable=true]{cursor:grab;border:1px dashed #117b82;background:#f2fbfa;padding-right:38px;position:relative}
body.qc-authenticated #workspaceNav.arranging .qc-menu-items button[draggable=true]::after{content:'↕';position:absolute;right:13px;color:#117b82;font-weight:900}
body.qc-authenticated #dashboardCard,body.qc-authenticated #dispatchCard,body.qc-authenticated #workloadCard,body.qc-authenticated #availabilityCard,body.qc-authenticated #centerCard,body.qc-authenticated #reportsCard,body.qc-authenticated #findingsCard,body.qc-authenticated #templatesCard,body.qc-authenticated #adminCard,body.qc-authenticated #notificationCard,body.qc-authenticated .columns{grid-column:2;min-width:0}
#dashboardFocus .task{display:block}.dispatch-actions{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.dispatch-actions label{flex:1 1 220px}.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
#reportMetrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 0 18px}
.toolbar{grid-template-columns:minmax(0,1fr) 180px auto;align-items:center}
#reportsTestFilter{display:inline-flex;align-items:center;width:max-content;max-width:100%;margin:0;font-weight:700;cursor:pointer}
#reportsTestFilter input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
#reportsTestFilter span{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 14px;border:1px solid #b9cbd6;border-radius:9px;background:#e9eff2;color:#183c50;white-space:nowrap}
#reportsTestFilter input:checked+span{border-color:#117b82;background:#117b82;color:#fff}
#reportsTestFilter input:focus-visible+span{outline:3px solid rgba(17,123,130,.25);outline-offset:2px}
#inspectorMetrics{border:1px solid #d8e2e8;border-radius:12px;padding:12px;margin:0 0 18px}
#inspectorMetrics summary{cursor:pointer;font-weight:700}
.inspector-metric{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-top:1px solid #e7eef1;font-size:13px}
.inspector-metric span{text-align:right;color:#5d7280}
.report-detail{border-top:1px solid #d8e2e8;margin-top:20px;padding-top:20px;min-width:0}
.report-detail-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}.report-detail-heading h3{margin:0}.report-detail-heading p{margin:6px 0 0}.report-detail-heading button{flex:none;margin:0}
.report-detail h4{margin:24px 0 10px;font-size:16px}.report-detail h5{margin:18px 0 8px;font-size:14px}.report-detail a{display:inline-flex;margin:8px 0;overflow-wrap:anywhere}
.report-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:8px 0 16px}.report-fact{min-width:0;padding:11px 12px;border:1px solid #dbe5ea;border-radius:10px;background:#f7fafb}.report-fact span{display:block;color:#637989;font-size:11px;margin-bottom:5px}.report-fact strong{display:block;color:#183348;font-size:13px;overflow-wrap:anywhere}
.report-note{padding:12px 14px;border-left:4px solid #d59b24;border-radius:8px;background:#fff8e8}.report-note h4{margin:0 0 6px}.report-note p{margin:0;white-space:pre-wrap}
.report-version{border:1px solid #d8e2e8;border-radius:12px;margin:10px 0;padding:14px;background:#fff}
.report-version summary{cursor:pointer;font-weight:700}
.report-version>summary{padding:2px}.report-version[open]>summary{padding-bottom:12px;border-bottom:1px solid #edf1f3}.report-table-wrap{width:100%;overflow-x:auto;border:1px solid #dbe5ea;border-radius:10px}.report-table{width:100%;border-collapse:collapse;min-width:520px}.report-table th,.report-table td{padding:10px 12px;text-align:left;border-bottom:1px solid #e8eef1;font-size:12px}.report-table th{background:#f0f6f7;color:#405c6c;white-space:nowrap}.report-table tbody tr:last-child td{border-bottom:0}
.report-evidence{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.evidence-card{display:flex;flex-direction:column;min-width:0;padding:12px;border:1px solid #dbe5ea;border-radius:10px;background:#fff}.evidence-card img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:7px;margin-bottom:10px;background:#edf2f4}.evidence-card strong,.evidence-card span{overflow-wrap:anywhere}.evidence-card span{margin-top:5px;color:#657a88;font-size:11px}
.report-timeline{border-left:2px solid #c8dce1;margin-left:7px;padding-left:18px}.timeline-item{position:relative;padding:10px 0;border-bottom:1px solid #edf1f3}.timeline-item::before{content:'';position:absolute;left:-24px;top:16px;width:10px;height:10px;border-radius:50%;background:#117b82;border:2px solid #fff}.timeline-item strong,.timeline-item span{display:block}.timeline-item span,.timeline-item small{color:#677d8c;font-size:11px}.timeline-item p{margin:6px 0 2px;white-space:pre-wrap;overflow-wrap:anywhere}
.suggestions{font-size:14px}.due-form{border:1px solid #d8e2e8;border-radius:10px;padding:12px;margin-top:16px}
.task-discussion{margin-top:24px;border-top:1px solid #d8e2e8;padding-top:10px}
@media(max-width:760px){
  body.qc-authenticated main{display:block;max-width:760px;padding-top:18px}
  body.qc-authenticated #workspaceNav{display:flex;position:fixed;z-index:70;inset:0 auto 0 0;width:min(310px,86vw);max-height:100dvh;margin:0;border:0;border-radius:0;transform:translateX(-105%);transition:transform .2s ease;box-shadow:18px 0 50px rgba(10,34,48,.22);padding:18px;overflow-y:auto;background:#fff}
  body.qc-authenticated #workspaceNav.mobile-open{transform:translateX(0)}
  body.qc-menu-open{overflow:hidden}
  .mobile-nav-backdrop{position:fixed;display:block;z-index:60;inset:0;width:100%;height:100%;margin:0;border:0;border-radius:0;background:rgba(11,34,49,.45)}
  .mobile-nav-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 2px 14px;border-bottom:1px solid #e2eaf0}
  .mobile-nav-heading strong{font-size:18px}.mobile-nav-heading button{width:40px!important;min-width:40px!important;min-height:40px!important;margin:0!important;padding:4px!important;text-align:center!important;font-size:25px;line-height:1}
  .mobile-menu-button{display:inline-flex!important;width:38px;min-width:38px!important;padding:5px!important;font-size:20px!important;line-height:1}
  .qc-menu-group{border-right:0;border-bottom:1px solid #e2eaf0;padding:8px 0 12px}
  .qc-menu-group-label{display:block;padding-left:4px}
  .qc-menu-items{display:flex;flex-direction:column;gap:5px}
  body.qc-authenticated #workspaceNav button{width:100%;min-width:0;text-align:left}
  body.qc-authenticated #workspaceNav #navCustomize{margin-top:2px;align-self:auto}
  #reportMetrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 12px;min-height:0}
  .brand-group{align-self:start}.brand{width:38px;height:38px}.brand-group strong{font-size:17px}header small{max-width:152px;font-size:10px;line-height:1.25;white-space:normal}
  .header-actions{display:grid;grid-template-columns:repeat(3,auto);justify-content:end;gap:6px}
  .header-actions .header-utility{min-height:36px;font-size:12px;padding:5px 8px;margin:0}
  .header-actions select{width:58px;min-width:58px;min-height:36px;padding:5px 7px}
  main{padding:16px 12px 36px}.card{padding:16px;border-radius:13px;margin-bottom:14px}h2{font-size:19px;margin-bottom:12px}
  .section-heading{display:flex;align-items:flex-start}.section-heading>div{min-width:0}.section-heading button{flex:none;margin-top:0;padding:9px 12px}
  .stats,#reportMetrics{gap:9px;margin:10px 0 15px}.stat{padding:12px}.stat strong{font-size:23px}.stat span{font-size:12px}
  .toolbar{grid-template-columns:1fr;gap:8px}.center-row,.template-card{padding:12px}.center-row-head{align-items:flex-start}.center-row-head strong{min-width:0;overflow-wrap:anywhere}.pill{flex:none}#reportsTestFilter,#reportsTestFilter span{width:100%}
  .dispatch-actions{display:grid;grid-template-columns:1fr;width:100%}.dispatch-actions label{min-width:0;margin-top:8px}.dispatch-actions button{width:100%;margin:0}
  .staff-fields,.staff-access-grid{grid-template-columns:1fr}.staff-person{padding:14px}.staff-person-head{display:block}.staff-recovery>label{max-width:none}
  .template-check{display:grid;grid-template-columns:1fr;gap:10px;padding:14px 0}.template-check>label{min-width:0}.template-check button{width:100%}
  .report-detail{margin-top:16px;padding-top:16px}.report-version{padding:10px}.report-facts{grid-template-columns:1fr 1fr}.report-evidence{grid-template-columns:1fr 1fr}.task-discussion button,.due-form button{width:100%;margin-right:0}
  .columns{gap:12px}.task{padding:12px;overflow-wrap:anywhere}
  input,select,textarea{font-size:16px;min-height:44px}button{min-height:42px}
}
@media(max-width:440px){
  header{grid-template-columns:1fr}.brand-group{padding-right:2px}.header-actions{grid-template-columns:repeat(4,minmax(0,1fr));width:100%}.header-actions .header-utility,.header-actions select{width:100%;min-width:0;padding:5px 4px;font-size:11px}.header-actions #enablePushButton{grid-column:span 2}.header-actions #logoutButton{grid-column:span 2}
  .section-heading{display:block}.section-heading button{width:100%;margin:8px 0 0}
  .facts,.report-detail .facts,.report-facts,.report-evidence{grid-template-columns:1fr}.report-detail-heading{display:block}.report-detail-heading button{width:100%;margin-top:10px}.inspector-metric{display:block}.inspector-metric span{display:block;text-align:left;margin-top:5px}
  #reportMetrics,.stats{grid-template-columns:1fr 1fr}
  #localLogin,#localSetup,#passwordReset{padding:20px 16px;margin-top:12px}
}
.template-language-note{border-left:4px solid #117b82;background:#eef9f8;border-radius:8px;padding:10px 12px;color:#31566a;font-size:13px}
.template-translations{grid-column:1/-1;width:100%;margin:4px 0 8px;padding:9px 11px;border:1px solid #dbe5ea;border-radius:9px;background:#f8fbfc}.template-translations>summary{cursor:pointer;color:#466474;font-size:12px;font-weight:700}.template-translations>p{margin:7px 0}.template-translation-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px}.template-translation-fields label,.template-translation-fields input{min-width:0}

/* Some mobile browsers and "desktop site" modes report a wide CSS viewport.
   app.js adds qc-compact from the actual device/touch characteristics so the
   QC workspace still uses the mobile drawer instead of clipping the content. */
html.qc-compact body.qc-authenticated main{display:block;width:100%;max-width:760px;padding:16px 12px 36px;overflow-x:hidden}
html.qc-compact body.qc-authenticated #workspaceNav{display:flex;position:fixed;z-index:70;inset:0 auto 0 0;width:min(310px,86vw);max-height:100dvh;margin:0;border:0;border-radius:0;transform:translateX(-105%);transition:transform .2s ease;box-shadow:18px 0 50px rgba(10,34,48,.22);padding:18px;overflow-y:auto;overflow-x:hidden;background:#fff}
html.qc-compact body.qc-authenticated #workspaceNav.mobile-open{transform:translateX(0)}
html.qc-compact body.qc-menu-open{overflow:hidden}
html.qc-compact .mobile-nav-backdrop{position:fixed;display:block;z-index:60;inset:0;width:100%;height:100%;margin:0;border:0;border-radius:0;background:rgba(11,34,49,.45)}
html.qc-compact .mobile-nav-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 2px 14px;border-bottom:1px solid #e2eaf0}
html.qc-compact .mobile-nav-heading strong{font-size:18px}
html.qc-compact .mobile-nav-heading button{width:40px!important;min-width:40px!important;min-height:40px!important;margin:0!important;padding:4px!important;text-align:center!important;font-size:25px;line-height:1}
html.qc-compact .mobile-menu-button{display:inline-flex!important;width:38px;min-width:38px!important;padding:5px!important;font-size:20px!important;line-height:1}
html.qc-compact body.qc-authenticated #workspaceNav button{width:100%;min-width:0;text-align:left}
html.qc-compact header{display:grid;grid-template-columns:1fr;align-items:center;gap:9px;padding:10px 12px;min-height:0}
html.qc-compact .brand-group{min-width:0}.qc-compact .brand{width:38px;height:38px}.qc-compact .brand-group strong{font-size:17px}.qc-compact header small{max-width:none;font-size:10px;line-height:1.25;white-space:normal}
html.qc-compact .header-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;justify-content:stretch;gap:6px}
html.qc-compact .header-actions .header-utility,html.qc-compact .header-actions select{width:100%;min-width:0;min-height:36px;margin:0;padding:5px 4px;font-size:11px}
html.qc-compact .header-actions #enablePushButton{grid-column:span 2}
html.qc-compact .header-actions #logoutButton{grid-column:span 2}
html.qc-compact .card{width:100%;min-width:0;padding:16px;border-radius:13px;margin-bottom:14px;overflow-wrap:anywhere}
html.qc-compact .stats,html.qc-compact #reportMetrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
html.qc-compact .toolbar,html.qc-compact .template-basics,html.qc-compact .template-check,html.qc-compact .staff-fields,html.qc-compact .staff-access-grid,html.qc-compact .facts{grid-template-columns:1fr}
html.qc-compact .template-translation-fields{grid-template-columns:1fr}
html.qc-compact .section-heading{display:block}html.qc-compact .section-heading button{width:100%;margin:8px 0 0}
html.qc-compact input,html.qc-compact select,html.qc-compact textarea{font-size:16px;min-height:44px}

/* Desktop shell follows the SCM workspace: a fixed, compact navigation rail
   and a single-line utility bar. The drawer is reserved for narrow screens. */
@media(min-width:761px){
  body.qc-authenticated{padding-left:244px}
  body.qc-authenticated header{
    position:fixed;inset:0 0 auto 0;height:86px;min-height:86px;z-index:50;
    padding:0 32px 0 18px;border-bottom:1px solid #d8e2e8;
    background:linear-gradient(90deg,#12314a 0,#12314a 244px,#fff 244px,#fff 100%);
    color:#182b38;box-shadow:none
  }
  body.qc-authenticated .brand-group{width:194px;gap:12px;color:#fff}
  body.qc-authenticated .brand{width:42px;height:42px;border-radius:11px}
  body.qc-authenticated .brand-group strong{font-size:19px;color:#fff}
  body.qc-authenticated header small{font-size:10px;color:#b9ced8}
  body.qc-authenticated .header-actions{margin-left:auto;display:flex;align-items:center;gap:10px}
  body.qc-authenticated .header-actions .header-utility{
    width:auto;min-width:38px;min-height:38px;margin:0;padding:7px 12px;
    border:0;border-radius:10px;background:#eef3f4;color:#294657;font-size:12px;
    box-shadow:none
  }
  body.qc-authenticated .header-actions .header-utility:hover{background:#e2ebee}
  body.qc-authenticated .header-actions select{
    width:70px;min-width:70px;height:38px;margin:0;padding:7px 9px;
    border:1px solid #d2dfe5;border-radius:9px;background:#fff;color:#294657;font-size:12px
  }
  body.qc-authenticated #mobileMenuButton{display:none!important}
  body.qc-authenticated main{
    display:block;width:100%;max-width:1580px;margin:0 auto;padding:116px 34px 60px
  }
  body.qc-authenticated #message{max-width:none}
  body.qc-authenticated #workspaceNav{
    display:flex;position:fixed;z-index:40;inset:86px auto 0 0;width:244px;max-height:none;
    margin:0;padding:18px 18px 22px;border:0;border-radius:0;background:#12314a;
    box-shadow:none;overflow-y:hidden;overflow-x:hidden;gap:8px;color:#fff;flex-wrap:nowrap
  }
  body.qc-authenticated #workspaceNav .mobile-nav-heading{display:none}
  body.qc-authenticated #workspaceNav .qc-menu-group{
    padding:0 0 14px;margin:0 0 4px;border-bottom:1px solid rgba(255,255,255,.12)
  }
  body.qc-authenticated #workspaceNav .qc-menu-group-label{
    padding:8px 10px 7px;color:#8faab7;font-size:10px;letter-spacing:.08em
  }
  body.qc-authenticated #workspaceNav .qc-menu-items{gap:5px}
  body.qc-authenticated #workspaceNav #qcWorkGroup{
    flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:3px
  }
  body.qc-authenticated #workspaceNav #qcSystemGroup{
    flex:none;margin-top:auto;padding-top:5px;background:#12314a
  }
  body.qc-authenticated #workspaceNav button{
    width:100%;min-height:42px;margin:0;padding:10px 12px;border:0;border-radius:9px;
    background:transparent;color:#bdd0d8;text-align:left;font-size:13px;font-weight:700;
    line-height:1.3;box-shadow:none
  }
  body.qc-authenticated #workspaceNav button:hover{background:rgba(255,255,255,.08);color:#fff}
  body.qc-authenticated #workspaceNav button:not(.secondary){background:rgba(255,255,255,.12);color:#fff}
  body.qc-authenticated #workspaceNav #navCustomize{
    order:0;min-height:38px;margin:0 0 4px;padding:8px 12px;border:0;background:rgba(255,255,255,.06);
    color:#a9c0ca;text-align:left;font-size:12px
  }
  body.qc-authenticated #workspaceNav #navCustomize:hover{background:rgba(255,255,255,.12);color:#fff}
  body.qc-authenticated #dashboardCard,
  body.qc-authenticated #dispatchCard,
  body.qc-authenticated #workloadCard,
  body.qc-authenticated #availabilityCard,
  body.qc-authenticated #centerCard,
  body.qc-authenticated #reportsCard,
  body.qc-authenticated #findingsCard,
  body.qc-authenticated #templatesCard,
  body.qc-authenticated #adminCard,
  body.qc-authenticated #notificationCard,
  body.qc-authenticated .columns{width:100%;min-width:0}
}
@media(max-width:760px){
  body.qc-authenticated #workspaceNav{flex-wrap:nowrap;overflow-y:auto}
  body.qc-authenticated #workspaceNav #qcWorkGroup{flex:none;min-height:auto;overflow:visible;padding-right:0}
  body.qc-authenticated #workspaceNav #qcSystemGroup{margin-top:0;background:#fff}
}
.quality-packet,.qc-check-item{border:1px solid #d6e3e5;border-radius:14px;padding:16px;margin:16px 0;background:#f8fcfc}.quality-packet h3,.qc-check-item h4{margin-top:0}.quality-packet>a{display:inline-block;margin-top:10px;font-weight:700}.qc-check-item textarea{min-height:72px}
