/* MyProcur design system (Phase 9.1): tokens and components from the owner-approved mockup. Plain CSS, no framework. */
/* Montserrat (SIL OFL, self-hosted): logo, page titles and section headings only; body and tables stay on the system stack. */
@font-face{font-family:Montserrat;font-style:normal;font-weight:400;font-display:swap;src:url(/static/fonts/montserrat-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:Montserrat;font-style:normal;font-weight:700;font-display:swap;src:url(/static/fonts/montserrat-latin-700-normal.woff2) format("woff2")}
:root{
  --bg:#F5F6F7;--surface:#fff;--text:#1D2D3E;--text2:#556B82;--line:#E5E8EB;
  --brand:#015ADE;--brand-h:#014BB9;--brand-soft:#E6EFFC;--font-brand:Montserrat,"Segoe UI","Helvetica Neue",Arial,sans-serif;
  --pos:#256F3A;--pos-bg:#F5FAE5;--crit:#AA5808;--crit-bg:#FFF3B8;--neg:#AA0808;--neg-bg:#FFEAF4;--info:#0064D9;--info-bg:#E1F4FF;--neu:#556B82;--neu-bg:#EFF1F2;
  --shadow:0 0 2px rgba(34,53,72,.2),0 2px 4px rgba(34,53,72,.2);
  --shadow-h:0 0 2px rgba(34,53,72,.25),0 6px 16px rgba(34,53,72,.18);
  --surface-1:#F7F8F9;--border-strong:#8A96A3;
  --disc:#3B6D11;--sur:#D85A30;--tag-disc-bg:#C0DD97;--tag-disc-fg:#173404;--tag-sur-bg:#F5C4B3;--tag-sur-fg:#4A1B0C;
  --r:12px;--sw:0px;
  --font:"Segoe UI","Helvetica Neue",Arial,sans-serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:110px}
body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 var(--font);-webkit-font-smoothing:antialiased;overflow-wrap:break-word}
a{color:var(--brand);text-decoration:none}a:hover{color:var(--brand-h);text-decoration:underline}
h1,h2,h3{margin:0;font-weight:600}
h1,h2,.pt,.login-card h1{font-family:var(--font-brand);font-weight:700}
h3{font-family:var(--font-brand);font-weight:700}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:6px}
svg.i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
svg.i.sm{width:16px;height:16px}

/* shell */
.sysband{color:#fff;text-align:center;font-size:12px;font-weight:600;line-height:20px;min-height:20px;padding:0 8px;letter-spacing:.02em;overflow-wrap:anywhere}
@media (max-width:700px){.sysband{font-size:11px;line-height:16px;padding:2px 8px}}
.top{position:sticky;top:var(--sw);z-index:50;background:var(--surface);box-shadow:var(--shadow)}
.shell{display:flex;align-items:center;gap:16px;height:48px;padding:0 16px;max-width:1600px;margin:0 auto}
.logo{display:flex;align-items:center;gap:8px;color:var(--text);font-weight:700;font-size:16px}
.logo:hover{text-decoration:none;color:var(--text)}
.shell .home{color:var(--text2);padding-left:16px;border-left:1px solid var(--line);font-weight:500}
.search{flex:1;max-width:480px;margin:0 auto;position:relative}
.search input{width:100%;height:32px;border:1px solid transparent;background:var(--bg);border-radius:16px;padding:0 14px 0 36px;font:inherit;color:var(--text)}
.search input:focus{outline:2px solid var(--brand);background:#fff}
.search svg{position:absolute;left:12px;top:8px;color:var(--text2);width:16px;height:16px}
.icon-btn{position:relative;width:36px;height:36px;border-radius:50%;border:0;background:none;color:var(--text);display:grid;place-items:center;cursor:pointer}
.icon-btn:hover{background:var(--bg)}
.icon-btn .count{position:absolute;top:2px;right:0;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:#E0136F;color:#fff;font-size:11px;font-weight:600;line-height:16px;text-align:center}
.avatar{width:32px;height:32px;border-radius:7px;background:#7800A4;color:#fff;font-weight:600;font-size:12px;display:grid;place-items:center;border:0;cursor:pointer}
.avatar:hover{box-shadow:0 0 0 3px var(--brand-soft)}
.menu-wrap{position:relative}
.menu{display:none;position:absolute;right:0;top:44px;width:240px;background:#fff;border-radius:var(--r);box-shadow:var(--shadow-h);padding:8px;z-index:60}
.menu.open{display:block}
.menu b{display:block}.menu small{color:var(--text2);display:block;margin-bottom:8px}
.menu a{display:block;padding:8px;border-radius:8px;color:var(--text)}.menu a:hover{background:var(--bg);text-decoration:none}

/* layout */
.page{margin-left:var(--sbw,0px);min-width:0}
main{max-width:1600px;margin:0 auto;padding:24px 16px calc(96px + var(--bbh,0px))}
.section{margin-bottom:32px}
.section>h2{font-size:18px;margin:0 0 12px;display:flex;align-items:center;gap:8px}
.section>h2 .link{margin-left:auto;font-size:14px;font-weight:400}
.card{background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow);padding:16px;margin-bottom:16px}
.card>h3{font-size:16px;margin-bottom:12px}
.muted{color:var(--text2)}
.card.flush{padding:0;overflow:hidden}

/* buttons */
.btn{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 14px;border-radius:8px;border:1px solid var(--line);background:#fff;color:var(--brand);font:600 14px var(--font);cursor:pointer;white-space:nowrap;transition:background .15s,box-shadow .15s}
.btn:hover{background:var(--brand-soft);text-decoration:none}
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}.btn.primary:hover{background:var(--brand-h)}
.btn.pos{background:#fff;border-color:#256F3A;color:#256F3A;border-radius:16px}.btn.pos:hover{background:#256F3A;color:#fff}
.btn.neg{background:#fff;border-color:#AA0808;color:#AA0808;border-radius:16px}.btn.neg:hover{background:#AA0808;color:#fff}
.btn.danger{color:var(--neg)}.btn.danger:hover{background:var(--neg-bg)}
.btn.sm{height:28px;padding:0 12px;font-size:13px}

/* pills */
.pill{display:inline-block;padding:2px 10px;border-radius:12px;font-size:12px;font-weight:600;line-height:18px;white-space:nowrap}
.pill.positive{color:var(--pos);background:var(--pos-bg)}.pill.critical{color:var(--crit);background:var(--crit-bg)}
.pill.negative{color:var(--neg);background:var(--neg-bg)}.pill.information{color:var(--info);background:var(--info-bg)}.pill.neutral{color:var(--neu);background:var(--neu-bg)}
.pill.lg{font-size:13px;padding:3px 12px}

/* todos */
.todos{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.todo{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:16px;display:flex;flex-direction:column;gap:4px;min-height:196px;transition:box-shadow .2s,transform .2s;position:relative}
.todo:hover{box-shadow:var(--shadow-h);transform:translateY(-2px)}
.todo .ic{width:40px;height:40px;border-radius:10px;display:grid;place-items:center;color:#fff;margin-bottom:8px}
.todo h3{font-family:var(--font);font-size:14px;font-weight:700;line-height:1.35}
.todo .prio{font-size:13px;font-weight:600}.prio.med{color:#C35500}.prio.high{color:#AA0808}.prio.low{color:var(--text2)}
.todo .code{color:var(--brand);font-size:13px}
.todo .meta{color:var(--text2);font-size:12px}
.todo .actions{margin-top:auto;padding-top:12px;display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.todo .stretch{position:absolute;inset:0;border-radius:var(--r)}
.todo.done{opacity:.45;pointer-events:none}
.more{display:block;margin:16px auto 0}

/* tiles */
.tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.tile{display:flex;flex-direction:column;justify-content:space-between;min-height:132px;padding:16px;border-radius:16px;color:#fff;box-shadow:var(--shadow);transition:transform .2s,box-shadow .2s,filter .2s;position:relative;overflow:hidden}
.tile:hover{color:#fff;text-decoration:none;transform:translateY(-3px);box-shadow:var(--shadow-h);filter:brightness(1.07)}
.tile::after{content:"";position:absolute;right:-28px;top:-28px;width:120px;height:120px;border-radius:50%;background:rgba(255,255,255,.1)}
.tile svg.i{width:32px;height:32px;stroke-width:1.6}
.tile b{font-size:18px;display:block}.tile span{font-size:13px;opacity:.9}
.t-req{background:#0057D2}.t-app{background:#E0136F}.t-pur{background:#C35500}.t-pln{background:#2E7D32}.t-src{background:#6A3FB5}.t-rec{background:#7800A4}.t-inv{background:#A93E00}.t-rep{background:#07838F}.t-ana{background:#1E8A2F}.t-adm{background:#5B738B}

/* apps / kpi */
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:16px;overflow-x:auto;overflow-y:hidden}
.tabs button{flex:none;border:0;background:none;font:500 14px var(--font);color:var(--text);padding:8px 16px;cursor:pointer;border-bottom:3px solid transparent;margin-bottom:-1px}
.tabs button:hover{background:var(--bg);border-radius:8px 8px 0 0}
.tabs button.active{color:var(--brand);border-bottom-color:var(--brand)}
.tabs a{flex:none;font:500 14px var(--font);color:var(--text);padding:8px 16px;text-decoration:none;border-bottom:3px solid transparent;margin-bottom:-1px}
.tabs a:hover{background:var(--bg);border-radius:8px 8px 0 0}
.tabs a.active{color:var(--brand);border-bottom-color:var(--brand)}
.tabpane{display:none}.tabpane.active{display:grid}
.kpis{grid-template-columns:repeat(6,1fr);gap:16px}
.kpi{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:16px;display:flex;flex-direction:column;gap:2px;color:var(--text);transition:box-shadow .2s,transform .2s;min-height:128px}
.kpi:hover{box-shadow:var(--shadow-h);transform:translateY(-2px);text-decoration:none;color:var(--text)}
.kpi .head{display:flex;justify-content:space-between;color:var(--text2)}
.kpi b{font-size:14px}.kpi small{color:var(--text2)}
.kpi .num{font-size:32px;font-weight:300;margin-top:auto;line-height:1.1}
.kpi .num span{font-size:14px;color:var(--text2);font-weight:400;margin-left:4px}
.kpi.warn .num{color:var(--crit)}

/* filter bar & tables */
.filterbar{display:grid;grid-template-columns:repeat(4,1fr) auto;gap:16px;align-items:end}
label.f{display:block;font-size:12px;color:var(--text2);font-weight:600}
label.f .req{color:var(--neg)}
/* QA-080: a label above a value-help field (div.f > label[for]) looks like every other header label */
div.f>label[for]{display:block;font-size:12px;color:var(--text2);font-weight:600}
div.f>label[for] .req{color:var(--neg)}
.in,select.in,textarea.in{display:block;width:100%;height:32px;margin-top:4px;border:1px solid #89919A;border-radius:8px;padding:0 10px;font:14px var(--font);color:var(--text);background:#fff}
textarea.in{height:auto;padding:8px 10px;resize:vertical}
.in:hover{border-color:var(--brand)}.in:focus{outline:2px solid var(--brand);outline-offset:0;border-color:var(--brand)}
.in.err{border-color:var(--neg);background:#FFF8FB}
.errmsg{color:var(--neg);font-size:12px;margin-top:4px;display:flex;gap:4px;align-items:center}
.btnrow{display:flex;gap:8px}
.form-actions{display:flex;gap:8px;margin-top:16px}
.toolbar{display:flex;align-items:center;gap:8px;padding:12px 16px;flex-wrap:wrap}
.toolbar h3{font-size:16px;margin-right:auto}
.toolbar .cnt{color:var(--text2);font-weight:400}
.toolbar.tr{justify-content:flex-end}   /* rule 16a: a section toolbar without a title (card body top) keeps its actions at the right */
.scroll{overflow-x:auto}
table.data{width:100%;border-collapse:collapse;min-width:720px}
table.data th{position:sticky;top:0;background:#F8F9FA;text-align:left;font-size:12px;color:var(--text2);font-weight:600;padding:10px 10px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);white-space:nowrap}
table.data td{padding:12px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
table.data tbody tr{transition:background .12s}
table.data tbody tr:hover{background:#F2F8FF}
table.data tr.click{cursor:pointer}
table.data .num,table.data th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
table.data tfoot td{font-weight:700;background:#F8F9FA;border-bottom:0}
table.data input[type=checkbox]{width:16px;height:16px;accent-color:var(--brand)}
table.data td .in{margin:0;min-width:80px}
/* QA-087: no hidden columns - wide lists scroll sideways inside the card (.scroll); first columns stay sticky. .c-lo is kept as a harmless marker class */
table.data.nw td,table.data.nw th{white-space:nowrap}
table.data.stk1 th:nth-child(1),table.data.stk1 td:nth-child(1),table.data.stk3 th:nth-child(-n+3),table.data.stk3 td:nth-child(-n+3){position:sticky;background:#fff;z-index:2}
table.data.stk1 th:nth-child(1),table.data.stk3 th:nth-child(-n+3){background:#F8F9FA;z-index:4}
table.data.stk1 td:nth-child(1),table.data.stk3 td:nth-child(1){left:0}
table.data.stk3 th:nth-child(1),table.data.stk3 td:nth-child(1){width:40px;min-width:40px;max-width:40px}
table.data.stk3 th:nth-child(2),table.data.stk3 td:nth-child(2){left:40px;width:130px;min-width:130px}
table.data.stk3 th:nth-child(3),table.data.stk3 td:nth-child(3){left:170px;width:56px;min-width:56px;box-shadow:2px 0 0 var(--line)}
table.data.stk1 th:nth-child(1),table.data.stk1 td:nth-child(1){left:0;box-shadow:2px 0 0 var(--line)}
table.data.stk3 tbody tr:hover td:nth-child(-n+3),table.data.stk1 tbody tr:hover td:nth-child(1){background:#F2F8FF}
table.data.stk3 tr.sel td:nth-child(-n+3){background:#EAF3FF}
.paging{display:flex;align-items:center;gap:8px;padding:12px 16px;color:var(--text2);flex-wrap:wrap}
.paging .sp{margin-left:auto}
.pg{min-width:32px;height:32px;border-radius:8px;border:0;background:none;font:500 14px var(--font);color:var(--text);cursor:pointer}
.pg:hover{background:var(--bg)}.pg.on{background:var(--brand);color:#fff}

/* object page */
.crumbs{font-size:13px;color:var(--text2);margin-bottom:8px}
.obj{display:flex;gap:24px;align-items:flex-start;flex-wrap:wrap}
.obj .main{flex:1;min-width:280px}
.obj h1{font-size:24px;line-height:1.25}
.obj .sub{color:var(--text2);margin:4px 0 12px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.facts{display:flex;gap:32px;flex-wrap:wrap}
.fact small{display:block;color:var(--text2);font-size:12px}.fact b{font-weight:600}
.kpibig{text-align:right}.kpibig small{display:block;color:var(--text2);font-size:12px}.kpibig .big{font-size:36px;font-weight:300;line-height:1.1}.kpibig .big span{font-size:16px;color:var(--text2)}
.anchor{position:sticky;top:calc(var(--sw) + 48px);z-index:40;background:var(--bg);margin:0 -16px 16px;padding:8px 16px 0}
.anchor .tabs{margin-bottom:0}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px 24px}
.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:16px 24px}
.span2{grid-column:span 2}.span3{grid-column:1/-1}
.kv small{display:block;color:var(--text2);font-size:12px;font-weight:600}
.kv div{padding:2px 0}
.timeline{list-style:none;margin:0;padding:0}
.timeline li{position:relative;padding:0 0 24px 40px}
.timeline li:last-child{padding-bottom:0}
.timeline li::before{content:"";position:absolute;left:13px;top:28px;bottom:0;width:2px;background:var(--line)}
.timeline li:last-child::before{display:none}
.timeline .dot{position:absolute;left:0;top:0;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;color:#fff;background:#89919A}
.timeline .dot svg{width:15px;height:15px}
.timeline .ok .dot{background:#256F3A}.timeline .now .dot{background:#C35500;box-shadow:0 0 0 4px var(--crit-bg)}
.timeline b{display:block}.timeline small{color:var(--text2)}
.hist{list-style:none;margin:0;padding:0}
.hist li{display:flex;gap:16px;padding:8px 0;border-bottom:1px solid var(--line)}.hist li:last-child{border:0}
.hist time{flex:none;width:140px;color:var(--text2);font-size:13px}
.comment{display:flex;gap:12px;margin-bottom:16px}
.comment .avatar{flex:none;cursor:default}
.comment .bubble{background:var(--bg);border-radius:12px;padding:8px 12px}
.comment small{color:var(--text2)}
.footer-bar{position:fixed;left:var(--sbw,0px);right:0;bottom:var(--bbh,0px);z-index:45;background:#fff;box-shadow:0 -2px 8px rgba(34,53,72,.15);padding:12px 16px;display:flex;gap:8px;justify-content:flex-end;align-items:center}
.footer-bar .note{margin-right:auto;color:var(--text2);font-size:13px}
.footer-bar .btn{height:36px}
.alertbar{background:var(--crit-bg);color:var(--crit);border-radius:8px;padding:8px 12px;margin-bottom:16px;display:flex;gap:8px;align-items:center;font-weight:500}

/* forms */
.form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px 24px}

/* dialog / toast */
.overlay{position:fixed;inset:0;background:rgba(29,45,62,.5);z-index:100;display:none;align-items:center;justify-content:center;padding:16px}
.overlay.open{display:flex}
.dialog{background:#fff;border-radius:16px;box-shadow:0 8px 32px rgba(34,53,72,.4);width:100%;max-width:440px;overflow:hidden;animation:pop .15s ease-out}
@keyframes pop{from{transform:scale(.96);opacity:0}to{transform:none;opacity:1}}
.dialog header{padding:16px 24px 0;font-size:18px;font-weight:600;display:flex;align-items:center;gap:8px}
.dialog .body{padding:12px 24px 16px}
.dialog footer{padding:12px 24px;background:#F8F9FA;display:flex;justify-content:flex-end;gap:8px}
.toasts{position:fixed;left:50%;bottom:calc(96px + var(--bbh,0px));transform:translateX(-50%);z-index:120;display:flex;flex-direction:column;gap:8px;align-items:center;width:max-content;max-width:calc(100vw - 32px)}
.toast{background:#1D2D3E;color:#fff;padding:10px 20px;border-radius:12px;box-shadow:var(--shadow-h);animation:pop .2s ease-out}

/* chart */
.chart{width:100%;height:auto;display:block}
.chart text{font:12px var(--font);fill:var(--text2)}
.chart .bar{fill:var(--brand);transition:fill .15s}.chart .bar:hover{fill:var(--brand-h)}
.chart .val{fill:var(--text);font-weight:600}
.bar-row{display:flex;align-items:center;gap:12px;margin:8px 0}
.bar-row .lbl{width:140px;flex:none;font-size:13px}
.bar-row .track{flex:1;background:var(--bg);border-radius:6px;height:24px;overflow:hidden}
.bar-row .track i{display:block;height:100%;border-radius:6px;transition:filter .15s}
.bar-row:hover .track i{filter:brightness(1.12)}
.bar-row .v{width:100px;text-align:right;font-weight:600;font-variant-numeric:tabular-nums;font-size:13px}

/* space pages */
.spt{font-size:24px;margin-bottom:16px;padding-left:12px;border-left:4px solid var(--c)}
.stiles{display:grid;grid-template-columns:repeat(auto-fill,176px);gap:16px}
.stile{position:relative;display:flex;flex-direction:column;height:176px;padding:16px;background:#fff;border-radius:16px;box-shadow:var(--shadow);border-top:4px solid var(--c);color:var(--text);transition:transform .2s,box-shadow .2s}
.stile:hover{transform:translateY(-3px);box-shadow:var(--shadow-h);text-decoration:none;color:var(--text)}
.stile.wide{grid-column:span 2}
.stile b{font-size:14px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.stile .sub{color:var(--text2);font-size:12px;margin-top:2px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.stile .st{font-size:12px;font-weight:600;margin-top:4px}.st.crit{color:#C35500}.st.pos{color:var(--pos)}.st.info{color:var(--info)}.st.neg{color:var(--neg)}
.stile .foot{margin-top:auto;display:flex;align-items:flex-end;justify-content:space-between;gap:8px;color:var(--c)}
.stile .foot svg.i{width:28px;height:28px}
.stile .sn{font-size:26px;font-weight:300;color:var(--text);line-height:1;white-space:nowrap}
.stile .mc{flex:1;min-width:0;height:44px;max-width:240px}
@media (max-width:700px){.stiles{grid-template-columns:repeat(2,1fr)}.stile{height:168px}.stile .sn{font-size:22px}}
@media (max-width:1280px){.kpis{grid-template-columns:repeat(3,1fr)}}
@media (max-width:1100px){
  .todos,.tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .filterbar{grid-template-columns:repeat(2,1fr)}
  .filterbar .btnrow{grid-column:1/-1}
  .grid3,.form-grid{grid-template-columns:repeat(2,1fr)}
  .kpibig{text-align:left}
}
@media (max-width:700px){
  .todos,.tiles,.grid3,.grid2,.form-grid,.filterbar{grid-template-columns:1fr}
  .span2{grid-column:auto}
  .kpis{grid-template-columns:repeat(2,1fr)}
  .search{display:none}.shell{gap:8px}.shell .sp{flex:1}
  .shell .mobsearch{display:grid}
  .tile{min-height:104px}
  .hist li{flex-direction:column;gap:0}.hist time{width:auto}
  .footer-bar .note{display:none}.footer-bar{justify-content:stretch;flex-wrap:wrap;padding:8px 12px}.footer-bar>.btn,.footer-bar>form{flex:1 1 auto;min-width:0}.footer-bar form{display:flex}.footer-bar form .btn{flex:1}.footer-bar .btn{flex:1 1 auto;justify-content:center;padding:0 10px;min-width:0;max-width:100%;white-space:nowrap}.footer-bar .btn.primary{flex:1 1 40%}
  main{padding-bottom:calc(150px + var(--bbh,0px))}
  .bar-row .lbl{width:96px}.bar-row .v{width:80px}
  .obj h1{font-size:20px}.facts{gap:16px 24px}
}
.mobsearch{display:none}
@media (min-width:701px){.shell .sp{display:none}}

/* ---- shell additions (app) */
.logo img{display:block;height:28px;width:auto;flex:none}
@media (max-width:700px){.logo img{height:24px}}
.search input::-webkit-search-cancel-button{display:none}
.menu form{margin:0}
.menu button.menu-item,.menu a.menu-item{text-decoration:none;display:flex;align-items:center;gap:8px;width:100%;padding:8px;border:0;border-radius:8px;background:none;color:var(--text);font:inherit;cursor:pointer;text-align:left}
.menu button.menu-item:hover,.menu a.menu-item:hover{background:var(--bg)}
.menu hr{border:0;border-top:1px solid var(--line);margin:8px 0}
.icon-btn{text-decoration:none;color:var(--text)}.icon-btn:hover{text-decoration:none;color:var(--text)}
.icon-btn .count[hidden]{display:none}
.skip{position:absolute;left:-999px;top:0}.skip:focus{left:8px;top:8px;z-index:200;background:#fff;padding:8px 12px;border-radius:8px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.top.msearch .shell{height:auto;flex-wrap:wrap;padding-bottom:8px}
@media (max-width:700px){.top.msearch .search{display:block;order:10;flex:1 1 100%;max-width:none;margin:0}}

/* ---- messages: green flash strip (existing ?msg= flow), red error strip */
.flash{background:var(--pos-bg);color:var(--pos);border-radius:8px;padding:8px 12px;margin:0 0 16px;font-weight:500}
.msgbar{display:flex;gap:8px;align-items:flex-start;border-radius:8px;padding:10px 12px;margin:0 0 16px;font-weight:500}
.msgbar.error{background:var(--neg-bg);color:var(--neg)}
.msgbar.warn{background:var(--crit-bg);color:var(--crit)}
.warnmsg{color:var(--crit);font-size:12px;margin-top:4px;display:flex;gap:4px;align-items:center}
.msgbar svg{margin-top:1px}
.msgbar .go{margin-left:auto;white-space:nowrap}
.error{color:var(--neg)}

/* ---- home: to-do card extras */
.todo .title{color:var(--text)}a.title:hover{text-decoration:none;color:var(--brand)}
.todo .cm{display:none;margin-top:6px}.todo .cm.open{display:block}
.todo .cm .in{height:28px;font-size:13px;margin:0}
.todo .tgl{background:none;border:0;padding:0;color:var(--brand);font:13px var(--font);cursor:pointer;text-align:left}
.todo .tgl:hover{text-decoration:underline}
.todo .done-msg{display:none;font-weight:600;font-size:13px}
.todo.done .actions,.todo.done .cm,.todo.done .tgl{display:none}
.todo.done .done-msg{display:block;margin-top:auto;padding-top:12px}
.todo.done .done-msg.ok{color:var(--pos)}.todo.done .done-msg.no{color:var(--neg)}
.todo.done{opacity:.55}
.js .todos:not(.all) .more-card{display:none}
.empty{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:24px;text-align:center;color:var(--text2)}
.sec-sub{color:var(--text2);font-weight:400;font-size:14px}
.tile .tn{font-size:13px;opacity:.95}
.kpi{position:relative}
.kpi .head .ico{display:flex;align-items:center;gap:6px}
.kpi .star{border:0;background:none;padding:0;width:20px;height:20px;color:var(--text2);cursor:pointer;opacity:0;display:grid;place-items:center}
.kpi:hover .star,.kpi .star:focus-visible{opacity:1}
#apps:not([data-tab=fav]) .kpi.fav .star{opacity:1}
.kpi.fav .star{color:#E9730C}.kpi.fav .star svg{fill:currentColor}
.kpi .star svg.i{width:16px;height:16px}
.kpis .none{grid-column:1/-1;color:var(--text2);padding:16px 0}
.tabpane.kpis{display:grid}
.kpi[hidden]{display:none}
.kpi .num span{white-space:nowrap}
.kpi .num{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:700px){.kpi .star{opacity:1}}

/* ---- dialogs (confirm / reason) */
.dialog form{margin:0}
.dialog .body p{margin:0 0 8px}
.btn.primary.neg-fill{background:var(--neg);border-color:var(--neg)}.btn.primary.neg-fill:hover{background:#8f0606}
.btn[disabled]{opacity:.5;cursor:default}
.htmx-request .btn{opacity:.6}

/* ---- space pages: title row + section headings */
.spt+.muted{margin:-8px 0 24px}
.stile .sub{min-height:0}
.stile .st.info{color:var(--info)}

/* ---- search + login pages */
.page-narrow{max-width:720px}
.results{list-style:none;margin:0;padding:0}
.results li{display:flex;gap:12px;align-items:center;padding:10px 16px;border-bottom:1px solid var(--line)}
.results li:last-child{border:0}
.results .kind{flex:none;width:96px;color:var(--text2);font-size:12px;font-weight:600}
.results .what{flex:1;min-width:0}
.login-card{max-width:380px;margin:12vh auto 48px;padding:32px 28px}
.login-card h1{font-size:22px;margin-bottom:16px}
.login-card .in{margin-bottom:12px}
.login-card .btn{width:100%;justify-content:center;height:36px}
.login-card .logo-big{display:flex;justify-content:center;margin:4px 0 24px}
.login-card .logo-big img{display:block;height:40px;width:auto}
.login-card h1{text-align:center}

/* ---- Phase 9.3 / 9.4: list reports, object pages, edit pages */
.pt{font-size:24px;margin:0 0 16px}
.pt .cnt{font-size:16px}
.card.flush .toolbar+.scroll{border-top:1px solid var(--line)}
.scroll.sticky{max-height:calc(100vh - 290px);min-height:120px;overflow:auto}
.scroll.sticky.short{max-height:420px}
.fill-list main{padding-bottom:24px}   /* QA-292: the list table fills the window, no empty band under the card (pages with a footer bar keep their padding) */
table.data th a{color:inherit}
table.data th a:hover{color:var(--brand);text-decoration:none}
table.data td.empty-row,table.data td.muted{color:var(--text2)}
table.data tr.grp td{background:#F2F4F6;font-weight:600;padding:8px 16px}
table.data tfoot tr.grp td{background:#F8F9FA}
table.data td.chev{width:32px;color:var(--text2);text-align:right;padding-left:0}
table.data td.chev a{color:var(--text2);display:inline-grid}
table.data td.sel,table.data th.sel{width:40px;padding-right:0}
table.data td .in.q{text-align:right;width:92px}
table.data td .in.p{text-align:right;width:104px}
table.data td .sub{display:block;color:var(--text2);font-size:12px}
table.data td.act{white-space:nowrap}
table.data td.act .btn+.btn{margin-left:4px}
table.data td.act .btn,table.data td.act form,table.data td.act .iconbtn{vertical-align:middle}table.data td.act form{display:inline-block;margin:0}   /* QA-052: icon buttons, links and form buttons share one centre line */
.paging a.pg{display:inline-grid;place-items:center;padding:0 6px;text-decoration:none}
.paging .gap{padding:0 4px}
.filterbar.many{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
@media (max-width:700px){.filterbar.many{grid-template-columns:1fr}}   /* QA-085: phone, the filters stack in one column */
.filterbar .btnrow{align-self:end}
label.f input[type=checkbox]{width:auto;height:auto;margin:0 8px 0 0;vertical-align:middle}
label.f.chk{display:flex;align-items:center;height:32px;font-size:14px;color:var(--text);font-weight:500}
label.f.chk input{margin:0 8px 0 0}
.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid .span2{grid-column:span 2}
.form-grid .span3{grid-column:1/-1}
.form-grid.lf{grid-template-columns:repeat(4,minmax(0,1fr))}
.in:disabled,.in[readonly]{background:#F5F6F7;color:var(--text2);cursor:default}
.in[readonly]:hover{border-color:#89919A}
.totals{display:grid;grid-template-columns:1fr auto;gap:8px 32px;max-width:360px;margin-left:auto;font-weight:400}
.totals .tot-sub{font-size:12px;padding-left:16px;margin-top:-4px}.totals .muted.tot-sub{color:var(--text2)}.totals .tot-sub[data-t]{font-weight:400}.totals .tot-d{color:var(--disc)}.totals .tot-s{color:var(--sur)}
.totals .gt{font-size:20px;font-weight:600;border-top:1px solid var(--line);padding-top:8px}
.totals span:nth-child(even){text-align:right;font-variant-numeric:tabular-nums}
.card.totals-card{padding:16px}
.footer-bar form{margin:0;display:inline-flex}
.footer-bar .btn.primary{order:99}
.footer-bar .btn.neg-fill{background:var(--neg);border-color:var(--neg);color:#fff}
.obj .main .facts{margin-top:4px}
.kv .muted{font-weight:400}
.kv.span3,.kv.span2{min-width:0}
.sec-head{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.sec-head h3{margin:0}
.msgbar{scroll-margin-top:110px}
.hist .who{color:var(--text2)}
.hist li>span{flex:1;min-width:0}
.comment .bubble{flex:1;min-width:0}
.commentform{display:flex;gap:8px;align-items:flex-start}
.commentform textarea.in{flex:1;margin:0;min-height:32px}
.timeline .ver{color:var(--text2);font-weight:600;font-size:12px;margin:0 0 12px;display:block}
.timeline.sep{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.timeline .dot.no{background:#AA0808}
.timeline li.no .dot{background:#AA0808}
.timeline li.skip .dot{background:#89919A}
.related td a{font-weight:600}
.empty-note{color:var(--text2);margin:0}
.rowhint{color:var(--text2);font-size:12px}
.term-hint{display:block;font-weight:400;line-height:1.35;margin-top:2px}
.term-hint:empty{display:none}
details.card>summary{cursor:pointer;font-weight:600;font-size:16px}
details.card[open]>summary{margin-bottom:12px}
.chart-card h3{display:flex;justify-content:space-between;align-items:baseline}
.bar-row .track svg{display:block;width:100%;height:24px;border-radius:6px}
.flash-seed{display:none}
.linkbtn{background:none;border:0;padding:0;color:var(--brand);font:inherit;cursor:pointer}
.linkbtn:hover{text-decoration:underline}
.line-edit-row td{background:#F8FBFF}
.line-edit-row .btnrow{margin-top:12px}
.rcv td .in{min-width:70px}
.print-actions{display:flex;gap:8px}
@media (max-width:1100px){.form-grid.lf{grid-template-columns:repeat(2,minmax(0,1fr))}.scroll.sticky{max-height:none}}
@media (max-width:700px){
  .form-grid.two,.form-grid.lf{grid-template-columns:1fr}
  .form-grid .span2,.form-grid .span3{grid-column:auto}
  .totals{max-width:none}
  .commentform{flex-direction:column}.commentform .btn{align-self:flex-end}
  .toolbar .btn{flex:none}
  .pt{font-size:20px}
}
html:not(.js) .js-only{display:none}
.toast.error{background:var(--neg);color:#fff}   /* QA-455b: the generic .error{color:var(--neg)} (later in this file) made the text red on red = an empty-looking toast */
input,select,textarea{max-width:100%}
main h1{font-size:22px;line-height:1.3;margin:0 0 12px}
main p{margin:0 0 10px}
main button.btn,main a.btn{font-family:var(--font)}
.errmsg[hidden]{display:none}
h4.subh{margin:0;padding:12px 16px 8px;font-size:14px;color:var(--text2);font-weight:600}

/* quantity cell with its input: keep input and unit on one line, the hint below */
table.data td.num:has(input.q){white-space:nowrap}
table.data td.num:has(input.q) .sub{white-space:normal}
table.data td input.q{display:inline-block;width:84px}
table.data td input.p{display:inline-block;width:104px}

/* Phase 10: two status pills in the object header, dialog reference line, quantity input in the buyer worklist */
.stpair{display:inline-flex;align-items:center;gap:6px}
.stpair small{color:var(--text2);font-size:12px}
.dialog .dlg-ref{margin:0 0 8px;color:var(--text2)}
table.data td.num input.in.q{width:96px;text-align:right}
/* Phase 12: parallel approval group inside the approval flow */
.timeline li.par{padding-left:40px}.timeline li.par>ol.timeline{border-left:2px dashed var(--line);padding-left:12px;margin-top:6px}

/* Phase 12.2: Customize Workflows */
.msgbar.info{background:var(--info-bg);color:var(--info)}
table.data tr.sel td{background:#EAF3FF}
#wf-steps .form-grid.lf,#wf-conds .form-grid.lf{align-items:end}
#wf-conds select[multiple]{height:auto}
.cond-form .form-grid .span2{grid-column:span 2}
@media (max-width:640px){#wf-steps .form-grid.lf,#wf-conds .form-grid.lf{grid-template-columns:1fr}.cond-form .form-grid .span2{grid-column:auto}}

/* Phase 13: change purchase order */
.toast.warn{background:var(--crit-bg);color:var(--crit);border:1px solid var(--crit)}
.warnstrip{background:var(--crit-bg);color:var(--crit);border-radius:8px;padding:8px 12px;margin-bottom:16px;display:flex;gap:8px;align-items:center;font-weight:500}
label.f.lk{color:var(--text2)}label.f.lk .in{background:var(--bg);color:var(--text2);cursor:not-allowed}
.lock{display:inline-flex;vertical-align:middle;margin-left:4px;color:var(--text2)}
.pochg .lh{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;justify-content:space-between;margin-bottom:12px}
.pochg .lh h3{margin:0}.pochg .lh .acts{display:flex;gap:8px;flex-wrap:wrap}
.pochg.gone{opacity:.6}.pochg.gone h3{text-decoration:line-through}
.hist .chg{display:block;margin:2px 0 0;color:var(--text2)}.hist .chg b{color:var(--text);font-weight:600}
@media (max-width:700px){.pochg .lh .acts{width:100%}.pochg .lh .acts .btn{flex:1;justify-content:center}}

/* ---- Phase 14: left sidebar (desktop), icon sidebar (tablet), bottom bar + slide-in menu (phone) */
.has-nav{--sbw:220px;--bbh:0px}
html.sb-collapsed .has-nav{--sbw:64px}
.sb-toggle{margin-left:-8px}
.sidebar{position:fixed;left:0;top:calc(var(--sw) + 48px);bottom:0;width:220px;z-index:40;background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto;padding:12px 8px}
.sb-head,.sb-close{display:none}
.sb-list{display:flex;flex-direction:column;gap:2px}
.sb-item{position:relative;display:flex;align-items:center;gap:10px;min-height:40px;padding:4px 12px;border-radius:8px;color:var(--text);font-weight:500;white-space:nowrap;cursor:pointer;list-style:none}
.sb-item::-webkit-details-marker{display:none}
.sb-item svg.i{color:var(--c);width:20px;height:20px}
.sb-item:hover{background:var(--bg);text-decoration:none;color:var(--text)}
.sb-item.active{background:#E7F0FC;color:#015ADE;font-weight:600}
.sb-item.active:hover{background:#DCE9FA;color:#015ADE}
.sb-item .lbl{min-width:0;overflow:hidden;white-space:normal;overflow-wrap:anywhere;line-height:1.2;font-size:13.5px}      /* QA-243 / QA-276: the badge stays visible and the label is never cut with '...': a long label (Approvals and Tasks + 3-digit badge) wraps to a second line */
.sb-badge{margin-left:auto;min-width:22px;height:20px;padding:0 7px;border-radius:10px;background:var(--neu-bg);color:var(--text2);font-size:12px;font-weight:600;line-height:20px;text-align:center}
.sb-badge.danger{background:var(--neg-bg);color:var(--neg)}
.sb-div{width:calc(100% - 16px);border:0;border-top:1px solid var(--line);margin:8px auto}
.sb-backdrop{display:none}
.bottombar{display:none}
html.sb-open .sb-backdrop{display:block;position:fixed;inset:0;z-index:65;background:rgba(29,45,62,.45)}

/* icon-only sidebar: desktop collapsed, tablet default */
@media (min-width:1100px){
  html.sb-collapsed .sidebar{width:64px}
  html.sb-collapsed .sb-item .lbl{display:none}
  html.sb-collapsed .sb-item{justify-content:center;padding:0}
  html.sb-collapsed .sb-badge{position:absolute;top:2px;right:4px;min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px;margin:0}
}
@media (min-width:700px) and (max-width:1099px){
  .has-nav,html.sb-collapsed .has-nav{--sbw:64px}
  html:not(.sb-open) .sidebar{width:64px}
  html:not(.sb-open) .sb-item .lbl{display:none}
  html:not(.sb-open) .sb-item{justify-content:center;padding:0}
  html:not(.sb-open) .sb-badge{position:absolute;top:2px;right:4px;min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px;margin:0}
  html.sb-open .sidebar{z-index:70;box-shadow:var(--shadow-h)}
}

/* phone: bottom bar, sidebar slides in from the left */
@media (max-width:699px){
  .has-nav,html.sb-collapsed .has-nav{--sbw:0px;--bbh:calc(56px + env(safe-area-inset-bottom,0px))}
  .sb-toggle{display:none}
  .sidebar{top:0;width:min(300px,86vw);z-index:70;transform:translateX(-102%);visibility:hidden;transition:transform .2s ease-out,visibility 0s .2s;box-shadow:var(--shadow-h);padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  html.sb-open .sidebar,.sidebar:target{transform:none;visibility:visible;transition:transform .2s ease-out}
  .sidebar:target~.sb-backdrop{display:block;position:fixed;inset:0;z-index:65;background:rgba(29,45,62,.45)}
  .sb-head{display:flex;align-items:center;justify-content:space-between;padding:0 4px 8px 12px;font:700 16px var(--font-brand)}
  .sb-close{display:grid}
  .sb-item{height:44px}
  .bottombar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:48;height:var(--bbh);padding-bottom:env(safe-area-inset-bottom,0px);background:var(--surface);box-shadow:0 -2px 8px rgba(34,53,72,.15)}
  .bb-item{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--text2);font-size:11px;font-weight:500}
  .bb-item:hover{text-decoration:none;color:var(--text2)}
  .bb-item span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bb-item.active{color:#015ADE}
  .bb-item.active::before{content:"";position:absolute;top:0;left:25%;right:25%;height:3px;border-radius:0 0 3px 3px;background:#015ADE}
  .bb-item .sb-badge{position:absolute;top:4px;left:calc(50% + 6px);margin:0;min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px}
  .bb-item span.sb-badge{overflow:visible}
}
.sb-badge[hidden]{display:none}

/* Phase 15.0 master data apps */
.wu{padding:8px 0;border-bottom:1px solid var(--line)}.wu:last-child{border:0}
.wu-h{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap}.wu-l{margin:4px 0 0;padding-left:18px;color:var(--text2);font-size:13px}
label.f.chk{display:flex;align-items:center;gap:8px;font-weight:600}label.f.chk input{width:auto}
.rowacts{white-space:nowrap;text-align:right}.rowacts .btn{margin-left:4px}

/* attachments (Phase 17) */
.att .att-body{padding:0}.att-dlg .att-body{padding:12px 24px 16px}.att-dlg .att-h{padding:16px 24px 0;font-size:18px;font-weight:600;display:flex;align-items:center;gap:8px}
.att-dlg footer{padding:12px 24px;background:#F8F9FA;display:flex;justify-content:flex-end;gap:8px}
.dialog.att-wide{max-width:860px;max-height:calc(100vh - 32px);overflow:auto}
.att-table .att-name a{display:inline-flex;align-items:center;gap:6px;font-weight:600;word-break:break-all}
.att-table td.act{white-space:nowrap}.att-table td.act .btn{margin-left:6px}
.att-from{margin-top:16px}.att-from h4{margin:0 0 6px;font-size:13px;color:var(--text2)}
.att-confirm{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0;padding:10px 12px;border:1px solid var(--neg);border-radius:8px;background:var(--neg-bg)}
.att-confirm[hidden]{display:none}.att-confirm-btns{display:flex;gap:8px}
.att-drop{margin-top:12px;border:2px dashed var(--line);border-radius:12px;padding:14px 16px;transition:background .12s,border-color .12s}
.att-drop.over{background:#F2F8FF;border-color:var(--info)}
.att-drop-t{display:flex;align-items:center;gap:8px;color:var(--text2);margin-bottom:10px}
.att-opts{display:flex;gap:16px;align-items:flex-end;flex-wrap:wrap;margin-bottom:10px}.att-opts .f{flex:1 1 220px;min-width:0}
.att-chk{display:flex;align-items:center;gap:6px;height:36px}
.att-pick{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.att-add{position:relative;cursor:pointer;overflow:hidden}
.att-add input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%;font-size:0}
.att-prog{list-style:none;margin:8px 0 0;padding:0}.att-prog li{display:flex;align-items:center;gap:10px;padding:4px 0;font-size:13px;word-break:break-all}
.att-prog li.err{color:var(--neg)}.att-prog li.ok{color:var(--pos)}.att-prog progress{flex:1;max-width:180px;height:8px}
.att-btn{display:inline-flex;align-items:center;gap:4px}.att-btn .badge{min-width:18px;height:18px;border-radius:9px;background:var(--info);color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center;padding:0 5px}
.att-btn .badge.zero{background:var(--neu-bg);color:var(--neu)}
.att-host:empty::before{content:"";display:block;height:48px}

/* ---- plan 27: in-app Back button in the shell bar (left of the logo; all pages except Home and login) */
.nav-back{flex:none;margin-right:-8px}
.nav-back .i{width:20px;height:20px}
.nav-back:focus-visible{outline:2px solid var(--brand);outline-offset:2px;background:var(--bg)}
@media (max-width:699px){.nav-back{margin-left:-8px;margin-right:-4px}}
.planbox{border:1px solid var(--line,#d0d7de);border-radius:8px;padding:8px 12px}.planbox.over{border-color:var(--crit,#b00020)}.planbox .neg,td.neg{color:var(--crit,#b00020)}

/* Phase 20.8 / 20.10 (Addendum 20.E): plan items = one grid row per item, every field a column. The grid has its own scroll area (about the screen height, both ways)
   on every width, the page never scrolls sideways; the header row stays at the top and Line + Item stay on the left. */
small.sub2{display:block;color:var(--text2);font-size:12px}
.gridwrap{overflow:auto;max-width:100%;max-height:calc(100vh - 200px);min-height:260px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
table.plangrid{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0}
table.plangrid th,table.plangrid td{white-space:nowrap;padding:8px 10px;vertical-align:middle;background:var(--card,#fff);border-bottom:1px solid var(--line)}
table.plangrid .stk{position:sticky;z-index:2}
table.plangrid thead th{position:sticky;top:0;z-index:3}
table.plangrid thead th.stk{z-index:5}
table.plangrid .c-ln{left:0;min-width:64px;width:64px;max-width:64px}
table.plangrid .c-nm{left:64px;min-width:220px;border-right:1px solid var(--line);box-shadow:2px 0 4px -2px rgba(0,0,0,.12)}
table.plangrid td.c-nm{white-space:normal;overflow-wrap:anywhere}
table.plangrid .c-cur{min-width:100px}table.plangrid .c-rt{min-width:110px}table.plangrid .c-am{min-width:140px}table.plangrid .c-ro{min-width:120px}
table.plangrid .c-st{min-width:130px}table.plangrid .c-pr{min-width:170px}table.plangrid .c-cc{min-width:150px}table.plangrid .c-bi{min-width:180px}
table.plangrid .c-rp{min-width:170px}table.plangrid .c-qt{min-width:110px}table.plangrid .c-nt{min-width:260px}table.plangrid .c-rs{min-width:240px}
table.plangrid tr.click:hover td{background:var(--hover,#F4F7FB)}
table.planedit td .in{margin:0;width:100%;min-width:0;height:40px}
table.planedit .num .in,table.planedit input.amt,table.planedit input.rate{text-align:right}
table.planedit .in[readonly]{background:#F2F4F6;color:var(--text2)}
table.planedit .ro{display:block}
table.planedit tbody.it.bad td{background:#FFF6F6}
.plan-add{margin:12px 16px}
.plan-tr .form-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:900px){.plan-tr .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:560px){.plan-tr .form-grid{grid-template-columns:1fr}}

/* Addendum 20.G: plan grid on phones. Below 700 px Line is about 40 px and Item about 120 px (cut with an ellipsis, full name in the tooltip), so a field is always fully visible next to them;
   the other columns keep usable minimum widths; focus scrolls a field to the right of the sticky columns (scroll-padding + the focus handler in proctool.js); the grid never traps a swipe. */
@media (max-width:700px){
  .gridwrap{scroll-padding-left:168px;scroll-behavior:auto;overscroll-behavior:auto;touch-action:pan-x pan-y}
  table.plangrid th,table.plangrid td{padding:8px 6px}
  table.plangrid .c-ln{left:0;min-width:40px;width:40px;max-width:40px;text-align:center;padding-left:2px;padding-right:2px}
  table.plangrid .c-nm{left:40px;min-width:120px;width:120px;max-width:120px}
  table.plangrid td.c-nm,table.plangrid th.c-nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  table.plangrid td.c-nm .in{text-overflow:ellipsis}
  table.plangrid th,table.plangrid td{padding:8px 4px}
  table.plangrid .c-am,table.plangrid .c-rt{min-width:120px;width:120px;max-width:120px}table.plangrid .c-ro{min-width:110px;width:110px;max-width:110px}
  table.plangrid .c-cur{min-width:100px;width:100px;max-width:100px}
  table.plangrid .c-st,table.plangrid .c-pr,table.plangrid .c-cc,table.plangrid .c-bi,table.plangrid .c-rp,table.plangrid .c-qt{min-width:150px;width:150px;max-width:150px}
  table.plangrid .c-nt,table.plangrid .c-rs{min-width:190px;width:190px;max-width:190px}
  table.plangrid td .in{width:100%;min-width:0;max-width:100%}
}
/* Phase 20.11 (Addendum 20.F): navigation arrow at the right end of every plan row; plan item object page */
table.plangrid .c-go{min-width:56px;width:56px;text-align:center}
table.plangrid .stk-r{position:sticky;right:0;z-index:2;border-left:1px solid var(--line);box-shadow:-2px 0 4px -2px rgba(0,0,0,.12)}
table.plangrid thead th.stk-r{z-index:5}
a.navarrow{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;font-size:28px;line-height:1;color:var(--brand);text-decoration:none}
a.navarrow:hover,a.navarrow:focus-visible{background:var(--hover,#E8F1FB)}
.usebar{height:10px;border-radius:6px;background:var(--bg,#EEF1F4);overflow:hidden;margin:12px 0 4px}
.usebar i{display:block;height:100%;background:var(--brand);border-radius:6px}.usebar.over i{background:var(--crit,#b00020)}
.usebar-note{margin:4px 0 0}
.grid3.padded{padding:0 16px 12px}
#plan-docs td{vertical-align:top}
@media (max-width:700px){table.plangrid .stk-r{position:relative;box-shadow:none}table.plangrid .c-go{min-width:48px;width:48px}}   /* phones: the arrow scrolls with the row (no room for a second sticky column) */

/* Plan 29: buyer worklist switch Requisitions | Contracts (top left, next to the title) */
.viewbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:12px}.viewbar h1{margin:0}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--card,#fff)}
.seg a{display:inline-flex;align-items:center;min-height:40px;padding:0 16px;color:var(--text);text-decoration:none;font-weight:600;border-right:1px solid var(--line)}
.seg a:last-child{border-right:0}.seg a.on{background:var(--brand);color:#fff}

/* ---- Addendum 20.H: value-help field (type-ahead + pop-up) ---- */
.vh{position:relative}
.vh-row{position:relative;margin-top:4px}
.vh-row .in{margin:0;padding-right:34px;text-overflow:ellipsis}
table.data td .vh-row,td .vh-row{margin-top:0}
/* QA-047: the search icon is part of the field - no box, no border, inside the right edge, same height (Guidebook rule 9) */
.vh-btn{position:absolute;top:1px;right:1px;bottom:1px;width:32px;padding:0;margin:0;border:0;border-radius:0 7px 7px 0;background:transparent;color:var(--text2);cursor:pointer;display:flex;align-items:center;justify-content:center}
.vh-btn:hover,.vh-btn:focus-visible{color:var(--brand)}
.vh-btn svg.i{pointer-events:none}
.vh-list{position:fixed;z-index:1000;margin:0;padding:4px 0;list-style:none;background:#fff;border:1px solid var(--line,#d5dbe1);border-radius:8px;box-shadow:0 6px 20px rgba(34,53,72,.25);max-height:320px;overflow:auto}
.linegrid td.stk.vh-lift,table.plangrid td.stk.vh-lift,td.stk.vh-lift,td.stk-r.vh-lift{z-index:60}
.vh-list li{padding:10px 12px;cursor:pointer;line-height:1.3}
.vh-list li.on,.vh-list li:hover{background:#E8F0F8}
.vh-list li.none{color:var(--text2);cursor:default}
.vh-dialog{animation:none;max-width:900px;width:100%;max-height:calc(100vh - 32px);display:flex;flex-direction:column}
.vh-dialog .body{overflow:auto;flex:1}
.vh-dialog header{padding-bottom:8px}
.vh-filters{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;align-items:end;margin-bottom:10px}
.vh-filters label{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--text2)}
.vh-fbtn{grid-column:1 / -1;display:flex;gap:8px}
.vh-tw{overflow:auto;border:1px solid var(--line,#d5dbe1);border-radius:8px}
.vh-tbl{width:100%;border-collapse:collapse}
.vh-tbl th,.vh-tbl td{padding:8px 10px;text-align:left;border-bottom:1px solid #eef1f4;white-space:nowrap}
.vh-tbl td:nth-child(3){white-space:normal}
.vh-sort{all:unset;cursor:pointer;font-weight:600;font-size:12px;display:inline-flex;gap:2px;align-items:center}
.vh-sort:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.vh-tbl tbody tr{cursor:pointer}
.vh-tbl tbody tr.sel,.vh-tbl tbody tr:hover{background:#E8F0F8}
.vh-none{color:var(--text2);text-align:center}
.vh-dialog footer{flex-wrap:wrap;align-items:center}
.vh-dialog footer .vh-total{margin-right:auto;color:var(--text2)}
.vh-pg{display:inline-flex;align-items:center;gap:6px}
@media (max-width:1024px){
  .vh-overlay{padding:0;align-items:stretch}
  .vh-dialog{max-width:none;width:100vw;height:100vh;height:100dvh;max-height:none;border-radius:0}
  .vh-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
  .vh-dialog footer .vh-total{flex-basis:100%}
}
@media (max-width:600px){.vh-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
[data-for][hidden]{display:none!important}
[data-rfp][hidden],[data-priced][hidden]{display:none!important}

/* plan 35.2: inline quantity errors on the buyer worklist */
table.data tr.line-err td,table.data tr.line-warn td{padding-top:0;border-top:0;background:transparent}
table.data input.q:disabled{background:#F2F4F6;color:#8A94A0;cursor:not-allowed}
.fully-ordered{display:block;margin-top:2px;text-align:right}
/* plan 34: lines edited in place - struck-through removed lines with Undo, trash-can icon button, contract column, supplier links */
tr.rm td{text-decoration:line-through;color:var(--text2)}
tr.rm td.act,tr.rm td .att-btn{text-decoration:none}
tr.rm td.act button{text-decoration:none}
.iconbtn{padding:0 8px;min-width:36px;min-height:36px;display:inline-flex;align-items:center;justify-content:center}
.btn.undo{min-height:36px}
.btn.rm-locked,.btn.rm-locked:hover{color:var(--text2);background:transparent;opacity:.45;cursor:not-allowed;pointer-events:none;border-color:var(--line)}   /* QA-166: not-allowed trash icon (U.rm_locked) */
.rm-locked-wrap{display:inline-block;cursor:not-allowed}
.btn[hidden]{display:none}
.ctcell{width:210px;min-width:210px;max-width:210px}      /* QA-276: 210 = the width of the contract search help (no overlap with the next column) */
.ctcell .ctlink{display:inline-block;white-space:nowrap;margin-bottom:4px}
.ctcell select.ct{width:100%;min-width:0;max-width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
a.suplink{font-weight:600;white-space:nowrap}
/* QA-078: in lists a supplier name is cut with an ellipsis (full name as tooltip), so rows stay one line and no column is pushed out of the card at 1300 px */
table.data td:has(>.supname),.nw{white-space:nowrap}
table.data .supname,table.data .cut{display:inline-block;max-width:320px;min-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
table.data .supname{min-width:200px}table.data .cut.prod{min-width:220px}
.vh-filters[data-cols="5"]{grid-template-columns:repeat(5,minmax(0,1fr))}
.vh-filters[data-cols="6"]{grid-template-columns:repeat(6,minmax(0,1fr))}
@media (max-width:1099px){.vh-filters[data-cols="5"],.vh-filters[data-cols="6"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:600px){.vh-filters[data-cols="5"],.vh-filters[data-cols="6"]{grid-template-columns:repeat(2,minmax(0,1fr))}}
.vh-tbl[data-kind="suppliers"] td:nth-child(2),.vh-tbl[data-kind="products"] td:nth-child(2){white-space:normal}
.vh-tbl[data-kind="suppliers"] td:nth-child(3){white-space:normal}
.vh-tbl td:nth-child(3){white-space:nowrap}
.vh-tbl[data-kind="plan-items"] td:nth-child(3){white-space:normal}
td .vh{min-width:200px}

tr.rm input{text-decoration:line-through}
/* QA-017: plan totals - AZN total first and bigger, wider block so lines do not wrap */
#plan-totals .totals{max-width:none;display:flex;flex-direction:column;align-items:flex-end;gap:10px}
#plan-totals .totals .kv>div{white-space:nowrap}
#plan-totals .kv-main{padding-bottom:10px;border-bottom:1px solid var(--line)}
#plan-totals .kv-main small{font-size:13px;font-weight:600}
#plan-totals .kv-main>div{font-size:18px}
@media (max-width:700px){#plan-totals .totals{align-items:stretch}#plan-totals .totals .kv>div{white-space:normal}}

/* date fields (plan 36): text box in the user's format + calendar button (datepicker.js, flatpickr) */
.dp{display:flex;align-items:center;gap:4px;margin-top:4px}.dp .in{margin-top:0;flex:1;min-width:0}
.dp-btn{flex:none;width:32px;height:32px;border:1px solid #89919A;border-radius:8px;background:#fff;cursor:pointer;line-height:1;padding:0;display:grid;place-items:center;color:var(--text2)}
.dp-btn:hover{border-color:var(--brand)}.dp-btn:disabled{background:#F5F6F7;cursor:default}
table.data td .dp{margin:0}
.flatpickr-calendar{font-family:var(--font)}
@media (max-width:600px){.flatpickr-calendar.open{width:auto!important;left:16px!important;right:16px!important;max-width:none}.flatpickr-calendar .flatpickr-innerContainer,.flatpickr-calendar .flatpickr-rContainer,.flatpickr-calendar .flatpickr-days,.flatpickr-calendar .dayContainer{width:100%!important;min-width:0!important;max-width:none!important}.flatpickr-day{max-width:none}}
/* QA-027: small named helpers replacing repeated inline styles */
.mt12{margin-top:12px}.mt16{margin-top:16px}.mb12{margin-bottom:12px}
.pad16{padding:16px}.pad-b{padding:0 16px 16px}
.msgbar.inset{margin:0 16px 16px}
.inl{display:inline}.contents{display:contents}
.form-grid.ai-end{align-items:end}
table.data.mw0{min-width:0}
.muted.fw4{font-weight:400}
h3.subhead{margin:16px 0 12px;font-size:14px}
fieldset.cl.card.flat{border:0;margin-left:0;margin-right:0}

/* QA-054 / rule 7a: grouped messages (warnings / errors by type with a count, one short item per line, more than 5 behind Show all (n)); success is a green toast */
.toast.ok{background:var(--pos);color:#fff}
.msgpanel{border-radius:8px;padding:10px 12px;margin:0 0 12px;font-weight:500}
.msgpanel.warn{background:var(--crit-bg);color:var(--crit)}
.msgpanel.error{background:var(--neg-bg);color:var(--neg)}
.msgpanel h4{display:flex;gap:6px;align-items:center;margin:0 0 4px;font-size:14px;font-weight:700}
.msgpanel h4 svg{flex:none}
.msgpanel .cnt{font-weight:600}
.msgpanel ul{margin:0;padding-left:26px}
.msgpanel li{margin:2px 0;font-weight:500}
.msgpanel a.msgline{color:inherit;text-decoration:underline;text-underline-offset:2px}
.msgpanel .msgcode{font-weight:600;white-space:nowrap}
.msgpanel .msgplace{font-weight:700;white-space:nowrap}
.msgpanel .msgmore{margin:2px 0 0 26px}
.msgpanel .msgmore summary{cursor:pointer;font-weight:600}
.msgpanel .msgmore ul{padding-left:0;margin-top:2px}
.msgpanel .msgmore[open] ul{max-height:40vh;overflow-y:auto;overscroll-behavior:contain}      /* QA-491: the expanded list scrolls inside the box, the form is not pushed down */
.msgpanel{scroll-margin-top:110px}
tr.line-hl>td,.line-hl{background:var(--crit-bg)!important;transition:background .3s}
/* QA-041: requisition lines = one grid (row per line); >= 1024 px horizontal scroll inside the card with line no. + product sticky; < 1024 px stacked blocks headed "Line 10" */
.lgwrap{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
table.linegrid{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0}
table.linegrid th,table.linegrid td{white-space:nowrap;padding:6px 8px;vertical-align:middle;background:var(--card,#fff);border-bottom:1px solid var(--line);text-align:left}
table.linegrid th{font-size:12px;color:var(--text2);font-weight:600;background:#F8F9FA;border-top:1px solid var(--line)}
table.linegrid th.num,table.linegrid td.num{text-align:right}
table.linegrid .stk{position:sticky;z-index:2}
table.linegrid thead th.stk{z-index:5}
table.linegrid .c-ln{left:0;min-width:84px;width:84px}
table.linegrid .c-pd{left:84px;min-width:240px;width:240px;border-right:1px solid var(--line);box-shadow:2px 0 4px -2px rgba(0,0,0,.12)}
table.linegrid td .in{margin:0;width:100%;min-width:0;height:40px}
table.linegrid td .vh{min-width:0}
table.linegrid .c-ty{min-width:150px}table.linegrid .c-ds{min-width:240px}table.linegrid .c-qt{min-width:100px}table.linegrid .c-um{min-width:90px}
table.linegrid .c-pr{min-width:110px}table.linegrid .c-tx{min-width:130px}table.linegrid .c-nb{min-width:150px}table.linegrid .c-sd,table.linegrid .c-ed{min-width:150px}
table.linegrid .c-cc,table.linegrid .c-io,table.linegrid .c-wb,table.linegrid .c-gl,table.linegrid .c-dt,table.linegrid .c-eq{min-width:180px}table.linegrid .c-pl{min-width:110px}table.linegrid .c-sl{min-width:150px}
table.linegrid .c-tm{min-width:150px}table.linegrid .c-by{min-width:200px}table.linegrid .c-net{min-width:100px}table.linegrid .c-act{min-width:104px}
table.linegrid td.c-ln .ln{font-weight:700;margin-right:4px}
table.linegrid td.c-act{white-space:nowrap}table.linegrid td.c-act .btn{margin-right:4px}
table.linegrid tr.rm td{background:#F5F6F7}
table.linegrid tr.errrow td{background:#FFF6F6;position:static}
@media (max-width:1023px){
  .lgwrap{overflow:visible}
  table.linegrid,table.linegrid tbody,table.linegrid tr,table.linegrid td{display:block;width:auto}
  table.linegrid{min-width:0}
  table.linegrid thead{display:none}
  table.linegrid tr.lrow{border:1px solid var(--line);border-radius:8px;margin:12px 16px;padding:0 12px 12px;background:var(--card,#fff);overflow:hidden}
  table.linegrid td{border:0;padding:6px 0;white-space:normal;background:transparent}
  table.linegrid td::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  table.linegrid td.c-ln{display:flex;align-items:center;gap:6px;margin:0 -12px 8px;padding:10px 12px;background:#F0F4F8;border-bottom:1px solid var(--line);font-size:16px;position:static}
  table.linegrid td.c-ln::before{display:inline;margin:0;font-size:16px;color:var(--text);font-weight:700}
  table.linegrid .stk,table.linegrid .c-pd{position:static;min-width:0;width:auto;border-right:0;box-shadow:none}
  table.linegrid td.c-ln{min-width:0;width:auto}
  table.linegrid td.c-net{text-align:left}
  table.linegrid td.c-act{padding-top:12px;display:flex;gap:8px}table.linegrid td.c-act::before{display:none}
  table.linegrid tr.errrow{margin:0 16px 12px}table.linegrid tr.errrow td::before{display:none}
  table.linegrid tr.rm{background:#F5F6F7}
}

/* collapsible card (U.collapsible_card, owner 07.11 21:51): whole header row = one button; chevron right = closed, down = open; summary on the right */
.ccard>h3.cc-h{margin:0;font-size:16px}
.cc-head{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:0;margin:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.cc-head:focus-visible{outline:2px solid var(--brand,#07838F);outline-offset:2px;border-radius:6px}
.cc-title{font-size:16px;font-weight:600}
.cc-sum{margin-left:auto;color:var(--text2);font-size:13px;font-weight:400;white-space:nowrap;text-align:right}
.cc-chev{transition:transform .15s;flex:none}
.ccard:not(.closed) .cc-chev{transform:rotate(90deg)}
.cc-body{margin-top:12px}
@media (max-width:700px){.cc-head{flex-wrap:wrap}.cc-sum{flex-basis:100%;margin-left:28px;text-align:left;white-space:normal}}
/* F-01 P2: supplier surcharge grid (card on the PO + item sections); phone: one block per line */
.scwrap{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
table.scgrid{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0}
table.scgrid th,table.scgrid td{white-space:nowrap;padding:6px 8px;vertical-align:middle;border-bottom:1px solid var(--line);text-align:left;background:var(--card,#fff)}
table.scgrid th{font-size:12px;color:var(--text2);font-weight:600;background:#F8F9FA;border-top:1px solid var(--line)}
table.scgrid th.num,table.scgrid td.num{text-align:right}
table.scgrid td .in{margin:0;width:100%;min-width:0;height:40px}
table.scgrid td .vh{min-width:0}
table.scgrid .sc-ln{min-width:72px;font-weight:700}table.scgrid .sc-ty{min-width:210px}table.scgrid .sc-ds{min-width:150px}table.scgrid .sc-cl{min-width:100px}
table.scgrid .sc-am{min-width:120px}table.scgrid .sc-tx{min-width:130px}table.scgrid .sc-ta{min-width:100px}table.scgrid .sc-st{min-width:90px}table.scgrid .sc-ac{min-width:56px;text-align:right}
table.scgrid .sc-pc{min-width:96px}table.scgrid td.sc-am{position:relative}table.scgrid .dsign{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--disc);font-weight:700;z-index:1}
table.scgrid tr.sc-disc td.sc-am .in{padding-left:24px;color:var(--disc);font-weight:700}table.scgrid .dtag{margin-left:6px;vertical-align:middle}table.scgrid tr.sc-disc td.sc-am{color:var(--disc);font-weight:700}
table.data td.dsc{color:var(--disc);font-weight:700;white-space:nowrap}
table.scgrid tr.rm td{background:#F5F6F7;text-decoration:line-through}table.scgrid tr.gone td{color:var(--text2);text-decoration:line-through}
/* QA-461: an error row is marked once (row tint + red left bar), never per cell: grid rows (External charges) would show separate pink boxes */
table.scgrid tr.scerr{background:#FFF6F6;box-shadow:inset 3px 0 0 var(--neg)}
table.scgrid tr.scerr td{background:transparent}
table.scgrid tr.scerr .errmsg{font-size:13px;font-weight:600;margin:0}
table.scgrid tr.scerr:not(.ex-r):not(.sc-r):not(.dp-r) td{padding-top:2px}
.scact{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:12px}
.scsum{display:flex;gap:6px 24px;flex-wrap:wrap;justify-content:flex-end;margin-top:12px;color:var(--text2)}
.scsum b{color:var(--text);font-variant-numeric:tabular-nums}
.scitem>summary{cursor:pointer;font-weight:600;padding:6px 0;list-style:none;display:flex;gap:8px;align-items:center}
.scitem>summary::-webkit-details-marker{display:none}
.scitem>summary .cnt{font-weight:400;color:var(--text2)}
tr.scrow>td{background:#FAFBFC;padding:8px 16px}
.sclock{display:flex;gap:6px;align-items:center;color:var(--text2);margin-bottom:8px}
@media (max-width:700px){
  .scwrap{overflow:visible}
  table.scgrid,table.scgrid tbody,table.scgrid tr,table.scgrid td{display:block;width:auto}
  table.scgrid{min-width:0}table.scgrid thead{display:none}
  table.scgrid tr.sc-r{border:1px solid var(--line);border-radius:8px;margin:0 0 12px;padding:0 12px 12px;background:var(--card,#fff);overflow:hidden}
  table.scgrid td{border:0;padding:6px 0;white-space:normal;background:transparent}
  table.scgrid td::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  table.scgrid td.sc-ln{display:flex;align-items:center;gap:6px;margin:0 -12px 8px;padding:10px 12px;background:#F0F4F8;border-bottom:1px solid var(--line);font-size:16px}
  table.scgrid td.sc-ln::before{display:inline;margin:0;font-size:16px;color:var(--text);font-weight:700}
  table.scgrid td.num{text-align:left}table.scgrid td.sc-ac{display:flex;justify-content:flex-start;padding-top:12px}table.scgrid td.sc-ac::before{display:none}
  .scsum{justify-content:flex-start}
}
.scitem[open]>summary .cc-chev{transform:rotate(90deg)}.scitem>summary .cc-chev{transition:transform .15s}
/* F-01 P4: box "Additional costs" (PO page): tables scroll inside the card on a phone */
.lc-h{margin:12px 0 6px;font-size:14px;color:var(--text2)}.lc-h:first-child{margin-top:0}
table.lc-lines{min-width:760px}
/* QA-092: lists Spread costs / Not on items (box and pop-up); phone: compact two-line rows, no sideways scroll */
table.lc-cmp{min-width:0}table.lc-cmp td.lc-d{white-space:nowrap;color:var(--text2)}table.lc-cmp td.lc-i{white-space:nowrap}
table.lc-cmp td .sub{display:block;font-size:12px;color:var(--text2)}
.lc-more{margin:8px 0 12px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.lc-ov .dialog.lc-dialog{max-width:1000px;max-height:calc(100vh - 32px);display:flex;flex-direction:column}
.lc-dialog .lc-filter{display:flex;gap:12px;flex-wrap:wrap;padding:12px 24px 0;align-items:flex-end}.lc-dialog .lc-filter .f{flex:1 1 220px;min-width:0}
.lc-dialog .lc-dbody{overflow:auto;flex:1 1 auto;min-height:120px;padding-top:0;margin-top:12px}.lc-dialog .lc-dbody .scroll{overflow:visible}
.lc-dialog .lc-dbody table.data th{top:0;z-index:2;background:#F8F9FA;box-shadow:0 1px 0 var(--line)}.lc-dialog .lc-dbody table.data td{position:relative;z-index:0}.lc-dialog .lc-filter,.lc-dialog header,.lc-dialog .lc-tot,.lc-dialog footer{flex:0 0 auto}
.lc-dialog button.lc-sort{all:unset;cursor:pointer;font:inherit;color:inherit;white-space:nowrap}
.lc-dialog th[aria-sort]>button.lc-sort::after{content:" \2191";color:var(--brand)}.lc-dialog th[aria-sort=descending]>button.lc-sort::after{content:" \2193"}
.lc-dialog button.lc-sort:hover,.lc-dialog button.lc-sort:focus-visible{color:var(--brand);text-decoration:underline}
.lc-sortbar{display:none;gap:6px;flex-wrap:wrap;width:100%}.lc-sortbar .btn.on{background:var(--brand);color:#fff}
.lc-tot{display:flex;gap:4px 16px;flex-wrap:wrap;align-items:baseline;padding:10px 24px;border-top:1px solid var(--line);background:#F8F9FA}
.lc-dialog footer{align-items:center}.lc-dialog footer .grow{flex:1}
@media (max-width:700px){
  .lc-ov{padding:0}.lc-ov .dialog.lc-dialog{max-width:none;width:100%;height:100%;max-height:none;border-radius:0}
  .lc-dialog .lc-filter{padding:12px 16px 0}.lc-dialog .lc-dbody{padding:8px 16px}.lc-tot{padding:10px 16px}.lc-dialog header{padding:16px 16px 0}.lc-dialog footer{padding:12px 16px}
  .lc-sortbar{display:flex}
  table.lc-cmp,table.lc-cmp tbody,table.lc-cmp tr,table.lc-cmp td{display:block}table.lc-cmp thead{display:none}
  table.lc-cmp tbody tr{display:grid;grid-template-columns:auto 1fr auto;column-gap:10px;padding:8px 0;border-bottom:1px solid var(--line);align-items:start}
  table.lc-cmp tbody td{border:0;padding:0;min-width:0}
  table.lc-cmp td.lc-t{grid-column:1 / 3;grid-row:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}table.lc-cmp td.lc-i .sub{display:none}
  table.lc-cmp td.lc-a{grid-column:3;grid-row:1 / 3;text-align:right}
  table.lc-cmp td.lc-i{grid-column:1;grid-row:2;font-size:13px}
  table.lc-cmp td.lc-d{grid-column:2;grid-row:2;font-size:13px}
  table.lc-cmp td.lc-sh{grid-column:1 / -1;grid-row:3;font-size:12px;color:var(--text2)}table.lc-cmp td.lc-sh .muted{display:none}
  table.lc-cmp td.lc-a .sub{font-size:12px}table.lc-cmp .lc-rt{display:none}
  table.lc-cmp tbody td[colspan]{grid-column:1 / -1}
}

/* F-01 Part 2 (Q1): additional cost PO (cost type column, Amount on invoice tick, Source POs card, linked box) and the contract line flag */
#po-lines:not([data-potype="ADDITIONAL_COST"]) .cpo-col { display: none; }
.chk.cpo-aoi, .chk.con-aoi { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--text2); white-space: nowrap; }
.pochg .chk.cpo-aoi { justify-content: flex-start; margin-top: 0; font-size: 14px; color: var(--text); }
.chk.cpo-aoi input, .chk.con-aoi input { width: auto; }
.chk.con-aoi[hidden] { display: none; }
.sp-add { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.sp-add .f { flex: 1 1 260px; max-width: 420px; }
.sp-grid tr.rm td { text-decoration: line-through; color: var(--text2); }
#sp-card[hidden] { display: none; }
/* F-01 Part 2 (Q2): card External costs (rows ex-r) and the Cost lines of an additional cost PO */
table.exgrid .ex-sp{min-width:210px}table.exgrid .ex-ct{min-width:190px}table.exgrid .ex-cu{min-width:70px}table.exgrid .ex-cu select.in{width:100%;min-width:0;padding-left:8px;padding-right:20px}table.exgrid .ex-po{min-width:150px}table.exgrid .ex-ao{min-width:140px}
table.exgrid .sc-ln{min-width:64px}
table.exgrid tr.rm td{background:#F5F6F7;text-decoration:line-through}table.exgrid tr.gone td{color:var(--text2);text-decoration:line-through}
.ex-del-hint{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap}
.vh.ex-ro .vh-row .in{background:#F5F6F7;color:var(--text2)}
#ex-card[hidden],#mc-card[hidden],#sp-card[hidden]{display:none}
#ex-totals{margin-top:4px}
@media (max-width:700px){
  table.exgrid tr.ex-r{border:1px solid var(--line);border-radius:8px;margin:0 0 12px;padding:0 12px 12px;background:var(--card,#fff);overflow:hidden}
  table.exgrid td.sc-ln{display:flex;align-items:center;gap:6px;margin:0 -12px 8px;padding:10px 12px;background:#F0F4F8;border-bottom:1px solid var(--line);font-size:16px}
  table.exgrid td.sc-ln::before{display:inline;margin:0;font-size:16px;color:var(--text);font-weight:700}
}

/* F-01 G2: External costs grid fits the card at desktop widths (no sideways scroll): two rows per line, the description sits under type / supplier / contract */
@media (min-width: 1100px) {
  table.exgrid[data-ex-grid]{display:block;width:100%;min-width:0}
  table.exgrid[data-ex-grid] thead,table.exgrid[data-ex-grid] tbody{display:block}
  table.exgrid[data-ex-grid] tr.ex-r,table.exgrid[data-ex-grid] thead tr{display:grid;grid-template-columns:52px minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,1.2fr) 96px 112px minmax(0,.9fr) 100px minmax(0,.8fr) 44px;column-gap:8px;align-items:center;border-bottom:1px solid var(--line);padding:4px 0}
  table.exgrid[data-ex-grid] thead tr{background:#F8F9FA;border-top:1px solid var(--line)}
  table.exgrid[data-ex-grid] th,table.exgrid[data-ex-grid] td{border:0;min-width:0;padding:4px 6px;white-space:normal;background:transparent}
  table.exgrid[data-ex-grid] th:nth-child(1),table.exgrid[data-ex-grid] .sc-ln{grid-column:1;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(2),table.exgrid[data-ex-grid] .sc-ty{grid-column:2;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(3),table.exgrid[data-ex-grid] .sc-ds{grid-column:2 / 5;grid-row:2}
  table.exgrid[data-ex-grid] th:nth-child(4),table.exgrid[data-ex-grid] .ex-sp{grid-column:3;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(5),table.exgrid[data-ex-grid] .ex-ct{grid-column:4;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(6),table.exgrid[data-ex-grid] .sc-am{grid-column:5;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(7),table.exgrid[data-ex-grid] .ex-ao{grid-column:6;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(8),table.exgrid[data-ex-grid] .sc-tx{grid-column:7;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(9),table.exgrid[data-ex-grid] .ex-cu{grid-column:8;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(10),table.exgrid[data-ex-grid] .ex-po{grid-column:9;grid-row:1}
  table.exgrid[data-ex-grid] th:nth-child(11),table.exgrid[data-ex-grid] .sc-ac{grid-column:10;grid-row:1}
  table.exgrid[data-ex-grid] thead th:nth-child(3){grid-row:2}
  table.exgrid[data-ex-grid] tr.ex-r.rm,table.exgrid[data-ex-grid] tr.ex-r.gone{opacity:.8}
  table.exgrid[data-ex-grid] tbody[hidden]{display:none}
  table.exgrid[data-ex-grid] tr.scerr:not(.ex-r){display:block}
  table.exgrid[data-ex-grid] tr.scerr:not(.ex-r) td{display:block}
  table.exgrid[data-ex-grid] .ex-ao .chk{white-space:normal;line-height:1.2;font-size:13px}
  table.exgrid[data-ex-grid]{overflow:hidden}
  table.exgrid[data-ex-grid] tbody[data-ex-empty] tr,table.exgrid[data-ex-grid] tbody[data-ex-empty] td{display:block}
}

/* F-01 G2: the invoice items table keeps its last column (Result pill) visible: compact "Spread by", no clipping */
#inv-items .spread-by label{display:block}
#inv-items .spread-by select{width:auto;max-width:130px}
#inv-items td:last-child,#inv-items th:last-child{padding-right:20px;white-space:nowrap}
#inv-items .pill{white-space:nowrap}

/* QA-085: chips of a multi-value value-help field */
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.chip{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 10px;border:1px solid var(--line,#D5D9DD);border-radius:12px;background:#F5F6F7;font-size:13px;max-width:100%}
.chip-x{border:0;background:none;cursor:pointer;font-size:16px;line-height:1;padding:2px 6px;color:var(--text2,#555)}
/* QA-087: group row text stays visible while the table scrolls sideways */
table.data tr.grp .gl{position:sticky;left:12px;display:inline-block;white-space:nowrap}

/* QA-095 Messages app: one row per language (language, text, length counter) */
.mmlist{display:flex;flex-direction:column;margin-bottom:8px}
.mmrow{display:grid;grid-template-columns:180px 1fr 80px;gap:12px;align-items:start;padding:8px 0;border-bottom:1px solid var(--line)}
.mmrow.mmhead{font:600 12px var(--font);color:var(--text2);text-transform:uppercase;padding:4px 0}
.mmlang{padding-top:9px;font-weight:500}
.mmtext{padding-top:0;min-width:0;overflow-wrap:anywhere}
.mmlist:not(:has(input)) .mmtext{padding-top:9px}
.mmlen{padding-top:9px;text-align:right;color:var(--text2);font-variant-numeric:tabular-nums;white-space:nowrap}
.mmlen.over{color:var(--neg,#BB0000);font-weight:600}
@media(max-width:640px){.mmrow{grid-template-columns:1fr 70px}.mmrow .mmlang{grid-column:1/2;padding-top:0}.mmrow .mmlen{grid-column:2/3;grid-row:1;padding-top:0}.mmrow .mmtext{grid-column:1/3}.mmrow.mmhead span:nth-child(2){display:none}}
.mmrow.mmhead .mmlen{padding-top:0}

/* QA-100: contract lines table - scrolls sideways inside its card on every width; Line and Product stay sticky; inputs keep sensible widths */
.cgwrap{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
table.congrid{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0}
table.congrid th,table.congrid td{white-space:nowrap;padding:6px 8px;vertical-align:middle;background:var(--card,#fff);border-bottom:1px solid var(--line);text-align:left}
table.congrid th{font-size:12px;color:var(--text2);font-weight:600;background:#F8F9FA;border-top:1px solid var(--line)}
table.congrid th.num,table.congrid td.num{text-align:right}
table.congrid .stk{position:sticky;z-index:2}
table.congrid thead th.stk{z-index:5}
table.congrid .c-ln{left:0;min-width:64px;width:64px}
table.congrid .c-pd{left:64px;min-width:240px;width:240px;border-right:1px solid var(--line);box-shadow:2px 0 4px -2px rgba(0,0,0,.12)}
table.congrid td .in{margin:0;width:100%;min-width:0;height:40px}
table.congrid td .vh{min-width:0}
table.congrid .c-ds{min-width:240px}table.congrid .c-pr{min-width:140px}table.congrid .c-um{min-width:100px}table.congrid .c-tx{min-width:150px}
table.congrid .c-qt{min-width:120px}table.congrid .c-or{min-width:110px}table.congrid .c-sp{min-width:120px}table.congrid .c-act{min-width:64px;text-align:right}
table.congrid td.c-pr .con-aoi{display:block;margin-top:4px;font-size:12px}
/* QA-120: the "Amount on invoice" tick sits under the price input; every cell of a line row is top-aligned so that all inputs stay on one line (text cells get the top offset of a 40px input) */
table.congrid tr[data-bu-key]>td{vertical-align:top}
table.congrid tr[data-bu-key]>td.ln,table.congrid tr[data-bu-key]>td.bu-c,table.congrid tr[data-bu-key]>td:not(:has(.in,.vh,button,select)){padding-top:16px}
table.congrid tr[data-bu-key]>td.c-act{padding-top:8px}
table.congrid td.vh-lift{z-index:60}
table.crgrid .c-pd{min-width:170px;width:170px}
table.crgrid .c-it,table.crgrid .c-to{min-width:230px}table.crgrid .c-am{min-width:130px}table.crgrid .c-nm{min-width:210px}table.crgrid .c-cu{min-width:100px}table.crgrid .c-rt{min-width:110px}table.crgrid .c-nt{min-width:230px}
table.crgrid td.off>*{visibility:hidden}
table.scgrid .dtag[hidden],.dsign[hidden]{display:none!important}

/* QA-101: Check result pop-up near the footer (amber warnings / red errors + Show) and the brief highlight of the message panel */
.chkpop{position:fixed;left:50%;bottom:calc(80px + var(--bbh,0px));transform:translateX(-50%);z-index:121;display:flex;align-items:center;gap:12px;padding:10px 12px 10px 20px;border-radius:12px;box-shadow:var(--shadow-h);animation:pop .2s ease-out;max-width:calc(100vw - 32px);font-weight:600}
.chkpop.warn{background:var(--crit-bg);color:var(--crit);border:1px solid var(--crit)}
.chkpop.error{background:var(--neg-bg);color:var(--neg);border:1px solid var(--neg)}
.chkpop-x{background:none;border:0;color:inherit;font-size:20px;line-height:1;cursor:pointer;padding:4px 8px;min-width:32px;min-height:32px}
.msg-flash{outline:3px solid currentColor;outline-offset:2px;transition:outline-color .3s}
/* QA-116: the Discount tag never shifts the cost type field: it sits on the top edge of the cell, so every input of the row stays on one line at the same height */
table.scgrid td.sc-ty{position:relative;vertical-align:middle}
table.scgrid td.sc-ty .dtag{position:absolute;top:1px;right:46px;margin:0;font-size:10px;line-height:14px;padding:0 6px;z-index:2;pointer-events:none}
table.scgrid td.sc-ty .vh,table.scgrid td.sc-ty .vh-input,table.scgrid td .vh .in{height:40px;margin:0}
@media (max-width:760px){table.scgrid td.sc-ty .dtag{top:20px;bottom:auto;right:46px;margin-top:0}table.congrid table.scgrid td.num{text-align:left}table.congrid table.scgrid td{white-space:normal}table.scgrid .dsign{top:46px}table.scgrid tbody[hidden]{display:none}}   /* QA-120: item sections inside the contract grid follow the phone block layout */
table td .vh-row{margin-top:0}

/* QA-119: price build-up - four per-unit columns after Unit price, the card per item, the pop-up of the edit pages */
.bu-th .sub{display:block;font-weight:400;font-size:11px;color:var(--text2)}
td.bu-c{white-space:nowrap;font-variant-numeric:tabular-nums}
td.bu-net b,td.bu-with b,td.bu-total b,.bu-v b{font-weight:700;color:var(--text)}
.bufig{background:none;border:0;padding:2px 4px;margin:0;font:inherit;color:inherit;cursor:pointer;text-decoration:underline dotted;text-underline-offset:3px;border-radius:4px}
.bufig:hover,.bufig:focus-visible{background:var(--brand-bg,#EAF2FE);outline:none}
.bu-kv .bu-v{min-height:40px;display:flex;align-items:center;font-variant-numeric:tabular-nums}
.bucard{border:1px solid var(--line);border-radius:10px;padding:12px 16px;margin:8px 0 4px;background:var(--card,#fff);max-width:640px}
.bucard h4{margin:0 0 8px;font-size:14px}
table.bu{width:100%;border-collapse:collapse;font-size:13px;min-width:0}
table.bu td{padding:5px 8px;border-bottom:1px solid var(--line);vertical-align:top}
table.bu td.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
table.bu td.calc{color:var(--text2)}
table.bu td .sub{display:block;font-size:11px;color:var(--text2)}
table.bu tr.bu-n td,table.bu tr.bu-w td{border-top:1px solid var(--text2)}
table.bu tr.bu-w td{border-bottom:0}

.bu-pop{position:fixed;inset:0;z-index:130;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.35);padding:16px}
.bu-pop[hidden]{display:none}
.bu-pop .bucard{margin:0;max-width:560px;width:100%;max-height:90vh;overflow:auto;box-shadow:var(--shadow-h)}
.bu-pop .bu-x{float:right;background:none;border:0;font-size:22px;line-height:1;cursor:pointer;color:inherit;padding:0 4px}
.bu-totals{margin-top:8px}
@media (max-width:760px){.bucard{padding:10px 12px}table.bu td.calc{font-size:12px}}

/* QA-122: colour rule - discount values (-) strong green, surcharge values (+) reddish orange, both bold; tags Discount / Surcharge; light + dark via variables */
.v-disc,td.v-disc,.totals [data-t="disc"]{color:var(--disc);font-weight:700}
.v-sur,td.v-sur,.totals [data-t="sur"]{color:var(--sur);font-weight:700}
table.scgrid tr.sc-r:not(.sc-disc) td.sc-am,table.scgrid tr.sc-r:not(.sc-disc) td.sc-am .in{color:var(--sur);font-weight:700}
table.scgrid tr.sc-r.rm td.sc-am .in{font-weight:400}
.pill.tag-disc{background:var(--tag-disc-bg);color:var(--tag-disc-fg)}
.pill.tag-sur{background:var(--tag-sur-bg);color:var(--tag-sur-fg)}
.pill.tag-val{background:var(--brand-soft);color:var(--brand);font-weight:600}
/* F-15: limit item (line type VALUE): unit / unit price show a dash, the overall limit box appears under the expected value */
.lm-dash,.lm-box{display:none}
tr.is-value .lm-dash{display:inline;color:var(--text2)}
tr.is-value .lm-hide{display:none}
tr.is-value .lm-box,.lm-box.lm-show{display:block;margin-top:4px}
tr.is-value + tr.scrow{display:none}
.lm-box .in{width:100%}.lm-box label.chk{display:block;font-size:12px;margin-top:2px}
.lm-sub{display:block;font-size:12px;color:var(--text2)}
table.scgrid .stag{margin-left:6px;vertical-align:middle}
table.scgrid .stag[hidden]{display:none!important}
table.scgrid td.sc-ty .stag{position:absolute;top:1px;right:46px;margin:0;font-size:10px;line-height:14px;padding:0 6px;z-index:2;pointer-events:none}
table.bu tr.bu-d .pill,table.bu tr.bu-s .pill{font-size:10px;padding:0 6px;margin-left:4px}
@media (max-width:760px){table.scgrid td.sc-ty .stag{top:20px;bottom:auto;right:46px;margin-top:0}}
:root[data-theme="dark"]{--disc:#97C459;--sur:#F0997B;--tag-disc-bg:#27500A;--tag-disc-fg:#C0DD97;--tag-sur-bg:#712B13;--tag-sur-fg:#F5C4B3}
table.bu td.bu-lab{white-space:nowrap}table.bu td.bu-lab .sub{white-space:normal}.bu-nm{white-space:nowrap}.bu-hd{color:var(--text2);font-weight:400}
table.bu tr.bu-t td{border-top:1px solid var(--line)}table.bu tr.bu-g td{border-top:1px solid var(--text2);border-bottom:0}
/* QA-122: the price build-up card on the phone: label + amount on the first line, the calculation text under the label */
@media (max-width:760px){table.bu,table.bu tbody{display:block}table.bu tr{display:grid;grid-template-columns:1fr auto;border-bottom:1px solid var(--line)}table.bu td{border-bottom:0;min-width:0}table.bu td.bu-lab{white-space:normal}table.bu td.calc{grid-column:1 / 3;grid-row:2;padding-top:0;white-space:normal}table.bu td.num{grid-column:2;grid-row:1}table.bu tr.bu-w{border-bottom:1px solid var(--line)}table.bu tr:last-child{border-bottom:0}}
table.scgrid td.sc-ty .tg-in{position:static;pointer-events:auto;font-size:11px;line-height:1.4;padding:1px 8px;margin-left:6px}

/* QA-123: wide line grids - floating scrollbar, sticky first columns (data-stick), item section at the left edge */
.pt-fbar{position:fixed;z-index:44;height:16px;overflow-x:scroll;overflow-y:hidden;background:rgba(255,255,255,.96);border-top:1px solid var(--line);box-shadow:0 -2px 6px rgba(34,53,72,.10)}
.pt-fbar[hidden]{display:none}.pt-fbar>div{height:1px}
table.pt-st .pt-sc{position:sticky;z-index:2;background:var(--card,#fff)}
table.pt-st thead .pt-sc{z-index:5;background:#F8F9FA}
table.pt-st td.pt-sc.vh-lift{z-index:60}
table.pt-st tr.muted>.pt-sc{background:#fff}
table.pt-st .pt-sc.pt-last{border-right:1px solid var(--line);box-shadow:2px 0 4px -2px rgba(0,0,0,.12)}
table.pt-st .pt-sc.pt-w2{min-width:200px;max-width:260px}
table.pt-st td.pt-sc.pt-w3,table.pt-st th.pt-sc.pt-w3{width:220px;min-width:220px;max-width:220px;overflow:hidden;text-overflow:ellipsis}
table.pt-st td.pt-sc.pt-w3:has(.vh,.in){overflow:visible}
.scitem{position:sticky;left:16px;width:calc(var(--pt-gw,calc(100vw - 32px)) - 32px);max-width:100%;box-sizing:border-box}

/* QA-123: full width for document pages (one class on the page wrapper: <div class="page page-wide">). Short form pages keep their width. Remove this block to revert. */
.page-wide main{max-width:none;padding-left:24px;padding-right:24px}
@media (max-width:700px){.page-wide main{padding-left:16px;padding-right:16px}}
.page-wide .form-grid,.page-wide .form-grid.two,.page-wide .form-grid.lf{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.page-wide .form-grid .span2{grid-column:span 2}.page-wide .form-grid .span3{grid-column:1/-1}
.page-wide .form-grid .in:not(textarea),.page-wide .form-grid .vh,.page-wide .form-grid select{max-width:360px}
.page-wide .form-grid textarea.in{max-width:720px}
.page-wide main p,.page-wide .rowhint{max-width:120ch}
@media (min-width:701px){.page-wide .grid3{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}}
@media (max-width:700px){.page-wide .form-grid,.page-wide .form-grid.two,.page-wide .form-grid.lf{grid-template-columns:1fr}.page-wide .form-grid .span2{grid-column:auto}}
/* QA-125: a derived (read-only) amount carries its minus sign inside the value ("−496.00"); the separate sign of an editable discount amount is hidden then */
table.scgrid td.sc-am:has(.in[readonly]) .dsign{display:none!important}table.scgrid tr.sc-disc td.sc-am .in[readonly]{padding-left:10px}
/* QA-130: ONE fixed form grid for the General / header card of every document (guidebook B4). 4 equal columns >1100px, 2 up to 1100px, 1 on phone (<=700px).
   Fields fill their cell; .span2 / .span3 / .span4 (full row) set the width in columns. Use class "form-grid fg"; display values (.kv) use the same grid. */
.form-grid.fg,.page-wide .form-grid.fg{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px 24px;max-width:1500px;align-items:start}
.form-grid.fg>.span2,.page-wide .form-grid.fg>.span2{grid-column:span 2}
.form-grid.fg>.span3,.page-wide .form-grid.fg>.span3{grid-column:span 3}
.form-grid.fg>.span4,.page-wide .form-grid.fg>.span4{grid-column:1/-1}
.form-grid.fg .in:not(textarea),.form-grid.fg .vh,.form-grid.fg select,.page-wide .form-grid.fg .in:not(textarea),.page-wide .form-grid.fg .vh,.page-wide .form-grid.fg select{max-width:none;width:100%;box-sizing:border-box}
.form-grid.fg textarea.in,.page-wide .form-grid.fg textarea.in{max-width:none;width:100%;box-sizing:border-box}
.form-grid.fg .kv{min-width:0;overflow-wrap:anywhere}
.form-grid.fg>.f,.form-grid.fg>.kv{min-width:0}
@media (max-width:1100px){.form-grid.fg,.page-wide .form-grid.fg{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid.fg>.span3,.page-wide .form-grid.fg>.span3{grid-column:1/-1}}
@media (max-width:700px){.form-grid.fg,.page-wide .form-grid.fg{grid-template-columns:1fr}.form-grid.fg>.span2,.form-grid.fg>.span3,.form-grid.fg>.span4,.page-wide .form-grid.fg>.span2,.page-wide .form-grid.fg>.span3,.page-wide .form-grid.fg>.span4{grid-column:auto}}
/* QA-130: document header card wraps cleanly (title wraps, key figure stays on one line at the right, drops under the title on narrow screens) */
.obj h1{overflow-wrap:anywhere}.obj .kpibig{margin-left:auto;flex:0 0 auto;max-width:100%}.kpibig .big{white-space:nowrap}
/* QA-140: Net / Tax mini grid under the header key figure */
.kpimini{display:grid;grid-template-columns:auto auto;justify-content:end;column-gap:12px;row-gap:1px;margin-top:4px;font-size:13px;text-align:right}.kpimini[hidden]{display:none}.kpimini span{color:var(--text2)}.kpimini b{font-weight:400;white-space:nowrap}
@media (max-width:700px){.obj .kpibig{margin-left:0}.kpimini{justify-content:start;text-align:left}}
.form-grid.fg>.planbox,.page-wide .form-grid.fg>.planbox{grid-column:1/-1}
/* QA-136: PO change grid (same table as PO edit, class chg): wider fields so values are not cut off */
/* QA-276: tax code, Source PR and Need by cells of the PO item table are never cut (create from award, edit, change) */
#po-items.chg tr.gone td{color:var(--text2)}#po-items.chg tr.gone td:nth-child(-n+2){text-decoration:line-through}

/* F-09 Part 1: Excel upload (buttons next to "Add line" + preview pop-up, static/xl_upload.js) */
.xl-btns{display:inline-flex;gap:8px;flex-wrap:wrap;align-items:center}
.xl-btns.busy{opacity:.6;pointer-events:none}
.dialog.xl-dialog{max-width:520px}
.dialog.xl-wide{max-width:min(1500px,calc(100vw - 32px));max-height:calc(100vh - 32px);display:flex;flex-direction:column}
.xl-wide .body{overflow:auto;display:flex;flex-direction:column;min-height:0}
.xl-sum{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.xl-tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0 0 8px}
.xl-scroll{max-height:52vh;overflow:auto;border:1px solid var(--line);border-radius:8px}
table.xl-table{min-width:720px}
table.xl-table td{vertical-align:top}
table.xl-table td.xl-changes,table.xl-table td.xl-rowmsg{min-width:220px;white-space:normal;overflow-wrap:break-word}
table.xl-table th,table.xl-table td{padding-left:8px;padding-right:8px;overflow-wrap:break-word}
table.xl-table td.xl-key{overflow-wrap:normal}
table.xl-table td.xl-key{white-space:nowrap}
table.xl-table tr.xl-error{background:var(--neg-bg)}
table.xl-table tr.xl-warn{background:var(--crit-bg)}
.xl-cm{font-size:12px;line-height:16px;margin-top:2px;white-space:normal;max-width:380px}
.xl-cm.bad{color:var(--neg)}.xl-cm.warn{color:var(--crit)}
td.xl-c-bad .xl-v{color:var(--neg);font-weight:600}
@media (max-width:700px){
  .dialog.xl-wide,.dialog.xl-dialog{max-width:none;max-height:none;height:100%;border-radius:0}
  .overlay.xl-ov{padding:0}
  .xl-scroll{max-height:none;overflow:visible;border:0}
  .xl-btns .btn{flex:1 1 auto}
  /* QA-276: the upload preview is a list of cards on a phone (no table wider than the dialog, the Message column always visible) */
  table.xl-table{min-width:0;width:100%;display:block}
  table.xl-table thead{display:none}
  table.xl-table tbody{display:block}
  table.xl-table tr.xl-r{display:block;border:1px solid var(--line);border-radius:8px;margin:0 0 10px;padding:6px 10px;background:var(--surface)}
  table.xl-table tr.xl-error{background:var(--neg-bg)}table.xl-table tr.xl-warn{background:var(--crit-bg)}
  table.xl-table tr.xl-r td{display:flex;gap:10px;justify-content:space-between;align-items:baseline;border:0;padding:3px 0;min-width:0 !important;text-align:right}
  table.xl-table tr.xl-r td::before{content:attr(data-label);flex:0 0 38%;text-align:left;color:var(--text2);font-size:12px;font-weight:600}
  table.xl-table tr.xl-r td.xl-empty{display:none !important}
  table.xl-table tr.xl-r td.xl-rowmsg,table.xl-table tr.xl-r td.xl-changes{display:block;text-align:left}
  table.xl-table tr.xl-r td.xl-rowmsg::before,table.xl-table tr.xl-r td.xl-changes::before{display:block;margin-bottom:2px}
  .xl-cm{max-width:none}
}
.xl-acts{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

/* F-08 Part 1: Output layout app */
.ol-sw{display:inline-block;width:14px;height:14px;border-radius:3px;border:1px solid var(--line);vertical-align:-2px}
.ol-low{color:var(--crit);font-weight:600}
.ol-colorrow{display:flex;gap:8px;align-items:center}
.ol-colorrow input[type=color]{width:44px;height:32px;padding:2px;border:1px solid var(--line);border-radius:6px;background:var(--surface);cursor:pointer;flex:none}
.ol-colorrow .in{flex:1;min-width:0}
.ol-sample{padding:8px 12px;border-radius:6px;border:1px solid var(--line);font-weight:600}
.ol-logo{max-width:220px;max-height:80px;display:block;border:1px solid var(--line);border-radius:6px;padding:6px;background:#fff}

/* QA-141 Part B: 3-panel layout editor (sections | live PDF | settings). Remove this block to revert. */
.ole-bar{display:flex;flex-wrap:wrap;gap:12px 16px;align-items:flex-end;margin-bottom:12px}
.ole-bar .f{min-width:0}.ole-bar select.in{width:240px;max-width:100%}.ole-bar #ole-template{width:200px}
.ole-btns{display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}
.ole-grid{display:grid;grid-template-columns:220px minmax(0,1fr) 420px;gap:12px;align-items:stretch;height:calc(100vh - 250px);min-height:640px}
.ole-grid>.card{margin:0;min-height:0;overflow:auto}
.ole-nav{padding:8px}.ole-nav ul{list-style:none;margin:0 0 8px;padding:0}
.ole-grp{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--text2);margin:10px 8px 4px}
.ole-sec{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;border:0;background:none;color:var(--text);font:500 14px var(--font);padding:7px 10px;border-radius:8px;cursor:pointer;text-align:left}
.ole-sec:hover{background:var(--bg)}.ole-sec.active{background:var(--brand-soft);color:var(--brand);font-weight:600}
.ole-badge{min-width:18px;height:18px;border-radius:9px;font-size:12px;font-weight:700;line-height:18px;text-align:center;padding:0 5px;flex:none}
.ole-badge[hidden]{display:none}
.ole-badge.dirty{background:var(--crit-bg);color:var(--crit);border:1px solid var(--crit)}.ole-badge.warn{background:var(--crit-bg);color:var(--crit);border:1px solid var(--crit)}.ole-badge.err{background:var(--neg);color:#fff}
.ole-navsel{display:none}
.ole-prev{display:flex;flex-direction:column;gap:8px;padding:12px}
.ole-prevbar{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}.ole-prevbar .tabs{margin:0;border:0}
.ole-status{margin-left:auto;font-size:13px}.ole-status.busy::before{content:"";display:inline-block;width:10px;height:10px;margin-right:6px;border:2px solid var(--line);border-top-color:var(--brand);border-radius:50%;animation:olespin .8s linear infinite;vertical-align:-1px}
.ole-status.ole-bad{color:var(--neg)}
@keyframes olespin{to{transform:rotate(360deg)}}
.ole-frame{flex:1;min-height:0;background:var(--surface-1);border:1px solid var(--line);border-radius:8px;overflow:hidden}
.ole-frame{display:flex;flex-direction:column}
.pv{display:flex;flex-direction:column;flex:1;min-height:0;height:100%}
.pv-bar{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center;padding:6px 8px;border-bottom:1px solid var(--line);background:var(--surface)}
.pv-btn{min-height:32px;padding:0 10px}.pv-btn:not(.pv-txt){min-width:36px;font-size:18px;line-height:1}.pv-btn.active{background:var(--brand-soft);color:var(--brand);border-color:var(--brand)}
.pv .pv-zoom{width:96px;max-width:96px;flex:none;height:32px;min-height:32px}.pv .pv-btn{width:auto;flex:none}.pv-page{margin-left:auto;font-size:13px;white-space:nowrap}
.pv-scroll{flex:1;min-height:0;overflow:auto;background:var(--bg);padding:12px;position:relative}
.pv-pages{display:flex;flex-direction:column;align-items:flex-start;gap:12px;width:max-content;min-width:100%}
.pv-pg{background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.25);margin:0 auto;flex:none}.pv-canvas{display:block}
.pv-msg{padding:16px;text-align:center}.pv-msg[hidden]{display:none}
.ole-note{margin:0;font-size:12px}
.ole-set{padding:12px 16px}.ole-sh{margin:0 0 12px;font-size:16px}.ole-sh:focus{outline:none}
.ole-fields{display:flex;flex-direction:column;gap:12px}
.ole-f .in:not(textarea),.ole-f select{max-width:100%}.ole-f textarea.in{width:100%}
.ole-warn{display:block;color:var(--crit);margin-top:2px}.ole-f .errmsg{display:block;margin-top:2px}
.ole-dirty{border-color:var(--crit)}
.ole-colorrow{display:flex;gap:8px;align-items:center}.ole-colorrow input[type=color]{width:44px;height:32px;padding:2px;border:1px solid var(--line);border-radius:6px;background:var(--surface);cursor:pointer;flex:none}
.ole-colorrow .in{flex:1;min-width:0}.ole-auto{display:inline-flex;gap:4px;align-items:center;flex:none;font-size:13px}
.ole-list{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:4px}
.ole-li{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center;border:1px solid var(--line);border-radius:8px;padding:4px 6px;background:var(--surface)}
.ole-li.off{opacity:.65}.ole-li.drag{outline:2px dashed var(--brand)}
.ole-h{border:0;background:none;color:var(--text2);cursor:grab;font-size:16px;line-height:1;padding:2px 4px}
.ole-lname{flex:1 1 120px;min-width:0}
.ole-ren{flex:1 1 120px;min-width:0;height:28px}.ole-wd{width:64px;height:28px;flex:none}
.ole-mv{display:inline-flex;gap:4px;margin-left:auto}.ole-mv .btn{min-width:30px;padding:0 6px}
.ole-sumlist{margin:4px 0 0;padding-left:18px;font-weight:400}
.ole-logo img.ol-logo{max-width:100%;max-height:80px;display:block;margin-bottom:8px}.ole-btnrow{display:flex;gap:8px;margin:8px 0}
@media (max-width:1300px){.ole-grid{grid-template-columns:190px minmax(0,1fr) 360px}}
@media (max-width:960px){
  .ole-grid{display:flex;flex-direction:column;height:auto;min-height:0}
  .ole-nav{display:none}.ole-navsel{display:block}.ole-set{order:2;overflow:visible}.ole-prev{order:3}
  .ole-frame{height:70vh;flex:none}
  .ole-bar select.in,.ole-bar #ole-template{width:100%}.ole-bar .f{flex:1 1 100%}.ole-btns{margin-left:0;width:100%}.ole-btns .btn{flex:1 1 auto}
}
/* QA-152: typed lines of the PO item grid (account row under the grid row) */
.nl-a td { background: var(--surface-2, #f7f8fa); padding: 8px 12px; }
.nl-acc { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; }
.nl-acc .f { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.nl-r td { vertical-align: top; }

/* QA-155: pop-up "Add from document" of the direct PO screen (po/_pick_dlg.html, po/_pick_list.html, po_pick.js) */
.pk-dialog{max-width:1180px;width:100%;height:min(88vh,860px);display:flex;flex-direction:column}
.pk-dialog header{justify-content:space-between;padding-bottom:8px}
.pk-dialog .body{flex:1 1 auto;overflow:auto;padding-top:8px;display:flex;flex-direction:column;gap:10px;min-height:0}
.pk-dialog footer{flex-wrap:wrap;align-items:center}
.pk-selall{margin-right:auto;display:inline-flex;gap:6px;align-items:center}
.pk-selinfo{margin-right:8px}
.pk-tabs{display:inline-flex;border:1px solid var(--line,#d5dbe1);border-radius:10px;overflow:hidden;align-self:flex-start}
.pk-tab{all:unset;cursor:pointer;padding:8px 18px;font-weight:600;font-size:14px;color:var(--text2)}
.pk-tab.on{background:var(--brand,#1F5F99);color:#fff}
.pk-tab:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
.pk-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 12px;align-items:end}
.pk-filters label{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--text2)}
.pk-filters label.pk-match{flex-direction:row;align-items:center;gap:6px;grid-column:span 2;font-size:14px;color:var(--text)}
.pk-fbtn{display:flex;gap:8px}
.pk-filters [hidden],.pk-filters label[hidden]{display:none!important}
.pk-list.busy{opacity:.5}
.pk-sum{font-size:13px;margin-bottom:4px}
.pk-doc{border:1px solid var(--line,#d5dbe1);border-radius:10px;margin-bottom:8px;background:#fff}
.pk-dh{display:flex;gap:8px;align-items:center;padding:8px 12px;flex-wrap:wrap;background:#F8F9FA;border-radius:10px}
.pk-doc.open .pk-dh{border-bottom:1px solid var(--line,#d5dbe1);border-radius:10px 10px 0 0}
.pk-tg{all:unset;cursor:pointer;display:inline-flex;padding:4px;border-radius:6px}
.pk-tg:focus-visible{outline:2px solid var(--brand)}
.pk-tg svg{transition:transform .15s;transform:rotate(0deg)}
.pk-doc.open .pk-tg svg{transform:rotate(90deg)}
.pk-dm{flex:1 1 auto}
.pk-cnt.has-sel{color:var(--brand);font-weight:600}
.pk-lines{display:none}
.pk-doc.open .pk-lines{display:block}
.pk-t td{vertical-align:middle}
.pk-t input.q{width:92px;text-align:right}
.pk-t tr.pk-r.on td{background:#E8F0F8}
.pk-ds,.pk-open{display:block}
.pk-none{padding:24px;text-align:center}
.pk-ov .msgbar{margin:0}
@media (max-width:1024px){.pk-filters{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:700px){
  .pk-ov{padding:0;align-items:stretch}
  .pk-dialog{max-width:none;width:100vw;height:100vh;height:100dvh;border-radius:0}
  .pk-dialog header,.pk-dialog .body,.pk-dialog footer{padding-left:16px;padding-right:16px}
  .pk-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pk-filters label.pk-match{grid-column:1 / -1}
  .pk-tabs{align-self:stretch}.pk-tab{flex:1;text-align:center}
  .pk-t thead{display:none}
  .pk-t,.pk-t tbody{display:block}
  .pk-t tr.pk-r{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;padding:10px 12px;border-bottom:1px solid var(--line,#d5dbe1)}
  .pk-t tr.pk-r td{display:block;border:0!important;padding:0!important;text-align:left!important;white-space:normal}
  .pk-t tr.pk-r td.sel{grid-column:1 / -1}
  .pk-t tr.pk-r td:nth-child(3){grid-column:1 / -1}
  .pk-t tr.pk-r td[data-label]:not(.sel)::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  .pk-t tr.pk-msg{display:block;padding:0 12px 8px}.pk-t tr.pk-msg td{display:block;padding:0}.pk-t tr.pk-msg td:first-child{display:none}
  .pk-t input.q{width:100%}
  .pk-dh{padding:8px}
  .pk-dialog footer .btn{flex:1 1 auto}
  .pk-selall{flex-basis:100%}
}
.pk-ov .msgbar[hidden],.pk-filters [hidden]{display:none!important}
.pk-dialog .body>*{flex-shrink:0}
.pk-t tr.pk-msg td{white-space:normal}
.pk-t tr.pk-msg .warnmsg,.pk-t tr.pk-msg .errmsg{white-space:normal;display:block}
@media (max-width:700px){.pk-t tr.pk-r.on td{background:transparent!important}.pk-t tr.pk-r.on{background:#E8F0F8}}

/* QA-159: icon-only sidebar label, one element on <body> (outside the sidebar stacking context) so it is always on top and never cut */
#sb-tip{position:fixed;display:none;background:#1D2D3E;color:#fff;padding:4px 10px;border-radius:6px;font-size:12px;font-weight:500;line-height:1.4;white-space:nowrap;z-index:2000;pointer-events:none;box-shadow:0 2px 8px rgba(0,0,0,.25)}

/* F-16: Load from CBAR dialog (progress bar and result) */
.fx-prog{height:8px;border-radius:4px;background:var(--line,#D5D9DD);overflow:hidden;margin:8px 0}
.fx-prog span{display:block;height:100%;width:0;background:var(--brand);transition:width .3s}
#fx-summary.fx-ok{color:var(--pos);font-weight:600}
#fx-summary.fx-bad{color:var(--neg);font-weight:600}
#fx-fields{grid-template-columns:1fr 1fr}
#fx-fields[hidden],#fx-result[hidden]{display:none}
@media (max-width:700px){#fx-fields{grid-template-columns:1fr}}
#fx-fields .dp{display:flex;gap:4px;width:100%}
/* QA-169: one-screen workflow form (rows of start conditions, steps, step conditions) */
.wf-list{display:flex;flex-direction:column;gap:12px}
.wf-row{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,3fr) auto;gap:8px 16px;align-items:end;padding:12px;border:1px solid var(--line);border-radius:8px}
.wf-ov{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2.4fr);gap:8px 16px;align-items:end}
.wf-row .f,.wf-step .f{margin:0}
.wf-val .vh,.wf-val .in{width:100%}
.wf-between{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.wf-checks{display:flex;flex-wrap:wrap;gap:4px 16px;min-height:32px;align-items:center}
.wf-hint{line-height:32px}
.wf-act{display:flex;gap:6px;align-items:center}
.wf-rowerr{grid-column:1/-1;margin:0}
.wf-row.has-err,.wf-step.has-err{border-color:var(--neg)}
.wf-step{border:1px solid var(--line);border-radius:8px;padding:12px 16px}
.wf-step-head{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.wf-step-head .wf-move{margin-left:auto}
.wf-sconds{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}
.wf-sconds h4{margin:0 0 4px;font-size:14px}
.wf-sconds .wf-row{margin-bottom:8px;background:var(--bg2,transparent)}
.wf-removed{opacity:.55}
.wf-removed .in,.wf-removed .wf-hint,.wf-removed h4{text-decoration:line-through}
.wf-empty{padding:8px 0}
#wf-form .ro{line-height:32px;display:block}
@media (max-width:900px){.wf-row{grid-template-columns:1fr}.wf-ov{grid-template-columns:1fr}.wf-row .wf-act{justify-self:end}}
div.f>.lbl{display:block;font-size:12px;color:var(--text2);font-weight:600}
.wf-val .vh-multi{display:block}
.in.num{text-align:right}

/* F-15 Part 2: service entry sheet */
.se-box{border:1px solid var(--border);border-radius:10px;padding:8px 10px;background:var(--bg2,#F7F9FB)}
.se-head{margin-bottom:6px}
.se-line{display:grid;grid-template-columns:minmax(160px,3fr) 90px 80px 120px auto;gap:6px;margin-bottom:6px;align-items:center}
.se-foot{display:flex;gap:12px;align-items:center}
.se-price{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:end;margin-bottom:8px}
.se-price .f{display:grid;gap:2px;font-size:12px;color:var(--text2);font-weight:600;width:140px;max-width:100%}
tr.se-row td{padding-top:0}
@media (max-width:700px){.se-line{grid-template-columns:1fr 1fr}.se-line input:first-child{grid-column:1 / -1}}

/* F-15 fix: goods receipt on a phone - every item is a card, so "Receive now" is never scrolled away (service entry sheet below its card) */
@media (max-width:700px){
  table.rcvgrid,table.rcvgrid tbody,table.rcvgrid tr,table.rcvgrid td{display:block;width:auto}
  table.rcvgrid thead{display:none}
  table.rcvgrid tr.rl{border:1px solid var(--line);border-radius:8px;margin:12px 16px 0;padding:0 12px 12px;background:var(--card,#fff)}
  table.rcvgrid tr.rl+tr.se-row{margin:0 16px 12px;padding:0}
  table.rcvgrid tr.se-row>td:first-child{display:none}
  table.rcvgrid td{border:0;padding:6px 0;white-space:normal;text-align:left}
  table.rcvgrid tr.rl td::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  table.rcvgrid td.num{text-align:left}
  table.rcvgrid td .in{min-width:0;width:100%}
  table.rcvgrid .se-box,table.rcvgrid .se-head{max-width:100%;white-space:normal;box-sizing:border-box}
  table.rcvgrid tr.rl{box-sizing:border-box;width:auto;max-width:calc(100% - 32px)}
  table.rcvgrid{width:100%;min-width:0;table-layout:fixed}
  table.rcvgrid tr.se-row,table.rcvgrid tr.se-row td{max-width:100%;box-sizing:border-box;white-space:normal}
  .se-price{white-space:normal}
  .se-price .muted{flex:1 1 100%}
}

/* F-18 S1a: "Add from requisition" dialog of the sourcing screens (list scrolls inside the dialog, full screen on the phone) */
.dialog.src-pick{max-width:960px;max-height:calc(100vh - 32px);display:flex;flex-direction:column}
.dialog.src-pick .body{overflow:auto;flex:1 1 auto;min-height:0}.dialog.src-pick #pick-list{margin-top:8px;overflow:auto}
.dialog.src-pick table.data th:first-child,.dialog.src-pick table.data td:first-child{width:36px}
@media (max-width:760px){.dialog.src-pick{max-width:none;max-height:none;height:100%;border-radius:0}}

/* ---- F-18 S4: contract offer clause table, deviations, versions (append-only) ---- */
.cd-rows{display:flex;flex-direction:column;gap:10px;margin:12px 0}
.cd-row{border:1px solid var(--line,#d9dee3);border-radius:8px;padding:10px;background:var(--card,#fff)}
.cd-row.is-mandatory{border-left:3px solid #6A3FB5}
.cd-rh{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.cd-rh .cd-title{flex:1 1 220px;min-width:0}
.cd-no{min-width:24px;font-weight:600;color:var(--muted,#667)}
.cd-tags{display:inline-flex;align-items:center;gap:6px}
.cd-btns{display:inline-flex;gap:4px;margin-left:auto}
.cd-text{width:100%;font-family:inherit;line-height:1.45}
.cd-tplrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cd-tplrow .cd-rt{flex:1 1 200px}
.cd-add{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-top:8px}
.cd-add .f{min-width:260px;flex:1 1 260px}
.cd-ph{margin:6px 0 10px}
.cd-ph summary{cursor:pointer;color:var(--muted,#667)}
.cd-ph ul{margin:6px 0 0 18px;padding:0}
.cd-clause-view{padding:10px 0;border-bottom:1px solid var(--line,#e5e8eb)}
.cd-clause-view h4{margin:0 0 6px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.cd-clause-view .cd-text{white-space:pre-wrap}
.cd-clause-view.is-changed{background:rgba(231,180,22,.07);padding-left:8px}
.cd-dev-h{margin:16px 0 6px}
.cd-dev{margin:0;padding:0;list-style:none}
.cd-dev li{padding:3px 0}
.cd-vbtns{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.cd-charges{margin:4px 0 8px 18px;padding:0}
@media (max-width:640px){.cd-btns{margin-left:0}.cd-add .f{min-width:100%}}

.cd-tplnote[hidden]{display:none}

/* F-18 S2: questionnaire editor, answers and scoring matrix */
.sq-q{border:1px solid var(--line);border-radius:8px;padding:12px;margin:0 0 12px;background:var(--card,#fff)}
.sq-q [hidden]{display:none!important}
.sq-sec{margin:12px 0 4px}
.sq-view{margin:0 0 8px;padding-left:24px}
.sq-row{margin:0 0 12px}
.sq-row .in{max-width:640px}
.sq-qtext{display:block;margin-bottom:4px}
.ssc-in{display:flex;gap:4px;flex-direction:column;min-width:130px}
.ssc-in .in{width:100%}
.ssc-cell.ko{background:var(--neg-bg,#fbe5e5)}
.ssc-sec td{background:var(--bg)}
.ssc-ans{margin-bottom:4px;overflow-wrap:anywhere}
.ssc-links{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
#sq-list ~ .form-actions,.sq-actions{display:flex;flex-wrap:wrap;gap:8px}

/* QA-179 / QA-180: the item grid of the sourcing request / order follows the requisition grid and fits 1440 px without scrolling sideways (fixed column widths, the description takes the rest) */
table.linegrid.src-grid{table-layout:fixed;width:100%;min-width:1040px}table.linegrid.src-grid.src-acct{min-width:1000px}table.linegrid.src-grid th,table.linegrid.src-grid td{box-sizing:border-box}
table.linegrid.src-grid .c-ln{left:0;min-width:0;width:48px}
table.linegrid.src-grid .c-pd{left:48px;min-width:0;max-width:none;width:136px}
table.linegrid.src-grid .c-ds{min-width:0}table.linegrid.src-grid .c-ty{min-width:0;width:100px}table.linegrid.src-grid .c-qt{min-width:0;width:80px}table.linegrid.src-grid .c-um{min-width:0;width:124px}
table.linegrid.src-grid .c-pr{min-width:0;width:88px}table.linegrid.src-grid .c-nb{min-width:0;width:150px}table.linegrid.src-grid .c-net{min-width:0;width:72px}table.linegrid.src-grid .c-act{min-width:0;width:76px}table.linegrid.src-grid .c-ac{min-width:0;width:96px}
/* QA-238: the description is the column that takes the rest: at 1440 px at least 200 px on the order grid (it was 74 px with the account column) */
table.linegrid.src-grid .c-ds{min-width:190px}
/* QA-276: quantity and the overall limit / target price cells are wide enough for 12500.75 and 5000.000 (no cut digits) */
table.linegrid.src-grid .c-qt{width:96px}table.linegrid.src-grid .c-pr{width:116px}table.linegrid.src-grid .c-ty{width:120px}table.linegrid.src-grid .c-nb{width:164px}table.linegrid.src-grid{min-width:1460px}table.linegrid.src-grid.src-acct{min-width:1420px}
@media (max-width:1024px){table.linegrid.src-grid{min-width:0}table.linegrid.src-grid .c-qt,table.linegrid.src-grid .c-pr,table.linegrid.src-grid .c-ty,table.linegrid.src-grid .c-nb{width:auto}}
table.linegrid.src-grid td.c-ln .ln{margin-right:0}table.linegrid.src-grid td.c-act .btn{margin-right:0}
.src-actions{flex-wrap:wrap}
@media (max-width:1024px){table.linegrid.src-grid{table-layout:auto;width:auto;min-width:0}table.linegrid.src-grid .c-ln,table.linegrid.src-grid .c-pd,table.linegrid.src-grid .c-act,table.linegrid.src-grid .c-ty,table.linegrid.src-grid .c-qt,table.linegrid.src-grid .c-um,table.linegrid.src-grid .c-pr,table.linegrid.src-grid .c-nb,table.linegrid.src-grid .c-net{width:auto}}
.kpibig small.muted{display:block;margin-top:2px}
.src-list-title{display:block;max-width:34ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:1024px){table.linegrid.src-grid td.num{text-align:left}table.linegrid.src-grid td .in.num{text-align:right}}
table.linegrid.src-grid tr.is-value .lm-box{margin-top:0}
table.linegrid.src-grid td.c-um label.chk{white-space:nowrap;font-size:12px}
@media (max-width:1024px){table.linegrid.src-grid tr.is-value td.c-um::before{display:none}}
table.linegrid.src-grid .errmsg{white-space:normal;line-height:1.3}
/* QA-194 (F13): the refusal of a material product on a limit item is a small bubble under the cell, so the row keeps its height; on the phone (cards) it is a normal line */
table.linegrid.src-grid td.c-pd .lm-refused{position:absolute;left:4px;top:calc(100% - 8px);width:280px;max-width:80vw;z-index:6;background:var(--surface,#fff);border:1px solid var(--neg);border-radius:6px;padding:6px 8px;box-shadow:0 4px 12px rgba(0,0,0,.18);font-size:12px;line-height:1.3}
@media (max-width:1024px){table.linegrid.src-grid td.c-pd .lm-refused{position:static !important;width:auto;max-width:none;border:0;box-shadow:none;padding:2px 0;background:none}}
/* QA-194 (F16): sortable column titles of the sourcing request list */
table.data th a.sortlink{color:inherit;text-decoration:none;white-space:nowrap}table.data th a.sortlink:hover{text-decoration:underline}table.data th[aria-sort] a.sortlink{font-weight:700}
table.linegrid.src-grid th.c-um{white-space:normal}
/* QA-195: Copy line + Remove in the last column */
table.linegrid.src-grid td.c-act,table.linegrid.src-grid th.c-act{width:76px;min-width:76px;white-space:nowrap}

/* QA-199 #3 / QA-201 / QA-205 N-3: the accounting of a sourcing order line is ONE column "Account assignment": a compact button (summary of the codes) that opens a panel with the three search help fields; the table never scrolls sideways */
table.linegrid.src-grid .c-ac{min-width:0;width:88px;position:relative}
table.linegrid.src-grid .acct-btn{width:100%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;text-align:left}
table.linegrid.src-grid .acct-btn.has{font-variant-numeric:tabular-nums}
.acct-panel{position:fixed;z-index:60;width:300px;max-width:calc(100vw - 24px);background:var(--surface,#fff);border:1px solid var(--line,#d0d5dd);border-radius:8px;padding:12px;box-shadow:0 8px 24px rgba(0,0,0,.2);display:flex;flex-direction:column;gap:8px}
.acct-panel[hidden]{display:none}
.acct-panel .acct-title{font-weight:600}.acct-panel .acct-foot{display:flex;justify-content:flex-end}
@media (max-width:1024px){
  table.linegrid.src-grid.src-acct{min-width:0}table.linegrid.src-grid .c-ac{width:auto}
  table.linegrid.src-grid .acct-btn{display:none}
  .acct-panel,.acct-panel[hidden]{position:static;display:flex;width:auto;max-width:none;border:0;box-shadow:none;padding:0;background:none}
  .acct-panel .acct-title,.acct-panel .acct-foot{display:none}
}

/* QA-192: questionnaire editor layout - head row, flags in one line, options as one row each */
.sq-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px}
.sq-head .sq-tools{display:flex;gap:6px}
.sq-flags{display:flex;gap:16px;align-items:center;flex-wrap:wrap;align-self:end;padding-bottom:8px}
.sq-opts{margin-top:8px}
.sq-optlist{display:flex;flex-direction:column;gap:6px;margin:0 0 8px}
.sq-opt{display:grid;grid-template-columns:minmax(0,1fr) 110px 40px;gap:8px;align-items:center}
.sq-opt .num{text-align:right}
@media(max-width:600px){.sq-opt{grid-template-columns:minmax(0,1fr) 80px 40px}}
.sq-undo[hidden],#sq-empty[hidden]{display:none!important}
/* QA-199: evaluation / scenario screens: toolbar in one row, comparison grid columns, labels of the totals never cut */
.evcard .tb-right{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.evcard .tb-right .tabs{margin:0;border:0}
.evcard .tb-right form.inline{display:inline-flex;margin:0}
table.evgrid th.evu,table.evgrid th.evl{min-width:104px;white-space:nowrap}
table.evgrid th .sub{font-weight:400;margin-left:2px}
table.evgrid td.evmeta{white-space:normal}
table.evgrid tfoot th.c-nm,table.evgrid tfoot th.c-nm.stk{white-space:normal;overflow:visible;text-overflow:clip}
@media (max-width:700px){table.evgrid.plangrid tfoot th.c-nm,table.evgrid.plangrid tbody td.c-nm{white-space:normal;overflow:visible;width:auto;min-width:130px;max-width:none}}
.evcard .gridwrap{max-height:none;min-height:0}
#ssc-table td.ssc-cell,#ssc-table th.evsup{white-space:normal;min-width:230px;max-width:300px;vertical-align:top}
#ssc-table td.ssc-cell .in{width:100%;min-width:0}
#ssc-table td.ssc-cell .errmsg{white-space:normal}
.f.is-off{opacity:.55}
table.linegrid.src-grid th,table.linegrid.src-grid td{padding:6px 5px}table.linegrid.src-grid th:first-child,table.linegrid.src-grid td:first-child{padding-left:8px}
table.linegrid.src-grid th{white-space:normal;line-height:1.2;vertical-align:bottom}
/* QA-193: limit item rows of the requisition / PO / contract grids: expected value in Qty / amount, overall limit in the price column, No limit tick in the unit column (one input per cell, row height unchanged) */
tr.is-value .lm-box.lm-cell{margin-top:0}
label.chk.lm-cell{white-space:nowrap;font-size:12px;margin:0}
td .lm-box.lm-cell .in{width:100%}
.lm-refused{position:absolute;left:4px;top:calc(100% - 8px);width:280px;max-width:80vw;z-index:6;background:var(--surface,#fff);border:1px solid var(--neg);border-radius:6px;padding:6px 8px;box-shadow:0 4px 12px rgba(0,0,0,.18);font-size:12px;line-height:1.3;white-space:normal}
@media (max-width:1024px){td .lm-refused{position:static !important;width:auto;max-width:none;border:0;box-shadow:none;padding:2px 0;background:none}}
/* F-20 R3: price comparison (QA-254: the RFQ grid now shows Overall limit / No limit of a limit item like the sourcing grid) */
table.cmp th.cmp-sup{min-width:150px;vertical-align:bottom}
table.cmp td.cmp-cell{vertical-align:top;white-space:nowrap}
table.cmp td.cmp-cheapest{background:var(--pos-bg)}
table.cmp td.cmp-won{box-shadow:inset 3px 0 0 var(--info)}
table.cmp .cmp-best{color:var(--pos)}
table.cmp tfoot th,table.cmp tfoot td{border-top:1px solid var(--line,#d9dde3);font-weight:600}
table.cmp td.cmp-pick select{min-width:110px}
/* F-20 R4: the bid charge table - the Applies to / Basis lists show their whole word */
#ch-table select.in{min-width:130px}
#ch-table td:nth-child(3) input.in{min-width:64px}
/* F-20 R4: price comparison on the phone - narrow Product / Qty columns so the first supplier column is visible without sideways scrolling first */
@media (max-width:640px){table.cmp th:nth-child(2),table.cmp td:nth-child(2){min-width:92px;max-width:92px;width:92px;font-size:12px;overflow-wrap:anywhere}table.cmp th:nth-child(3),table.cmp td:nth-child(3){min-width:60px;font-size:12px}table.cmp td:first-child,table.cmp th:first-child{min-width:34px;padding-left:6px;padding-right:6px}}
/* F-20 R4 (F12): the bid line table fits the page at 1440 (no sideways scroll); on the phone it scrolls inside its card */
#bid-items th,#bid-items td{padding-left:6px;padding-right:6px}
#bid-items input.in{min-width:0}
#bid-items input.in.p{width:86px}
#bid-items td:nth-child(6) input.in{width:54px}
#bid-items td:last-child input.in{width:100%;min-width:90px}
#bid-items th{font-size:12px;white-space:normal}

/* F-20 R4 F18: the Type select shows 'Limit item' in full at every width */
table.linegrid .c-ty select.lm-type{width:100%;min-width:118px;padding-right:26px;text-overflow:clip}

/* QA-178 Q2: Purchasing Workload Monitor - on a phone every row is a card (label above value) */
.wl-reassign{display:flex;gap:8px;align-items:center;flex-wrap:nowrap}.wl-reassign select.in{width:auto;flex:0 1 240px;min-width:160px}
.toolbar select.wl-buyer{width:auto;min-width:240px;max-width:100%}
@media (max-width:700px){
  table.wlcards,table.wlcards tbody,table.wlcards tr,table.wlcards td{display:block;width:auto;min-width:0}
  table.wlcards thead{display:none}
  table.wlcards tr[data-pr],table.wlcards tr[data-po],table.wlcards tr[data-buyer],table.wlcards tr[data-member]{border:1px solid var(--line);border-radius:8px;margin:12px 16px;padding:8px 12px;background:var(--card,#fff)}
  table.wlcards td{border:0;padding:4px 0;white-space:normal;background:transparent;text-align:left}
  table.wlcards td.num{text-align:left}
  table.wlcards td[data-label]::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  table.wlcards td.sel{padding:2px 0 6px}
  .wl-reassign{flex-direction:column;align-items:stretch;flex-wrap:wrap}.wl-reassign select.in{width:100%;flex:none}
  .toolbar select.wl-buyer{width:100%}
}
/* QA-213: on the phone the Apps tiles (Favorites / Most Used / Recently Used) scroll inside their own row; the page never scrolls sideways */
@media (max-width:700px){
  #apps{min-width:0;max-width:100%}
  #apps .kpis{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(150px,44%);overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch;padding-bottom:8px}
  #apps .kpis .kpi{min-width:0}
  #apps .kpis .none{grid-column:auto;white-space:normal;min-width:70vw}
}
/* QA-515: phone, ONE rule for every tile header (.kpi .head: title + refresh / star / app icon): the title gets the full width and wraps, the icons sit in their own small row at the right; nothing sticks out of the tile. Desktop unchanged. */
@media (max-width:700px){
  .kpi .head{flex-wrap:wrap;justify-content:flex-end;gap:4px}
  .kpi .head>b{flex:1 1 100%;min-width:0;overflow-wrap:anywhere}
  .kpi .head .ico{flex:none;max-width:100%}
}

/* QA-266 (V1 #19): the Description column of the read-only item table of a sourcing request / order keeps a readable width (was squeezed to 12 lines at 1440) */
#src-lines td:nth-child(3){min-width:170px;max-width:320px;white-space:normal}
#src-lines td:nth-child(2){min-width:100px;max-width:160px;overflow-wrap:anywhere}
#src-lines th{white-space:normal;line-height:1.2;vertical-align:bottom}      /* QA-277: the items table fits the card at 1440 (no scroll inside the card, Value visible) */
#src-lines th:nth-child(4),#src-lines td:nth-child(4){white-space:nowrap}
/* QA-260: wide comparison grids - on a phone only the Line column is fixed and the first scrolling columns stay narrow (every supplier column reachable); at 1440 the fixed columns are compact */
@media (max-width:640px){table.congrid .c-pd{min-width:180px;width:180px}table.congrid .c-ds{min-width:180px}table.evgrid th.num,table.evgrid td.num{min-width:0}table.evgrid td.c-nm,table.evgrid th.c-nm{min-width:110px;max-width:150px;white-space:normal}}
@media (min-width:641px){table.evgrid thead th{white-space:normal;line-height:1.25;vertical-align:bottom}table.evgrid td.c-nm,table.evgrid th.c-nm{min-width:150px;width:150px;max-width:150px}table.evgrid th.evu,table.evgrid th.evl{min-width:92px}}
/* QA-260 (round 2): at 1100 px and wider the evaluation / score grids fit the card with four suppliers and the totals - compact cells, narrow Item column with wrapped text, no inner scroll */
@media (min-width:1101px){
 table.evgrid.plangrid{width:100%;min-width:0}
 table.evgrid.plangrid th,table.evgrid.plangrid td{padding:6px 5px;font-size:12.5px}
 table.evgrid.plangrid th.c-ln,table.evgrid.plangrid td.c-ln{min-width:40px;width:40px;max-width:40px;padding-left:2px;padding-right:2px;text-align:center}
 table.evgrid.plangrid th.c-nm,table.evgrid.plangrid td.c-nm{left:40px;min-width:120px;width:120px;max-width:120px;white-space:normal;overflow:visible;text-overflow:clip}
 table.evgrid.plangrid th.num,table.evgrid.plangrid td.num,table.evgrid.plangrid th.evu,table.evgrid.plangrid th.evl{min-width:0;width:auto}
 table.evgrid.plangrid th.evsup{white-space:normal;min-width:0}
 table.evgrid.plangrid td.num{white-space:nowrap}
 table.evgrid.plangrid thead th{white-space:normal;overflow-wrap:break-word}
 table.evgrid.plangrid td.evmeta .pill{white-space:normal}
}
/* QA-260 (round 2): the contract line grid (also "contract from bid") fits the card at 1100 px and wider - narrow Product / Description, compact numbers; nothing is hidden */
@media (min-width:1101px){
 .cgwrap table.congrid{width:100%;min-width:0}
 table.congrid.pt-st th,table.congrid.pt-st td{padding:6px 4px;font-size:12.5px}
 table.congrid.pt-st th.c-ln,table.congrid.pt-st td.c-ln{min-width:36px;width:36px;padding-left:2px;padding-right:2px}
 table.congrid.pt-st .pt-sc.c-pd,table.congrid.pt-st th.c-pd,table.congrid.pt-st td.c-pd{left:auto;min-width:120px;width:120px;max-width:120px}
 table.congrid.pt-st th.c-ds,table.congrid.pt-st td.c-ds,table.congrid.pt-st td.pt-sc.pt-w3,table.congrid.pt-st th.pt-sc.pt-w3{min-width:150px;width:150px;max-width:150px}
 table.congrid.pt-st th.c-pr,table.congrid.pt-st th.c-um,table.congrid.pt-st th.c-qt,table.congrid.pt-st th.c-tx,table.congrid.pt-st th.c-lt,table.congrid.pt-st th.c-sp,table.congrid.pt-st th.c-act{min-width:0;width:auto;white-space:normal;overflow-wrap:break-word}
 table.congrid.pt-st td.c-pr,table.congrid.pt-st td.c-um,table.congrid.pt-st td.c-qt,table.congrid.pt-st td.c-tx,table.congrid.pt-st td.c-lt,table.congrid.pt-st td.c-sp,table.congrid.pt-st td.c-act{min-width:0}
 table.congrid.pt-st th.bu-th{white-space:normal;overflow-wrap:break-word}
 table.congrid.pt-st td.num .in{min-width:0}
}
table.congrid textarea.con-desc{height:auto;min-height:56px;resize:vertical;line-height:1.3;font-size:12.5px;padding:4px 6px;margin:0;width:100%;box-sizing:border-box}
@media (min-width:1101px){
 table.congrid.pt-st th.c-pr,table.congrid.pt-st td.c-pr{width:108px;max-width:108px}
 table.congrid.pt-st .pt-sc.c-pd,table.congrid.pt-st th.c-pd,table.congrid.pt-st td.c-pd{min-width:110px;width:110px;max-width:110px}
 table.congrid.pt-st td.c-act,table.congrid.pt-st th.c-act{width:80px;padding-left:2px;padding-right:2px;white-space:nowrap}
 table.congrid.pt-st td select.in{min-width:64px;padding-left:4px;padding-right:2px}
}
@media (min-width:1101px){
 table.congrid.pt-st th.c-ds,table.congrid.pt-st td.c-ds,table.congrid.pt-st td.pt-sc.pt-w3,table.congrid.pt-st th.pt-sc.pt-w3{min-width:140px;width:140px;max-width:140px}
 table.congrid.pt-st td.c-act .btn.iconbtn{min-width:30px;width:30px;padding:0}
 table.congrid.pt-st td.c-act{width:70px}
}
@media (min-width:1101px){
 table.congrid.pt-st th.c-qt,table.congrid.pt-st td.c-qt{min-width:72px}
 table.congrid.pt-st td.c-qt .in,table.congrid.pt-st td.num .in[name$="target_quantity"]{min-width:64px}
 table.congrid.pt-st th.c-ds,table.congrid.pt-st td.c-ds,table.congrid.pt-st td.pt-sc.pt-w3,table.congrid.pt-st th.pt-sc.pt-w3{min-width:130px;width:130px;max-width:130px}
 table.congrid.pt-st .pt-sc.c-pd,table.congrid.pt-st th.c-pd,table.congrid.pt-st td.c-pd{min-width:100px;width:100px;max-width:100px}
}
/* QA-280: numbers load after the page (placeholder of the same size, no jump) and the small refresh buttons of My Home */
.ph{color:transparent!important;background:var(--neu-bg,#eef1f5);border-radius:6px;animation:phpulse 1.2s ease-in-out infinite;user-select:none}
.stile .sn.ph{width:56px;height:26px}.stile .mc.ph{height:44px}.stile .st.ph{width:96px;height:14px;margin-top:6px}
.kpi .num.ph{width:64px;height:35px}
.kpi .num.warn{color:var(--crit)}
@keyframes phpulse{0%,100%{opacity:.55}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){.ph{animation:none}}
.rf{border:0;background:none;padding:0;width:20px;height:20px;color:var(--text2);cursor:pointer;display:grid;place-items:center;border-radius:50%;opacity:.55;transition:opacity .15s}
.rf svg.i{width:14px;height:14px}
.rf:hover{color:var(--brand);background:var(--neu-bg,#eef1f5)}
.kpi:hover .rf,.kpi .rf:focus-visible,.todo:hover .rf,.todo .rf:focus-visible,.rf:hover{opacity:1}
.rf.htmx-request svg{animation:rfspin .8s linear infinite}
@keyframes rfspin{to{transform:rotate(360deg)}}
.todo .card-rf{position:absolute;top:10px;right:10px}
@media (max-width:700px),(hover:none){.rf{opacity:1}}

/* ---- QA-283: Export button states (Preparing, busy) + history icon with badge + history dialog */
.btn.exp-wait{opacity:.6;cursor:default;pointer-events:none}
.btn.exp-busy{opacity:.6;cursor:progress}
.btn.exp-hist{position:relative;padding:0 9px;margin-left:-4px}
.exp-badge{position:absolute;top:-7px;right:-7px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--brand);color:#fff;font-size:11px;font-weight:600;line-height:18px;text-align:center}
.exp-badge[hidden]{display:none}
/* QA-458: history entry with text; as a menu item it follows .ltb-mi (same padding / left start), the badge sits inline after the text */
.btn.exp-hist.exp-hist-txt{padding:0 12px;margin-left:6px;gap:6px}
.ltb-mi.exp-hist{margin:0}
.ltb-mi.exp-hist .exp-badge{position:static;margin-left:auto;flex:none}
.ltb-mi.exp-hist .exp-badge[hidden],.ltb-rest .ltb-mi.exp-hist span.exp-badge[hidden]{display:none}
.dialog.exp-dlg{max-width:760px}
.exp-dlg .body{max-height:60vh;overflow:auto}
.exp-dlg .exp-act{white-space:nowrap;text-align:right}
.exp-dlg .exp-err td{border-top:0;padding-top:0}
@media (max-width:700px){.btn.exp-hist,.btn.exp-hist.exp-hist-txt{margin-left:0}.exp-dlg .exp-act{text-align:left}}
@media (max-width:700px){
  .exp-dlg table,.exp-dlg tbody,.exp-dlg td{display:block;width:auto}
  .exp-dlg thead{display:none}
  .exp-dlg table{min-width:0}
  .exp-dlg tr[data-exp]{display:grid;grid-template-columns:1fr 1fr;column-gap:12px;border:1px solid var(--line);border-radius:8px;margin:0 0 10px;padding:6px 12px 10px}
  .exp-dlg tr[data-exp] td{border:0;padding:4px 0;white-space:normal;text-align:left}
  .exp-dlg tr[data-exp] td::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  .exp-dlg tr[data-exp] td.num{text-align:left}
  .exp-dlg tr[data-exp] td.exp-act{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}.exp-dlg tr[data-exp] td.exp-act::before{display:none}
  .exp-dlg tr.exp-err td{padding:0 0 10px}
}

/* QA-274 / QA-273: a hidden message bar of a dialog takes no space; the character counter of a text field */
.msgbar[hidden]{display:none!important}
small.chars{display:block;margin-top:2px;font-size:11px;line-height:1.3;color:var(--neu);text-align:right}
small.chars[hidden]{display:none}
small.chars.over{color:var(--neg);font-weight:600}
.in.over-max{border-color:var(--neg)}
/* QA-294 R10: the description column of the sourcing item grid is at least 180 px at 1440 (it was 132 px): Need by, Unit, Type and the account column are narrower; 390 px stays the stacked phone layout */
@media (min-width:1025px){table.linegrid.src-grid .c-nb{width:142px}table.linegrid.src-grid .c-sd,table.linegrid.src-grid .c-ed{width:142px}table.linegrid.src-grid .c-um{width:110px}table.linegrid.src-grid .c-ty{width:110px}table.linegrid.src-grid .c-pr{width:108px}table.linegrid.src-grid .c-ac{width:84px}table.linegrid.src-grid .c-act{width:70px}}
/* QA-300: the tax select of the sourcing order item grid */
table.linegrid.src-grid .c-tx{min-width:0;width:150px}table.linegrid.src-grid.src-acct{min-width:1160px}
@media (max-width:1024px){table.linegrid.src-grid .c-tx{width:auto}table.linegrid.src-grid.src-acct{min-width:0}}

/* QA-314: every input of an invoice / memo line sits on one level: the unit goes in one line with the input (flex), the 'max' hint hangs under it without adding height, rows keep room for it */
#inv-items tbody tr[id^="il-"]{height:68px}
#inv-items td.qcell{white-space:nowrap}
#inv-items td.qcell .qu{display:inline-flex;align-items:center;gap:6px;vertical-align:middle}
#inv-items td.qcell .sub.mx{display:block;height:16px;margin:0 0 -16px;line-height:16px;white-space:nowrap;text-align:right}
#inv-items td .memo-sel{display:flex;align-items:center;gap:8px}
#inv-items td .memo-sel .in{flex:1 1 0;min-width:0}
/* QA-301: a scenario row of the Evaluation page opens its line split */
tr.sc-row{cursor:pointer}
.sc-toggle{min-width:28px;min-height:28px;width:28px;padding:0;margin-right:6px;vertical-align:middle;display:inline-flex;align-items:center;justify-content:center}
.sc-toggle .i{transition:transform .15s}
.sc-toggle[aria-expanded=true] .i{transform:rotate(90deg)}
tr.sc-detail>td{padding:8px 12px;background:var(--surface-2,#f7f8fa)}
table.sc-split{margin:0}
/* QA-313: an RFQ (purchasing) line has no period - the shared item grid hides the two date cells there */
.rfq-grid table.linegrid .c-sd,.rfq-grid table.linegrid .c-ed{display:none}
/* QA-313: Start / End date cells of the contract grid */
table.congrid .c-sd,table.congrid .c-ed{min-width:170px}
/* QA-313: the two date columns of the item grid (fixed layout) - the grid is wider, the Description column keeps its 190px */
@media (min-width:1025px){table.linegrid.src-grid{min-width:1460px}table.linegrid.src-grid.src-acct{min-width:1600px}}
/* QA-318 (owner approved the mockup 21.11.2026): every line of the contract and PO line grids is a visual block - grey band on the line row, 3px blue bar on its first cell, line number as a badge,
   a strong divider closing the block and ~12px space before the next one. The item charges sit INSIDE the block (indented), as ONE small header row; opened, the rows sit in a small boxed table. Contract and PO alike. */
table[data-stick].data tbody tr.lnrow>td{border-top:12px solid transparent;background-clip:padding-box;background-color:var(--neu-bg)}
table[data-stick].data tbody>tr.lnrow:first-child>td{border-top-width:0}
table[data-stick].data tbody tr.lnrow>td:first-child{background-image:linear-gradient(var(--brand),var(--brand));background-size:3px 100%;background-repeat:no-repeat;background-position:left top}
table[data-stick].data tbody tr.lnrow:is(:last-child,:has(+ tr.lnrow),.is-value)>td,
table[data-stick].data tbody tr.scrow:is(:last-child,:has(+ tr.lnrow))>td{border-bottom:1.5px solid var(--border-strong)}
.lnbadge{display:inline-block;min-width:26px;padding:1px 8px;border-radius:11px;background:var(--brand);color:#fff;font-weight:700;font-size:12px;line-height:18px;text-align:center}
.lnbadge:empty{display:none}
table[data-stick].data tbody tr.lnrow.muted .lnbadge,table[data-stick].data tbody tr.lnrow.gone .lnbadge{background:var(--neu)}
table[data-stick].data tbody tr.scrow>td{background:var(--surface);padding:2px 16px 8px}
table[data-stick] .scitem{padding-left:12px;border-left:3px solid var(--brand-soft)}
.scitem>summary{min-height:32px;padding:0}
.scitem>summary .sctitle{font-weight:600}
.scitem>.scadd-row{margin:0 0 6px;text-align:left}  /* QA-320: + Add line under the rows, left */
.scitem .scbox{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:8px;margin:0 0 6px}
.scitem .scbox:not(:has(tr.sc-r)){display:none}
.scitem .scbox>.scwrap{border-radius:6px}
@media (max-width:700px){
  .scitem .scbox{padding:6px}
  .scitem>summary .sctitle{min-width:0;font-size:13px}
}

/* QA-321: charge type name + category / variable badges on ONE line (side by side, same height), wrapping as a group */
.tyline{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}.tybadges{display:inline-flex;flex-wrap:nowrap;align-items:center;gap:6px}
.tybadges .pill,table.scgrid td.sc-ty .tybadges .pill{position:static;margin:0;font-size:11px;line-height:18px;height:20px;padding:0 8px;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle}

/* QA-322: invoice 'Variable charges' - groups, charge header band (grey + blue left bar like QA-318) and entry rows */
#var-charges .vc-wrap{padding:0 16px 8px}#var-charges .vg{margin-bottom:12px}
#var-charges .vg-head{font-weight:700;padding:8px 0 6px;border-bottom:1.5px solid var(--border-strong)}
#var-charges .vc{margin-top:8px;border:1px solid var(--line);border-radius:8px;overflow:hidden}
#var-charges .vc-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;padding:8px 12px;background:var(--bg,#F4F6F8);border-left:3px solid var(--brand)}
#var-charges .vc-code{color:var(--text2);margin-left:4px}#var-charges .vc-rate{font-weight:600}#var-charges .vc-tg,#var-charges .vc-descr{color:var(--text2);font-size:12px}
#var-charges .vc-row{display:grid;grid-template-columns:80px 190px minmax(0,1fr) 130px;gap:8px 12px;align-items:center;padding:6px 12px;border-top:1px solid var(--line)}
#var-charges .vc-in{display:flex;align-items:center;gap:6px}#var-charges .vc-in .in{width:110px}#var-charges .vc-lab{color:var(--text2)}
#var-charges .vc-am{text-align:right;font-weight:600;white-space:nowrap}#var-charges .vc-add{padding:6px 12px;border-top:1px solid var(--line)}
#var-charges .vc-total{display:flex;justify-content:flex-end;align-items:baseline;gap:8px;padding:8px 16px;border-top:1.5px solid var(--border-strong)}
@media (max-width:760px){#var-charges .vc-row{grid-template-columns:1fr auto}#var-charges .vc-lab{grid-column:1 / 3;grid-row:1}#var-charges .vc-in{grid-column:1;grid-row:2}#var-charges .vc-am{grid-column:2;grid-row:2}#var-charges .vc-eq{grid-column:1 / 3;grid-row:3}}
/* QA-333: ONE actions column at the far right of the line grids (contract create / edit / change, PO edit / change): every row shows the same icon buttons (copy, cancel line / delete), same size, same place; it stays visible (sticky) when the grid scrolls sideways, also on the phone */
#con-items td.c-act,#con-items th.c-act{width:84px;min-width:84px;text-align:right;white-space:nowrap}
#con-items td.c-act .btn.iconbtn{width:32px;min-width:32px;height:32px;padding:0;margin:0 0 0 4px;vertical-align:middle}
#con-items td.c-act .btn.iconbtn:first-child{margin-left:0}
#con-items tr.lnrow>td.c-act{position:sticky;right:0;z-index:2;background-color:var(--neu-bg)}
#con-items thead th.c-act{position:sticky;right:0;z-index:3;background-color:#F8F9FA}
/* QA-333 / QA-321: on charge edit rows the category tag sits beside the search field on the same line, not on its edge */
table.scgrid td.sc-ty .tyedit{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
table.scgrid td.sc-ty .tyedit>.vh,table.scgrid td.sc-ty .tyedit>.vh-row,table.scgrid td.sc-ty .tyedit>:first-child{flex:1 1 auto;min-width:0}
table.scgrid td.sc-ty .tyedit .dtag,table.scgrid td.sc-ty .tyedit .stag{position:static;flex:none;margin:0;top:auto;right:auto;pointer-events:auto;font-size:11px;line-height:1.4;padding:1px 8px;white-space:nowrap}

/* F-22: System updates - error text of a release */
.su-err{white-space:pre-wrap;word-break:break-word;font-size:12px;margin:4px 0 0;max-width:70ch;background:var(--neu-bg);padding:8px;border-radius:6px}
#su-head .btnrow{flex-wrap:wrap}
/* F-22: System updates lists on the phone: one card per row, label above the value (no sideways scroll inside the card) */
@media (max-width:700px){
  #su-table,#su-table tbody,#su-table tr,#su-table td,#su-actions,#su-actions tbody,#su-actions tr,#su-actions td{display:block;width:auto}
  #su-table,#su-actions{min-width:0}
  #su-table thead,#su-actions thead{display:none}
  #su-table tr,#su-actions tr{border-bottom:1px solid var(--line);padding:10px 16px}
  #su-table td,#su-actions td{border:0;padding:4px 0;white-space:normal}
  #su-table td::before,#su-actions td::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  #su-table td[colspan],#su-actions td[colspan]{padding:12px 0}
}
/* QA-519: Demo sign-ups list on the phone: one card per row, label above the value */
@media (max-width:700px){
  #ds-table,#ds-table tbody,#ds-table tr,#ds-table td{display:block;width:auto}
  #ds-table{min-width:0}
  #ds-table thead{display:none}
  #ds-table tr{border-bottom:1px solid var(--line);padding:10px 16px}
  #ds-table td{border:0;padding:4px 0;white-space:normal;overflow-wrap:anywhere}
  #ds-table td::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  #ds-table td[colspan]{padding:12px 0}
}
.su-expl{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:var(--text2);margin-top:4px;max-width:44ch;word-break:break-word}
.su-log{white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;margin:8px 0 0;max-height:60vh;overflow:auto;background:var(--neu-bg);padding:12px;border-radius:6px}
.su-lines{margin:0;padding-left:18px}.su-lines li{margin:2px 0;word-break:break-word}

/* QA-342: checkbox labels inside the PO header form (variable flag, amount on invoice) carry the standard header label style (12px / 600) like every other label of the form */
#hdr label.chk.sc-var, #hdr label.chk.cpo-aoi, #hdr .ex-ao label.chk { font-size: 12px; font-weight: 600; color: var(--text2); }
/* QA-344 (1): the Variable checkbox under the calculation select makes the charge row taller; every cell of a charge row is top-aligned so the value-help field, selects and inputs share one top line (one input height per row); text cells get the 40px input line */
@media (min-width:701px){
  table.scgrid tr.sc-r>td{vertical-align:top}
  table.scgrid tr.sc-r>td.sc-ln,table.scgrid tr.sc-r>td.sc-ta,table.scgrid tr.sc-r>td.sc-st{line-height:40px}
  table.scgrid tr.sc-r>td.sc-st .sub{line-height:1.3}
  table.scgrid tr.sc-r td.sc-am .dsign{top:26px}
}

/* QA-362 / QA-363: every single-choice select draws its own arrow inside the right edge (same in every browser); a long chosen value is cut with an ellipsis, never wrapped */
select:not([multiple]):not([size]){-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235B6670' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:12px 8px;padding-right:28px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;line-height:normal}
select:not([multiple]):not([size]):disabled{background-color:#F5F6F7}

/* ===== QA-430: THE PO line (templates/_line.html + po/_line.html): main row + closed Details, the same in every mode (edit, new, change, display, approval) ===== */
table.pol{table-layout:fixed;width:100%;min-width:0}
table.pol th,table.pol td{padding:6px 4px;vertical-align:top;overflow:hidden;text-overflow:ellipsis}
table.pol th.c-ln,table.pol td.c-ln{width:42px}table.pol th.c-pr{width:96px}table.pol th.c-ty{width:78px}table.pol th.c-q{width:72px}table.pol th.c-um{width:62px}table.pol th.c-pc{width:84px}table.pol th.c-tx{width:80px}
table.pol th.c-nb{width:122px}table.pol th.c-dt{width:72px}table.pol th.c-ct{width:80px}table.pol th.c-sp{width:92px}table.pol th.c-lt{width:84px}table.pol th.c-nv{width:94px}table.pol th.c-sel,table.pol td.c-sel{width:34px}
table.pol td .in,table.pol td .vh,table.pol td select.in{width:100%;min-width:0;max-width:100%;box-sizing:border-box;text-overflow:ellipsis}
table.pol td .in.q,table.pol td .in.p{width:100%}
table.pol td.c-ln{padding-top:10px}
table.pol td.c-nv .ph-link{display:inline-block;margin-left:4px;vertical-align:middle}
table.pol td .pl-pn,table.pol td .pl-t{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-top:6px}
table.pol td.c-nv,table.pol td.c-um,table.pol td.c-ct,table.pol td.c-sp{padding-top:12px}
table.pol td.c-nv .sub{display:block;white-space:normal;font-size:11px}
/* QA-433: Period (from - to) of a service / limit line has its own cell in the compact area under the main row; only shown for service / limit lines */
table.pol td.c-pe,table.pol th.c-pe{display:none}
table.pol tr.is-service td.c-pe{display:flex;align-items:center;gap:6px;overflow:visible}
table.pol td.c-pe .dp{flex:none;width:150px;display:inline-flex}table.pol td.c-pe .dp .in{min-width:0}
table.pol td.c-pe::before{content:attr(data-label);font-size:12px;color:var(--text2);font-weight:600;white-space:nowrap;min-width:48px}
table.pol td.c-pe .pe-dash{color:var(--text2)}
table.pol td.c-q .pill,table.pol td.c-q .sub{display:block;white-space:normal;font-size:11px}
table.pol tbody tr.lnrow>td{border-top:12px solid transparent;background-clip:padding-box;background-color:var(--neu-bg)}
table.pol tbody tr.lnrow>td:first-child{background-image:linear-gradient(var(--brand),var(--brand));background-size:3px 100%;background-repeat:no-repeat;background-position:left top}
table.pol tbody>tr:first-child.lnrow>td{border-top-width:0}
table.pol tbody tr.lnrow.gone .lnbadge{background:var(--neu)}table.pol tbody tr.lnrow.gone td:nth-child(-n+4) .pl-pn{text-decoration:line-through}
table.pol tbody tr.scrow.pl-det>td{background:var(--surface);padding:2px 6px 8px 46px;border-bottom:1.5px solid var(--border-strong)}
table.pol .pldet>summary{cursor:pointer;list-style:none;display:flex;gap:8px;align-items:center;min-height:30px;font-weight:600}
table.pol .pldet>summary::-webkit-details-marker{display:none}
table.pol .pldet .cc-chev{transition:transform .15s}table.pol .pldet[open] .cc-chev{transform:rotate(90deg)}
table.pol .pl-hint{font-weight:400;color:var(--text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
table.pol .pl-body{padding:4px 0 4px 12px;border-left:3px solid var(--brand-soft)}
table.pol .pl-sec{margin:0 0 10px}table.pol .pl-sec h4{margin:4px 0 6px;font-size:13px}
table.pol .pl-acc .nl-acc{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
table.pol .scitem{position:static;width:auto;max-width:100%;overflow-x:auto}
table.pol .sc-head{display:flex;flex-wrap:wrap;gap:4px 16px;align-items:baseline;margin:0 0 6px}table.pol .sc-head .sctitle{margin:4px 0 6px;font-size:13px}
table.pol .pl-fig{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:12px;color:var(--text2)}table.pol .pl-f .lab{margin-right:4px}table.pol .pl-f:has([data-bu-cell]:empty){display:none}
table.pol .scitem .scact{margin:0 0 6px;text-align:left}
table.pol tr.is-value+tr.scrow .pl-chg{display:none}

table.pol tr.rm>td{opacity:.55}table.pol tr.rm+tr.scrow{opacity:.55}
table.pol .scroll,#po-lines .scroll{overflow-x:auto}
/* QA-514: the Follow-on / Status pill button and the status flex row apply on every width (they were inside the desktop block, so the phone showed the grey default button box) */
.fo-pillbtn{all:unset;cursor:pointer;display:inline-flex;border-radius:12px}.fo-pillbtn .pill{text-decoration:underline dotted;text-underline-offset:3px}.fo-pillbtn:hover .pill,.fo-pillbtn:focus-visible .pill{filter:brightness(.94)}:root[data-theme=dark] .fo-pillbtn:hover .pill{filter:brightness(1.25)}@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .fo-pillbtn:hover .pill{filter:brightness(1.25)}}.fo-pillbtn:focus-visible{outline:2px solid var(--focus,#2563eb);outline-offset:2px}
table.pol td.c-fo .fo-s{display:flex;align-items:center;gap:6px}
/* QA-436 (owner 25.11): ONE table row per item on the desktop - every field in its own fixed-width column, the grid scrolls sideways inside its card (min-width below), the page never does. Cells are placed in DOM order (head and row have the same 18 cells). */
@media (min-width:701px){
  table.pol,table.pol>thead,table.pol>tbody{display:block;width:100%}   /* QA-447: child selectors - the nested charge / extra-cost grids keep normal table layout */
  table.pol>tbody[hidden]{display:none}
  table.pol{--pol-cols:34px 40px 240px 220px 120px 84px 80px 96px 96px 96px 96px 110px 104px 128px 150px 330px 240px 132px 200px;min-width:2668px}   /* QA-455: selection checkbox first, no actions column (18 cells + QA-486 Source PR = 19) */
  table.pol>thead>tr,table.pol>tbody>tr.lnrow{display:grid;grid-template-columns:var(--pol-cols);column-gap:4px;align-items:start}
  table.pol>thead>tr{border-bottom:1px solid var(--line)}
  table.pol>thead th,table.pol>tbody>tr.lnrow>td{width:auto!important;min-width:0}
  table.pol td.c-pe,table.pol th.c-pe{display:block}
  table.pol td.c-pe::before{display:none}
  table.pol tr:not(.is-service) td.c-pe>*{display:none}
  table.pol tr.is-service td.c-pe,table.pol tr.is-value td.c-pe{display:flex;align-items:center;gap:6px;overflow:visible}
  table.pol td.c-pe .dp{flex:1 1 0;min-width:0;width:auto;display:inline-flex}
  table.pol td.c-nb .dp{display:flex;width:100%}table.pol td.c-nb .dp .in{min-width:0;flex:1}
  table.pol td.c-ds,table.pol td.c-dt{overflow:visible}
  table.pol td.c-dt{overflow:hidden;text-overflow:ellipsis}
  table.pol td.c-fo{white-space:nowrap;padding-top:6px}.fo-card table.fo-tbl{width:100%}.fo-card table.fo-tbl td,.fo-card table.fo-tbl th{padding:4px 6px;text-align:left}.fo-card table.fo-tbl .num{text-align:right}.fo-card tr.fo-open td{border-top:1px solid var(--line)}@media (max-width:760px){.fo-card table.fo-tbl{display:table;width:100%;font-size:12px}.fo-card table.fo-tbl thead{display:table-header-group}.fo-card table.fo-tbl tbody{display:table-row-group}.fo-card table.fo-tbl tr{display:table-row;border:0;background:none;box-shadow:none}.fo-card table.fo-tbl th,.fo-card table.fo-tbl td{display:table-cell;width:auto;padding:4px 3px;white-space:normal}.fo-card table.fo-tbl td::before{content:none}}   /* QA-466: a long address text must not stick out of the last column (it made the grid wider than its tracks, so the far right looked unreachable) */
  /* the items grid scrolls sideways inside its card; Details stays at the left edge while scrolling */
  table.pol tbody tr.scrow.pl-det>td{overflow:visible;padding-left:0;padding-right:0}
  table.pol .pldet{position:sticky;left:0;box-sizing:border-box;width:var(--pt-gw,min(100%,1000px));padding:0 6px 0 46px}   /* QA-466: as wide as the visible grid (--pt-gw is set by the shared component), the indent is INSIDE the sticky block - the cell itself has no left padding, so the block never moves while the grid scrolls */
  table.pol .pldet.vh-lift{z-index:60}   /* QA-439: the sticky Details block is its own stacking context - raised while a search list inside it is open */
  table.pol .pldet .bucard{margin-left:auto}   /* QA-449: the line price build-up box in Details sits on the right, under Amount / Tax / Status (like the document totals box) */
  table.pol tbody tr.lnrow>td{border-top:0;padding:6px 4px}
  table.pol tbody tr.lnrow{border-top:12px solid transparent;background:var(--neu-bg);background-clip:padding-box;position:relative}
  table.pol tbody>tr:first-child.lnrow{border-top-width:0}
  table.pol tbody tr.lnrow>td:first-child{background-image:none}
  table.pol tbody tr.lnrow::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--brand)}
  table.pol td.c-ct,table.pol td.c-sp,table.pol td.c-dt,table.pol td.c-ct .ctlink{white-space:nowrap}
  table.pol td.c-pr .pl-pn{white-space:nowrap}
  table.pol td.bu-c{padding-top:12px;white-space:nowrap}
  table.pol td.bu-c .bufig{white-space:nowrap}
  table.pol>thead th{white-space:normal;line-height:1.2;vertical-align:bottom}
  table.pol th .sub{display:block;font-weight:400}
  table.pol tbody tr.scrow.pl-det{display:block;width:100%}table.pol tbody tr.scrow.pl-det>td{display:block;width:auto}
}
@media (max-width:700px){
  table.pol,table.pol>tbody{display:block;width:100%;min-width:0;max-width:100%}
  table.pol>thead{display:none}
  table.pol tr.lnrow{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 10px;padding:10px 12px 8px;border:1px solid var(--line);border-bottom:0;border-left:3px solid var(--brand);border-radius:8px 8px 0 0;margin-top:12px;background:var(--neu-bg)}
  table.pol tr.lnrow>td{display:block;padding:0;border:0!important;width:auto!important;background:none!important;min-width:0}
  table.pol tr.lnrow>td::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  table.pol tr.lnrow>td.c-ln::before,table.pol tr.lnrow>td.c-sel::before{display:none}
  table.pol tr.lnrow>td.c-pr,table.pol tr.lnrow>td.c-ds,table.pol tr.lnrow>td.c-pe{grid-column:1/-1}
  table.pol tr.lnrow>td.c-ln{grid-column:1;grid-row:1}table.pol tr.lnrow>td.c-sel{grid-column:2;grid-row:1;justify-self:end;display:flex;align-items:center;gap:6px;min-height:28px}
  table.pol tr.lnrow.is-sel{border-color:var(--brand);background:var(--brand-soft)}
  table.pol tr.is-service td.c-pe{display:block}table.pol td.c-pe .dp{width:calc(50% - 10px);display:inline-flex}
  table.pol td.c-um,table.pol td.c-nv,table.pol td.c-ct,table.pol td.c-sp{padding-top:0}
  table.pol tr.lnrow>td.bu-c:not(.bu-total):empty{display:none}
  /* QA-514: every card field is one cell of the 2-column grid, label above value, left-aligned (numbers too); empty display cells are left out so the next field moves up; the price history icon stays inline after the value */
  table.pol tr.lnrow>td.num,table.pol tr.lnrow>td.c-fo,table.pol tr.lnrow>td.c-lt{text-align:left;white-space:normal;padding-top:0}
  table.pol tr.lnrow>td.is-empty{display:none}
  table.pol td.c-nv .ph-link{display:inline-block;margin-left:6px;vertical-align:middle}
  table.pol tr.scrow.pl-det{display:block;border:1px solid var(--line);border-top:0;border-left:3px solid var(--brand);border-radius:0 0 8px 8px;background:var(--surface)}
  table.pol tbody tr.scrow.pl-det>td{display:block;padding:4px 12px 8px;border:0}
  table.pol .pl-body{border-left:0;padding-left:0;min-width:0}
  table.pol .pl-acc .nl-acc{grid-template-columns:minmax(0,1fr)}
  table.pol td .in[type=date]{min-width:0}
  table.pol .pl-hint{white-space:normal}
}

/* QA-451: charges table = Calculation / Quantity / Unit of measure / Unit amount / Percent / Amount ... each with its own header. A field that does not apply carries [hidden] and is really hidden (beats .in);
   the read-only quantity / unit of a Per product unit charge are plain text taken from the PO line; the cell stays (header count = cell count, QA-447), on the phone card a not-applicable cell is left out. */
table.scgrid [hidden]{display:none!important}
table.scgrid .sc-qt{min-width:96px}table.scgrid .sc-um{min-width:92px}
table.scgrid .sc-qro,table.scgrid .sc-uro{display:inline-block;line-height:40px;color:var(--text2)}
@media (min-width:701px){table.scgrid tr.sc-r>td.sc-qt,table.scgrid tr.sc-r>td.sc-um{vertical-align:top}}
@media (max-width:700px){table.scgrid td.sc-na{display:none}table.scgrid .sc-qro,table.scgrid .sc-uro{line-height:1.4}}

/* ===== QA-455: the standard line toolbar (templates/_line_toolbar.html, static/line_toolbar.js) + selection column ===== */
.ltb{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;position:relative}
.ltb-rest{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ltb-b{gap:6px}
.ltb .ltb-more{display:none}
.ltb-b.is-off{opacity:.5;cursor:not-allowed}.ltb-b.is-off:hover{background:var(--surface);text-decoration:none}.ltb-b.danger.is-off:hover{background:var(--surface)}
.ltb-xl{position:relative;display:inline-block}
.ltb-xl .ltb-chev{width:12px;height:12px;transform:rotate(90deg);margin-left:-2px}
.ltb-pop{display:none;position:absolute;right:0;top:calc(100% + 4px);z-index:70;min-width:200px;background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow-h);padding:4px}
.ltb-xl.open .ltb-pop{display:block}
.ltb-mi{display:flex;align-items:center;gap:8px;width:100%;min-height:36px;padding:0 12px;border:0;background:none;color:var(--text);font:inherit;text-align:left;border-radius:6px;cursor:pointer;text-decoration:none;white-space:nowrap}
.ltb-mi:hover{background:var(--surface-1);text-decoration:none;color:var(--text)}.ltb-mi[aria-disabled=true]{opacity:.5;cursor:not-allowed}
.ltb-undo{position:fixed;left:50%;bottom:calc(150px + var(--bbh,0px));transform:translateX(-50%);z-index:121;display:flex;align-items:center;gap:12px;background:#1D2D3E;color:#fff;padding:8px 8px 8px 18px;border-radius:12px;box-shadow:var(--shadow-h)}
.ltb-undo[hidden]{display:none}.ltb-undo .btn{height:30px}
input.ln-sel{width:18px;height:18px;margin:0;cursor:pointer;accent-color:var(--brand)}input.ln-sel[hidden]{display:none}
table.pol .ln-undo{width:28px;min-width:28px;height:28px;min-height:28px;padding:0;margin:0}
table.pol tr.rm>td.c-sel{opacity:1}
@media (max-width:1000px){.ltb-b .ltb-t{display:none}.ltb-pop .ltb-mi span,.ltb-t{}}
@media (max-width:1000px){.ltb-b{min-width:36px;padding:0 10px;justify-content:center}}
/* QA-466: NO own sticky rules for the grid's first columns - table.pol uses the ONE shared component (data-stick="4" data-stick-fixed: selection, Line, Product, Description; see .pt-sc above and proctool.js). Only colours and the cover of the 4 px column gap live here. */
@media (min-width:701px){
  table.pol.pt-st .pt-sc{margin-right:-4px;align-self:stretch}   /* stretch: a short sticky cell must cover the whole row height, or scrolled cells show above / below it */   /* the sticky cell also covers the column gap behind it, so nothing scrolled shows between the sticky cells */
  table.pol.pt-st>thead .pt-sc{background:#F8F9FA}
  table.pol.pt-st>tbody>tr.lnrow>.pt-sc{background:var(--neu-bg)}
  table.pol.pt-st>tbody>tr.lnrow.is-sel>.pt-sc{background:var(--brand-soft)}
  table.pol>tbody>tr.lnrow.is-sel{background:var(--brand-soft)}
  table.pol>thead th.c-sel,table.pol>tbody>tr.lnrow>td.c-sel{padding-top:12px;text-align:center}
  table.pol>thead th.c-sel{padding-bottom:6px}
  table.pol .c-sel .sel-in{display:flex;align-items:center;justify-content:center;gap:6px}
}
@media (max-width:700px){
  .ltb .ltb-more{display:inline-flex}
  .ltb-rest{display:none;position:absolute;right:0;top:calc(100% + 4px);z-index:70;flex-direction:column;align-items:stretch;gap:2px;min-width:230px;background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow-h);padding:6px}
  .ltb.more-open .ltb-rest{display:flex}
  .ltb-rest>.ltb-b{justify-content:flex-start;border:0;background:none;min-height:40px}
  .ltb-rest .ltb-b .ltb-t,.ltb-rest .ltb-mi span{display:inline}
  .ltb-rest .ltb-xlb{display:none}
  .ltb-rest .ltb-xl{display:block}
  .ltb-rest .ltb-pop{display:block;position:static;border:0;box-shadow:none;padding:0;min-width:0}
  .ltb-rest .ltb-mi{min-height:40px}
  .ltb-b.danger{color:var(--neg)}
}
/* QA-457: receipt items - selection column, reversed lines greyed */
table.rcl th.c-sel,table.rcl td.c-sel{width:34px;text-align:center}
table.rcl tr.rev>td{color:var(--text2);background:var(--surface-1)}table.rcl tr.rev>td a{color:var(--text2)}
table.rcl tr.is-sel>td{background:var(--brand-soft)}

/* ===== QA-431: the purchase contract on the one line template (templates/contracts/_line.html): no need-by / deliver-to / contract columns - the grid has 15 cells ===== */
table.pol.pol-con th.c-nb,table.pol.pol-con td.c-nb,table.pol.pol-con th.c-dt,table.pol.pol-con td.c-dt{display:none!important}      /* QA-488: the contract's Contract slot (c-ct) shows the source requisition */
table.pol .pl-more .nl-acc{grid-template-columns:repeat(auto-fill,minmax(190px,1fr))}
table.pol .pl-more .f .lbl{display:block;font-size:12px;color:var(--text2)}
table.pol .pl-more .f .in{max-width:120px}
table.pol td.c-pr .vh{width:100%}
table.pol .con-aoi{display:flex;align-items:center;gap:6px;margin-top:4px;font-size:12px;white-space:normal}table.pol .con-aoi[hidden]{display:none}
@media (min-width:701px){table.pol.pol-con{--pol-cols:34px 40px 240px 220px 120px 84px 80px 96px 96px 96px 96px 110px 104px 128px 330px 84px 150px;min-width:2180px}   /* QA-486/488: + Lead time and Source PR (Contract slot) */
  table.pol.pol-con.pol-cfo{--pol-cols:34px 40px 240px 220px 120px 84px 80px 96px 96px 96px 96px 110px 104px 128px 330px 150px 84px 150px;min-width:2330px}}   /* display: + Status pill column (QA-486) */

/* ===== QA-431: the requisition plugs into the one line template (templates/requisitions/_line.html): no price build-up columns (pol-nobu) and no Contract column (pol-noct) - the grid template follows the cells that are really there; an empty charges section takes no room ===== */
@media (min-width:701px){
  table.pol.pol-nobu{--pol-cols:34px 40px 240px 220px 120px 84px 80px 96px 104px 128px 150px 330px 240px 132px 200px;min-width:2254px}
  table.pol.pol-noct{--pol-cols:34px 40px 240px 220px 120px 84px 80px 96px 96px 96px 96px 110px 104px 128px 150px 330px 240px;min-width:2328px}
  table.pol.pol-nobu.pol-noct{--pol-cols:34px 40px 240px 220px 120px 84px 80px 96px 104px 128px 150px 330px 240px 150px 150px 150px 150px;min-width:2530px}
  table.pol.pol-nobu.pol-noct.pol-fo{--pol-cols:34px 40px 240px 220px 120px 84px 80px 96px 104px 290px 128px 150px 330px 240px 150px 150px 150px 150px;min-width:2824px}   /* QA-469: + Follow-on column (approved requisition, display) */
}
table.pol .pl-chg:empty{display:none}
table.pol .pl-del .nl-acc{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
@media (max-width:700px){table.pol .pl-del .nl-acc{grid-template-columns:minmax(0,1fr)}}
table.pol td.c-nv .sub .q-ordered,table.pol td.c-nv .sub .q-received,table.pol td.c-nv .sub .q-invoiced,table.pol td.c-nv .sub .q-open{display:block}
table.pol td.c-nv .btn.sm{white-space:normal;height:auto;min-height:28px;line-height:1.2;padding:4px 6px;margin-top:4px;max-width:100%}
/* QA-431: the empty-grid tbody stays hidden on the phone too (the phone rule above sets display:block; QA-427: no "No lines." under typed rows) */
table.pol>tbody[hidden]{display:none}
table.pol td.c-nv .btn.sm{margin-bottom:8px}

/* QA-470: buyer worklist (requisition lines) - quantity to order now = input + unit on ONE line; Close remainder = sticky icon button at the right edge (never cut off); first columns via the shared data-stick component */
.bw-qn{display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;white-space:nowrap}.bw-qn .in{width:84px;text-align:right}.bw-qn .bw-u{min-width:28px;text-align:left}
#bw-lines th:last-child,#bw-lines td.act{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-2px 0 4px -2px rgba(0,0,0,.12);text-align:center}
#bw-lines th:last-child{background:#F8F9FA;z-index:5}
@media (max-width:700px){#bw-lines th:last-child,#bw-lines td.act{position:static;box-shadow:none}}
#bw-lines th:nth-child(1),#bw-lines td:nth-child(1){width:40px;min-width:40px}
#bw-lines th:nth-child(2),#bw-lines td:nth-child(2){width:120px;min-width:120px}
#bw-lines th:nth-child(3),#bw-lines td:nth-child(3){width:56px;min-width:56px}
#bw-lines tr.grp td:nth-child(1){width:auto;min-width:0}
/* QA-473: line Details - own Sources section (same grid as Account assignment) */

/* QA-471: the Excel menu inside a fixed bottom bar opens upwards */
.footer-bar .ltb-pop{top:auto;bottom:calc(100% + 4px)}
.nl-acc .f[hidden],table.pol .pl-det [hidden]{display:none!important}      /* QA-486: a hidden field of the Details panel can never show (the .nl-acc .f display rule used to beat [hidden]) */
table.congrid.pt-st .c-ln:not(.pt-sc),table.congrid.pt-st .c-pd:not(.pt-sc){left:auto}   /* QA-466 rest: a column that is not stuck (phone: only Line) keeps no left offset from the old fixed-column rule, so the sticky header row does not hold it in place */

/* ===== QA-497: DISPLAY mode columns sized to the content (edit mode keeps the list above): Tax code narrow, Period wide enough for two dates on one line, Description takes the extra width; every track sits under its own header */
@media (min-width:701px){
  table.pol#po-view-items{--pol-cols:34px 40px 240px minmax(220px,1fr) 120px 84px 80px 96px 96px 96px 96px 110px 104px 64px 150px 200px 150px 132px 200px;min-width:2384px}
  table.pol#con-items.pol-cfo{--pol-cols:34px 40px 240px minmax(220px,1fr) 120px 84px 80px 96px 96px 96px 96px 110px 104px 128px 64px 200px 84px 150px;min-width:2110px}
  table.pol#pr-items{--pol-cols:34px 40px 240px minmax(220px,1fr) 120px 84px 80px 96px 104px 64px 150px 200px 150px 150px 150px 150px 150px;min-width:2246px}
  table.pol#pr-items.pol-fo{--pol-cols:34px 40px 240px minmax(220px,1fr) 120px 84px 80px 96px 104px 290px 64px 150px 200px 150px 150px 150px 150px 150px;min-width:2540px}
}

/* ===== QA-497b: Source PR / Source requisition / Contract reference show the FULL value ("PR1000074 / 10") in every mode: wide enough tracks (above) and no ellipsis in those cells */
table.pol th.c-sp,table.pol td.c-sp,table.pol th.c-ct,table.pol td.c-ct,table.pol td.c-sp a,table.pol td.c-ct a,table.pol td.c-ct .ctlink{text-overflow:clip;white-space:nowrap}
table.pol td.c-sp,table.pol td.c-ct{overflow:visible}
/* QA-514: invoice lines (edit #inv-items, display) as cards on the phone, same look as the item cards of table.pol: 2-column grid, label above value, left-aligned numbers, empty cells left out (class is-empty from proctool.js, truly empty cells by :empty) */
@media (max-width:700px){
  table.icard,table.icard>tbody,table.icard>tbody>tr,table.icard>tbody>tr>td{display:block;width:auto;min-width:0;max-width:100%;box-sizing:border-box}
  table.icard{width:100%}
  table.icard>thead{display:none}
  table.icard>tbody>tr:not(.grp):not(.rmrow){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 10px;padding:10px 12px 8px;border:1px solid var(--line);border-left:3px solid var(--brand);border-radius:8px;margin:12px 0 0;background:var(--neu-bg);height:auto}
  table.icard>tbody>tr.grp{margin-top:12px}
  table.icard>tbody>tr>td,#inv-items>tbody>tr>td{padding:0;border:0!important;background:none!important;white-space:normal;text-align:left;height:auto;width:auto}
  table.icard>tbody>tr>td[data-label]::before{content:attr(data-label);display:block;font-size:12px;color:var(--text2);font-weight:600;margin-bottom:2px}
  table.icard>tbody>tr>td.c-ln{grid-column:1/-1;font-weight:700}table.icard>tbody>tr>td.c-ln::before{display:none}
  table.icard>tbody>tr>td.ic-w,table.icard>tbody>tr>td[colspan],table.icard>tbody>tr>td.act,table.icard>tbody>tr>td.c-eq{grid-column:1/-1}
  table.icard>tbody>tr>td.num,#inv-items>tbody>tr>td.num,#inv-items td.qcell{text-align:left;white-space:normal}
  table.icard>tbody>tr>td:empty,table.icard>tbody>tr>td.is-empty{display:none}
  table.icard>tbody>tr>td.act{text-align:right}
  #inv-items td:last-child{padding-right:0;white-space:normal}
  #inv-items tbody tr[id^="il-"]{height:auto}
  #inv-items td .sub.mx{display:block;height:auto;margin:0;text-align:left;white-space:normal}
  table.icard td .in{width:100%;max-width:100%;min-width:0}
  table.icard td.qcell .qu{display:flex;align-items:center;gap:6px}
  table.icard>tbody>tr.se-row>td{grid-column:1/-1}
}
